Breadth-First Search
Breadth-First Search — Level-Order Traversal
Explores all vertices at the current depth before moving deeper. Uses a queue. Guarantees shortest path in unweighted graphs.
Unweighted graph (click a node to set as source)
Source
Current
Visited
Discovered
Unvisited

Queue

empty
Press ▶ Run or Step to begin...

Controls

Ready
Time Complexity: O(V + E)
Space: O(V)

Traversal Table

NodeDepthParent