A linear-time algorithm for a special case of disjoint set union. (English) Zbl 0572.68058

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 m union and find operations on n elements in \(O(m+n)\) time and O(n) space. This is a slight but theoretically significant improvement over the fastest known algorighm for the general problem, which runs in \(O(m\alpha (m+n,n)+n)\) time and O(n) space, where \(\alpha\) is a functional inverse of Ackermann’s function.


68R99 Discrete mathematics in relation to computer science
68Q25 Analysis of algorithms and problem complexity


union tree
Full Text: DOI


[1] Aho, A.V.; Hopcroft, J.E.; Ullman, J.D., The design and annalysis of computer algorithms, (1974), Addison-Wesley Reading, Mass
[2] Aho, A.V.; Hopcroft, J.E.; Ullman, J.D., On finding lowest common ancestors in trees, SIAM J. comput., 5, 115-132, (1976) · Zbl 0325.68018
[3] Dijkstra, E.W., A discipline of programming, (1976), Prentice-Hall Englewood Cliffs N.J · Zbl 0286.00013
[4] Doyle, J.; Rivest, R.L., Linear expected time of a simple union-find algorithm, Inform. process. lett., 5, 146-148, (1976) · Zbl 0345.68024
[5] Frederickson, G.N., Scheduling unit-time tasks with integer release times and deadlines, Inform. process. lett., 16, 171-173, (1983) · Zbl 0508.68023
[6] Gabow, H.N., An efficient implementation of edmonds’ algorithm for maximum matching on graphs, J. assoc. comput. Mach., 23, 221-234, (1976) · Zbl 0327.05121
[7] Gabow, H.N., A linear-time recognition algorithm for interval dags, Inform. process. lett., 12, 20-22, (1981) · Zbl 0454.68011
[8] Gabow, H.N., An almost-linear algorithm for two-processor scheduling, J. assoc. comput. Mach., 29, 766-780, (1982) · Zbl 0485.68034
[9] Gabow, H.N.; Tarjan, R.E., A linear-time algorithm for a special case of disjoint set union, (), 246-251
[10] Harel, D., A linear time algorithm for the least common ancestors problem, (), 308-319
[11] Harel, D.; Tarjan, R.E., Fast algorithms for finding nearest common ancestors, SIAM J. comput., 13, 338-355, (1984) · Zbl 0535.68022
[12] Havens, B., Experiments on an asymptotically optimum, special purpose set merging algorithm, ()
[13] Hopcroft, J.E.; Ullman, J.D., Set merging algorithms, SIAM J. comput., 2, 294-303, (1973) · Zbl 0253.68003
[14] Horowitz, E.; Sahni, S., Fundamentals of computer algorithms, (1978), Computer Science Potomac, Md · Zbl 0442.68022
[15] {\scH. Imai and T. Asano}, Efficient algorithms for geometric graph search problems, J. Algorithms, to appear. · Zbl 0591.68068
[16] Imai, H.; Asano, T., Dynamic segment intersection search with applications, (), 393-402
[17] Knuth, D.E.; Schönhage, A., The expected linearity of a simple equivalence algorithm, Theoret. comput. sci., 6, 281-315, (1978) · Zbl 0377.68024
[18] Lengauer, T.; Tarjan, R.E., A fast algorithm for finding dominators in a flowgraph, ACM trans. programming lang. systems, 1, 121-141, (1979) · Zbl 0449.68024
[19] Lipski, W.; Preparata, F., Efficient algorithms for finding maximum matchings in convex bipartite graphs and related problems, Acta inform., 15, 329-346, (1981) · Zbl 0445.68052
[20] Lipski, W., An O(n log n) Manhattan path algorithm, Inform. process. lett., 19, 99-102, (1984) · Zbl 0542.68052
[21] {\scS. Micali}, Private communication, May 1982.
[22] Micali, S.; Vazirani, V.V., An O(√|V| · |E|) algorithm for finding maximum matching in general graphs, (), 17-27
[23] Papadimitriou, C.H.; Yannakakis, M., Scheduling interval-ordered tasks, SIAM J. comput., 8, 405-409, (1979) · Zbl 0421.68040
[24] Preparata, F.P.; Lipski, W., Three layers are enough, (), 350-357
[25] Sethi, R., Scheduling graphs on two processors, SIAM J. comput., 5, 73-82, (1976) · Zbl 0328.68057
[26] Tarjan, R.E., Testing flow graph reducibility, J. comput. system sci., 8, 355-365, (1974) · Zbl 0315.68018
[27] Tarjan, R.E., Efficiency of a good but not linear set union algorithm, J. assoc. comput. Mach., 22, 215-225, (1975) · Zbl 0307.68029
[28] Tarjan, R.E., Edge-disjoint spanning trees and depth-first search, Acta inform., 6, 171-185, (1976) · Zbl 0307.05104
[29] Tarjan, R.E., Applications of path compression on balanced trees, J. assoc. comput. Mach., 26, No.4, 690-715, (1979) · Zbl 0413.68063
[30] Tarjan, R.E., A class of algorithms which require non-linear time to maintain disjoint sets, J. comput. system-sci., 18, 110-127, (1979) · Zbl 0413.68039
[31] Tarjan, R.E.; Van Leeuwen, J., Worst-case analysis of set union algorithms, J. assoc. comput. Mach., 31, 245-281, (1984) · Zbl 0632.68043
[32] Harel, D., A linear algorithm for finding dominators in flow graphs and related problems, (), to appear
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.