Maze Runner
Race your own path through a maze, then watch BFS find the provably shortest route, and DFS show why 'a path' isn't 'the shortest path'.
How to play
- Move from the green start to the violet goal using arrow keys or the on-screen pad.
- After you finish, run BFS: it explores in rings and reconstructs the shortest path.
- Switch to DFS to watch a deep-dive exploration and compare its path length.
- Three handcrafted mazes, sized up as you go.
maze1 / 3moves0wall bumps0shortest20
Move from A (green) to B (violet) with the arrow keys or the pad. Every step counts, after you arrive, BFS will judge your route.
You
B
Move (arrow keys / WASD also work)
What's the difference?
BFS expands in rings around A using a queue, the first time it reaches B, the path is guaranteed shortest (unweighted maze). DFS dives down one corridor using a stack, it finds a path, whatever length it happens to be.
Estimated play time: 5–8 min. Scores feed your local progress, stored only in this browser.