Breadth-First Search (BFS)
- Objective:
- Given a graph and a vertex S, discover every vertex in the
graph reachable from S.
- Strategy:
- Discover all vertices at distance k from S before
discovering any vertex at distance k+1.
- Side Effects:
-
- The shortest-path distance from S to all vertices is found
- A breadth-first tree is constructed