Dijkstra's Algorithm CCN
Dijkstra's Algorithm CCN
855J
Dijkstra’s Algorithm
2
An Example
2 4 4
2 2
0
1 2 3
1 6
4 2
3 3 5
Initialize
Select the node with
the minimum temporary
distance label.
3
Update Step
2
2 4 4
2 2
0
1 2 3
1 6
4 2
3 3 5
4
4
Choose Minimum Temporary Label
2
2 4 4
2 2
0
1 2 3
1 6
4 2
3 3 5
4
5
Update Step
6
2
2 4 4
2 2
0
1 2 3
1 6
4 2
3 3 5
4
3 4
The predecessor
of node 3 is now
node 2
6
Choose Minimum Temporary Label
2 6
2 4 4
2 2
0
1 2 3
1 6
4 2
3 3 5
3 4
7
Update
2 6
2 4 4
2 2
0
1 2 3
1 6
4 2
3 3 5
3 4
8
Choose Minimum Temporary Label
2 6
2 4 4
2 2
0
1 2 3
1 6
4 2
3 3 5
3 4
9
Update
2 6
2 4 4
2 2
0 6
1 2 3
1 6
4 2
3 3 5
3 4
10
Choose Minimum Temporary Label
2 6
2 4 4
2 2
0
1 2 3
1 6 6
4 2
3 3 5
3 4
11
Update
2 6
2 4 4
2 2
0
1 2 3
1 6 6
4 2
3 3 5
3 4
12
Choose Minimum Temporary Label
2 6
2 4 4
2 2
0
1 2 3
1 6 6
4 2
3 3 5
3 4
13
End of Algorithm
2 6
2 4 4
2 2
0
1 2 3
1 6 6
4 2
3 3 5
3 4