logoalt Hacker News

dfajgljsldkjagyesterday at 5:19 PM1 replyview on HN

I've always known about algorithms that solve mazes, but never about actually making them. It's interesting seeing all these algorithms and how the mazes they generate look different.


Replies

ameliusyesterday at 11:01 PM

The main insight in many of these algorithms is that if you have a tree, there's exactly one path between any two leaves (assuming you don't pass over a branch twice). So if you just draw a random tree-like structure and make the entry and exit points of the maze leaves in the tree, then you have a valid maze with exactly one solution.