Maze Solver Museum
Selected Algorithm

Breadth-First Search

native Unweighted graph search

Breadth-first search explores the maze in distance layers, so the first time it reaches the goal is the shortest unweighted route.

How To Read It Cyan cells are explored by layer; amber cells are waiting in the frontier.
Best Use Use it when every move has the same cost and shortest path length matters.
Trade-Off It is reliable but can visit a wide area before the goal is reached.
Core Procedure
enqueue start
pop by FIFO layer
record parent
trace goal path

Recursive Backtracker

Depth-first spanning-tree construction over odd grid cells.

Spanning tree Perfect maze O(V + E)
Model Randomized DFS on the cell graph.
Bias Long corridors and low branching.
Invariant Every carved cell is connected to the start tree.
Procedure
push start
choose unvisited neighbor
carve wall
backtrack on dead ends

Mathematical Breakdown

Layered graph expansion over a grid graph G = (V, E).

Grid graph Unit cost
Recurrence / Score dist[v] = dist[u] + 1
Invariant The first time a cell is dequeued, its edge-count distance is minimal.
Procedure
enqueue start
pop by FIFO layer
record parent for every new cell
trace parents from goal
What to Watch The cyan wave grows in distance layers; magenta appears only after the route is reconstructed.