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.
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.