Dijkstra’s AlgorithmAssumption: c(u,v) = infinity if (u,v) not in E.
DijkstraShortestPaths (directed graph G, vertex s):
Set U (initialized to be empty)
for each vertex v in G except s do
Dist(s) := 0; U.insert(s);
v := any member of U with minimum Distance
for each neighbor w of v do
Dist(w) := min(Dist(w), Dist(v) + c(v,w));