disjoint-sets

Amortized time per operation using disjoint sets

I happened to read on Wikipedia that the amortized time per operation on a disjoint set (union two elements, find parent of a specific element) is O(a(n)), where a(n) is the inverse Ackermann function, which grows very fast. Can anyone explain why this is true? ...

Disjoint set as linked list

Can anyone point me to some info on Disjoint sets as linked list? I cant find any code on this. Language C++ ...

c++ test if 2 sets are disjoint

I know the STL has set_difference, but I need to just know if 2 sets are disjoint. I've profiled my code and this is slowing my app down quite a bit. Is there an easy way to see if 2 sets are disjoint, or do I need to just roll my own code? EDIT: I also tried set_intersection but it took the same time... ...

What operations can be performed on disjoint sets?

I just studied the disjoint set data structure and I know that it is also called "union-find data structures", union and find are two main operations of this data structure. We can can perform union on disjoint sets, similarly we can perform find operations; I want to know what other operations we can perform on disjoint sets except unio...

Disjoint Set ADT Implementation in c++

Hay Dear! I have problem in implementing disjoint set ADT in c++ due to the fact that our teacher only explained the union and find operations. I have full concept of union and find but still I am confused about how to implement. Please give me an idea , also explain what should be the interface of this data structure. Explain this data...

Union/find algorithm without union by rank for disjoint-set forests data structure

Here's a breakdown on the union/find algorithm for disjoint set forests on wikipedia: Barebone disjoint-set forests... (O(n)) ... with union by rank ... (now improved to O(log(n)) ... with path compression (now improved to O(a(n)), effectively O(1)) Implementing union by rank necessitates that each node keeps a rank field for com...

What is the order in this Union by Rank diagram?

Hi, I'm having trouble understanding the following diagram: Why is A linked to D instead of B? Why is C linked to F instead of D? ...

O(1) Make, Find, Union in Disjoint Sets Data Structure

Today, I had discussion with someone about Kruskal Minimum Spanning Tree algorithm because of page 13 of this slide. The author of the presentation said that if we implement disjoint sets using (doubly) linked list, the performance for Make and Find will be O(1) and O(1) respectively. The time for operation Union(u,v) is min(nu,nv), wh...

Implementing equivalence relations in C++ (using boost::disjoint_sets)

Assume you have many elements, and you need to keep track of the equivalence relations between them. If element A is equivalent to element B, it is equivalent to all the other elements B is equivalent to. I am looking for an efficient data structure to encode this information. It should be possible to dynamically add new elements throu...