问题
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