Negative Cycle Detection Problem

  • Chi-Him Wong
  • Yiu-Cheong Tam
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3669)


In this paper, we will describe some heuristics that can be used to improve the runtime of a wide range of commonly used algorithms for the negative cycle detection problem significantly, such as Bellman-Ford-Tarjan (BFCT) algorithm, Goldberg-Radzik (GORC) algorithm and Bellman-Ford-Moore algorithm with Predecessor Array (BFCF). The heuristics are very easy to be implemented and only require modifications of several lines of code of the original algorithms. We observed that the modified algorithms outperformed the original ones, particularly in random graphs and no cycle graphs. We discovered that 69% of test cases have improved. Also, the improvements are sometimes dramatic, which have an improvement of a factor of 23, excluding the infinity case, while the worst case has only decreased by 85% only, which is comparably small when compared to the improvement.


Random Graph Constraint Graph Negative Cycle Cycle Graph Distance Label 
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. [CG96]
    Cherkassky, B.V., Goldberg, A.V.: Negative-cycle detection algorithms. In: Díaz, J., Serna, M. (eds.) ESA 1996. LNCS, vol. 1136, pp. 349–363. Springer, Heidelberg (1996)Google Scholar
  2. [Gol95]
    Goldberg, A.V.: Scaling algorithms for the shortest paths problem. SIAM Journal on Computing 24(3), 494–504 (1995)MATHCrossRefMathSciNetGoogle Scholar
  3. [Tar81]
    Tarjan, R.E.: Shortest Paths. Technical report. AT&T Bell Laboratories, Murray Hill (1981)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Chi-Him Wong
    • 1
  • Yiu-Cheong Tam
    • 1
  1. 1.The Chinese University of Hong Kong 

Personalised recommendations