An \({\cal O}(n^{2.75})\) Algorithm for Online Topological Ordering

  • Deepak Ajwani
  • Tobias Friedrich
  • Ulrich Meyer
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4059)


We present a simple algorithm which maintains the topological order of a directed acyclic graph with n nodes under an online edge insertion sequence in \({\cal O}(n^{2.75})\) time, independent of the number of edges m inserted. For dense DAGs, this is an improvement over the previous best result of \({\cal O}(\min\{m^{\frac{3}{2}} \log{n}, m^{\frac{3}{2}} + n^2 \log{n}\})\) by Katriel and Bodlaender. We also provide an empirical comparison of our algorithm with other algorithms for online topological sorting.


Directed Acyclic Graph Recursive Call Topological Order Adjacency List Arbitrary Node 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ajwani, D., Friedrich, T., Meyer, U.: An O(n 2.75) algorithm for online topological ordering (2006) arXiv:cs.DS/0602073Google Scholar
  2. 2.
    Alpern, B., Hoover, R., Rosen, B.K., Sweeney, P.F., Kenneth Zadeck, F.: Incremental evaluation of computational circuits. In: Proceedings of the First Annual ACM-SIAM Symposium on Discrete Algorithms, Philadelphia, PA, USA, pp. 32–42. Society for Industrial and Applied Mathematics (1990)Google Scholar
  3. 3.
    Cormen, T., Leiserson, C., Rivest, R.: Introduction to Algorithms. MIT Press, Cambridge (1989)Google Scholar
  4. 4.
    Katriel, I., Bodlaender, H.L.: Online topological ordering. In: Proceeding of the 16th ACM-SIAM Symposium on Discrete Algorithms (SODA), Vancouver, pp. 443–450 (2005)Google Scholar
  5. 5.
    Marchetti-Spaccamela, A., Nanni, U., Rohnert, H.: On-line graph algorithms for incremental compilation. In: van Leeuwen, J. (ed.) WG 1993. LNCS, vol. 790, pp. 70–86. Springer, Heidelberg (1994)Google Scholar
  6. 6.
    Marchetti-Spaccamela, A., Nanni, U., Rohnert, H.: Maintaining a topological order under edge insertions. Information Processing Letters 59(1), 53–58 (1996)zbMATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Omohundro, S.M., Lim, C., Bilmes, J.: The sather language compiler/debugger implementation. Technical Report TR-92-017, International Computer Science Institute, Berkeley (1992)Google Scholar
  8. 8.
    Östlin, A., Pagh, R.: Uniform hashing in constant time and linear space. In: Proceedings of the 35th Annual ACM Symposium on Theory of Computing, pp. 622–628. ACM Press, New York (2003)Google Scholar
  9. 9.
    Pearce, D.J., Kelly, P.H.J.: A dynamic algorithm for topologically sorting directed acyclic graphs. In: Ribeiro, C.C., Martins, S.L. (eds.) WEA 2004. LNCS, vol. 3059, pp. 383–398. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  10. 10.
    Pearce, D.J., Kelly, P.H.J., Hankin, C.: Online cycle detection and difference propagation for pointer analysis. In: Proceedings of the Third International IEEE Workshop on Source Code Analysis and Manipulation (SCAM 2003) (2003)Google Scholar
  11. 11.
    Ramalingam, G., Reps, T.W.: On competitive on-line algorithms for the dynamic priority-ordering problem. Information Processing Letters 51, 155–161 (1994)zbMATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Deepak Ajwani
    • 1
  • Tobias Friedrich
    • 1
  • Ulrich Meyer
    • 1
  1. 1.Max-Planck-Institut für InformatikSaarbrückenGermany

Personalised recommendations