Take the 2-minute tour ×

I have been searching for some time if it is possible to create route on Google Maps without having start and endpoint, only with way points. I'm trying to show/calculate full route on points user have to visit in right, economic order, but I don't know which one of them should be the first and the last one.

Does Google Maps allow such functionality or I have to take random two points and make them start and final?

share|improve this question
If you don't want links (lines) between the points to visit (of which the order is undetermined), why don't you just put markers there? –  j13r Mar 3 '12 at 19:00

3 Answers 3

Google gives a couple of websites

As an API: https://code.google.com/p/google-maps-tsp-solver/

And an implementation: http://gebweb.net/optimap/

share|improve this answer

Google allows you to add a "optimizeWaypoints" field to your DirectionsRequest. https://developers.google.com/maps/documentation/javascript/directions#DirectionsRequests

I dont know if this function reorders the full route (including start and endpoint) or only the waypoints. If only the waypoints, you may choose two fake "far away" points for start and endpoint, I think that would give a good result.

share|improve this answer

You can use the google maps tsp solver to solve a tsp. It uses the Ant Colony Optimization to efficient solve a tsp. Or you can use a fractal for example a hilbert curve.

share|improve this answer

Your Answer


