A facet F of a simplicial complex is called a leaf if either F is the only facet of Δ, or there exists a facet G∈Δ∖F such that
F∩(⋃H∈Δ∖FH)⊆G.A connected simplicial complex Δ is a tree if every nonempty subcollection (that is, a subcomplex of Δ whose facets are also facets of Δ) has a leaf.
In the language of simplicial complexes, simplicial trees are equivalent to totally balanced hypergraphs [see Theorem 3.2 of [Herzog, Jürgen; Hibi, Takayuki; Trung, Ngô Viêt; Zheng, Xinxian, Standard graded vertex cover algebras, cycles and leaves, Trans. Am. Math. Soc. 360, No. 12, 6231-6249 (2008)].
A hypergraph is called totally balanced if every cycle C in H of length at least 3 (not necessarily odd-length) has an edge containing at least three vertices of C. A cycle in a hypergraph is a sequence of distinct vertices and hyperedges (v1,e1,v2,e2,…,vk,ek,vk+1=v1), where every vertex vi is contained in both ei−1 and ei. The number k is called the length of the cycle.
My question. Is there any code in SageMath to generate all simplicial trees (equivalently, totally balanced hypergraphs) on n vertices, having as output the list of hyperedges, and ideally also some visual representation?