Linear-Time Algorithms for Dominators and Other Path-Evaluation Problems

We present linear-time algorithms for the classic problem of finding dominators in a flowgraph, and for several other problems whose solutions require evaluating a function defined on paths in a tree. Although all these problems had linear-time solutions previously, our algorithms are simpler, in some cases substantially. Our improvements come from three new ideas: a refined analysis of path compression that gives a linear bound if the compressions favor certain nodes; replacement of random-access table look-up by a radix sort; and a more careful partitioning of a tree into easily managed parts. In addition to finding dominators, our algorithms find nearest common ancestors off-line, verify and construct minimum spanning trees, do interval analysis of a flowgraph, and build the component tree of a weighted tree. Our algorithms do not require the power of a random-access machine; they run in linear time on a pointer machine. The genesis of our work was the discovery of a subtle error in the analysis of a previous allegedly linear-time algorithm for finding dominators. That algorithm was an attempt to simplify a more complicated algorithm, which itself was intended to correct errors in a yet earlier algorithm. Our work provides a systematic study of the subtleties in the dominators problem, the techniques needed to solve it in linear time, and the range of application of the resulting methods. We have tried to make our techniques as simple and as general as possible and to understand exactly how earlier approaches to the dominators problem were either incorrect or overly complicated.

[1]  Robert E. Tarjan,et al.  Dominator tree verification and vertex-disjoint paths , 2005, SODA '05.

[2]  Robert E. Tarjan,et al.  A fast algorithm for finding dominators in a flowgraph , 1979, TOPL.

[3]  Stefano Allesina,et al.  Who dominates whom in the ecosystem? Energy flow bottlenecks and cascading extinctions. , 2004, Journal of theoretical biology.

[4]  Robert E. Tarjan,et al.  Edge-disjoint spanning trees and depth-first search , 1976, Acta Informatica.

[5]  J. Kruskal On the shortest spanning subtree of a graph and the traveling salesman problem , 1956 .

[6]  Alfred V. Aho,et al.  On Finding Lowest Common Ancestors in Trees , 1976, SIAM J. Comput..

[7]  Jens Gustedt,et al.  Efficient Union-Find for Planar Graphs and other Sparse Graph Classes , 1998, Theor. Comput. Sci..

[8]  Seth Pettie,et al.  Computing shortest paths with comparisons and additions , 2002, SODA '02.

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

[10]  Seth Pettie,et al.  An optimal minimum spanning tree algorithm , 2000, JACM.

[11]  Philip N. Klein,et al.  A randomized linear-time algorithm to find minimum spanning trees , 1995, JACM.

[12]  Giorgio Satta,et al.  Theory of Parsing , 2010 .

[13]  Harold N. Gabow,et al.  Path-based depth-first search for strong and biconnected components , 2000, Inf. Process. Lett..

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

[15]  S. Allesina,et al.  Secondary extinctions in ecological networks: Bottlenecks unveiled , 2006 .

[16]  Jaroslav Nesetril,et al.  Linearity and Unprovability of Set Union Problem Strategies. I. Linearity of Strong Postorder , 1997, J. Algorithms.

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

[18]  Robert E. Tarjan,et al.  Finding Dominators Revisited , 2004, SODA 2004.

[19]  Erik D. Demaine,et al.  Logarithmic Lower Bounds in the Cell-Probe Model , 2005, SIAM J. Comput..

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

[21]  Joan M. Lucas Postorder Disjoint Set Union is Linear , 1990, SIAM J. Comput..

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

[23]  Irith Pomeranz,et al.  Fault equivalence identification using redundancy information and static and dynamic extraction , 2001, Proceedings 19th IEEE VLSI Test Symposium. VTS 2001.

[24]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

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

[26]  Yves Deville,et al.  Using Dominators for Solving Constrained Path Problems , 2006, PADL.

[27]  Mikkel Thorup,et al.  Dominators in Linear Time , 1999, SIAM J. Comput..

[28]  Michael A. Bender,et al.  The LCA Problem Revisited , 2000, LATIN.

[29]  Jan van Leeuwen,et al.  Worst-case Analysis of Set Union Algorithms , 1984, JACM.

[30]  Bernard Chazelle,et al.  A minimum spanning tree algorithm with inverse-Ackermann type complexity , 2000, JACM.

[31]  Joe D. Warren,et al.  The program dependence graph and its use in optimization , 1987, TOPL.

[32]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[33]  Stephen Alstrup,et al.  Nearest common ancestors: a survey and a new distributed algorithm , 2002, SPAA.

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

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

[36]  Jean Vuillemin,et al.  A unifying look at data structures , 1980, CACM.

[37]  Ronald L. Graham,et al.  On the History of the Minimum Spanning Tree Problem , 1985, Annals of the History of Computing.

[38]  Haim Kaplan,et al.  A new, simpler linear-time dominators algorithm , 1998, TOPL.

[39]  Robert E. Tarjan,et al.  Finding Dominators in Directed Graphs , 1974, SIAM J. Comput..

[40]  Robert E. Tarjan,et al.  Efficiency of a Good But Not Linear Set Union Algorithm , 1972, JACM.

[41]  Robert E. Tarjan,et al.  Linear-time algorithms for dominators and related problems , 2005 .

[42]  Valerie King A simpler minimum spanning tree verification algorithm , 2006, Algorithmica.

[43]  Stephen Alstrup,et al.  Optimal On-Line Decremental Connectivity in Trees , 1997, Inf. Process. Lett..

[44]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[45]  Robert E. Tarjan,et al.  Depth-First Search and Linear Graph Algorithms , 1972, SIAM J. Comput..

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

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

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

[49]  Robert E. Tarjan,et al.  Data-Structural Bootstrapping, Linear Path Compression, and Catenable Heap-Ordered Double-Ended Queues , 1995, SIAM J. Comput..

[50]  Robert E. Tarjan Testing flow graph reducibility , 1973, STOC '73.

[51]  Mikkel Thorup,et al.  Optimal algorithms for ?nding nearest common ancestors in dynamic trees , 2000 .

[52]  Christophe Fiorio,et al.  Two Linear Time Union-Find Strategies for Image Processing , 1996, Theor. Comput. Sci..

[53]  Shimon Even,et al.  An On-Line Edge-Deletion Problem , 1981, JACM.

[54]  Robert Paige,et al.  Using Multiset Discrimination to Solve Language Processing Problems Without Hashing , 1995, Theor. Comput. Sci..

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

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

[57]  Edward S. Lowry,et al.  Object code optimization , 1969, CACM.

[58]  Mikkel Thorup,et al.  Undirected single-source shortest paths with positive integer weights in linear time , 1999, JACM.

[59]  Hanan Samet,et al.  A general approach to connected-component labeling for arbitrary image representations , 1992, JACM.

[60]  Robert E. Tarjan,et al.  Finding Dominators in Practice , 2004, ESA.

[61]  János Komlós Linear verification for spanning trees , 1985, Comb..