I was playing around with the recursive backtracking algorithm but it always produces very easy mazes. What algorithm produces the hardest mazes to solve (please include information about braids and biased directions if appropriate)?
Quantitatively defining the "difficulty" of a maze isn't easy. So let me be qualitative.
First off, Recursive Backtracker is a "perfect maze" algorithm; it generates mazes with one, and only one, solution. Most work on maze generation has to do with generating perfect mazes, so I will limit my answer to those.
There are many, many variations and off-shoots of maze algorithms. But in effect, there are only 12 basic maze algorithms. I have them listed here in the order that I personally (qualitatively and anecdotally) find to be most-to-least difficult:
- Kruskal's
- Prim's
- Recursive Backtracker
- Aldous-Broder
- Growing Tree
- Hunt-and-Kill
- Wilson's
- Eller's
- Cellular Automaton (Easy)
- Recursive Division (Very Easy)
- Sidewinder (Predictable)
- Binary Tree (Flawed)
There is not a lot of difference in the difficulty of the top four on my list. Sorry about that. Perhaps there is a flaw in your implementation. Most likely, you're just good at doing mazes. Try making them larger.
Whilst not a direct answer, this article on visualizing maze generation algorithms is a must-watch.
You can check maze generation algorithms from here :
Depth-first search can produce very complex mazes. Here is an open-source C++ implementation: https://github.com/corporateshark/random-maze-generator
Try setting ImageSize
to 4096 and NumCells
to 2047. The result will be pretty tough.
flood fill algorithms is what IEEE recommend.
There are many versions of this algorithm.
I google an implemantion for the flood fill algorithm.
but I did not find implemantion
© 2022 - 2024 — McMap. All rights reserved.