Skip to content
Solving the Traveling Salesman problem with 49 US Capitals using a genetic algorithm
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Apr 4, 2017
LICENSE Initial commit Apr 4, 2017
README.md Added image to README Apr 5, 2017
cache.p Initial commit Apr 4, 2017
config.yml Initial commit Apr 4, 2017
createCache.py Initial commit Apr 4, 2017
createDirectionsCache.py Initial commit Apr 4, 2017
createGeoCache.py
createMap.py Initial commit Apr 4, 2017
directions.p Initial commit Apr 4, 2017
geoCache.p
gmap-plot.py Initial commit Apr 4, 2017
gmap-stats.py Initial commit Apr 4, 2017
imagesToGif.py Initial commit Apr 4, 2017
index.py MAX_DURATION should by default be 0 Oct 13, 2017
map.p Initial commit Apr 4, 2017
maputils.py Initial commit Apr 4, 2017
plot.py Initial commit Apr 4, 2017
requirements.txt Initial commit Apr 4, 2017

README.md

Traveling-Saleman-Genetic-Algorithm

Solving the Traveling Salesman problem with 49 US Capitals using a genetic algorithm

Best solution

Video of the solution evolving over time: https://www.youtube.com/watch?v=7KCLMNRRPN0

This solver utilizes several Google Map APIs:

  • Capitals are converted into geolocations using the Geocoding API.
  • The Distance Matrix API is used in order to calculate driving time between each pair of capitals.
  • The Directions API is used to get the paths of the fastest routes between cities.
  • Lastly, the Static Maps API is used to draw the full solution and cities on a map and save it to disk.
You can’t perform that action at this time.