資源簡介
本資源用matlab實現了粒子群算法,并解決了旅行商問題。其中給出了TSP問題最優解的路徑圖以及收斂次數等信息。

代碼片段和文件信息
%?clc
%?clear
%?a=[12345];
%?b=[54321];
%?t=[54345];
function?t=change(ab)
for?k=1:size(a1)
????for?i=1:size(a2)
????????t(ki)=find(b(k:)==a(ki));
????????b(k[it(ki)])=b(k[t(ki)i]);
????end
end
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????235??2018-06-03?15:39??pso_tsp\change.m
?????文件????????215??2018-06-03?16:21??pso_tsp\choose.m
?????文件????????147??2017-02-01?19:55??pso_tsp\city15.txt
?????文件????????202??2017-02-01?19:55??pso_tsp\city20.txt
?????文件????????204??2017-02-01?19:55??pso_tsp\city30.txt
?????文件?????????73??2017-02-01?19:55??pso_tsp\city8.txt
?????文件????????691??2018-06-03?15:22??pso_tsp\gchange.m
?????文件????????302??2018-06-03?19:40??pso_tsp\len.m
?????文件????????208??2018-06-03?16:22??pso_tsp\path_change.m
?????文件???????2161??2018-06-05?21:20??pso_tsp\pso_tsp.m
?????文件????????563??2018-06-05?21:17??pso_tsp\resultplot.m
?????目錄??????????0??2018-06-04?13:51??pso_tsp
-----------?---------??----------?-----??----
?????????????????5001????????????????????12
評論
共有 條評論