Problem 2608 · Hard

Shortest Cycle in a Graph

Run a breadth-first search from every node; a non-tree edge that closes back into the search gives a candidate cycle.

Open the interactive visualisation