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.
Run a breadth-first search from every node; a non-tree edge that closes back into the search gives a candidate cycle.