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:
ABCDEFG

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 yet

Start 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

Learn the theory