Concept Flow - Connected Components Using BFS
Start with all nodes unvisited
Pick an unvisited node
Initialize queue with this node
While queue not empty
Dequeue node, mark visited
Enqueue all unvisited neighbors
Repeat until queue empty
One connected component found
Repeat for next unvisited node
All nodes visited, done
The BFS explores all nodes connected to a starting node, marking them visited to find one connected component. Repeat for all unvisited nodes to find all components.