It turns out there are 11 classic algorithms to generate “perfect” mazes. A maze is perfect if it has one, and only one, solution. Here are some links to each algorithm, in rough order of my preference.
- Kruskal’s
- Prim’s
- Recursive Backtracker
- Aldous-Broder
- Growing Tree
- Hunt-and-Kill
- Wilson’s
- Eller’s
- Recursive Division (Predictable)
- Sidewinder (Predictable)
- Binary Tree (Flawed)
For more info, check out mazelib on GitHub, a Python library implementing all the standard maze generating/solving algorithms.