Graph Theory37 sections · 1633 units
Open in Course

CSES 1197 Cycle Finding - Problem Statement

(CSES 1197)

Given a directed graph with nn nodes and mm edges, determine if it contains a negative cycle. If yes, output the nodes in the cycle in order.

Unlike High Score, you do not need reachability checks. Any negative cycle in the graph should be reported, regardless of whether it is reachable from a specific source. This is a pure cycle detection problem without path constraints. The challenge is reconstructing the cycle, not detecting its existence.