Share Download code Jump to the code Open in the playground

Cycle detection

One by one highlights the cycles in the graph and removes them by cutting the edges.