Misplaced Pages

Zero-weight cycle problem

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

In computer science and graph theory, the zero-weight cycle problem is the problem of deciding whether a directed graph with weights on the edges (which may be positive or negative or zero) has a cycle in which the sum of weights is 0.

A related problem is to decide whether the graph has a negative cycle, a cycle in which the sum of weights is less than 0. This related problem can be solved in polynomial time using the Bellman–Ford algorithm. If there is no negative cycle, then the distances found by the Bellman–Ford algorithm can be used, as in Johnson's algorithm, to reweight the edges of the graph in such a way that all edge weights become non-negative and all cycle lengths remain unchanged. With this reweighting, a zero-weight cycle becomes trivial to detect: it exists if and only if the zero-weight edges do not form a directed acyclic graph. Therefore, the special case of the zero-weight cycle problem, on graphs with no negative cycle, has a polynomial-time algorithm.

In contrast, for graphs that contain negative cycles, detecting a simple cycle of weight exactly 0 is an NP-complete problem. This is true even when the weights are integers of polynomial magnitude. In particular, there is a reduction from the Hamiltonian path problem, on an n {\displaystyle n} -vertex unweighted graph G {\displaystyle G} with specified starting and ending vertices s {\displaystyle s} and t {\displaystyle t} , to the zero-weight cycle problem on a weighted graph obtained by giving all edges of G {\displaystyle G} weight equal to one, and adding an additional edge from t {\displaystyle t} to s {\displaystyle s} with weight 1 n {\displaystyle 1-n} .

References

  1. ^ Sanders, Peter; Schulz, Christian (2013), "Think Locally, Act Globally: Highly Balanced Graph Partitioning", in Bonifaci, Vincenzo; Demetrescu, Camil; Marchetti-Spaccamela, Alberto (eds.), Experimental Algorithms, 12th International Symposium, SEA 2013, Rome, Italy, June 5–7, 2013, Proceedings, Lecture Notes in Computer Science, vol. 7933, Springer, pp. 164–175, arXiv:1210.0477, doi:10.1007/978-3-642-38527-8_16, ISBN 978-3-642-38526-1
  2. Kawase, Yasushi; Kobayashi, Yusuke; Yamaguchi, Yutaro (2015), "Finding a zero path in Z 3 {\displaystyle \mathbb {Z} _{3}} -labeled graphs" (PDF), RIMS Kôkyûroku, 1931: 148–160
Categories: