Dead Ends

A dead end is defined as a cell that is linked to only a single neighbor. Fewer dead ends and a long path might suggest lengthy side roads that can take someone far astray.

The following figure shows how the number of dead ends per maze compared across algorithms.

images/chart-deadends.png

Aldous-Broder and Wilson’s tend to produce mazes where around 30% of the cells are dead ends. True Prim’s produces about 50% more than that, and Hunt-and-Kill and Recursive Backtracker produce significantly fewer.

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.