MATH3250 · Theorem · Chapter 5 · Graph methods
Breadth-first search finds unweighted distances
1 steps of prerequisites below it
Breadth-first search from s with a first-in, first-out queue discovers exactly the vertices reachable from s, labels each by the length of a shortest path from s, and runs in O(|V| + |E|) time on adjacency lists.
Taught in
- 5.1 Trees and breadth-first search · introduced
Uses
- Loop invariant · used in its proof, proof step 5.1
- Graphs, paths, cycles and trees · used in its proof, proof step 5.1
Used by
Lenses
- Distance labels organize several questions · Structural
Everything this builds on, earliest first · 2 steps
Each step comes after its own prerequisites, so reading in this order never needs something you have not met. It is a reading order for these notes, not a diagnosis of what you know.
- Loop invariant · 4.1
- Graphs, paths, cycles and trees · 5.1
Possible roots and a review route need your own answers on these points. None are recorded yet, so none are suggested.
Longest chain down to a starting point
Each step is used by the one above it, across courses where the notes link them. It ends at a point the notes define without another point.