Problem
Because a tree having nodes has edges (see “Completing a Tree”), removing a single edge from a tree will produce two smaller, disjoint trees. Recall from “Creating a Character Table” that for this reason, each edge of an unrooted binary tree corresponds to a split , where is a subset of the taxa.
A consistent character table is one whose characters' splits do not conflict with the edge splits of some unrooted binary tree on the taxa. More precisely, conflicts with if all four intersections , , , and are nonempty. As a simple example, consider the conflicting splits and .
More generally, given a consistent character table , an unrooted binary tree "models" if the edge splits of agree with the splits induced from the characters of .
Given: A list of species () and an -column character table in which the th column denotes the th species.
Return: An unrooted binary tree in Newick format that models .
因为一棵树有 节点有 边(请参阅“完成树”),从树中删除一条边将产生两棵较小的,不相交的树。回想一下“创建字符表”,由于这个原因,无根二叉树的每个边缘都对应一个拆分 ,在哪里 是一个子集的的类群。
一个一致的字符表是指其角色的分裂不要与一些无根二叉树的边缘分裂冲突 在 分类单元。更确切地说, 与...发生冲突 如果所有四个路口 , , 和 是非空的。作为一个简单的示例,请考虑冲突的拆分 和 。
更普遍地说,给定一致的字符表 ,无根的二叉树 “楷模” 如果边缘裂开 从诱发劈叉同意字符的。
给出:清单 种类() 和 列字符表 在其中 第列表示 th种。
返回值:以Newick格式建模的无根二叉树。
Sample Dataset
cat dog elephant mouse rabbit rat 011101 001101 001100
Sample Output
(dog,(cat,rabbit),(rat,(elephant,mouse)));