Concept Flow - Connected Components Using BFS
Start with graph
Initialize visited set
For each node in graph
If node not visited?
No→Skip to next node
Yes
Start BFS from node
Mark node visited, add to queue
While queue not empty
Pop node from queue
For each neighbor
If neighbor not visited
Mark visited, add to queue
Repeat until queue empty
One connected component found
Repeat for next unvisited node
All nodes visited, done
The flow shows how BFS explores each connected component by visiting nodes and their neighbors, marking them visited to avoid repeats.
