Wilson’s

In a nutshell:

Choose an arbitrary cell and add it to the maze. Starting from any other cell, perform a loop-erased random walk until you encounter a cell belonging to the maze, and then add the resulting walk. Repeat until all cells have been added.

images/appendix-wilsons.png
Typical features:

Slow to start but accelerates quickly as paths are added to the maze. As with Aldous-Broder, it is unbiased, meaning it is guaranteed to generate mazes perfectly randomly, without preference to any particular texture or feature.

More information:

Wilson’s Algorithm.

Get Mazes for Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.