This is a my version of Shortest Path Algorithm inspired in Edsger Dijkstra - Shortest Path Alogorithm (1959) using Python3.
The algorithm exists in many variants. Dijkstra's original algorithm found the shortest path between two given nodes,[6] but a more common variant fixes a single node as the "source" node and finds shortest paths from the source to all other nodes in the graph, producing a shortest-path tree. link
Todo:
- Shortest path on 1 level.
- Shortest path on 2 levels.
- Shortest path on 3 levels.
- Shortest path on infinity levels.
- Optimization.
- Visual demonstration
python3 main.py
Implements a Shortest Path Algorithm with infinity levels as shown in the image below.
Illustration of Dijkstra's algorithm finding a path from a start node (lower left, red) to a goal node (upper right, green) in a robot motion planning problem. Open nodes represent the "tentative" set (aka set of "unvisited" nodes). Filled nodes are visited ones, with color representing the distance: the greener, the closer. Nodes in all the different directions are explored uniformly, appearing more-or-less as a circular wavefront as Dijkstra's algorithm uses a heuristic identically equal to 0. link