Abstract
We consider how to maintain 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 marginally 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 three alternatives over a large number of random DAG’s. The results show our algorithm is the best for sparse graphs and, surprisingly, that an alternative with poor theoretical complexity performs marginally better on dense graphs.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Alpern, B., Hoover, R., Rosen, B.K., Sweeney, P.F., Zadeck, F.K.: Incremental evaluation of computational circuits. In: Proc. 1st Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 32–42 (1990)
Baswana, S., Hariharan, R., Sen, S.: Improved algorithms for maintaining transitive closure and all-pairs shortest paths in digraphs under edge deletions. In: Proc. ACM Symposium on Theory of Computing (2002)
Berman, A.M.: Lower And Upper Bounds For Incremental Algorithms. PhD thesis, New Brunswick, New Jersey (1992)
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms. MIT Press, Cambridge (2001)
Demetrescu, C., Frigioni, D., Marchetti-Spaccamela, A., Nanni, U.: Maintaining shortest paths in digraphs with arbitrary arc weights: An experimental study. In: Proc. Workshop on Algorithm Engineering. LNCS, pp. 218–229 (2000)
Demetrescu, C., Italiano, G.F.: Fully dynamic transitive closure: breaking through the O(n2) barrier. In: Proc. IEEE Symposium on Foundations of Computer Science, pp. 381–389 (2000)
Dietz, P., Sleator, D.: Two algorithms for maintaining order in a list. In: Proc. ACM Symposium on Theory of Computing, pp. 365–372 (1987)
Djidjev, H., Pantziou, G.E., Zaroliagis, C.D.: Improved algorithms for dynamic shortest paths. Algorithmica 28(4), 367–389 (2000)
Frigioni, D., Marchetti-Spaccamela, A., Nanni, U.: Fully dynamic shortest paths and negative cycle detection on digraphs with arbitrary arc weights. In: Proc. European Symposium on Algorithms, pp. 320–331 (1998)
Ioannidis, Y., Ramakrishnan, R., Winger, L.: Transitive closure algorithms based on graph traversal. ACM Transactions on Database Systems 18(3), 512–576 (1993)
Italiano, G.F., Eppstein, D., Galil, Z.: Dynamic graph algorithms. In: Algorithms and Theory of Computation Handbook, CRC Press, Boca Raton (1999)
Karp, R.M.: The transitive closure of a random digraph. Random Structures & Algorithms 1(1), 73–94 (1990)
Katriel, I.: On algorithms for online topological ordering and sorting. Research Report MPI-I-2004-1-003, Max-Planck-Institut fĂĽr Informatik (2004)
King, V., Sagert, G.: A fully dynamic algorithm for maintaining the transitive closure. In: Proc. ACM Symposium on Theory of Computing, pp. 492–498 (1999)
Marchetti-Spaccamela, A., Nanni, U., Rohnert, H.: Maintaining a topological order under edge insertions. Information Processing Letters 59(1), 53–58 (1996)
Pearce, D.J.: Some directed graph algorithms and their application to pointer analysis. PhD thesis, Imperial College, London (2004) (work in progress)
Pearce, D.J., Kelly, P.H.J., Hankin, C.: Online cycle detection and difference propagation for pointer analysis. In: Proc. IEEE workshop on Source Code Analysis and Manipulation (2003)
Ramalingam, G. (ed.): Bounded Incremental Computation. LNCS, vol. 1089. Springer, Heidelberg (1996)
Ramalingam, G., Reps, T.: On competitive on-line algorithms for the dynamic priority-ordering problem. Information Processing Letters 51(3), 155–161 (1994)
Reps, T.: Optimal-time incremental semantic analysis for syntax-directed editors. In: Proc. Symp. on Principles of Programming Languages, pp. 169–176 (1982)
Zhou, J., Müller, M.: Depth-first discovery algorithm for incremental topological sorting of directed acyclic graphs. Information Processing Letters 88(4), 195–200 (2003)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Pearce, D.J., Kelly, P.H.J. (2004). A Dynamic Algorithm for Topologically Sorting Directed Acyclic Graphs. In: Ribeiro, C.C., Martins, S.L. (eds) Experimental and Efficient Algorithms. WEA 2004. Lecture Notes in Computer Science, vol 3059. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24838-5_29
Download citation
DOI: https://doi.org/10.1007/978-3-540-24838-5_29
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-22067-1
Online ISBN: 978-3-540-24838-5
eBook Packages: Springer Book Archive