fast-tsp
An SLS (Stochastic Local Search) solver for TSP (Travelling Salesman Problem).
Quickstart:
Install the module:
$ pip install fast-tsp
Create a distance matrix and run the solver:
import fast_tsp
dists = [
[ 0, 63, 72, 70],
[63, 0, 57, 53],
[72, 57, 0, 4],
[70, 53, 4, 0],
]
tour = fast_tsp.find_tour(dists)
print(tour)
# [0, 1, 3, 2]
The returned tour is the list of indices of the nodes in the order they are visited.