There's an easy way to apply a shortest path alghoritm in objective c?

假装没事ソ 提交于 2019-12-18 13:38:39

问题


I have a series of point (x,y) linked by a path. There's an easy way in objective c to apply something like a Dijkstra shortest path alghoritm in order to know the shortest path among two variable points of these? The real problem is i have an image with a series of locations on it and the coordinate of all these location. Now i need the user to choose two of this location and getting the shortest path between the location choosen.


回答1:


I found a way to do this. Here there is a perfect implementation of the algorithm. Hope it helps someone.

https://github.com/snyderp/PESGraph




回答2:


You may be able to find an algorithm online in C or C++ and manipulate it to input your list type, and output the shortest path point list, that way you dont have to implement the actual algorithm, just manipulate a set of code that already exists.



来源:https://stackoverflow.com/questions/10737580/theres-an-easy-way-to-apply-a-shortest-path-alghoritm-in-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!