Maze Algorithms

If you're interested in maze algorithms, I've written a book about the subject: "Mazes for Programmers". Check it out!

The source code for these demos is freely available at http://github.com/jamis/csmazes.


Recursive Backtracking


Recursive Backtracking (Parallel Seeds)


Eller's Algorithm


Kruskal's Algorithm


Prim's Algorithm


Recursive Division


"Blobby" Recursive Subdivision Algorithm

Threshold:


Aldous-Broder Algorithm


Wilson's Algorithm


Houston's Algorithm

This combines Aldous-Broder and Wilson's, to get the best performance of both. Sadly, it is not guaranteed to be uniform like the other two, but it is faster! It runs Aldous-Broder until some minimum number of cells have been visited, and then switches to Wilson's.


"Hunt and Kill" Algorithm


Growing Tree Algorithm


E.g. random:50, newest:30, oldest:75, middle:100, or any comma-delimited combination of those.
You must click "reset" before the maze will recognize your changes.


Growing Binary Tree Algorithm


E.g. random:50, newest:30, oldest:75, middle:100, or any comma-delimited combination of those.


Binary Tree Algorithm


Sidewinder Algorithm