LABYRINTH ENGINE

Recursive Backtracker  ·  A* / BFS Visualizer

Canvas 21 × 21
Seed
No network · Fully offline

Generator

Maze Dimensions21 × 21
TinyHuge
Generation Style
Recursive Backtracker (Depth-First Search) — carves a perfect maze with exactly one solution. Long winding corridors, few branches.
Solver
A* uses Manhattan distance heuristic — explores toward the goal and typically visits ~40% fewer cells than BFS.
Animation Speed45 ms
SpaceSolve / Pause GNew maze
Animate carving

Watch walls get knocked down

Start
Goal
Ready to solve
Frontier Visited Path
Cells Visited
0
Frontier
0
Path Length
0% explored A* · Manhattan heuristic

How it works

1. Recursive Backtracker
Start at a random cell, mark visited, push to stack. While stack not empty: pick a random unvisited neighbor, remove the wall between, push. If no neighbor, backtrack. Results in a perfect maze.

2. Solver
A* expands the most promising cell first (f = g + h). g is steps from start, h is Manhattan distance to goal. Guaranteed shortest path, far faster than blind BFS on open mazes.
  • Perfect maze — exactly one solution
  • Canvas-rendered — no DOM grid
  • Reproducible seeds

Interaction

Click and drag on the maze to paint walls / erase. Shift+click sets start (green), Alt/Opt+click sets goal (red).
Seed: Click maze to edit