# getGoodLeafIndex -- returns the index of an edge that is a good leaf

## Synopsis

• Usage:
n = getGoodLeafIndex(H)
• Inputs:
• H, ,
• Outputs:
• n, an integer, the index of an edge in H of a good leaf. Returns -1 if H does not have a good leaf.

## Description

A good leaf of hypergraph H is an edge L whose intersections with all other edges form a totally ordered set. It follows that L must have a free vertex. In the graph setting, a good leaf is an edge containing a vertex of degree one. The notion of a good leaf was introduced by X. Zheng in her Ph.D. thesis (2004).

 i1 : R = QQ[a..g]; i2 : H = hyperGraph {b*c*d*e, a*b*c*d, c*d*f, d*g, e*f*g}; i3 : getGoodLeaf(H) o3 = {a, b, c, d} o3 : List i4 : edges(H) o4 = {{a, b, c, d}, {b, c, d, e}, {c, d, f}, {d, g}, {e, f, g}} o4 : List i5 : getGoodLeafIndex(H) o5 = 0