Complete Technical Guide to Generate Sierpinski Maze
A Sierpinski Maze carves a perfect spanning-tree labyrinth strictly through the 8^n walkable chambers of a Sierpinski Carpet, treating every recursive 3×3 fractal cutout as an impassable void!
Every generated maze guarantees a unique path between the top-left entrance and bottom-right exit, verified live by an integrated Breadth-First Search (BFS) shortest-path solver.
Recursive Carpet Domain + Spanning-Tree Labyrinth
Walkable cells: { (r, c) ∈ [0..3^n − 1]² : no base-3 digit pair is (1, 1) }
Total rooms = 8^n; Guaranteed unique solution path via DFS spanning tree + BFS verification
Because the Sierpinski Carpet graph is connected at every finite order n, randomized depth-first spanning trees always link all 8^n rooms with zero unreachable pockets.
How to Use Generate Sierpinski Maze
- 1Pick Fractal Order 1 (3×3), 2 (9×9), or 3 (27×27 with 512 fractal chambers).
- 2Toggle the golden BFS solution path on or off to print puzzles for solving.
- 3Click Generate New Maze Portals for fresh labyrinths and export as PNG or SVG.
Reference Examples & Worked Benchmarks
| Order n | Grid Size | Walkable Chambers |
|---|---|---|
| 1 | 3 × 3 | 8 rooms |
| 2 | 9 × 9 | 64 rooms |
| 3 | 27 × 27 | 512 rooms |
Practical Applications & Engineering Workflows
Printable Fractal Puzzles
Uncheck the solution path and export clean SVG/PNG mazes for classrooms or books.
Graph Theory & BFS Demos
Demonstrate spanning trees and shortest-path traversal on fractal-topology graphs.
Accuracy, Edge Cases & Best Practices
- Every cell is reachable with a single unique non-looping solution path.
All calculations execute locally inside your browser using JavaScript with zero server round-trips, guaranteeing instant responsiveness and complete data privacy.