Playground

BFS Traversal

Visualize Breadth-First Search step-by-step with state, queue history, and detailed traversal logs.

BFS Traversal Lab

Explore Breadth-First Search with a starter graph loaded by default. BFS visits neighbors level-by-level with a FIFO queue and now continues across disconnected components.

function BFS(start) {
queue = [start]
visited = set(start)
while queue not empty: visit node, enqueue unvisited neighbors
if queue empty and nodes remain: start next component
}
ABCDEFG

INSPECTOR

Select a node or edge.
Click any Node or Edge on the canvas to update its label or weight here.
Traversal Controls
500ms
Fast (100ms)Slow (2000ms)
Execution Logs & Queue
Memory Queue (FIFO)
Queue is empty
Traversal Output
Pending...
Start Traversal to view execution logs.