Skip to main content

Lowest Common Ancestors in Trees

  • Reference work entry
  • First Online:
Encyclopedia of Algorithms
  • 111 Accesses

Years and Authors of Summarized Original Work

  • 1984; Gabow, Bentley, Tarjan

  • 1984; Harel, Tarjan

  • 1989; Berkman, Breslauer, Galil, Schieber, Vishkin

  • 2000; Bender, Farach-Colton

Problem Definition

One of the most fundamental algorithmic problems on trees is how to find the lowest common ancestor (LCA) of a pair of nodes. The LCA of nodes u and v in a tree is the shared ancestor of u and v that is located farthest from the root. More formally, the lowest common ancestor (LCA) problem is:

Preprocess: :

A rooted tree T having n nodes.

Query: :

For nodes u and v of tree T, query lca T (u, v) returns the least common ancestor of u and v in T, that is, it returns the node farthest from the root that is an ancestor of both u and v. (When the context is clear, we drop the subscript T on the lca.)

The goal is to optimize both the preprocessing time and the query time. We will therefore refer to the running time of an algorithm with preprocessing time T P (N) and query time of T Q (N) as having run...

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 1,599.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 1,999.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Recommended Reading

  1. Alstrup S, Gavoille C, Kaplan H, Rauhe T (2004) Nearest common ancestors: a survey and a new algorithm for a distributed environment. Theory Comput Syst 37(3):441–456

    Article  MathSciNet  MATH  Google Scholar 

  2. Bender MA, Farach-Colton M (2000) The LCA problem revisited. In: Proceedings of Latin American theoretical informatics (LATIN), Montevideo, pp 88–94

    Google Scholar 

  3. Berkman O, Breslauer D, Galil Z, Schieber B, Vishkin U (1989) Highly parallelizable problems. In: Proceedings of the 21st annual ACM symposium on theory of computing, New Orleans, pp 309–319

    Google Scholar 

  4. Bille P (2014) Nearest common ancestors. http://massivedatasets.files.wordpress.com/2014/02/nearestcommonancestors_2014.pdf

    Google Scholar 

  5. Fischer J (2010) Optimal succinctness for range minimum queries. In: Proceedings of LATIN, Oaxaca, pp 158–169

    MATH  Google Scholar 

  6. Gabow HN, Bentley JL, Tarjan RE (1984) Scaling and related techniques for geometry problems. In: Proceedings of the 16th annual ACM symposium on theory of computing, New York, vol 67, pp 135–143

    Google Scholar 

  7. Harel D, Tarjan RE (1984) Fast algorithms for finding nearest common ancestors. SIAM J Comput 13(2):338–355

    Article  MathSciNet  MATH  Google Scholar 

  8. Navarro G, Sadakane K (2014) Fully functional static and dynamic succinct trees. ACM Trans Algorithms 10(3)

    Google Scholar 

  9. Sadakane K (2002) Space-efficient data structures for flexible text retrieval systems. In: International symposium on algorithms and computation (ISAAC), Vancouver, pp 14–24

    Google Scholar 

  10. Sadakane K (2002) Succinct representations of lcp information and improvements in the compressed suffix arrays. In: Proceedings of the 13th annual ACM-SIAM symposium on discrete algorithms, San Francisco, pp 225–232

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Martı́n Farach-Colton .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer Science+Business Media New York

About this entry

Cite this entry

Farach-Colton, M. (2016). Lowest Common Ancestors in Trees. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, New York, NY. https://doi.org/10.1007/978-1-4939-2864-4_630

Download citation

Publish with us

Policies and ethics