Maze Generator & Solver

A maze gets carved by recursive backtracking, then two ways of finding the way out race through identical copies of it, one cell per turn. Breadth-first spreads evenly in every direction; A* leans toward the exit. Both come back with the same route every time — the only question is how many dead ends each opens first, and that swings a lot from maze to maze. Hit Regenerate a few times and watch the margin move.

Breadth-first

Fans out evenly. No idea where the exit is.

ready
A map of the maze showing which cells breadth-first search opened.
—cells opened
—route length

A* search

Same steps, but prefers cells that look closer to the exit.

ready
A map of the maze showing which cells A* search opened.
—cells opened
—route length

Race

turn 0 / 0 solved

Result

breadth-first—
a* search—

Both searches are ready.

across 1 maze · a* −0%

Maze

seed 11104 · 576 cells