TSP(旅行推销员问题)求解器使用GoogleMap [英] TSP (Traveling Salesman Problem) solver Using GoogleMap
问题描述
我们正在开发一个应用程序,我们将在谷歌地图中显示一些可用的房屋出售。用户可以从地图上选择任何房屋,并可以找到他/她选择的所有房屋之间最短的行车路线。
任何人都可以告诉我,我们如何找到最短路线并在地图上显示?是否有任何基于PHP的TSP库,可以帮助我们实现我们正在尝试的?
A Google搜索显示了很多结果。 $ b http://scrivna.com/blog/travelling-salesman-problem/ - 蛮力PHP实现保证获得最佳答案。只适用于有限数量的节点。 http://www.renownedmedia.com/blog/genetic-algorithm-traveling-salesperson-php/ - 遗传算法PHP实现将近似答案。适用于大量节点。
正如@Barbar在评论中指出的,有一个现有的应用程序,可以做你正在尝试的东西。有一篇博客文章解释它是如何工作的。
We are developing an application, in which we will show some available houses for sale in google map. User can select any houses from the map and can find the shortest driving route between all the houses he/she selected.
Can any one please tell me how we can find the shortest route and can show that on the map? Is there any PHP based TSP library, that can help us to achieve what we are trying?
A Google search shows many results.
http://scrivna.com/blog/travelling-salesman-problem/ - Brute force PHP implementation guaranteed to get the optimal answer. Only suitable for a limited number of nodes.
http://www.renownedmedia.com/blog/genetic-algorithm-traveling-salesperson-php/ - Genetic algorithm PHP implementation which will approximate the answer. Suitable for large numbers of nodes.
You could probably combine the two, choosing which to run based on the size of the graph.
As @Barbar points out in the comments, there is an existing app that does what you're attempting. There is a blog post explaining how it works.
这篇关于TSP(旅行推销员问题)求解器使用GoogleMap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!