Macaulay2 » Documentation
Packages » Graphs :: isForest
next | previous | forward | backward | up | index | toc

isForest -- determines whether a graph is a forest

Description

A graph is a forest if it is a disjoint collection of trees.

i1 : G = graph({{1,2},{1,3},{6,4},{4,5}},EntryMode=>"edges");
i2 : isForest G

o2 = true

See also

Ways to use isForest:

  • isForest(Graph)

For the programmer

The object isForest is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.25.05+ds/M2/Macaulay2/packages/Graphs.m2:4461:0.