A tree can be described in terms of its leaves by specifying a leaf set and specifying the edges as partitions of the leaf set. This leaf centric description is particularly useful for phylogenetic trees.
The main constructor method is leafTree.
i1 : T = leafTree({a,b,c,d},{{a,b}}) o1 = {{a, b, c, d}, {set {a, b}, set {a}, set {b}, set {c}, set {d}}} o1 : LeafTree |
i2 : leaves T o2 = set {a, b, c, d} o2 : Set |
i3 : edges T o3 = {set {a, b}, set {a}, set {b}, set {c}, set {d}} o3 : List |
i4 : G = graph{{a,e},{b,e},{e,f},{c,f},{d,f}} o4 = Graph{a => {e} } b => {e} c => {f} d => {f} e => {a, b, f} f => {e, c, d} o4 : Graph |
i5 : leafTree G o5 = {{a, b, c, d}, {set {a, b}, set {a}, set {b}, set {c}, set {d}}} o5 : LeafTree |