Traveling salesman problem
Using Dynamic Programming
Reference: https://github.com/phvargas/TSP-python.git
what is in the readfile.txt?
First column is the index of city
Second column is the x cooridinate
Third column is the y cooridinate
You can simply modify this txt file by changing its idex or position.
python3 TSP_dp.py
- draw.txt -> used to draw the route
- output.txt ->include route, best distance and execution time.
Best Visit Order: 1 3 2 11 9 10 5 4 6 7 8 1
Best Distance: 167.80695975880067
Execution Time: 0.1690812110900879 (s)
gnuplot
load "draw.plt"
output.svg will be generated.
Use Chrome or safari to open it