skip to main content
research-article

Union-Find with Constant Time Deletions

Published: 25 August 2014 Publication History

Abstract

A union-find data structure maintains a collection of disjoint sets under the operations makeset, union, and find. Kaplan, Shafrir, and Tarjan [SODA 2002] designed data structures for an extension of the union-find problem in which items of the sets maintained may be deleted. The cost of a delete operation in their implementations is essentially the same as the cost of a find operation; namely, O(log n) worst-case and OM/N (n)) amortized, where n is the number of items in the set returned by the find operation, N is the total number of makeset operations performed, M is the total number of find operations performed, and αM/N(n) is a functional inverse of Ackermann’s function. They left open the question whether delete operations can be implemented more efficiently than find operations, for example, in o(log n) worst-case time. We resolve this open problem by presenting a relatively simple modification of the classical union-find data structure that supports delete, as well as makeset and union operations, in constant worst-case time, while still supporting find operations in O(log n) worst-case time and O⌈ M/N⌉ (n)) amortized time.
Our analysis supplies, in particular, a very concise potential-based amortized analysis of the standard union-find data structure that yields an OM/N (n)) amortized bound on the cost of find operations. All previous potential-based analyses yielded the weaker amortized bound of OM/N (N)). Furthermore, our tighter analysis extends to one-path variants of the path compression technique such as path splitting.

References

[1]
A. V. Aho, J. E. Hopcroft, and J. D. Ullman. 1974. The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading.
[2]
Amir M. Ben-Amram and Simon Yoffe. 2011. A simple and efficient Union-Find-Delete algorithm. Theoretical Computer Science 412, 4--5 (2011), 487--492.
[3]
T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. 2001. Introduction to Algorithms (2nd ed.). MIT Press.
[4]
J. Edmonds. 1965. Paths, trees, and flowers. Canadian Journal of Mathematics 17 (1965), 449--467.
[5]
J. Edmonds. 1967. Optimum branchings. Journal of Research of the National Bureau of Standards 71B (1967), 233--240.
[6]
M. Fredman and M. Saks. 1989. The cell probe complexity of dynamic data structures. In Proceedings of the 21st Annual ACM Symposium on Theory of Computing (STOC’89). 345--354.
[7]
H. N. Gabow, Z. Galil, T. H. Spencer, and R. E. Tarjan. 1986. Efficient algorithms for finding minimum spanning trees in undirected and directed graphs. Combinatorica 6 (1986), 109--122.
[8]
Z. Galil and G. F. Italiano. 1991. Data structures and algorithms for disjoint set union problems. Computing Surveys 23, 3 (Sept. 1991), 319--344.
[9]
H. Kaplan, N. Shafrir, and R. E. Tarjan. 2002a. Union-find with deletions. In Proceedings of the 13th Annual ACM-SIAM Symposium on Discrete Mathematics (SODA’02). 19--28.
[10]
H. Kaplan, N. Shafrir, and R. E. Tarjan. 2002b. Meldable heaps and boolean union-find. In Proceedings of the 34rd Annual ACM Symposium on Theory of Computing (STOC’02). New York, NY, 573--582.
[11]
R. M. Karp. 1971. A simple derivation of Edmonds’ algorithm for optimum branchings. Networks 1 (1971), 265--272.
[12]
A. Kennedy. 2007. Compiling with continuations, continued. In Proceedings of the 12th Annual ACM SIGPLAN International Conference on Functional Programming (ICFP’07). ACM, New York, NY, 177--190.
[13]
D. L. Kozen. 1992. The Design and Analysis of Algorithms. Springer, Berlin.
[14]
J. B. Kruskal. 1956. On the shortest spanning subtree of a graph and the traveling salesman problem. Proceedings of the American Mathematical Society 7 (1956), 48--50.
[15]
K. Mehlhorn and S. Näher. 1999. LEDA -- A Platform for Combinatorial and Geometric Computing. Cambridge University Press.
[16]
R. Mendelson, R. E. Tarjan, M. Thorup, and U. Zwick. 2006. Melding priority queues. ACM Transactions on Algorithms 2, 4 (2006), 535--556.
[17]
P. Müller and A. Rudich. 2007. Ownership transfer in universe types. In Proceedings of the 22nd Annual ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA’07). 461--478.
[18]
Mihai Pǎtraşcu and Mikkel Thorup. 2011. Don’t rush into a union: Take time to find your roots. In Proceedings of the 43rd Annual ACM Symposium on Theory of Computing (STOC). 559--568.
[19]
E. Raman and D. I. August. 2005. Recursive data structure profiling. In Proceedings of the 3rd Annual ACM SIGPLAN Workshop on Memory Systems Performance (MSP). 5--14.
[20]
R. Seidel and M. Sharir. 2005. Top-Down analysis of path compression. SIAM Journal on Computing 34, 3 (2005), 515--525.
[21]
M. Smid. 1990. A data structure for the union-find problem having good single-operation complexity. ALCOM: Algorithms Review, Newsletter of the ESPRIT II Basic Research Actions Program Project no. 3075 (ALCOM) 1 (1990), 1--12.
[22]
Y. Takano. 2007. Implementing Uniqueness and Ownership Transfer in the Universe Type System. Master’s thesis. ETH Zurich.
[23]
R. E. Tarjan. 1973. Testing flow graph reproducibility. In Proceedings of the 5th Annual ACM Symposium on Theory of Computing (STOC’73). 96--107.
[24]
R. E. Tarjan. 1974. Finding dominators in directed graphs. SIAM Journal of Computing 3 (1974), 62--89.
[25]
R. E. Tarjan. 1975a. Efficiency of a good but not linear disjoint set union algorithm. Journal of the ACM 22 (1975), 215--225.
[26]
R. E. Tarjan. 1975b. Efficiency of a good but not linear set union algorithm. Journal of the ACM 22, 2 (April 1975), 215--225.
[27]
R. E. Tarjan. 1977. Finding optimum branchings. Networks 7 (1977), 25--35.
[28]
R. E. Tarjan. 1983. Data Structures and Network Algorithms. SIAM.
[29]
R. E. Tarjan and J. van Leeuwen. 1984. Worst-case analysis of set union algorithms. Journal of the ACM 31, 2 (April 1984), 245--281.

Cited By

View all
  • (2024)Query Optimization for Ontology-Mediated Query AnsweringProceedings of the ACM Web Conference 202410.1145/3589334.3645567(2138-2148)Online publication date: 13-May-2024
  • (2024)Piecewise Computation of Persistent Homology2024 IEEE International Conference on Big Data (BigData)10.1109/BigData62323.2024.10825374(2721-2730)Online publication date: 15-Dec-2024
  • (2024)Finding strong components using depth-first searchEuropean Journal of Combinatorics10.1016/j.ejc.2023.103815119(103815)Online publication date: Jun-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Algorithms
ACM Transactions on Algorithms  Volume 11, Issue 1
October 2014
183 pages
ISSN:1549-6325
EISSN:1549-6333
DOI:10.1145/2660578
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 25 August 2014
Accepted: 01 November 2013
Revised: 01 June 2013
Received: 01 February 2012
Published in TALG Volume 11, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Union-find
  2. disjoint sets

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)39
  • Downloads (Last 6 weeks)3
Reflects downloads up to 19 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Query Optimization for Ontology-Mediated Query AnsweringProceedings of the ACM Web Conference 202410.1145/3589334.3645567(2138-2148)Online publication date: 13-May-2024
  • (2024)Piecewise Computation of Persistent Homology2024 IEEE International Conference on Big Data (BigData)10.1109/BigData62323.2024.10825374(2721-2730)Online publication date: 15-Dec-2024
  • (2024)Finding strong components using depth-first searchEuropean Journal of Combinatorics10.1016/j.ejc.2023.103815119(103815)Online publication date: Jun-2024
  • (2020)Verified Textbook AlgorithmsAutomated Technology for Verification and Analysis10.1007/978-3-030-59152-6_2(25-53)Online publication date: 19-Oct-2020
  • (2019)Verifying the Correctness and Amortized Complexity of a Union-Find Implementation in Separation Logic with Time CreditsJournal of Automated Reasoning10.1007/s10817-017-9431-762:3(331-365)Online publication date: 1-Mar-2019
  • (2016)Improved MHP AnalysisProceedings of the 25th International Conference on Compiler Construction10.1145/2892208.2897144(207-217)Online publication date: 17-Mar-2016
  • (2016)Runtime Monitoring with Union-Find StructuresProceedings of the 22nd International Conference on Tools and Algorithms for the Construction and Analysis of Systems - Volume 963610.1007/978-3-662-49674-9_54(868-884)Online publication date: 2-Apr-2016
  • (2015)Machine-Checked Verification of the Correctness and Amortized Complexity of an Efficient Union-Find ImplementationInteractive Theorem Proving10.1007/978-3-319-22102-1_9(137-153)Online publication date: 19-Aug-2015

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media