Prim’s (Simplified)

In a nutshell:

Initialize a set with an arbitrary cell. Randomly choose a cell from the set. If it has no unvisited neighbors, remove it from the set. Otherwise, choose one of the cell’s unvisited neighbors, link the two together, and add the neighbor to the set. Repeat until the set is empty.

images/appendix-prims-simplified.png
Typical features:

A strong radial texture centered on the starting cell. Mazes tend to have more dead ends than other algorithms, and shorter paths. Behaves identically to Prim’s (True) if that algorithm is given a grid where every cell is weighted the same.

More information:

Simplified Prim’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.