首先感谢这位github上的Marcos Castro de Souza大神
本文利用代码链接如下:https://github.com/marcoscastro/tsp_pso,此代码使用python实现,我用于此实例的代码稍作修改。
欢迎私戳关注这位大神!
首先来看一下什么是TSP:
The travelling salesman problem (TSP) asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?" It is an NP-hard problem in