Problem 2204 · Hard

Distance to a Cycle in Undirected Graph

For each vertex, find its distance to the unique cycle in a connected undirected graph. The visual peels off the tree branches and marks the cycle vertices.

Open the interactive visualisation