pub fn is_forest(graph: &Graph) -> boolExpand description
Returns whether graph is a forest: a DAG in which every node has in-degree at most 1, so that the
edges point away from the root nodes.
The empty graph is a forest. For the undirected reading, see is_undirected_forest.
Time: O(node_count + edge_count). Memory: 8 x node_count bytes while it runs.