Python-Ant-Colony-TSP-Solver-master
所属分类:其他
开发工具:Python
文件大小:5KB
下载次数:11
上传日期:2018-11-20 14:10:23
上 传 者:
乃木坂道
说明: 用于路径规划的蚁群算法,蚁群算法是一种用来寻找优化路径的概率型算法。它由Marco Dorigo于1992年在他的博士论文中提出,其灵感来源于蚂蚁在寻找食物过程中发现路径的行为。
(Ant colony algorithm for path planning)
文件列表:
ant.py (4084, 2012-10-31)
antcolony.py (3443, 2012-10-31)
antgraph.py (1898, 2018-11-16)
anttsp.py (1713, 2012-10-31)
citiesAndDistances.pickled (1556, 2012-10-31)
Python Ant Colony TSP Solver
-----------------------------
Uses Ant Colony Optimization to solve the TSP. See http://en.wikipedia.org/wiki/Ant_colony_optimization_algorithms
anttsp.py is the file to run. It reads from citiesAndDistances.pickled, which is a pickled 2D array with this format:
CityName1 CityName2 ... CitNameN
0 23 34
10 0 22
.
.
.
It is not necessary for the matrix to be symmetric i.e. the distance traveling from A to B need not be the distance from B to A (if you have ever been to Italy and dealt with the mess of one-way streets you will understand how this applies).
Run without additional arguments, it solves the 10-city TSP
You can also try this:
python anttsp.py 14
Other values <= 14 tested as well
近期下载者:
相关文件:
收藏者: