Improved Algorithms for Finding Level Ancestors in Dynamic Trees

Given a node x at depth d in a rooted tree Level Ancestor(x; i) returns the ancestor to x in depth d - i. We show how to maintain a tree under addition of new leaves so that updates and level ancestor queries are being performed in worst case constant time. Given a forest of trees with n nodes where edges can be added, m queries and updates take O(mα(m, n)) time. This solves two open problems (P.F. Dietz, Finding level-ancestors in dynamic trees, LNCS, 519:32-40, 1991). In a tree with node weights, min(x, y) report the node with minimum weight on the path between the nodes x and y. We can substitute the Level Ancestor query with min, without increasing the complexity for updates and queries. Previously such results have been known only for special cases (e.g. R. E. Tarjan. Applications of path compression on balanced trees. J. ACM, 26(4):690-715, 1979).

[1]  Andrew Chi-Chih Yao,et al.  Space-time tradeoff for answering range queries (Extended Abstract) , 1982, STOC '82.

[2]  Michael E. Saks,et al.  The cell probe complexity of dynamic data structures , 1989, STOC '89.

[3]  Uzi Vishkin,et al.  On Finding Lowest Common Ancestors: Simplification and Parallelization , 1988, AWOC.

[4]  Robert E. Tarjan,et al.  A data structure for dynamic trees , 1981, STOC '81.

[5]  Robert E. Tarjan,et al.  A Class of Algorithms which Require Nonlinear Time to Maintain Disjoint Sets , 1979, J. Comput. Syst. Sci..

[6]  Mikkel Thorup,et al.  Maintaining Center and Median in Dynamic Trees , 2000, SWAT.

[7]  Paul F. Dietz Finding Level-Ancestors in Dynamic Trees , 1991, WADS.

[8]  J. van Leeuwen An optimal pointer machine algorithm for finding nearest common ancestors , 1988 .

[9]  Michael L. Fredman,et al.  Trans-Dichotomous Algorithms for Minimum Spanning Trees and Shortest Paths , 1994, J. Comput. Syst. Sci..

[10]  Udi Manber,et al.  Recognizing Breadth-First Search Trees in Linear Time , 1990, Information Processing Letters.

[11]  Faith Ellen,et al.  Optimal bounds for the predecessor problem , 1999, STOC '99.

[12]  Robert E. Tarjan,et al.  Applications of Path Compression on Balanced Trees , 1979, JACM.

[13]  Robert E. Tarjan,et al.  A Linear-Time Algorithm for a Special Case of Disjoint Set Union , 1985, J. Comput. Syst. Sci..

[14]  Uzi Vishkin,et al.  Finding Level-Ancestors in Trees , 1994, J. Comput. Syst. Sci..

[15]  Robert E. Tarjan,et al.  Fast Algorithms for Finding Nearest Common Ancestors , 1984, SIAM J. Comput..

[16]  Bernard Chazelle Computing on a Free Tree via Complexity-Preserving Mappings , 1984, FOCS.

[17]  Stephen Alstrup,et al.  Worst-case and amortised optimality in union-find (extended abstract) , 1999, STOC '99.

[18]  Athanasios K. Tsakalidis The nearest common ancestor in a dynamic tree , 1988 .

[19]  Robert E. Tarjan,et al.  Scaling and related techniques for geometry problems , 1984, STOC '84.

[20]  Athanasios K. Tsakalidis The nearest common ancestor in a dynamic tree , 2002, SPAA '02.

[21]  Robert E. Tarjan,et al.  A data structure for dynamic trees , 1981, STOC '81.

[22]  Dov Harel,et al.  A linear algorithm for finding dominators in flow graphs and related problems , 1985, STOC '85.

[23]  Mikkel Thorup,et al.  Optimal Pointer Algorithms for Finding Nearest Common Ancestors in Dynamic Trees , 1996, SWAT.

[24]  Uzi Vishkin,et al.  Recursive Star-Tree Parallel Data Structure , 1993, SIAM J. Comput..

[25]  Harold N. Gabow,et al.  A scaling algorithm for weighted matching on general graphs , 1985, 26th Annual Symposium on Foundations of Computer Science (sfcs 1985).

[26]  Harold N. Gabow,et al.  Data structures for weighted matching and nearest common ancestors with linking , 1990, SODA '90.

[27]  Mikkel Thorup,et al.  Parallel Shortcutting of Rooted Trees , 1997, J. Algorithms.

[28]  Haim Kaplan,et al.  Linear-time pointer-machine algorithms for least common ancestors, MST verification, and dominators , 1998, STOC '98.

[29]  Robert E. Tarjan,et al.  Verification and Sensitivity Analysis of Minimum Spanning Trees in Linear Time , 1992, SIAM J. Comput..

[30]  Mikkel Thorup,et al.  Minimizing Diameters of Dynamic Trees , 1997, ICALP.