The TSP solved using genetic algorithm.
This project show TSP path overlaid on a map of the Iran provinces & their capitals.
Python code was inspired from here.
- Python version 3+
- Jupyter notebook
- Numpy
- Pandas
- Matplotlib
To launch the notebook, run the following command from a terminal on the application path:
jupyter notebook tsp-ga.ipynb
Change the numCities
for different results.
The yellow star shows the starting city coordinates which is the first line in capitals.json
.You can replace it with another cities to change starting city coordinates.
The result for first 15 capitals :