Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Disjoint-set data structure

From Wikipedia, the free encyclopedia
(Redirected fromDisjoint set data structure)
Data structure for storing non-overlapping sets
Disjoint-set/Union-find Forest
Typemultiway tree
Invented1964
Invented byBernard A. Galler andMichael J. Fischer
Time complexity inbig O notation
OperationAverageWorst case
SearchO(α(n))[1] (amortized)O(α(n))[1] (amortized)
InsertO(1)[1]O(1)[1]
Space complexity
SpaceO(n)[1]O(n)[1]

Incomputer science, adisjoint-set data structure, also called aunion–find data structure ormerge–find set, is adata structure that stores a collection ofdisjoint (non-overlapping)sets. Equivalently, it stores apartition of a set into disjointsubsets. It provides operations for adding new sets, merging sets (replacing them with theirunion), and finding a representative member of a set. The last operation makes it possible to determine efficiently whether any two elements belong to the same set or to different sets.

While there are several ways of implementing disjoint-set data structures, in practice they are often identified with a particular implementation known as adisjoint-set forest. This specialized type offorest performs union and find operations in near-constantamortized time. For a sequence ofm addition, union, or find operations on a disjoint-set forest withn nodes, the total time required isO(mα(n)), whereα(n) is the extremely slow-growinginverse Ackermann function. Although disjoint-set forests do not guarantee this time per operation, each operation rebalances the structure (via tree compression) so that subsequent operations become faster. As a result, disjoint-set forests are bothasymptotically optimal and practically efficient.

Disjoint-set data structures play a key role inKruskal's algorithm for finding theminimum spanning tree of a graph. The importance of minimum spanning trees means that disjoint-set data structures support a wide variety of algorithms. In addition, these data structures find applications in symbolic computation and in compilers, especially forregister allocation problems.

History

[edit]

Disjoint-set forests were first described byBernard A. Galler andMichael J. Fischer in 1964.[2] In 1973, their time complexity was bounded toO(log(n)){\displaystyle O(\log ^{*}(n))}, theiterated logarithm ofn{\displaystyle n}, byHopcroft andUllman.[3] In 1975,Robert Tarjan was the first to prove theO(mα(n)){\displaystyle O(m\alpha (n))} (inverse Ackermann function) upper bound on the algorithm's time complexity.[4] He also proved it to be tight. In 1979, he showed that this was the lower bound for a certain class of algorithms,pointer algorithms, that include the Galler-Fischer structure.[5] In 1989,Fredman andSaks showed thatΩ(α(n)){\displaystyle \Omega (\alpha (n))} (amortized) words ofO(logn){\displaystyle O(\log n)} bits must be accessed byany disjoint-set data structure per operation,[6] thereby proving the optimality of the data structure in this model.

In 1991, Galil and Italiano published a survey of data structures for disjoint-sets.[7]

In 1994, Richard J. Anderson and Heather Woll described a parallelized version of Union–Find that never needs to block.[8]

In 2007, Sylvain Conchon and Jean-Christophe Filliâtre developed a semi-persistent version of the disjoint-set forest data structure and formalized its correctness using theproof assistantCoq.[9] "Semi-persistent" means that previous versions of the structure are efficiently retained, but accessing previous versions of the data structure invalidates later ones. Their fastest implementation achieves performance almost as efficient as the non-persistent algorithm. They do not perform a complexity analysis.

Variants of disjoint-set data structures with better performance on a restricted class of problems have also been considered. Gabow and Tarjan showed that if the possible unions are restricted in certain ways, then a truly linear time algorithm is possible.[10] In particular, linear time is achievable if a "union tree" is given a priori. This is a tree that includes all elements of the sets. Let p[v] denote the parent in the tree, then the assumption is that union operations must have the formunion(v,p[v]) for somev.

Representation

[edit]

In this and the following section we describe the most common implementation of the disjoint-set data structure, as a forest ofparent pointer trees. This representation is known asGaller-Fischer trees.

Each node in a disjoint-set forest consists of a pointer and some auxiliary information, either a size or a rank (but not both). The pointers are used to makeparent pointer trees, where each node that is not the root of a tree points to its parent. To distinguish root nodes from others, their parent pointers have invalid values, such as a circular reference to the node or a sentinel value. Each tree represents a set stored in the forest, with the members of the set being the nodes in the tree. Root nodes provide set representatives: Two nodes are in the same set if and only if the roots of the trees containing the nodes are equal.

Nodes in the forest can be stored in any way convenient to the application, but a common technique is to store them in an array. In this case, parents can be indicated by their array index. Every array entry requiresΘ(logn) bits of storage for the parent pointer. A comparable or lesser amount of storage is required for the rest of the entry, so the number of bits required to store the forest isΘ(n logn). If an implementation uses fixed size nodes (thereby limiting the maximum size of the forest that can be stored), then the necessary storage is linear inn.

Operations

[edit]

Disjoint-set data structures support three operations: Making a new set containing a new element; Finding the representative of the set containing a given element; and Merging two sets.

Making new sets

[edit]

TheMakeSet operation adds a new element into a new set containing only the new element, and the new set is added to the data structure. If the data structure is instead viewed as a partition of a set, then theMakeSet operation enlarges the set by adding the new element, and it extends the existing partition by putting the new element into a new subset containing only the new element.

In a disjoint-set forest,MakeSet initializes the node's parent pointer and the node's size or rank. If a root is represented by a node that points to itself, then adding an element can be described using the following pseudocode:

function MakeSet(x)isifx is not already in the forestthenx.parent :=xx.size := 1// if nodes store sizex.rank := 0// if nodes store rankend ifend function

This operation has linear time complexity. In particular, initializing adisjoint-set forest withn nodes requiresO(n)time.

Lack of a parent assigned to the node implies that the node is not present in the forest.

In practice,MakeSet must be preceded by an operation that allocates memory to holdx. As long as memory allocation is an amortized constant-time operation, as it is for a gooddynamic array implementation, it does not change the asymptotic performance of the random-set forest.

Finding set representatives

[edit]

TheFind operation follows the chain of parent pointers from a specified query nodex until it reaches a root element. This root element represents the set to whichx belongs and may bex itself.Find returns the root element it reaches.

Performing aFind operation presents an important opportunity for improving the forest. The time in aFind operation is spent chasing parent pointers, so a flatter tree leads to fasterFind operations. When aFind is executed, there is no faster way to reach the root than by following each parent pointer in succession. However, the parent pointers visited during this search can be updated to point closer to the root. Because every element visited on the way to a root is part of the same set, this does not change the sets stored in the forest. But it makes futureFind operations faster, not only for the nodes between the query node and the root, but also for their descendants. This updating is an important part of the disjoint-set forest's amortized performance guarantee.

There are several algorithms forFind that achieve the asymptotically optimal time complexity. One family of algorithms, known aspath compression, makes every node between the query node and the root point to the root. Path compression can be implemented using a simple recursion as follows:

function Find(x)isifx.parent ≠xthenx.parent := Find(x.parent)returnx.parentelsereturnxend ifend function

This implementation makes two passes, one up the tree and one back down. It requires enough scratch memory to store the path from the query node to the root (in the above pseudocode, the path is implicitly represented using the call stack). This can be decreased to a constant amount of memory by performing both passes in the same direction. The constant memory implementation walks from the query node to the root twice, once to find the root and once to update pointers:

function Find(x)isroot :=xwhileroot.parent ≠rootdoroot :=root.parentend whilewhilex.parent ≠rootdoparent :=x.parentx.parent :=rootx :=parentend whilereturnrootend function

Tarjan andVan Leeuwen also developed one-passFind algorithms that retain the same worst-case complexity but are more efficient in practice.[4] These are called path splitting and path halving. Both of these update the parent pointers of nodes on the path between the query node and the root.Path splitting replaces every parent pointer on that path by a pointer to the node's grandparent:

function Find(x)iswhilex.parent ≠xdo        (x,x.parent) := (x.parent,x.parent.parent)end whilereturnxend function

Path halving works similarly but replaces only every other parent pointer:

function Find(x)iswhilex.parent ≠xdox.parent :=x.parent.parentx :=x.parentend whilereturnxend function

Merging two sets

[edit]
MakeSet creates 8 singletons.
After some operations ofUnion, some sets are grouped together.

The operationUnion(x,y) replaces the set containingx and the set containingy with their union.Union first usesFind to determine the roots of the trees containingx andy. If the roots are the same, there is nothing more to do. Otherwise, the two trees must be merged. This is done by either setting the parent pointer ofx's root toy's, or setting the parent pointer ofy's root tox's.

The choice of which node becomes the parent has consequences for the complexity of future operations on the tree. If it is done carelessly, trees can become excessively tall. For example, suppose thatUnion always made the tree containingx a subtree of the tree containingy. Begin with a forest that has just been initialized with elements1,2,3,,n,{\displaystyle 1,2,3,\ldots ,n,} and executeUnion(1, 2),Union(2, 3), ...,Union(n - 1,n). The resulting forest contains a single tree whose root isn, and the path from 1 ton passes through every node in the tree. For this forest, the time to runFind(1) isO(n).

In an efficient implementation, tree height is controlled usingunion by size orunion by rank. Both of these require a node to store information besides just its parent pointer. This information is used to decide which root becomes the new parent. Both strategies ensure that trees do not become too deep.

Union by size

[edit]

In the case of union by size, a node stores its size, which is simply its number of descendants (including the node itself). When the trees with rootsx andy are merged, the node with more descendants becomes the parent. If the two nodes have the same number of descendants, then either one can become the parent. In both cases, the size of the new parent node is set to its new total number of descendants.

function Union(x,y)is// Replace nodes by rootsx := Find(x)y := Find(y)ifx =ythenreturn// x and y are already in the same setend if// If necessary, swap variables to ensure that// x has at least as many descendants as yifx.size <y.sizethen        (x,y) := (y,x)end if// Make x the new rooty.parent :=x// Update the size of xx.size :=x.size +y.sizeend function

The number of bits necessary to store the size is clearly the number of bits necessary to storen. This adds a constant factor to the forest's required storage.

Union by rank

[edit]

For union by rank, a node stores itsrank, which is an upper bound for its height. When a node is initialized, its rank is set to zero. To merge trees with rootsx andy, first compare their ranks. If the ranks are different, then the larger rank tree becomes the parent, and the ranks ofx andy do not change. If the ranks are the same, then either one can become the parent, but the new parent's rank is incremented by one. While the rank of a node is clearly related to its height, storing ranks is more efficient than storing heights. The height of a node can change during aFind operation, so storing ranks avoids the extra effort of keeping the height correct. In pseudocode, union by rank is:

function Union(x,y)is// Replace nodes by rootsx := Find(x)y := Find(y)ifx =ythenreturn// x and y are already in the same setend if// If necessary, rename variables to ensure that// x has rank at least as large as that of yifx.rank <y.rankthen        (x,y) := (y,x)end if// Make x the new rooty.parent :=x// If necessary, increment the rank of xifx.rank =y.rankthenx.rank :=x.rank + 1end ifend function

It can be shown that every node has ranklogn{\displaystyle \lfloor \log n\rfloor } or less.[11] Consequently each rank can be stored inO(log logn) bits and all the ranks can be stored inO(n log logn) bits. This makes the ranks an asymptotically negligible portion of the forest's size.

It is clear from the above implementations that the size and rank of a node do not matter unless a node is the root of a tree. Once a node becomes a child, its size and rank are never accessed again.

There is a variant of theUnion operation in which the user determines the representative of the formed set. It is not hard to add this functionality to the above algorithms without losing efficiency.

Time complexity

[edit]

A disjoint-set forest implementation in whichFind does not update parent pointers, and in whichUnion does not attempt to control tree heights, can have trees with heightO(n). In such a situation, theFind andUnion operations requireO(n) time.

If an implementation uses path compression alone, then a sequence ofnMakeSet operations, followed by up ton − 1Union operations andfFind operations, has a worst-case running time ofΘ(n+f(1+log2+f/nn)){\displaystyle \Theta (n+f\cdot \left(1+\log _{2+f/n}n\right))}.[11]

Using union by rank, but without updating parent pointers duringFind, gives a running time ofΘ(mlogn){\displaystyle \Theta (m\log n)} form operations of any type, up ton of which areMakeSet operations.[11]

The combination of path compression, splitting, or halving, with union by size or by rank, reduces the running time form operations of any type, up ton of which areMakeSet operations, toΘ(mα(n)){\displaystyle \Theta (m\alpha (n))}.[4][5] This makes theamortized running time of each operationΘ(α(n)){\displaystyle \Theta (\alpha (n))}. This is asymptotically optimal, meaning that every disjoint set data structure must useΩ(α(n)){\displaystyle \Omega (\alpha (n))} amortized time per operation.[6] Here, the functionα(n){\displaystyle \alpha (n)} is theinverse Ackermann function. The inverse Ackermann function grows extraordinarily slowly, so this factor is4 or less for anyn that can actually be written in the physical universe. This makes disjoint-set operations practically amortized constant time.

Proof of O(m log* n) time complexity of Union-Find

[edit]

The precise analysis of the performance of a disjoint-set forest is somewhat intricate. However, there is a much simpler analysis that proves that the amortized time for anymFind orUnion operations on a disjoint-set forest containingn objects isO(m log*n), wherelog* denotes theiterated logarithm.[12][13][14][15]

Lemma 1: As thefind function follows the path along to the root, the rank of node it encounters is increasing.

Proof

We claim that as Find and Union operations are applied to the data set, this fact remains true over time. Initially when each node is the root of its own tree, it's trivially true. The only case when the rank of a node might be changed is when theUnion by Rank operation is applied. In this case, a tree with smaller rank will be attached to a tree with greater rank, rather than vice versa. And during the find operation, all nodes visited along the path will be attached to the root, which has larger rank than its children, so this operation won't change this fact either.

Lemma 2: A nodeu which is root of a subtree with rankr has at least2r{\displaystyle 2^{r}} nodes.

Proof

Initially when each node is the root of its own tree, it's trivially true. Assume that a nodeu with rankr has at least2r nodes. Then when two trees with rankr are merged using the operationUnion by Rank, a tree with rankr + 1 results, the root of which has at least2r+2r=2r+1{\displaystyle 2^{r}+2^{r}=2^{r+1}} nodes.

Lemma 3: The maximum number of nodes of rankr is at mostn2r.{\displaystyle {\frac {n}{2^{r}}}.}

Proof

Fromlemma 2, we know that a nodeu which is root of a subtree with rankr has at least2r{\displaystyle 2^{r}} nodes. We will get the maximum number of nodes of rankr when each node with rankr is the root of a tree that has exactly2r{\displaystyle 2^{r}} nodes. In this case, the number of nodes of rankr isn2r.{\displaystyle {\frac {n}{2^{r}}}.}

At any particular point in the execution, we can group the vertices of the graph into "buckets", according to their rank. We define the buckets' ranges inductively, as follows: Bucket 0 contains vertices of rank 0. Bucket 1 contains vertices of rank 1. Bucket 2 contains vertices of ranks 2 and 3. In general, if theB-th bucket contains vertices with ranks from interval[r,2r1]=[r,R1]{\displaystyle \left[r,2^{r}-1\right]=[r,R-1]}, then the (B+1)st bucket will contain vertices with ranks from interval[R,2R1].{\displaystyle \left[R,2^{R}-1\right].}


ForBN{\displaystyle B\in \mathbb {N} }, lettower(B)=222B times{\displaystyle {\text{tower}}(B)=\underbrace {2^{2^{\cdots ^{2}}}} _{B{\text{ times}}}}. ThenbucketB{\displaystyle B} will have vertices with ranks in the interval[tower(B1),tower(B)1]{\displaystyle [{\text{tower}}(B-1),{\text{tower}}(B)-1]}.

Proof ofO(logn){\displaystyle O(\log ^{*}n)} Union Find

We can make two observations about the buckets' sizes.

  1. The total number of buckets is at mostlog*n.
    Proof: Since no vertex can have rank greater thann{\displaystyle n}, only the firstlog(n){\displaystyle \log ^{*}(n)} buckets can have vertices, wherelog{\displaystyle \log ^{*}} denotes the inverse of thetower{\displaystyle {\text{tower}}} function defined above.
  2. The maximum number of elements in bucket[B,2B1]{\displaystyle \left[B,2^{B}-1\right]} is at most2n2B{\displaystyle {\frac {2n}{2^{B}}}}.
    Proof: The maximum number of elements in bucket[B,2B1]{\displaystyle \left[B,2^{B}-1\right]} is at mostn2B+n2B+1+n2B+2++n22B12n2B.{\displaystyle {\frac {n}{2^{B}}}+{\frac {n}{2^{B+1}}}+{\frac {n}{2^{B+2}}}+\cdots +{\frac {n}{2^{2^{B}-1}}}\leq {\frac {2n}{2^{B}}}.}

LetF represent the list of "find" operations performed, and let

T1=F(link to the root){\displaystyle T_{1}=\sum _{F}{\text{(link to the root)}}}T2=F(number of links traversed where the buckets are different){\displaystyle T_{2}=\sum _{F}{\text{(number of links traversed where the buckets are different)}}}T3=F(number of links traversed where the buckets are the same).{\displaystyle T_{3}=\sum _{F}{\text{(number of links traversed where the buckets are the same).}}}

Then the total cost ofm finds isT=T1+T2+T3.{\displaystyle T=T_{1}+T_{2}+T_{3}.}

Since each find operation makes exactly one traversal that leads to a root, we haveT1 =O(m).

Also, from the bound above on the number of buckets, we haveT2 =O(mlog*n).

ForT3, suppose we are traversing an edge fromu tov, whereu andv have rank in the bucket[B, 2B − 1] andv is not the root (at the time of this traversing, otherwise the traversal would be accounted for inT1). Fixu and consider the sequencev1,v2,,vk{\displaystyle v_{1},v_{2},\ldots ,v_{k}} that take the role ofv in different find operations. Because of path compression and not accounting for the edge to a root, this sequence contains only different nodes and because ofLemma 1 we know that the ranks of the nodes in this sequence are strictly increasing. By both of the nodes being in the bucket we can conclude that the lengthk of the sequence (the number of times nodeu is attached to a different root in the same bucket) is at most the number of ranks in the bucketsB, that is, at most2B1B<2B.{\displaystyle 2^{B}-1-B<2^{B}.}

Therefore,T3[B,2B1]u2B.{\displaystyle T_{3}\leq \sum _{[B,2^{B}-1]}\sum _{u}2^{B}.}

From Observations1 and2, we can conclude thatT3B2B2n2B2nlogn.{\textstyle T_{3}\leq \sum _{B}2^{B}{\frac {2n}{2^{B}}}\leq 2n\log ^{*}n.}

Therefore,T=T1+T2+T3=O(mlogn).{\displaystyle T=T_{1}+T_{2}+T_{3}=O(m\log ^{*}n).}

Other structures

[edit]

Better worst-case time per operation

[edit]

The worst-case time of theFind operation in trees withUnion by rank orUnion by weight isΘ(logn){\displaystyle \Theta (\log n)} (i.e., it isO(logn){\displaystyle O(\log n)} and this bound is tight). In 1985, N. Blum gave an implementation of the operations that does not use path compression, but compresses trees duringunion{\displaystyle union}. His implementation runs inO(logn/loglogn){\displaystyle O(\log n/\log \log n)} time per operation,[16] and thus in comparison with Galler and Fischer's structure it has a better worst-case time per operation, but inferior amortized time. In 1999, Alstrup et al. gave a structure that has optimal worst-casetimeO(logn/loglogn){\displaystyle O(\log n/\log \log n)} together with inverse-Ackermann amortized time.[17]

Deletion

[edit]

The regular implementation as disjoint-set forests does not react favorably to the deletion of elements,in the sense that the time forFind will not improve as a result of the decrease in the number of elements. However, there exist modern implementations that allow for constant-time deletion and where the time-bound forFind depends on thecurrent number of elements[18][19]

Backtracking

[edit]

It is possible to extend certain disjoint-set forest structures to allow backtracking. The basic form of backtracking is to allow aBacktrack(1) operation, that undoes the lastUnion. A more advanced form allowsBacktrack(i),which undoes the last i unions. The following complexity result is known: there is a data structure which supportsUnionandFind inO(logn/loglogn){\displaystyle O(\log n/\log \log n)} time per operation, andBacktrack inO(1){\displaystyle O(1)} time.[20]. In this result, the freedom ofUnion to choose the representative of the formed set is essential.Better amortized time cannot be achieved within the class of separablepointer algorithms[20].

Applications

[edit]
A demo for Union-Find when using Kruskal's algorithm to find minimum spanning tree.

Disjoint-set data structures model thepartitioning of a set, for example to keep track of theconnected components of anundirected graph. This model can then be used to determine whether two vertices belong to the same component, or whether adding an edge between them would result in a cycle. The Union–Find algorithm is used in high-performance implementations ofunification.[21]

This data structure is used by theBoost Graph Library to implement itsIncremental Connected Components functionality. It is also a key component in implementingKruskal's algorithm to find theminimum spanning tree of a graph.

TheHoshen-Kopelman algorithm uses a Union-Find in the algorithm.

See also

[edit]
  • Partition refinement, a different data structure for maintaining disjoint sets, with updates that split sets apart rather than merging them together
  • Dynamic connectivity – Data structure that maintains info about the connected components of a graph

References

[edit]
  1. ^abcdefTarjan, Robert Endre (1975). "Efficiency of a Good But Not Linear Set Union Algorithm".Journal of the ACM.22 (2):215–225.doi:10.1145/321879.321884.hdl:1813/5942.S2CID 11105749.
  2. ^Galler, Bernard A.;Fischer, Michael J. (May 1964)."An improved equivalence algorithm".Communications of the ACM.7 (5):301–303.doi:10.1145/364099.364331.S2CID 9034016.. The paper originating disjoint-set forests.
  3. ^Hopcroft, J. E.;Ullman, J. D. (1973). "Set Merging Algorithms".SIAM Journal on Computing.2 (4):294–303.doi:10.1137/0202024.
  4. ^abcTarjan, Robert E.;van Leeuwen, Jan (1984)."Worst-case analysis of set union algorithms".Journal of the ACM.31 (2):245–281.doi:10.1145/62.2160.S2CID 5363073.
  5. ^abTarjan, Robert Endre (1979)."A class of algorithms which require non-linear time to maintain disjoint sets".Journal of Computer and System Sciences.18 (2):110–127.doi:10.1016/0022-0000(79)90042-4.
  6. ^abFredman, M.; Saks, M. (May 1989). "The cell probe complexity of dynamic data structures".Proceedings of the twenty-first annual ACM symposium on Theory of computing - STOC '89. pp. 345–354.doi:10.1145/73007.73040.ISBN 0897913078.S2CID 13470414.Theorem 5: Any CPROBE(logn) implementation of the set union problem requires Ω(m α(m,n)) time to executem Find's andn−1 Union's, beginning withn singleton sets.
  7. ^Galil, Z.; Italiano, G. (1991). "Data structures and algorithms for disjoint set union problems".ACM Computing Surveys.23 (3):319–344.doi:10.1145/116873.116878.S2CID 207160759.
  8. ^Anderson, Richard J.; Woll, Heather (1994).Wait-free Parallel Algorithms for the Union-Find Problem. 23rd ACM Symposium on Theory of Computing. pp. 370–380.
  9. ^Conchon, Sylvain; Filliâtre, Jean-Christophe (October 2007). "A Persistent Union-Find Data Structure".ACM SIGPLAN Workshop on ML. Freiburg, Germany.
  10. ^Harold N. Gabow, Robert Endre Tarjan, "A linear-time algorithm for a special case of disjoint set union," Journal of Computer and System Sciences, Volume 30, Issue 2, 1985, pp. 209–221, ISSN 0022-0000,https://doi.org/10.1016/0022-0000(85)90014-5
  11. ^abcCormen, Thomas H.;Leiserson, Charles E.;Rivest, Ronald L.;Stein, Clifford (2009). "Chapter 21: Data structures for Disjoint Sets".Introduction to Algorithms (Third ed.). MIT Press. pp. 571–572.ISBN 978-0-262-03384-8.
  12. ^Raimund Seidel, Micha Sharir. "Top-down analysis of path compression", SIAM J. Comput. 34(3):515–525, 2005
  13. ^Tarjan, Robert Endre (1975)."Efficiency of a Good But Not Linear Set Union Algorithm".Journal of the ACM.22 (2):215–225.doi:10.1145/321879.321884.hdl:1813/5942.S2CID 11105749.
  14. ^Hopcroft, J. E.; Ullman, J. D. (1973). "Set Merging Algorithms".SIAM Journal on Computing.2 (4):294–303.doi:10.1137/0202024.
  15. ^Robert E. Tarjan andJan van Leeuwen. Worst-case analysis of set union algorithms. Journal of the ACM, 31(2):245–281, 1984.
  16. ^Blum, Norbert (1985). "On the Single-Operation Worst-Case Time Complexity of the Disjoint Set Union Problem".2nd Symp. On Theoretical Aspects of Computer Science:32–38.
  17. ^Alstrup, Stephen; Ben-Amram, Amir M.; Rauhe, Theis (1999). "Worst-case and amortised optimality in union-find (Extended abstract)".Proceedings of the thirty-first annual ACM symposium on Theory of Computing. pp. 499–506.doi:10.1145/301250.301383.ISBN 1581130678.S2CID 100111.
  18. ^Alstrup, Stephen; Thorup, Mikkel; Gørtz, Inge Li; Rauhe, Theis; Zwick, Uri (2014). "Union-Find with Constant Time Deletions".ACM Transactions on Algorithms.11 (1): 6:1–6:28.doi:10.1145/2636922.S2CID 12767012.
  19. ^Ben-Amram, Amir M.; Yoffe, Simon (2011). "A simple and efficient Union-Find-Delete algorithm".Theoretical Computer Science.412 (4–5):487–492.doi:10.1016/j.tcs.2010.11.005.
  20. ^abWestbrook, Jeffery R.; Tarjan, Robert E. (1989). "Amortized Analysis of Algorithms for Set Union with Backtracking".SIAM Journal on Computing.18 (1):1–11.doi:10.1137/0218001.
  21. ^Knight, Kevin (1989)."Unification: A multidisciplinary survey"(PDF).ACM Computing Surveys.21:93–124.doi:10.1145/62029.62030.S2CID 14619034.

External links

[edit]
Types
Abstract
Arrays
Linked
Trees
Graphs
Retrieved from "https://en.wikipedia.org/w/index.php?title=Disjoint-set_data_structure&oldid=1296484969"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp