Negative cycle (source code)

= Negative cycle
{title2=$\sum_{e\in C}w(e)<0$}

A directed <cycle> in an edge-weighted graph whose total weight is negative. Repeating it makes walk costs arbitrarily small. For a particular <shortest-path distance> $d(s,t)$ to be affected, the cycle must be reachable from $s$ and must have a route to $t$; an unrelated component does not change that distance.