Skip to main content
Log in

Nearest Common Ancestors: A Survey and a New Algorithm for a Distributed Environment

  • Published:
Theory of Computing Systems Aims and scope Submit manuscript

Abstract

Several papers describe linear time algorithms to preprocess a tree, in order to answer subsequent nearest common ancestor queries in constant time. Here, we survey these algorithms and related results. Whereas previous algorithms produce a linear space data structure, in this paper we address the problem of distributing the data structure into short labels associated with the nodes. Localized data structures received much attention recently as they play an important role for distributed applications such as routing. We conclude our survey with a new simple algorithm that labels in O(n) time all the nodes of an n-node rooted tree such that from the labels of any two nodes alone one can compute in constant time the label of their nearest common ancestor. The labels assigned by our algorithm are of size O(log n) bits.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Stephen Alstrup, Cyril Gavoille, Haim Kaplan or Theis Rauhe.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Alstrup, S., Gavoille, C., Kaplan, H. et al. Nearest Common Ancestors: A Survey and a New Algorithm for a Distributed Environment. Theory Comput Syst 37, 441–456 (2004). https://doi.org/10.1007/s00224-004-1155-5

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00224-004-1155-5

Keywords

Navigation