pub fn is_dag(graph: &Graph) -> boolExpand description
Returns whether graph is a DAG: a graph without cycles. A self-loop is a cycle.
find_cycle returns a cycle where this function finds one.
Time: O(node_count + edge_count), stopping at the first cycle. Memory: 2 bits per node while it runs, and up to 8 x node_count bytes for the stack, which grows with the deepest path.
ยงPanics
With an invalid argument message if a depth-first path is longer than 2^30 - 5 nodes.