This function determines if a graph or hypergraph is a forest. A graph is a forest if if the graph has no cycles. We say that a hypergraph is forest if each connected component is a tree in the sense of S. Faridi. See the paper "The facet ideal of a simplicial complex," Manuscripta Mathematica 109, 159-174 (2002).
i1 : S = QQ[a..f]; |
i2 : t = graph {a*b,a*c,a*e} o2 = Graph{edges => {{a, b}, {a, c}, {a, e}}} ring => S vertices => {a, b, c, d, e, f} o2 : Graph |
i3 : isForest t o3 = true |
i4 : h = hyperGraph {a*b*c,c*d*e,b*d*f} o4 = HyperGraph{edges => {{a, b, c}, {c, d, e}, {b, d, f}}} ring => S vertices => {a, b, c, d, e, f} o4 : HyperGraph |
i5 : isForest h o5 = false |
The object isForest is a method function.