Skip to content

Using the Google Maps API and route-searching algorithms to find the (one of the) longest route(s) across Massachusetts that hits every single town.

Notifications You must be signed in to change notification settings

Countdown369/MA_Travelling_Snails_Man

Repository files navigation

Massachusetts Travelling Snailsman

Python to find the longest route across Massachusetts that hits every single town. Built for my website / blog / personal project, cultivatingmassachusetts.com.

The greedy route-finding algorithm isn't perfect - it finds the furthest town from the current town while ignoring previously-visited towns, which makes the last towns very close to each other - but according to the statistics scraped into stats.csv by distStatFinder.py, it should be one of the best possible routes.

My original "naive" algorithm and current "greedy" algorithm are in this repository. So is the script I used to find the distances between every town in Massachusetts (massachusettsGmaps.py) and print them into text files (maDistsLists). Finally, bestRoutes catalogues the best two routes found by the naive algorithm and the one Holy Grail route found by the greedy algorithm (plus a couple even better but difficult to explain routes produced by /u/xelf on Reddit).

Currently, this algorithm is not being used by the Cultivating Massachusetts project, but it was used from January - March 2021. If you ever need to solve the exact opposite of the Travelling Salesman Problem, this might be the repo to investigate.

About

Using the Google Maps API and route-searching algorithms to find the (one of the) longest route(s) across Massachusetts that hits every single town.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages