Vertex A has the smallest temporary label, so make it permanent with final label 0
final(A)=0update: B=49,E=14,F=22,G=28 Its neighbours' working values are replaced only if the new value is smaller.
Vertex E has the smallest temporary label, so make it permanent with final label 14
final(E)=14update: B=23,D=67 Its neighbours' working values are replaced only if the new value is smaller.
Vertex F has the smallest temporary label, so make it permanent with final label 22
final(F)=22update: C=66,D=26 Its neighbours' working values are replaced only if the new value is smaller.
Vertex B has the smallest temporary label, so make it permanent with final label 23
final(B)=23update: C=31 Its neighbours' working values are replaced only if the new value is smaller.
Vertex D has the smallest temporary label, so make it permanent with final label 26
final(D)=26no labels improved Its neighbours' working values are replaced only if the new value is smaller.
Vertex G has the smallest temporary label, so make it permanent with final label 28
final(G)=28update: H=66 Its neighbours' working values are replaced only if the new value is smaller.
Vertex C has the smallest temporary label, so make it permanent with final label 31
final(C)=31update: H=64 Its neighbours' working values are replaced only if the new value is smaller.
Vertex H has the smallest temporary label, so make it permanent with final label 64
final(H)=64no labels improved Its neighbours' working values are replaced only if the new value is smaller.
List the order in which the vertices became permanent
A,\;E,\;F,\;B,\;D,\;G,\;C,\;H
The final labels are all different, so this order is unique.
Confirm that the shortest route is unique
next best route A→G→Hhas weight 66>64 No other route from A to H achieves the minimum, so the shortest route is unique.
List the final labels of all the vertices
A=0,B=23,C=31,D=26,E=14,F=22,G=28,H=64 Each final label is the length of the shortest path from A to that vertex.
Recall how Dijkstra's algorithm works
make the smallest temporary label permanent, then update its neighbours The vertex with the smallest temporary label can never be improved, so it may be made permanent.
Note that a temporary label is only ever replaced by a smaller value
temp(X)←min{temp(X),final(Y)+w(YX)} A working value is crossed out and rewritten only when a shorter route to that vertex is found.
Note that Dijkstra's algorithm requires non-negative weights
All the arc weights here are positive, so the algorithm is valid.
Select the option giving the order of the final labels
order:A,E,F,B,D,G,C,H Vertices receive their final labels in increasing order of those labels.
AnswerA,\;E,\;F,\;B,\;D,\;G,\;C,\;H