求解步骤:
a) 初始化
指定节点编号及其位置
距离估计算法:sqrt((x1-x2)^2 +(y1-y2)^2)
b) 初始化PSO参数
指定最大迭代次数
指定初始种群/粒子
c) 适应度函数
以距离为代价/最小化距离
d) 结果
用箭头显示搜索的路由路径
开始节点显示为绿色
a) Initialization
–Assign No of Nodes and their position
– Estimate the Distance using sqrt((x1-x2)^2 +(y1-y2)^2)
b) Initialize PSO parameters
– Assign Maximum Iteration
– Assign Initial Population/particles
c) Fitness Function
– Distance as cost/ We want to minimize the Distance
d) Result
– Routing path Displayed with Arrow
– starting node show as green color
完整源码下载地址:
http://page2.dfpan.com/fs/6ldc6j0252f1b279169/
更多精彩文章请关注微信号: