A very fast, practical algorithm for finding a negative cycle in a digraph

  • Paul Spirakis
  • Athanasios Tsakalidis
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 226)


We present an algorithm which can find a negative cycle in a directed graph in worst case time O(n·e), where n is the number of nodes and e the number of edges, using only space O(n + e). Our algorithm is implemented on a pointer machine. Assuming that the input to our algorithm is a weighted random digraph, we prove that its average time complexity for dense graphs lies between O(n·logn) and O(min{n2/log2n,e}), the exact value depending on the probability with which an edge is present in the random graph, and for sparse random graphs is Θ(n2).


Random Graph Negative Cycle Pointer Machine Weighted Digraph Algorithm Cycle 
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. AHO A., HOPCROFT J., ULLMAN J. "Design and Analysis of Computer Algorithms", Addison Wesley (1974)Google Scholar
  2. ANGLUIN D. and VALLANT L. "Fast Probabilistic Algorithms for Hamiltonian Circuits and Mathings" J. Computers and System Sciences, Vol.18, pp.155–193 (1979)Google Scholar
  3. CHERNOFF H. "A Measure of Asymptotic Efficiency for Tests of a Hypothesis based on the Sum of Observations", Annals of Math. Statistics, Vol.23 (1952)Google Scholar
  4. ERDOS P. and RENYI A. "On Random Graphs", in the "Art of Counting", J.Spencer editor, MIT Press, also "Publicationes Mathematicae", Vol. 6, pp. 290–297 (1959)Google Scholar
  5. ERDOS P. and RENYI A. "On the evolution on random graphs", Publications of the Mathematical Institute of the Hungarian Academy of Sciences, 5, (1960)Google Scholar
  6. HAREL D. and TARJAN R.E. "Fast Algorithms for finding Nearest Common Ancestors", SIAM Journal of Computing, Vol. 13, pp. 338–355 (1984)Google Scholar
  7. KARP R. and TARJAN R. "Linear Expected-Time Algorithms for Connectivity Problems", 12th ACM Symp. on Theory of Computing, pp. 368–377 (1980)Google Scholar
  8. LAWLER E.L. "Combinatorial Optimization: Networks and Matroids", Holt, Rinehart and Winston (1976)Google Scholar
  9. LENGAUER T. "Efficient Algorithms for The Constraint Generation for Intergrated Circuit Layout Compaction", Proc. of 9-th Workshop on Graphtheoretic Concepts in Computer Science, Trauner Verlag, pp.219–230 (1983)Google Scholar
  10. MAIER D. "An Efficient Method for Storing Ancestor Information in Trees", SIAM Journal of Computing, Vol.8, No 4, pp.599–618 (1979)Google Scholar
  11. MEHLHORN K. "Data Structures and Algorithms, Vol.2: Graph-Algorithms and NP-Completeness", EATCS Monographs on Theoretical Computer Science, Springer Verlag (1984)Google Scholar
  12. PAPADIMITRIOU CH. and STEIGLITZ K. "Combinatorial Optimization: Algorithms and Complexity", Prentice-Hall (1982)Google Scholar
  13. REIF J. and SPIRAKIS P. "Random Matroids", 12th ACM Symp. on Theory of Computing, pp.385–397 (1980)Google Scholar
  14. REIF J. and SPIRAKIS P. "K-Connectivity of Random Undirected Graphs" to appear in Journal of Discrete Mathematics Google Scholar
  15. SPIRAKIS P. and TSAKALIDIS A. "A Very Fast, Practical Algorithm for Finding a Negative Cycle in a Digraph", Technischer Bericht, FB 10, Universität des Saarlandes (1986)Google Scholar
  16. TARJAN R.E. "Data Structures and Network Algorithms", Society for Industrial and Applied Mathematics, Philadelphia, PA (1983)Google Scholar
  17. TSAKALIDIS A.K. "Maintaining Order in Generalized Linked List", Acta Informatica, Vol. 21, pp. 101–112 (1984)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1986

Authors and Affiliations

  • Paul Spirakis
    • 1
    • 2
  • Athanasios Tsakalidis
    • 3
  1. 1.Courant Institute Mathematical ScienceNew YorkUSA
  2. 2.Computer Technology InstitutePatrasGreece
  3. 3.Fachbereich 10, Angewandte Mathematik und InformatikUniversität des SaarlandesSaarbrückenWest Germany

Personalised recommendations