pub fn has_cycle<N, E>(g: &DiGraph<N, E>) -> boolwhere N: Clone,
Check if a graph contains any cycles.
Uses petgraph’s is_cyclic_directed algorithm.
is_cyclic_directed