Assign to vertex S potential 0;
label each vertex V reached directly from S with the distance from S to V;
chose the smallest of these labels, and make it the potential of the corresponding vertex or
vertices.
Consider the vertex or vertices just assigned a potential;
for each such vertex V, look at each vertex W reached directly from V and assign W the label
(potential of V)+(distance from V to W),
unless W already has a smaller label;
when all such vertices W have been labeled, choose the smallest label in the network which is
not already a potential and make it as potential at each vertex where it occurs;
repeat the GENERAL STEP with the new potential(s).
when vertex T has been assigned a potential; this is the shortest distance from S to T.
Work backwards from T and include VW whenever
(potential of W)-(potential of V)=(distance from V to W).