## Nearest Common Ancestors: A survey and a new distributed algorithm (2002)

### Cached

### Download Links

- [www.math.tau.ac.il]
- [dept-info.labri.fr]
- [dept-info.labri.fr]
- DBLP

### Other Repositories/Bibliography

Citations: | 76 - 11 self |

### BibTeX

@INPROCEEDINGS{Alstrup02nearestcommon,

author = {Stephen Alstrup and Cyril Gavoille and Haim Kaplan and Theis Rauhe},

title = {Nearest Common Ancestors: A survey and a new distributed algorithm},

booktitle = {},

year = {2002},

pages = {258--264},

publisher = {ACM PRESS}

}

### Years of Citing Articles

### OpenURL

### Abstract

Several papers describe linear time algorithms to preprocess a tree, such that one can answer subsequent nearest common ancestor queries in constant time. Here, we survey these algorithms and related results. A common idea used by all the algorithms for the problem is that a solution for complete balanced binary trees is straightforward. Furthermore, for complete balanced binary trees we can easily solve the problem in a distributed way by labeling the nodes of the tree such that from the labels of two nodes alone one can compute the label of their nearest common ancestor. Whether it is possible to distribute the data structure into short labels associated with the nodes is important for several applications such as routing. Therefore, related labeling problems have received a lot of attention recently.

### Citations

992 | Depth first search and linear graph algorithms
- Tarjan
- 1972
(Show Context)
Citation Context ...ining x i and the node containing x j . Gabow et al. also show how to reduce the nca problem to the drs problem. Given a tree theysrst construct a sequence of its nodes by doing a depthsrst traversal =-=[60]-=-. Each time we visit a node we add it to the end of the sequence so each node appears in the sequence as many times as its degree. Note that this sequence is an Euler tour of the tree. From the Euler ... |

899 |
Algorithms on Strings, Trees, and Sequences
- Gusfield
- 1997
(Show Context)
Citation Context ...ding a maximum weighted matching in a graph [22], a minimum spanning tree in a graph [30, 14], and a dominator tree in a directed flow-graph [3]. It is also proved useful in several string algorithms =-=[25, 16]-=-, for dynamic planarity testing [45], in network routing [43], for solving various geometric problems [9] including range searching [23], for finding evolutionary trees [17], and in bounded tree-width... |

330 |
Fast algorithms for finding nearest common ancestors
- Harel, Tarjan
(Show Context)
Citation Context ...f x and y by nca(x, y). The problem of e#ciently computing ncas has been studied extensively over the last three decades in an online and o#ine setting, and in various models of computation (see e.g. =-=[34, 2, 3, 27, 41, 11, 7]-=-). The problem of finding ncas has numerous applications. A procedure solving it is used by algorithms for finding a maximum weighted matching in a graph [22], a minimum spanning tree in a graph [30, ... |

296 | A data structure for dynamic trees - Sleator, Tarjan - 1983 |

289 | Finding the k Shortest Paths
- Eppstein
- 1998
(Show Context)
Citation Context ...ies [8, 52, 64, 42, 43, 57, 54, 55, 41, 15, 56, 66, 58], and the I/O-complexity [14] of several of the above problems. Some natural extensions of the problems to rooted directed trees [47] and graphs =-=[21, 22]-=- have also been given. 3 Labeling schemes for distributed environment Motivated by applications in the construction of XML search engines and network routing [1, 37, 49] labeling schemes that allow an... |

218 |
Storing a sparse table with O(1) worst case access time
- Fredman, Komlós, et al.
- 1984
(Show Context)
Citation Context ...han its label we need one lookup in a global table to map a label to a real number. We can implement this mapping either using sucient space, using linear space and expected linear preprocessing time =-=[28]-=-, or using linear space with O(n log n) deterministic preprocessing time [48]. 2.2 Previous static algorithms for computing NCA As mentioned in Section 1, Harel and Tarjan [35] were thesrst who descri... |

195 | Compact routing schemes
- Thorup, Zwick
- 2001
(Show Context)
Citation Context ...anning tree in a graph [38, 19], and a dominator tree in a directedsowgraph [3]. It is also proved useful in several string algorithms [33, 23], for dynamic planarity testing [67], in network routing =-=[62-=-], for solving various geometric problems [12] including range searching [30], forsnding evolutionary trees [24], and in bounded treewidth algorithms [13]. The IT University of Copenhagen, Denmark, E... |

185 |
On finding lowest common ancestors: simplification and parallelization
- Schieber, Vishkin
- 1988
(Show Context)
Citation Context ...f x and y by nca(x, y). The problem of e#ciently computing ncas has been studied extensively over the last three decades in an online and o#ine setting, and in various models of computation (see e.g. =-=[34, 2, 3, 27, 41, 11, 7]-=-). The problem of finding ncas has numerous applications. A procedure solving it is used by algorithms for finding a maximum weighted matching in a graph [22], a minimum spanning tree in a graph [30, ... |

176 |
Scaling and related techniques for geometry problems
- Gabow, Bentley, et al.
- 1984
(Show Context)
Citation Context ...[3]. It is also proved useful in several string algorithms [33, 23], for dynamic planarity testing [67], in network routing [62], for solving various geometric problems [12] including range searching =-=[3-=-0], forsnding evolutionary trees [24], and in bounded treewidth algorithms [13]. The IT University of Copenhagen, Denmark, E-Mail: stephen@it-c.dk y LaBRI - Universite de Bordeaux, France, E-Mail: ga... |

137 |
Data structures for weighted matching and nearest common ancestors with linking
- Gabow
- 1990
(Show Context)
Citation Context ... best result [3, 61]. Back with respect to the online nca problem, extensive research has also been done on how to allow update operations on the tree that are interspersed between nca queries. Gabow =-=[31]-=- and Alstrup and Thorup [7] show how to add new leafs to the tree in amortized constant time while keeping the constant worst-case query time on a RAM, or the O(log log n) worst-case query time on poi... |

133 |
Labelling and Implicit Routing in Networks
- Santoro, Khatib
- 1985
(Show Context)
Citation Context ...f x at a particular level. The drawback of this scheme is that it requires external data structures to compute the ancestor of a node with a specified depth and to answer ancestor queries (see, e.g., =-=[56]-=-, [21], and [6]). |xi − xi+1| =1 only to solve small subproblems of size 1 2 2.3. Dynamic NCA Problems and Different Models for Computation All algorithms mentioned above for the online NCA problem us... |

128 |
The cell probe complexity of dynamic data structures
- Fredman, Saks
- 1989
(Show Context)
Citation Context ...a forest of n nodes use time O(n +m(m+ n; n)) time. If we allow roots to be linked the problem is at least as hard as the Union-Find problem [31]. Thus the amortized inverse ackermann lower bound in [=-=29]-=- is applicable. A more general update operation on a forest would allow to make any node in one tree a parent of a root of another tree. Alstrup and Thorup in [7] give an algorithm for a pointer machi... |

115 | A randomized linear-time algorithm to find minimum spanning trees
- Karger, Tarjan, et al.
- 1995
(Show Context)
Citation Context ...1, 7]). The problem of finding ncas has numerous applications. A procedure solving it is used by algorithms for finding a maximum weighted matching in a graph [22], a minimum spanning tree in a graph =-=[30, 14]-=-, and a dominator tree in a directed flow-graph [3]. It is also proved useful in several string algorithms [25, 16], for dynamic planarity testing [45], in network routing [43], for solving various ge... |

111 | Compact routing with minimum stretch
- Cowen
(Show Context)
Citation Context ...address of y. So the path from x to y is built in a distributed way by all intermediate nodes encountered along the way. The goal is to obtain such labeling with labels as small as possible. Cowen in =-=[17]-=- shows how to construct a labeling for trees that uses 3 log n bits for the addresses and O(min fd log n; p n log ng) bits for the local routing table, where d is the degree of the node. In [20], Eila... |

109 |
Inferring a tree from lowest common ancestors with an application to the optimization of relational expressions
- Aho, Sagiv, et al.
- 1981
(Show Context)
Citation Context ...y). The problem of eciently computing nearest common ancestors has been studied extensively over the last three decades in an online and oine settings, and in various models of computation (See e.g. [=-=45, 2, 3, 35, 58, 16, 7]-=-). The problem ofsnding ncas has numerous applications. A procedure solving it is used by algorithms forsnding a maximum weighted matching in a graph [31], a minimum spanning tree in a graph [38, 19],... |

107 | A comparison of labeling schemes for ancestor queries
- Kaplan, Milo, et al.
- 2002
(Show Context)
Citation Context ...ed directed trees [47] and graphs [21, 22] have also been given. 3 Labeling schemes for distributed environment Motivated by applications in the construction of XML search engines and network routing =-=[1, 37, 49]-=- labeling schemes that allow ancestor queries have been recently developed. Santoro and Khatib [53] 6 suggested to label the leaves of the tree from left to right by consecutive integers, and then to ... |

94 |
A unifying look at data structures
- Vuillemin
- 1980
(Show Context)
Citation Context ...ions are often reduced to drs [30]. Gabow et al. (see also [40]) reduce the drs problem to the nca problem by constructing a Cartesian tree for the sequence x 1 ; : : : ; x n , as dened by Vuillemin [=-=65]-=-. The Cartesian tree of the sequence x 1 ; : : : ; x n is a binary tree with n nodes each containing a number x i . Let x j = max fx 1 ; : : : ; x n g. The root of the Cartesian tree for x 1 ; : : : ;... |

87 |
Applications of path compression on balanced trees
- Tarjan
(Show Context)
Citation Context ...e as input. Recently Buchsbaum et al. [11] gave an O(m+n) time algorithm for the oine nca problem on a pointer machine, improving by a factor of inverse ackermann's function the previous best result [=-=3, 61]-=-. Back with respect to the online nca problem, extensive research has also been done on how to allow update operations on the tree that are interspersed between nca queries. Gabow [31] and Alstrup and... |

86 | Routing in Trees
- Fraigniaud, Gavoille
(Show Context)
Citation Context ...r nca labeling scheme also allows to identify thesrst edge on the shortest path from x to y from the labels of x and y alone. In that sense it generalizes recent labeling schemes for routing on trees =-=[25, 62]-=- (see also Section 3). Another possible application of our algorithm arises in XML search engines. Such search engines typically maintain a reverse index. This index is a hash table mapping each word ... |

77 | A Robust Model for Finding Optimal Evolutionary Trees
- Farach, Kannan, et al.
- 1996
(Show Context)
Citation Context ...eral string algorithms [25, 16], for dynamic planarity testing [45], in network routing [43], for solving various geometric problems [9] including range searching [23], for finding evolutionary trees =-=[17]-=-, and in bounded tree-width algorithms [10]. One of the most fundamental results on computing ncas is that of Harel and Tarjan [27, 26]. Harel and Tarjan describe a linear time algorithm to preprocess... |

71 | Implicit representation of graphs
- Kannan, Naor, et al.
- 1988
(Show Context)
Citation Context ...icated recursive labeling scheme for ancestor queries that generates labels of length at most log n + O( p log n) bits. Labeling schemes for parent queries, and other functions have also been studied =-=[36, 37, 50]-=-. Unfortunately these labeling schemes for ancestor queries do not allow to identify the nearest common ancestor of x and y when they are unrelated. The labeling scheme that we describe in this paper ... |

68 |
Recursive star-tree parallel data structure
- Berkman, Vishkin
- 1993
(Show Context)
Citation Context ...nca queries to be answered in constant time. Following this result of Harel and Tarjan's several simpler algorithms with essentially the same properties but better constant factors have been proposed =-=[51, 44, 30, 58, 9]-=- (See also Section 2.2). These algorithms, including the one of Harel and Tarjan, use the observation that it is rather easy to solve the problem when the input tree is a completely balanced binary tr... |

61 | Compact routing schemes with low stretch factor
- Eilam, Gavoille, et al.
- 2003
(Show Context)
Citation Context ...en in [17] shows how to construct a labeling for trees that uses 3 log n bits for the addresses and O(min fd log n; p n log ng) bits for the local routing table, where d is the degree of the node. In =-=[20]-=-, Eilam et al. show that any labeling in which the length of the addresses is at most log n bits will require p n) bits for the routing table in some trees. However, Gavoille and Fraigniaud [25] showe... |

55 |
Proximity-preserving labeling schemes and their applications
- Peleg
- 1986
(Show Context)
Citation Context ...ed directed trees [47] and graphs [21, 22] have also been given. 3 Labeling schemes for distributed environment Motivated by applications in the construction of XML search engines and network routing =-=[1, 37, 49]-=- labeling schemes that allow ancestor queries have been recently developed. Santoro and Khatib [53] 6 suggested to label the leaves of the tree from left to right by consecutive integers, and then to ... |

54 | Verification and Sensitivity Analysis of Minimum Spanning Trees in Linear Time
- Dixon, Rauch, et al.
- 1992
(Show Context)
Citation Context ...8, 16, 7]). The problem ofsnding ncas has numerous applications. A procedure solving it is used by algorithms forsnding a maximum weighted matching in a graph [31], a minimum spanning tree in a graph =-=[38, 19]-=-, and a dominator tree in a directedsowgraph [3]. It is also proved useful in several string algorithms [33, 23], for dynamic planarity testing [67], in network routing [62], for solving various geome... |

49 | Improved labeling scheme for ancestor queries
- Alstrup, Rauhe
- 2002
(Show Context)
Citation Context ...One can then answer ancestor queries by checking if the corresponding intervals are nested. Clearly the maximum length of a label according to this scheme is 2 log n bits. Recently, Alstrup and Rauhe =-=[6]-=- building upon the work of Abiteboul, Kaplan, and Milo [1] gave a more complicated recursive labeling scheme for ancestor queries that generates labels of length at most log n + O( p log n) bits. Labe... |

48 |
Informative labeling schemes for graphs
- Peleg
- 2005
(Show Context)
Citation Context ...vice versa. Thus our algorithm provides an alternative to any of the algorithms mentioned above also in a non distributed settings. Theorem 1 should put in contrast with a recent lower bound of Peleg =-=[5-=-0]. Peleg shows that labels which allow to compute directly a (log n) bit predetermined identier of nca(x; y) from the labels of x and y alone must be of length ngt 2 n) bits. So to obtain a theorem l... |

47 |
Algorithms on Strings, Trees, and Sequences
- Gus
- 1997
(Show Context)
Citation Context ...rsnding a maximum weighted matching in a graph [31], a minimum spanning tree in a graph [38, 19], and a dominator tree in a directedsowgraph [3]. It is also proved useful in several string algorithms =-=[33, 23]-=-, for dynamic planarity testing [67], in network routing [62], for solving various geometric problems [12] including range searching [30], forsnding evolutionary trees [24], and in bounded treewidth a... |

46 |
Variable-Length binary encodings
- Gilbert, Moore
- 1959
(Show Context)
Citation Context ...em like Theorem 1 one has to exploit the freedom to choose the identiers of the nodes. A 1 All the logarithms are in base two. 2 distinguished feature in our algorithm is its use of alphabetic codes [=-=32]-=- to generalize the inorder approach for completely balanced binary trees. A labeling scheme to identify ncas may be useful in routing messages on tree networks. When a message has to be sent from node... |

44 | Dynamic lca queries on trees
- Richard, Ramesh
- 1999
(Show Context)
Citation Context ...y). The problem of eciently computing nearest common ancestors has been studied extensively over the last three decades in an online and oine settings, and in various models of computation (See e.g. [=-=45, 2, 3, 35, 58, 16, 7]-=-). The problem ofsnding ncas has numerous applications. A procedure solving it is used by algorithms forsnding a maximum weighted matching in a graph [31], a minimum spanning tree in a graph [38, 19],... |

37 |
Highly Parallelizable Problems
- Berman, Breslauer, et al.
- 1989
(Show Context)
Citation Context ...bound ons49 n) even for the static case, hence for the pointer machine Sleator and Tarjan's dynamic trees [59] give optimal results. People have also studied the parallel and distributed complexities =-=[8, 52, 64, 42, 43, 57, 54, 55, 41, 15, 56, 66, 58]-=-, and the I/O-complexity [14] of several of the above problems. Some natural extensions of the problems to rooted directed trees [47] and graphs [21, 22] have also been given. 3 Labeling schemes for d... |

35 | Shortest paths in digraphs of small treewidth, Part I: Sequential algorithms, Algorithmica 27 (3–4
- Chaudhuri, Zaroliagis
- 2000
(Show Context)
Citation Context ... planarity testing [70], in network routing [66], for solving various geometric problems [15] including range searching [35], for finding evolutionary trees [27], and in bounded tree-width algorithms =-=[16]-=-. One of the most fundamental results on computing NCAs is that of Harel and Tarjan [39], [38]. Harel and Tarjan describe a linear time algorithm to preprocess a tree and build a data structure that a... |

33 |
Finding level-ancestors in trees
- Berkman, Vishkin
- 1994
(Show Context)
Citation Context ... Let level(x; i) return the ancestor to x which depth is i less than the depth of x. If we substitute nca with level for the dierent dynamic settings the same bounds mentioned above hold for the RAM [=-=18, 5, 10, 59]-=-. For a pointer machine, however, we have a trivial lower bound ons49 n) even for the static case, hence for the pointer machine Sleator and Tarjan's dynamic trees [59] give optimal results. People ha... |

27 | Linear-Time Pointer-Machine Algorithms for Least Common Ancestors
- Buchsbaum, Kaplan, et al.
- 1998
(Show Context)
Citation Context ...ne and return the label of the nca in constant time. The nca problem is of interest also in an oine settings where the list of, say m, queries is given in advance as input. Recently Buchsbaum et al. [=-=11-=-] gave an O(m+n) time algorithm for the oine nca problem on a pointer machine, improving by a factor of inverse ackermann's function the previous best result [3, 61]. Back with respect to the online n... |

27 | Labeling schemes for small distances in trees
- Alstrup, Bille, et al.
- 2003
(Show Context)
Citation Context ...omplicated recursive labeling scheme for ancestor queries that generates labels of length at most log n + O( √ log n) bits. A lower bound showing that log n + �(log log n) bits are needed is given in =-=[5]-=-. This lower bound also holds for NCA queries which are more general. Labeling schemes for parent queries and other functions have also been studied [40], [41], [53]. Unfortunately neither of these la... |

27 | A Space Lower Bound for Routing in Trees
- Fraigniaud, Gavoille
(Show Context)
Citation Context ...3] Eilam et al. show that any labeling in which the length of the addresses is at most log n bits will require �( √ n) bits for the routing table in some trees. However, Gavoille and Fraigniaud [28], =-=[29]-=- showed that c log n bits, for a small constant c, are enough to encode both the address and the local routing table of each node of the tree. Thorup and Zwick [66] even show that both the address and... |

24 |
Space-efficient message routing in c-decomposable networks
- Frederickson, Janardan
- 1990
(Show Context)
Citation Context ...beling schemes. A particular routing context where a labeling schemes for nca may prove useful is the design of routing labeling schemes for graphs that are close to a tree, say c-decomposable graphs =-=[26, 27]-=- for c = O(1). These graphs admit a tree-decomposition T where each node of T represents a separator of the graph of size at most c. So, one can use a compact labeling of T in order to determine the n... |

24 |
Fast algorithms for nearest common ancestors
- Harel, Tarjan
- 1984
(Show Context)
Citation Context ...y). The problem of eciently computing nearest common ancestors has been studied extensively over the last three decades in an online and oine settings, and in various models of computation (See e.g. [=-=45, 2, 3, 35, 58, 16, 7]-=-). The problem ofsnding ncas has numerous applications. A procedure solving it is used by algorithms forsnding a maximum weighted matching in a graph [31], a minimum spanning tree in a graph [38, 19],... |

24 |
A best possible bound for the weighted path length of binary search trees
- Mehlhorn
- 1977
(Show Context)
Citation Context ...ace construct a table representing these functions. This will only increase the preprocessing time of our labeling algorithm which is described in Section 4.2 by a constant factor. Note that Mehlhorn =-=[46-=-] gives a somewhat more complicated algorithm that produce an alphabetic code, hbi k , for an arbitrary sequence hyi k of positive real numbers with the same bound on the lengths, i.e., jb i j log n ... |

23 |
On finding lowest common ancestors in trees
- Aho, Hopcroft, et al.
- 1973
(Show Context)
Citation Context |

22 | Linear verification for spanning trees
- Komlós
- 1985
(Show Context)
Citation Context ...y by max(i, j). The drs problem is a fundamental geometric searching problem and orthogonal range searching problems in two and higher dimensions are often reduced to drs [23]. Gabow et al. (see also =-=[32]-=-) reduce the drs problem to the nca problem by constructing a Cartesian tree for the sequence x1 , . . . , xn , as defined by Vuillemin [44]. The Cartesian tree of the sequence x1 , . . . , xn is a bi... |

20 |
Private communication
- King
- 1999
(Show Context)
Citation Context ...onding nodes alone, then the shortest labels we can get consists ofs32 2 n) bits. A somewhat dierent and interesting approach for computing ncas on trees of depth O(log n) has been suggested by King [=-=39]-=-. King's algorithm labels each edge of the tree by either 0 or 1 randomly bysipping a fair coin. Then we label each node v with the concatenation of the labels of the edges on the path from the root t... |

20 |
On lowest common ancestors: Simpli and parallelization
- Schieber, Vishkin
- 1988
(Show Context)
Citation Context |

19 |
Separator-based strategies for efficient message routing
- Frederickson, Janardan
- 1986
(Show Context)
Citation Context ...cular routing context where a labeling scheme for NCA may prove useful is the design of routing labeling schemes for graphs that are close to a tree, say c-decomposable or graphs with tree-width O(c) =-=[30]-=-, [31] for c = O(1). These graphs admit a treedecomposition T where each node of T represents a separator of the graph of size at most c. So, one can use a compact labeling of T in order to determine ... |

18 |
A linear-time algorithm for minimum spanning tree
- Klein, Tarjan
- 1976
(Show Context)
Citation Context ...8, 16, 7]). The problem ofsnding ncas has numerous applications. A procedure solving it is used by algorithms forsnding a maximum weighted matching in a graph [31], a minimum spanning tree in a graph =-=[38, 19]-=-, and a dominator tree in a directedsowgraph [3]. It is also proved useful in several string algorithms [33, 23], for dynamic planarity testing [67], in network routing [62], for solving various geome... |

17 | Finding least common ancestors in directed acyclic graphs
- Bender, Pemmasani, et al.
- 2001
(Show Context)
Citation Context ..., [18], [59], [69], [61] and on the I/O complexity [17] of several of the problems mentioned above. Some natural extensions of these problems to rooted directed trees [50] and Directed Acyclic Graphs =-=[10]-=-, [24], [25] have also been studied. 3. Labeling Schemes for a Distributed Environment Motivated by applications in the construction of XML search engines and network routing [1], [41], [52], labeling... |

16 | Fast incremental planarity testing
- Westbrook
- 1992
(Show Context)
Citation Context ... graph [31], a minimum spanning tree in a graph [38, 19], and a dominator tree in a directedsowgraph [3]. It is also proved useful in several string algorithms [33, 23], for dynamic planarity testing =-=[67-=-], in network routing [62], for solving various geometric problems [12] including range searching [30], forsnding evolutionary trees [24], and in bounded treewidth algorithms [13]. The IT University ... |

16 | Improved algorithms for finding level ancestors in dynamic trees
- Alstrup, Holm
- 2000
(Show Context)
Citation Context ...a particular level. The drawback of this scheme is that it requires external data structures to compute the ancestor of a node with a specified depth and to answer ancestor queries (See e.g. [40] and =-=[13, 4]-=-). 3. LABELING SCHEMES FOR DISTRIBUTED ENVIRONMENT Motivated by applications in the construction of XML search engines and network routing [1, 29, 37] labeling schemes that allow ancestor queries have... |

14 |
Optimal suffix tree construction with large alphabets
- Farach-Colton
- 1997
(Show Context)
Citation Context ...ximum weighted matching in a graph [34], a minimum spanning tree in a graph [42], [22], and a dominator tree in a directed flow-graph [2]. It has also proved useful in several string algorithms [37], =-=[26]-=-, for dynamic planarity testing [70], in network routing [66], for solving various geometric problems [15] including range searching [35], for finding evolutionary trees [27], and in bounded tree-widt... |

13 |
Finding level-ancestors in dynamic trees
- Dietz
- 1991
(Show Context)
Citation Context ... Let level(x; i) return the ancestor to x which depth is i less than the depth of x. If we substitute nca with level for the dierent dynamic settings the same bounds mentioned above hold for the RAM [=-=18, 5, 10, 59]-=-. For a pointer machine, however, we have a trivial lower bound ons49 n) even for the static case, hence for the pointer machine Sleator and Tarjan's dynamic trees [59] give optimal results. People ha... |