✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
You are given a weakly connected directed weighted graph — connected when the edge directions are ignored — and asked whether it contains a negative cycle anywhere— not just one reachable from some particular vertex.
Which approach settles it in O(|V| · |E|) time?