Breadth-First Search
Use a queue to explore a graph one distance layer at a time.
Recognition signal
Fewest edges or simultaneous spread on an unweighted graph.
Method
Mark a vertex when enqueuing it so its distance is assigned on first discovery.
Worked example
With edges A–B, A–C, C–D, vertex D first receives distance 2.
Common mistake
Different edge weights invalidate the fewest-edges cost guarantee.