So I finally finished writing a program to build a maze using disjoint set (I just learned it =P). Anyway as I was writing my program, I was under the impression that I could start from the end of the maze and I could climb up to the parent node until I reach the entrance. However, I found out that this was not how disjoint works as I was writing the program heh. I am wondering if there was a simple way to solve my maze by using the properties of a disjoint set data structure? Or do I have no other choice, but to solve this recursively by going through the maze manually?

Recommended Answers

All 2 Replies

Could you explain what you meant by
>>solve this recursively by going through the maze manually?

I meant like using algorithm like backtracking, etc to go through the maze. I was hoping that there was some properties of a disjoint set that I can exploit that can make solving the maze easier, but I can't seem to think of anything that I can use within the data structure. It only has Union() and Find() and a parent value.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.