A dynamic topological sort algorithm for directed acyclic graphs

We consider the problem of maintaining the topological order of a directed acyclic graph (DAG) in the presence of edge insertions and deletions. We present a new algorithm and, although this has inferior time complexity compared with the best previously known result, we find that its simplicity leads to better performance in practice. In addition, we provide an empirical comparison against the three main alternatives over a large number of random DAGs. The results show our algorithm is the best for sparse digraphs and only a constant factor slower than the best on dense digraphs.

[1]  Hans L. Bodlaender,et al.  Online topological ordering , 2005, SODA '05.

[2]  Alberto Marchetti-Spaccamela,et al.  Maintaining a Topological Order Under Edge Insertions , 1996, Inf. Process. Lett..

[3]  Ronald L. Rivest,et al.  Introduction to Algorithms , 1990 .

[4]  Pascal Van Hentenryck,et al.  Maintaining Longest Paths Incrementally , 2003, Constraints.

[5]  B. Bollobás The evolution of random graphs , 1984 .

[6]  Dashing Yeh On incremental evaluation of ordered attributed grammars , 1983, BIT Comput. Sci. Sect..

[7]  J PearceDavid,et al.  A dynamic topological sort algorithm for directed acyclic graphs , 2007 .

[8]  Daniele Frigioni,et al.  Maintaining Shortest Paths in Digraphs with Arbitrary Arc Weights: An Experimental Study , 2000, WAE.

[9]  Mats Wir,et al.  Bounded Incremental Parsing , 2022 .

[10]  Daniele Frigioni,et al.  Incremental Algorithms for the Single-Source Shortest Path Problem , 1994, FSTTCS.

[11]  Ulrich Meyer,et al.  An O(n2.75) Algorithm for Online Topological Ordering , 2006, SWAT.

[12]  Ramesh Hariharan,et al.  Improved decremental algorithms for maintaining transitive closure and all-pairs shortest paths , 2002, STOC '02.

[13]  Fan Chung Graham,et al.  A Random Graph Model for Power Law Graphs , 2001, Exp. Math..

[14]  Thomas W. Reps Optimal-time incremental semantic analysis for syntax-directed editors , 1982, POPL '82.

[15]  Giuseppe F. Italiano,et al.  Fully dynamic transitive closure: breaking through the O(n/sup 2/) barrier , 2000, Proceedings 41st Annual Symposium on Foundations of Computer Science.

[16]  Valerie King,et al.  A fully dynamic algorithm for maintaining the transitive closure , 1999, STOC '99.

[17]  Valerie King,et al.  A fully dynamic algorithm for maintaining the transitive closure , 1999, STOC '99.

[18]  Grammati E. Pantziou,et al.  Improved Algorithms for Dynamic Shortest Paths , 2000, Algorithmica.

[19]  P. Erdos,et al.  On the evolution of random graphs , 1984 .

[20]  Clifford Stein,et al.  Introduction to Algorithms, 2nd edition. , 2001 .

[21]  Boris G. Pittel,et al.  A phase transition phenomenon in a random directed acyclic graph , 2001, Random Struct. Algorithms.

[22]  David J. Pearce,et al.  Some directed graph algorithms and their application to pointer analysis , 2005 .

[23]  Alan M. Frieze,et al.  Random graphs , 2006, SODA '06.

[24]  Svante Janson,et al.  Random graphs , 2000, ZOR Methods Model. Oper. Res..

[25]  A. M. Berman,et al.  Lower and upper bounds for incremental algorithms , 1992 .

[26]  Jeremy G. Siek,et al.  The Boost Graph Library - User Guide and Reference Manual , 2001, C++ in-depth series.

[27]  Thomas W. Reps,et al.  Remote attribute updating for language-based editors , 1986, POPL '86.

[28]  Svante Janson,et al.  Random graphs , 2000, Wiley-Interscience series in discrete mathematics and optimization.

[29]  Fabio Gagliardi Cozman,et al.  Random Generation of Bayesian Networks , 2002, SBIA.

[30]  Ulrich Meyer,et al.  An O(n2.75) algorithm for online topological ordering , 2006, Electron. Notes Discret. Math..

[31]  Thomas W. Reps,et al.  On Competitive On-Line Algorithms for the Dynamic Priority-Ordering Problem , 1994, Inf. Process. Lett..

[32]  Jim Law,et al.  Review of "The boost graph library: user guide and reference manual by Jeremy G. Siek, Lie-Quan Lee, and Andrew Lumsdaine." Addison-Wesley 2002. , 2003, SOEN.

[33]  Boris Pittel,et al.  A phase transition phenomenon in a random directed acyclic graph , 2001 .

[34]  G. Ramalingam Bounded Incremental Computation , 1996, Lecture Notes in Computer Science.

[35]  Paul H. J. Kelly,et al.  A Dynamic Algorithm for Topologically Sorting Directed Acyclic Graphs , 2004, WEA.

[36]  Fan Chung Graham,et al.  A random graph model for massive graphs , 2000, STOC '00.

[37]  Richard Cole,et al.  Two Simplified Algorithms for Maintaining Order in a List , 2002, ESA.

[38]  Mireille Bousquet-Mélou,et al.  Random Generation of Directed Acyclic Graphs , 2001, Electron. Notes Discret. Math..

[39]  Paul F. Dietz,et al.  Two algorithms for maintaining order in a list , 1987, STOC.

[40]  Bowen Alpern,et al.  Incremental evaluation of computational circuits , 1990, SODA '90.

[41]  Paul Erdös,et al.  On the Maximal Number of Strongly Independent Vertices in a Random Acyclic Directed Graph , 1984 .

[42]  Chris Hankin,et al.  Online Cycle Detection and Difference Propagation: Applications to Pointer Analysis , 2004, Software Quality Journal.

[43]  Daniele Frigioni,et al.  Fully Dynamic Shortest Paths and Negative Cycles Detection on Digraphs with Arbitrary Arc Weights , 1998, ESA.

[44]  Martin Müller,et al.  Depth-First Discovery Algorithm for incremental topological sorting of directed acyclic graphs , 2003, Inf. Process. Lett..

[45]  Thomas W. Reps,et al.  On the Computational Complexity of Dynamic Graph Problems , 1996, Theor. Comput. Sci..