Encyclopedia of Algorithms

2016 Edition
| Editors: Ming-Yang Kao

Lowest Common Ancestors in Trees

• Martı́n Farach-Colton
Reference work entry
DOI: https://doi.org/10.1007/978-1-4939-2864-4_630

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 lcaT(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 TP(N) and query time of TQ(N) as having run time \(\lan...

Keywords

Least common ancestor Nearest common ancestor Range minimum query Succinct structures
This is a preview of subscription content, log in to check access.

1. 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
2. 2.
Bender MA, Farach-Colton M (2000) The LCA problem revisited. In: Proceedings of Latin American theoretical informatics (LATIN), Montevideo, pp 88–94Google Scholar
3. 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–319Google Scholar
4. 4.
Bille P (2014) Nearest common ancestors. http://massivedatasets.files.wordpress.com/2014/02/nearestcommonancestors_2014.pdfGoogle Scholar
5. 5.
Fischer J (2010) Optimal succinctness for range minimum queries. In: Proceedings of LATIN, Oaxaca, pp 158–169
6. 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–143Google Scholar
7. 7.
Harel D, Tarjan RE (1984) Fast algorithms for finding nearest common ancestors. SIAM J Comput 13(2):338–355
8. 8.
Navarro G, Sadakane K (2014) Fully functional static and dynamic succinct trees. ACM Trans Algorithms 10(3)Google Scholar
9. 9.
Sadakane K (2002) Space-efficient data structures for flexible text retrieval systems. In: International symposium on algorithms and computation (ISAAC), Vancouver, pp 14–24Google Scholar
10. 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–232Google Scholar