Skip to main content

Shortest Path - Dijkstra

Learn Shortest Path - Dijkstra (Graphs, Advanced DSA) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Shortest Paths from One Source, Non-Negative Weights Dijkstra's Algorithm greedily expands the UNVISITED vertex with the smallest known distance, using a min-heap - once a vertex is finalized, its distance is guaranteed correct and never revisited. Works ONLY when all edge weights are non-negative.

More lessons in Graphs