Optimal map routing with Google Maps

后端 未结 5 2019
臣服心动
臣服心动 2021-01-31 05:49

Is there a way using the Google Maps API to get back an \"optimized\" route given a set of waypoints (in other words, a \"good-enough\" solution to the traveling salesman proble

5条回答
  •  无人及你
    2021-01-31 06:17

    There is an option in Google Maps API DirectionsRequest called optimizeWaypoints, which should do what you want. This can only handle up to 8 waypoints, though.

    Alternatively, there is an open source (MIT license) library that you can use with the Google Maps API to get an optimal (up to 15 locations) or pretty close to optimal (up to 100 locations) route.

    See http://code.google.com/p/google-maps-tsp-solver/

    You can see the library in action at www.optimap.net

提交回复
热议问题