function dist=dist(x,D)
n=size(x,2);
dist=0;
for i=1:n-1
    dist=dist+D(x(i),x(i+1));
end
dist=dist+D(x(1),x(n));
    
HuangCongQing
github-repos/MATLAB/HuangCongQing-Algorithms_MathModels/Algorithms_MathModels-e15b0e9053b11f08b5ce1e3492c4acb444409c8b/MATLAB智能算法30个案例分析/chapter15 基于混合粒子群算法的TSP搜索算法/dist.m
Algorithms_MathModels
github-repos/MATLAB/HuangCongQing-Algorithms_MathModels
e15b0e9053b11f08b5ce1e3492c4acb444409c8b