Python implementation of heuristics for the TSP - greedy, also known as nearest neighbour (NN) and 2-opt.
The tour used for the TSP is: New York, Los Angeles, Chicago, Minneapolis, Denver, Dallas, Seattle, Boston, San Francisco, St. Louis, Houston, Phoenix, Salt Lake City. The NxN matrix is in miles.
The traveling Salesman Problem (TSP) is a problem that deals with finding the shortest and most efficient route for a list of specific destinations. It is an NP-hard combinatorial problem, and consequently, no known polynomial-time algorithm can solve all instances of the problem.
Heuristic algorithms provide strong solutions, but not necessarily optimal.
If you have a suggestion to improve this, please fork the repo and create a pull request. You can also open an issue with the tag "improvement". Any contributions you make are greatly appreciated.
Impelement 3-opt.