Breadth-First Search vs Random Mouse
Same maze, same speed, first to the exit wins. On this maze Breadth-First Search gets there first and turns gold.
The numbers
- BFS explored
- 1,959 cells
- BFS path
- 173 steps
- Random Mouse
- never reaches the exit
Breadth-First Search
Breadth-First Search explores a maze in rings: every cell one step away, then two, then three, until it reaches the exit. More on Breadth-First Search.
Random Mouse
The Random Mouse picks a random direction at every step. It has no memory and no plan, and it almost never finds the exit in time. More on Random Mouse.
FAQ
Which is faster in a maze, Breadth-First Search or Random Mouse?
Breadth-First Search. The Random Mouse moves at random with no memory, so it almost never finds the exit in time.
How is the race fair?
Both solvers run on the same maze and explore the same number of cells per frame. Whoever explores fewer cells before reaching the exit finishes first and turns gold.
Which one finds the shorter path?
Breadth-First Search always finds a shortest path; the mouse finds none.