Dijkstra's Algorithm as a Spreading Frontier

About this lecture

Dijkstra's algorithm, taught as a frontier that spreads outward from a source across a weighted graph. We build a small six-node graph, give every node a tentative distance, and watch those numbers fall as edges are relaxed and the settled region grows one node at a time. Then we do the part that matters: we prove that the greedy choice — always settling the unsettled node with the smallest tentative distance — is safe, by tracing where any cheaper route would have to go, and showing exactly how that argument collapses the moment a single negative edge appears. We finish with the priority-queue implementation, the predecessor pointers that recover the routes themselves, and the O((V + E) log V) bound.

Transcript

Loading discussion…