isTree

val <T, W> Graph<T, W>.isTree: Boolean

Whether this graph is a tree/forest, i.e. every node has at most one incoming edge. Note that this alone does not rule out cycles (see isAcyclic for that); e.g. a single node with a self-loop satisfies this check.