Growing Tree maze algorithm
Growing Tree keeps a list of active cells and grows the maze from one of them at each step. How it picks that cell decides the maze's look.
How it works
Start with one cell in the list. Pick a cell from the list, carve to a random unvisited neighbour and add that neighbour to the list; if it has no unvisited neighbours, remove it. Repeat until the list is empty.
Always picking the newest cell makes it the recursive backtracker; always picking a random cell makes it like Prim's. This version picks the newest cell half the time and a random one otherwise, so it mixes long corridors with lots of short branches.
What to watch for
Watch it run off in long snakes like the backtracker, then jump somewhere random and sprout a new branch.
Properties
- Texture
- A mix of long corridors and short branches
- Dead ends
- Medium
- Uniform
- No
- Speed
- Fast
- Memory
- The active list
Try it
Open the studio to carve your own Growing Tree maze at any size, solve it with up to four algorithms, and save the video.
FAQ
Is Growing Tree a different algorithm or a family?
A family. The rule for picking the next cell turns it into the backtracker, Prim's, or anything in between.