BFS spreads out
Breadth-first search uses a queue. It explores everything one step away, then everything two steps away, and so on.
Graph theory playground
This prototype introduces graph search through vertices, edges and traversal algorithms. Change the graph yourself, then watch how breadth-first search and depth-first search behave.
The aim is to make discrete mathematics feel concrete: predict what will happen, run the algorithm, then adjust the network and try again.
View the search algorithms mapBreadth-first search uses a queue. It explores everything one step away, then everything two steps away, and so on.
Depth-first search follows a path as far as it can before backtracking. It feels more like exploring a maze by choosing a corridor and committing to it.
Change one edge or the starting vertex and the same algorithm can behave differently. The point is to predict, test and then explain why.
Interactive prototype
Add vertices, click two vertices to add or remove an edge, then choose a start vertex and compare how breadth-first and depth-first search explore the same graph.
Adjacency list
Side-by-side comparison
Explores in layers using a queue.
Put V1 into the queue. Breadth-first search always removes from the front, so it explores nearby vertices before going deeper.
BFS order
Goes deep along one path before backtracking.
Start at V1. Depth-first search follows one path as far as it can before backtracking.
DFS order
Joy in the process
These tools are invitations to explore. A good mistake, a surprising pattern or a question you cannot yet answer is part of the work, not a failure of it.
The challenge is deliberate: the site should support thinking, not remove the need for it.
What comes next