Decision Maths 1 Shortest path algorithm Dijkstra’s Algorithm A V Ali : www.2july- maths.co.uk
Jan 18, 2018
Decision Maths 1
Shortest path algorithmDijkstra’s Algorithm
A V Ali : www.2july-maths.co.uk
Box 3 Box 2
Box 1
Dijkstra’s algorithm used to find the shortest path through a network.
Step 4 : Repeat 3, for all nodes in the network. Label Box 2 when you have checked the shortest path has been found. Label Box 3 with the node order number through the path.
0 0
1 3 2 5
4 9
3 6
5 14
6 17
12
3 5
15
19
8
18
7 6
9 14
170
Find the shortest path from A to G Step 1 : For first node
label Box 1, 2 and 3 all 0.
Step 2 : Each node has Box 1 labeled as the shortest distance to this node from the start so far.
Step 3 : Go from each node labeled so far, and replace Box 1 value if a new shortest path from the start is found.
Shortest route from A to G = 17