The pseudocode initializes distances to infinity and predecessors to nil, sets the source distance to 0, and uses a priority queue H. It repeatedly extracts the vertex u with the minimum distance, relaxes all outgoing edges (u,v), updating dist(v) and prev(v) if a shorter path is found, and decreases the key of v in H.
Conditions: Input: Graph , directed or undirected.; Positive edge lengths { : }.; Source vertex .; Output: dist(u) is the shortest distance from s to u for all reachable u.
The pseudocode initializes distances to infinity and predecessors to nil, sets the source distance to 0, and uses a priority queue H. It repeatedly extracts the vertex u with the minimum distance, relaxes all outgoing edges (u,v), updating dist(v) and prev(v) if a shorter path is found, and decreases the key of v in H.
Conditions: Input: Graph , directed or undirected.; Positive edge lengths { : }.; Source vertex .; Output: dist(u) is the shortest distance from s to u for all reachable u.