Graph Algorithm Visualizer
Play, pause and scrub through a traversal. The queue, stack and distance table update alongside the graph, so you can see why the algorithm does what it does.
Example:
Click any node to start the traversal from there.
Queue (first in, first out)
A
We always take from the left. New nodes join on the right.
Visited, in order
nothing yetStart at A. The queue holds the nodes we know about but haven't looked at yet, so A goes in first.
Step 1 of 9
How to use it
- Press Play to run the traversal, or Step to advance one frame at a time.
- Click any node to restart from there.
- Switch between BFS and DFS to compare visit orders on the identical graph.