Abstract

In this paper, we develop a greedy strategy for the problem of checking whether a network (directed graph) with positive and negative costs on its edges has a negative cost cycle. We call our approach the Vertex Contraction algorithm; it is the first known greedy strategy for this problem. As per the literature, all known approaches to the problem of detecting negative cost cycles are based on dynamic programming or scaling. It is well known that the negative cost cycle detection problem is equivalent to the problem of checking whether a system of linear difference constraints is feasible. Our algorithm exploits this equivalence and uses polyhedral projection on the polyhedron of linear difference constraints, corresponding to the input network, to detect the presence of negative cost cycles. We use a variant of the Fourier–Motzkin elimination procedure to effect polyhedral projection and contrast the performance of our algorithm with the “standard” Bellman–Ford algorithm for the same problem. We observed that the Vertex Contraction algorithm performed an order of magnitude better than the Bellman–Ford algorithm on a range of randomly generated inputs, thereby conclusively demonstrating the superiority of our approach. From the perspective of asymptotic analysis, the Bellman–Ford algorithm is superior to our algorithm, in that it runs in time O ( m ⋅ n ) in the worst case, on a network with m edges and n vertices, whereas the worst-case complexity of our algorithm is O ( n 3 ) .

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.