Upvote:5
The Android application Wanderlog has a paid feature to view the fastest driving route is that goes through all these n places:
Reddit user quatrotires pointed me to it.
Roadtrippers also has this feature. From https://support.roadtrippers.com/hc/en-us/articles/201310953-Quickly-Customize-a-Trip-s-Route:
Our trip planner looks for the most efficient route between waypoints by default. If you want to take a different route, on our desktop site you can easily customize the route by clicking and dragging it on the map.
SE user Moo pointed me to it.
Google Directions API also has this feature:
In case you are inclined to do some coding, Google has support for that on its Directions API. See the docs on the
optimize:true
parameter. The service isn't free though, but Google awards some free credits every month or so. sourcream 4 hours ago
Upvote:10
As pointed out in the comments, this is the classical Travelling Salesman problem.
It's mathematically tricky to solve. You can always brute force by trying all possible routes but the number of permutation increases with the factorial of the number of cities, so that becomes unwieldy very quickly.
This being said, for 5-20 cities, even something simple as Microsoft Excel can solve this pretty well. Here is an example: https://www.youtube.com/watch?v=-E3rSoClgMI on how to do this.
The input to the algorithm is the distance matrix. You can either use distance or time, either one would work. You either need to get these manually from Google Maps or use one of the existing APIs. For 10 cities, that's 45 numbers you need to pull out of Google Maps. I guess it's up to you to decide whether that's worth the effort or not.
I ran a 13 city simulation and it took less than a minute on my laptop. (source https://developers.google.com/optimization/routing/tsp).
For something larger you probably need a more advanced algorithm and a decent programming language (like Python or Matlab/Octave). See for example: https://www.youtube.com/watch?v=c5395m-nVz4
Here are the results: You can cover 13 major cities in the US in 7386 miles.