Dijkstra's Algorithm
- Given a graph with weighted non-negative arcs, find the shortest
path between two points.
- Assign a distance value to all nodes. 0 for the start node,
and infinity for all others.
- Mark all nodes as unvisited, and set the initial node as current.
- Repeat until goal node is visited (or all nodes visited then fail).
- For the current node, visit all unvisited nodes that are connected.
Give the appropriate distance to each of these nodes.
- Mark the current node as visited. Whack in the distance to it.
- Make the unvisited node with the smallest distance
the current node.
- Assumes non-negative weights.