BFS
Mode
A
Start Node
0
Visited
0
Queue / Stack
Ready
Status
BFS visited / Queue
DFS visited / Stack
Current node / edge scan
Start node
Graph Canvas
Click empty space to add a node. Drag from one node to another to connect them. Double-click a node to set the start.
Queue
Traversal Order
Message
How It Works
BFS and DFS use the same graph but different frontier rules. BFS removes from the front of a queue, so it explores in layers. DFS removes from the top of a stack, so it follows one branch as far as possible before returning.
- Blue is used for BFS runs and orange is used for DFS runs.
- The side panel shows the exact queue or stack contents after each step.
- You can edit the graph at any time, then reset and run again from a different start node.