Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Public Access

A Data Structure for Nearest Common Ancestors with Linking

Published: 19 September 2017 Publication History

Abstract

Consider a forest that evolves via link operations that make the root of one tree the child of a node in another tree. Intermixed with link operations are nca operations, which return the nearest common ancestor of two given nodes when such exists. This article shows that a sequence of m such nca and link operations on a forest of n nodes can be processed online in time O(mα (m,n)+n). This was previously known only for a restricted type of link operation.
The special case where a link only extends a tree by adding a new leaf occurs in Edmonds’ algorithm for finding a maximum weight matching on a general graph. Incorporating our algorithm into the implementation of Edmonds’ algorithm in [9] achieves time O(n(m + nlog n)) for weighted matching, an arguably optimum asymptotic bound (n and m are the number of vertices and edges, respectively). Our data structure also provides a simple alternative implementation of the incremental-tree set merging algorithm of Gabow and Tarjan [11].

References

[1]
A. V. Aho, J. E. Hopcroft, and J. D. Ullman. 1976. On finding lowest common ancestors in trees. SIAM J. Comput. 5 (1976), 115--132
[2]
M. A. Bender and M. Farach-Colton. 2000. The LCA problem revisited. Latin American Theoretical INformatics (LATIN) 2000 (2000), 88--94.
[3]
O. Berkman and U. Vishkin. 1993. Recursive star-tree parallel data structure. SIAM J. Comput. 22, 2 (1993), 221--242.
[4]
R. Cole and R. Hariharan. 2005. Dynamic LCA queries on trees. SIAM J. Comput. 34, 4 (2005), 894--923.
[5]
T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. 2001. Introduction to Algorithms (2nd ed.). McGraw--Hill, New York.
[6]
J. Edmonds. 1965. Maximum matching and a polyhedron with 0,1-vertices. J. Res. Nat. Bur. Standards 69B (1965), 125--130.
[7]
H. N. Gabow. 1985. A scaling algorithm for weighted matching on general graphs. In Proc. 26th Annual Symp. on Found. of Comp. Sci. IEEE Computer Society, Long Beach, CA, 90--100.
[8]
H. N. Gabow. 1990. Data structures for weighted matching and nearest common ancestors with linking. In Proc. 1st Annual ACM-SIAM Symp. on Disc. Algorithms. SIAM, Philadelphia, PA, 434--443.
[9]
H. N. Gabow. 2016. Data structures for weighted matching and extensions to b-matching and f-factors. (2016). Available at https://arxiv.org/abs/1611.07541.
[10]
H. N. Gabow and M. Stallmann. 1985. Efficient algorithms for graphic matroid intersection and parity. In Automata, Languages and Programming: 12th Colloquium; Lecture Notes in Computer Science 194, W. Brauer (Ed.). Springer-Verlag, 210--220.
[11]
H. N. Gabow and R. E. Tarjan. 1985. A linear--time algorithm for a special case of disjoint set union. J. Comp. and System Sci. 30, 2 (1985), 209--221.
[12]
D. Gusfield. 1999. Algorithms on Strings, Trees, and Sequences. Cambridge University Press, New York.
[13]
D. Harel and R. E. Tarjan. 1984. Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13, 2 (1984), 338--355.
[14]
J. A. La Poutré. 1990. New techniques for the union-find problem. In Proc. 1st Annual ACM-SIAM Symp. on Disc. Algorithms. SIAM, Philadelphia, PA, 54--63.
[15]
B. Schieber and U. Vishkin. 1988. On finding lowest common ancestors: Simplification and parallelization. SIAM J. Comput. 17, 6 (1988), 1253--1262.
[16]
A. Schrijver. 2003. Combinatorial Optimization: Polyhedra and Efficiency. Springer, New York.
[17]
D. D. Sleator and R. E. Tarjan. 1983. A data structure for dynamic trees. J. Comp. and System Sci. 26 (1983), 362--391.
[18]
B. Smyth. 2003. Computing Patterns in Strings. Pearson Education Limited, Harlow, England.
[19]
R. E. Tarjan. 1979. Applications of path compression on balanced trees. J. ACM 26, 4 (1979), 690--715.
[20]
R. E. Tarjan. 1983. Data Structures and Network Algorithms. SIAM, Philadelphia, PA.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Algorithms
ACM Transactions on Algorithms  Volume 13, Issue 4
October 2017
333 pages
ISSN:1549-6325
EISSN:1549-6333
DOI:10.1145/3143522
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: 19 September 2017
Accepted: 01 May 2017
Received: 01 December 2014
Published in TALG Volume 13, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Least common ancestors
  2. disjoint-set data structure
  3. matching algorithms
  4. set merging

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)91
  • Downloads (Last 6 weeks)11
Reflects downloads up to 15 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Traversing Combinatorial 0/1-Polytopes via OptimizationSIAM Journal on Computing10.1137/23M161201953:5(1257-1292)Online publication date: 9-Sep-2024
  • (2023)Traversing combinatorial 0/1-polytopes via optimization2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS)10.1109/FOCS57990.2023.00076(1282-1291)Online publication date: 6-Nov-2023
  • (2023)Blocking Trails for f-factors of MultigraphsAlgorithmica10.1007/s00453-023-01126-y85:10(3168-3213)Online publication date: 13-May-2023
  • (2018)Data Structures for Weighted Matching and Extensions to b-matching and f-factorsACM Transactions on Algorithms10.1145/318336914:3(1-80)Online publication date: 22-Jun-2018
  • (2014)On channel-discontinuity-constraint routing in wireless networksAd Hoc Networks10.1016/j.adhoc.2011.04.01113(153-169)Online publication date: 1-Feb-2014
  • (2010)Approximation algorithms for multiple terminal, Hamiltonian path problemsOptimization Letters10.1007/s11590-010-0252-46:1(69-85)Online publication date: 27-Oct-2010
  • (1990)Graph AlgorithmsAlgorithms and Complexity10.1016/B978-0-444-88071-0.50015-1(525-631)Online publication date: 1990

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media