A new approach to incremental topological ordering

Let G = (V, E) be a directed acyclic graph (dag) with n = |V| and m = |E|. We say that a total ordering p on vertices V is a topological ordering if for every edge (u, v) ∈ E, we have u ∈ v. In this paper, we consider the problem of maintaining a topological ordering subject to dynamic changes to the underlying graph. That is, we begin with an empty graph G = (V, o) consisting of n nodes. The adversary adds m edges to the graph G, one edge at a time. Throughout this process, we maintain an online topological ordering of the graph G. In this paper, we present a new algorithm that has a total cost of O(n2logn) for maintaining the topological ordering throughout all the edge additions. At the heart of our algorithm is a new approach for maintaining the ordering. Instead of attempting to place the nodes in an ordered list, we assign each node a label that is consistent with the ordering, and yet can be updated efficiently as edges are inserted. When the graph is dense, our algorithm is more efficient than existing algorithms. By way of contrast, the best known prior algorithms achieve only O(min(m1.5, n2.5)) cost.

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

[2]  Irit Katriel,et al.  On algorithms for online topological ordering and sorting , 2004 .

[3]  Alberto Marchetti-Spaccamela,et al.  On-line Graph Algorithms for Incremental Compilation , 1993, WG.

[4]  Tobias Friedrich,et al.  Average-Case Analysis of Online Topological Ordering , 2007, ISAAC.

[5]  Robert E. Tarjan,et al.  Faster Algorithms for Incremental Topological Ordering , 2008, ICALP.

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

[7]  Glynn Winskel,et al.  Proceedings of the 25th International Colloquium on Automata, Languages and Programming , 1998 .

[8]  Telikepalli Kavitha,et al.  Faster Algorithms for Online Topological Ordering , 2007, ArXiv.

[9]  Robert E. Tarjan,et al.  Incremental Topological Ordering and Strong Component Maintenance , 2008, ArXiv.

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

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

[12]  Kun-Mao Chao,et al.  A tight analysis of the Katriel-Bodlaender algorithm for online topological ordering , 2007, Theor. Comput. Sci..

[13]  Ronald L. Rivest,et al.  Introduction to Algorithms, Second Edition , 2001 .

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

[15]  Chris Hankin,et al.  Online cycle detection and difference propagation for pointer analysis , 2003, Proceedings Third IEEE International Workshop on Source Code Analysis and Manipulation.

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

[17]  Ference Belik An Efficient Deadlock Avoidance Rechnique , 1990, IEEE Trans. Computers.

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

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

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