資源簡介
使用模擬退火算法解決TSP旅行商問題,在TSP70問題上跑出的結果幾乎接近最優解,同時速度很快,在自己筆記本上測試10s左右。同時包括論文形式的設計報告。

代碼片段和文件信息
function?city?=?insert(cityn)
????
????ind1?=?0;?ind2?=?0;
????while?(ind1?==?ind2)
????????ind1?=?ceil(rand.*n);
????????ind2?=?ceil(rand.*n);
????end
????if?ind1?>?ind2
????????temp?=?ind1;
????????ind1?=?ind2;
????????ind2?=?temp;
????end
????templist?=?city(ind1:ind2:);
%?????city(ind1:ind2:)?=?fliplr(templist);
????for?i?=?0:(ind2-ind1-1)
????????city(ind1+i:)?=?templist(i+2:);
????end
????city(ind2:)?=?templist(1:);
%?????city(ind2:)?=?tmp1;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????676??2018-05-30?20:33??city.txt
?????文件?????????477??2018-05-31?22:19??insert.m
?????文件?????????964??2018-05-31?22:10??inverse.m
?????文件????????1016??2018-06-01?14:57??multi_run.m
?????文件????????1874??2018-06-03?21:45??mywork.m
?????文件????????1463??2018-06-01?14:27??mywork_fun.m
?????文件????????1821??2018-05-31?21:40??swap_three.m
?????文件?????????489??2018-05-31?21:34??swap_two.m
?????文件??????124928??2018-06-01?16:30??智能優化算法設計報告.doc
- 上一篇:LMS算法matlab程序
- 下一篇:基于MATLAB實時串口數據采集與曲線顯示
評論
共有 條評論