Darwin Help

Back to Index

IdenticalTrees

Function IdenticalTrees - test whether two trees have the same topology

Calling Sequence  IdenticalTrees(t1,t2)
Parameters
NameTypeDescription

t1 Tree 
t2 Tree 
Return Type  boolean
Synopsis IdenticalTrees tests whether the two given trees have the same topology (shape, relation between the leaves). The branch lengths are ignored. The trees must have leaves based on the same labels (first argument of Leaf). If the set of leaf labels differs, IdenticalTrees will return false.
Examples
> t1 := Tree(Tree(Leaf(a,2),1,Leaf(b,2)),0,Tree(Leaf(c,2),1,Leaf(d,2))):

> t2 := Tree(Tree(Leaf(a,2),1,Leaf(d,2)),0,Tree(Leaf(c,2),1,Leaf(b,2))):

> IdenticalTrees(t1,t2);
false


See also Leaf,   Tree