What It Does
Dijkstra's algorithm finds the shortest path from a single starting node to all other nodes in a graph with non-negative edge weights.
High-Level Steps
- Set the starting node distance to 0 and all others to infinity.
- Pick the unvisited node with the smallest known distance.
- Update distances of its neighbors and repeat until done.
Visual Idea
This animation shows how shortest distances are updated as the algorithm explores nodes.
Learn More
Visit Wikipedia's Dijkstra's Algorithm page for detailed explanations and pseudocode.