Longest Path

The longest path was computed using Dijkstra’s algorithm, as described in Making Challenging Mazes. It is represented in the following figure as the percentage of cells in a maze that lie on that longest path.

images/chart-longest-path.png

Recursive Backtracker is far-and-away the champion here, with an average of 50% of the cells in the grid existing on the longest path. Simplified Prim’s falls at the other end of the spectrum, with longest paths that cover less than 10% of the grid.

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.