dsagraphs
Why does BFS find shortest paths in an unweighted graph?
Anonymous
BFS visits nodes in layers: first distance 0, then distance 1, then distance 2, and so on. With every edge having equal cost, the first visit to a node uses a path with the fewest edges. With different edge costs, that reasoning no longer applies.
0