Save this video — free

Shortest Paths

Kent Quanrud · 1:16:23 · Watch on YouTube

Shortest Paths Watch on YouTube →

Overview

Kent Quanrud develops shortest-path algorithms from first principles: breadth-first search (BFS) finds minimum-hop paths in O(m+n), while Dijkstra’s algorithm handles positive edge lengths by repeatedly settling the vertex with the smallest tentative distance. He derives Dijkstra’s correctness and runtime, including the O(m+n log n) bound with a Fibonacci heap, then shows how to reduce an even-edge-count shortest-walk problem to ordinary shortest paths using a two-layer graph with only 2n vertices and 2m edges.

Key takeaways

Chapters

0:00 Shortest Paths Begin with Minimum-Hop Routes
4:28 Weighted Distance, Infinite Values, and the Triangle Inequality
5:08 BFS Finds Minimum-Hop Distances in Layers
11:05 Proving BFS Correct with Induction on Distance
18:33 Positive Edge Lengths Replace Hop Counts
20:55 Why Subdividing Weighted Edges Can Be Too Slow
25:40 Dijkstra’s Algorithm Selects the Next Closest Vertex
28:35 Dijkstra Correctness Uses the Algorithm’s Vertex Order
36:20 Tentative Distances Avoid Recomputing Old Candidates
40:20 Binary Heaps Improve Dijkstra’s Runtime
45:10 Fibonacci Heaps Reduce Decrease-Key Costs
54:45 Shortest Walks with an Even Number of Edges
1:00:15 Two-Edge Shortcuts Work but Can Create a Dense Graph
1:04:50 Why a Sparse Reduction Needs to Track Route State
1:09:55 Parity Layers Generalize to Modulo-5 Path Constraints

Keep these chapters and the full searchable transcript in your own library.

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Kent Quanrud.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.