Python Forum

Full Version: Python Shortest Path
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a graph of a map based on Tuples in Python. So I have to calculate the shortest path (Dijkstra) between two Tuples. My paths are generated by a function

add_path((0, 0, compass.east), (1, 0, compass.west))
add_path((0, 1, compass.north), (0, 2, compass.south))
add_path((0, 2, compass.north), (0, 3, compass.south))
...
First Tuple is "start" based on x,y-Coordinates and a direction. 
Second Tuple is "end" based on x,y-Coordinates and a direction.

So the Shortest Path is called by dijkstra((0,0), (2,2)). So now the shortest path between these coordinates should returned full with path. The distance should calculated by euclidean distance..


So now I need help, how i should start and build my functions. Python3 is required.