6 ms·
Disjoint sets. 1) Each cell in the maze is a set. 2) Randomize walls. Check if wall to be removed are already in the same set. Merge the set if wall is remov
by tankerdude 13y ago
Disjoint sets.
1) Each cell in the maze is a set.
2) Randomize walls. Check if wall to be removed are already in the same set. Merge the set if wall is removed.
3) Repeat until entire maze is in one set.
DFS seems a bit odd for generation. For generating a solution, it would be what I would do.
- kd0amg 13y agoI'm told DFS tends to produce easier mazes in the sense that after you've made a bit of progress, false paths typically end more and more quickly.