Example Dijkstra Algorithm
Example Dijkstra Algorithm
Iterations
c 2(a) 10 e S = { a,c,b,d,e,z }
10 (a,c,b,d)
procedure Dijkstra (G: weighted connected simple
graph, with all
Legend weights positive)
{G has vertices a = v0, v1, …, vn = z and weights w(vi,vj) where w(vi,vj) =
Processed……. ∞ if {vi,vj} is not an edge of G}
for i := 1 to n
L(vi) := ∞
L(a) := 0
Processing… S := ∅
{the labels are now initialized so that the label of a is 0 and all other
labels are ∞, and S is the empty set}
while z not belong to S
5/9/2012 45