A linear-time algorithm for a special case of disjoint set union

This paper presents a linear-time algorithm for the special case of the disjoint set union problem in which the structure of the unions (defined by a “union tree”) is known in advance. The algorithm executes an intermixed sequence of <italic>m</italic> union and find operations on <italic>n</italic> elements in 0(<italic>m</italic>+<italic>n</italic>) time and 0(<italic>n</italic>) space. This is a slight but theoretically significant improvement over the fastest known algorithm for the general problem, which runs in 0(<italic>m</italic>α(<italic>m</italic>+<italic>n, n</italic>)+<italic>n</italic>) time and 0(<italic>n</italic>) space, where α is a functional inverse of Ackermann's function. Used as a subroutine, the algorithm gives similar improvements in the efficiency of algorithms for solving a number of other problems, including two-processor scheduling, the off-line min problem, matching on convex graphs, finding nearest common ancestors off-line, testing a flow graph for reducibility, and finding two disjoint directed spanning trees. The algorithm obtains its efficiency by combining a fast algorithm for the general problem with table look-up on small sets, and requires a random access machine for its implementation. The algorithm extends to the case in which single-node additions to the union tree are allowed. The extended algorithm is useful in finding maximum cardinality matchings on nonbipartite graphs.

[1]  D. Rose,et al.  A Separator Theorem for Chordal Graphs , 1982 .

[2]  Mihalis Yannakakis,et al.  Scheduling Interval-Ordered Tasks , 1979, SIAM J. Comput..

[3]  Jan van Leeuwen,et al.  Worst-case Analysis of Set Union Algorithms , 1984, JACM.

[4]  Robert E. Tarjan,et al.  Efficiency of a Good But Not Linear Set Union Algorithm , 1972, JACM.

[5]  J. E. Thornton Design of a Computer: The Control Data 6600 , 1970 .

[6]  Ellis Horowitz,et al.  Fundamentals of Computer Algorithms , 1978 .

[7]  Robert E. Tarjan,et al.  A Class of Algorithms which Require Nonlinear Time to Maintain Disjoint Sets , 1979, J. Comput. Syst. Sci..

[8]  Greg N. Frederickson,et al.  Scheduling Unit-Time Tasks With Integer Release Times and Deadlines , 1983, Inf. Process. Lett..

[9]  Harold N. Gabow A Linear-Time Recognition Algorithm for Interval Dags , 1981, Inf. Process. Lett..

[10]  Robert E. Tarjan Testing flow graph reducibility , 1973, STOC '73.

[11]  Robert E. Tarjan,et al.  A Linear-Time Algorithm for a Special Case of Disjoint Set Union ; CU-CS-261-82 , 1984 .

[12]  Daniel J. Rosenkrantz,et al.  Table Machine Simulation , 1969, SWAT.

[13]  Franco P. Preparata,et al.  Three layers are enough , 1982, FOCS 1982.

[14]  Jeffrey D. Ullman,et al.  Set Merging Algorithms , 1973, SIAM J. Comput..

[15]  Harold N. Gabow,et al.  An Almost-Linear Algorithm for Two-Processor Scheduling , 1982, JACM.

[16]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[17]  Dov Harel,et al.  A linear time algorithm for the lowest common ancestors problem , 1980, 21st Annual Symposium on Foundations of Computer Science (sfcs 1980).

[18]  Jon Doyle,et al.  Linear Expected Time of a Simple Union-Find Algorithm , 1976, Inf. Process. Lett..

[19]  Harold N. Gabow,et al.  An Efficient Implementation of Edmonds' Algorithm for Maximum Matching on Graphs , 1976, JACM.

[20]  Alfred V. Aho,et al.  On Finding Lowest Common Ancestors in Trees , 1976, SIAM J. Comput..

[21]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[22]  Ravi Sethi,et al.  Scheduling Graphs on Two Processors , 1976, SIAM J. Comput..

[23]  Robert E. Tarjan,et al.  Applications of Path Compression on Balanced Trees , 1979, JACM.

[24]  Robert E. Tarjan,et al.  Fast Algorithms for Finding Nearest Common Ancestors , 1984, SIAM J. Comput..

[25]  Robert E. Tarjan,et al.  A fast algorithm for finding dominators in a flowgraph , 1979, TOPL.

[26]  Donald E. Knuth,et al.  The Expected Linearity of a Simple Equivalence Algorithm , 1978, Theor. Comput. Sci..