Problem
In “Counting Quartets”, we found an expression for , the number of quartets that can be inferred from an unrooted binary tree containing taxa.
If and are both unrooted binary trees on the same taxa, then we now let denote the number of inferred quartets that are common to both trees. The quartet distance between and , is the number of quartets that are only inferred from one of the trees. More precisely, .
Given: A list containing taxa () and two unrooted binary trees and on the given taxa. Both and are given in Newick format.
Return: The quartet distance .
在“计数四重奏”中,我们找到了,可以从包含以下内容的无根二叉树推断出的四重奏数 分类单元。
如果 和 都是无根的二叉树 分类,那么我们现在让 表示两棵树共有的推断四重奏数。该四重奏距离之间 和 , 是仅从其中一棵树推断出的四重奏的数量。更确切地说,。
给出:包含以下内容的列表 类别()和两个无根的二叉树 和 在给定的分类单元上。都 和 以Newick格式给出。
回程:四重奏距离
Sample Dataset
A B C D E (A,C,((B,D),E)); (C,(B,D),(A,E));
Sample Output
4