BMC Bioinformatics
Research
Triplet supertree heuristics for the tree of life
Harris T Lin', J Gordon Burleigh2 and Oliver Eulenstein* 1
Address: 'Department of Computer Science, Iowa State University, Ames, IA, USA and 2National Evolutionary Synthesis Center, Durham, NC,
USA; University of Florida, Gainesville, FL, USA
Email: Harris T Lin htlin@cs.iastate.edu; J Gordon Burleigh gburleigh@ufl.edu; Oliver Eulenstein* oeulenst@cs.iastate.edu
* Corresponding author
from The Seventh Asia Pacific Bioinformatics Conference (APBC 2009)
Beijing, China. 1316 January 2009
Published: 30 January 2009
8MC Bioinformatics 2009, 10 O(Suppl I):S8 doi: 10.1186/1471210510SI S8
This article is available from: http://www.biomedcentral.com/14712105/10/S I/S8
2009 Lin et al; licensee BioMed Central Ltd.
This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0),
which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Abstract
Background: There is much interest in developing fast and accurate supertree methods to infer
the tree of life. Supertree methods combine smaller input trees with overlapping sets of taxa to
make a comprehensive phylogenetic tree that contains all of the taxa in the input trees. The
intrinsically hard triplet supertree problem takes a collection of input species trees and seeks a
species tree (supertree) that maximizes the number of triplet subtrees that it shares with the input
trees. However, the utility of this supertree problem has been limited by a lack of efficient and
effective heuristics.
Results: We introduce fast hillclimbing heuristics for the triplet supertree problem that perform
a stepwise search of the tree space, where each step is guided by an exact solution to an instance
of a local search problem. To realize time efficient heuristics we designed the first nontrivial
algorithms for two standard search problems, which greatly improve on the time complexity to the
best known (naive) solutions by a factor of n and n2 (the number of taxa in the supertree). These
algorithms enable largescale supertree analyses based on the triplet supertree problem that were
previously not possible. We implemented hillclimbing heuristics that are based on our new
algorithms, and in analyses of two published supertree data sets, we demonstrate that our new
heuristics outperform other standard supertree methods in maximizing the number of triplets
shared with the input trees.
Conclusion: With our new heuristics, the triplet supertree problem is now computationally more
tractable for largescale supertree analyses, and it provides a potentially more accurate alternative
to existing supertree methods.
Background
Assembling the tree of life, or the phylogeny of all species,
is one of the grand challenges in evolutionary biology.
Supertree methods take a collection of species trees with
overlapping, but not identical, sets of taxa and return a
"supertree" that contains all taxa found in the input trees
(e.g., [14]). Thus, supertrees provide a way to synthesize
small trees into a comprehensive phylogeny representing
Page 1 of 12
(page number not for citation purposes)
0
BioMed Central
BMC Bioinformatics 2009, 10(Suppl 1):S8
large sections of the tree of life. Recent supertree analyses
have produced the first complete familylevel phylogeny
of flowering plants [5], and the first phylogeny of nearly
all extant mammals [6]. Since the main objective of most
supertree analyses is to build extremely large phylogenetic
trees by solving intrinsically hard computational prob
lems, the design of efficient and effective heuristics is a
critically important part of developing any useful super
tree method.
Ideal supertree methods must combine speed and accu
racy. By far the most commonly used supertree method is
matrix representation with parsimony (MRP; [7,8]). MRP
converts a collection of input trees into a binary character
matrix, and then performs a parsimony analysis on a
matrix representation of the input trees. Thus, MRP anal
yses can use efficient parsimony heuristics implemented
in programs such as PAUP* [9] and TNT [10], making
largescale MRP supertree analyses computationally more
tractable. However, the accuracy and performance of MRP
are frequently criticized. For example, there is evidence of
input tree size and shape biases [11,12], the results can
vary depending on the method of matrix representation
[ 111, and the accuracy of the MRP supertrees are not nec
essarily correlated with the parsimony score [13]. There
fore, there is a need to develop alternate methods that
share the advantages of MRP but produce more accurate
supertrees.
Since we rarely know the evolutionary history of a group
of organisms with certainty, it is usually impossible to
assess the accuracy of a supertree based on its similarity to
the true species phylogeny. A more practical way to define
the accuracy of a supertree is based on the overall similar
ity of the supertree to the collection of input trees. There
are numerous ways to measure the similarity between
input trees and the supertree. The intrinsically hard [14]
triplet supertree problem measures this similarity based
on the common shared triplets, or rooted, binary, 3taxon
trees that are the irreducible unit of phylogenetic informa
tion in rooted trees [14]. Specifically, the triplet supertree
problem seeks a supertree that shares the most triplets
with the input trees.
We introduce hillclimbing heuristics for the triplet super
tree problem that make it feasible for truly largescale phy
logenetic analyses. Hillclimbing heuristics have been
effectively applied to other intrinsically difficult supertree
problems [7,13,15]. They search the space of all possible
supertrees guided by a series of exact solutions to
instances of a local search problem. The local search prob
lem is to find an optimal phylogenetic tree that shares the
most number of triplets with the input trees in the neigh
borhood of a given tree. The neighborhood is the set of all
phylogenetic trees into which the given tree can be trans
http://www.biomedcentral.com/14712105/10/S1/S8
formed by applying a tree edit operation. A variety of dif
ferent tree edit operations have been proposed [16,17],
and two of them, rooted Subtree Pruning and Regrafting
(SPR) and Tree Bisection and Reconnection (TBR), have
shown much promise for phylogenetic studies [18,19].
However, algorithms for local search problems based on
SPR and TBR operations, especially on rooted trees, are
still in their infancy. To conduct largescale phylogenetic
analyses, there is much need for effective SPR and TBR
based local search problems that can be solved efficiently.
In this work we improve upon the best known (naive)
solutions for the SPR and TBR local search problems by a
factor of n and n2 (the number of taxa in the supertree)
respectively. This is especially desirable since standard
local search heuristics for the triplet supertree problem
typically involve solving several thousand instances of the
local search problem. We demonstrate the performance of
our new triplet heuristics in a comparative analysis with
other standard supertree methods.
Related work
Triplet supertree problem
The triplet supertree problem makes use of the fact that
every rooted tree can be equivalently represented by a set
of triplet trees [171. A triplet tree is a rooted fully binary
tree over three taxa. Thus, a tripletsimilarity measure can
be defined between two rooted trees that is the cardinality
of the intersection of their triplet presentations. This
measure can be extended to measure the similarity from a
collection of rooted input trees to a rooted supertree, by
summing up the tripletsimilarities for each input tree and
the supertree. The triplet supertree problem is to find a
supertree that maximizes the tripletsimilarity for a given
collection of input trees. Figure 1 illustrates the triplet
supertree problem.
Hillclimbing heuristics
We introduce hillclimbing heuristics to solve the triplet
supertree problem. Hillclimbing heuristics have been
successfully applied to several intrinsically complex super
tree problems. In these heuristics a tree graph is defined
for the given set of input trees and some, typically sym
metric, treeedit operation. The nodes in the tree graph are
the phylogenetic trees over the overall taxon set of the
input trees. An edge adjoins two nodes exactly if the cor
responding trees can be transformed into each other by
the tree edit operation. The cost of a node in the graph is
the measurement from the input trees to the tree repre
sented by the node under the particular supertree prob
lems optimization measurement. For the triplet supertree
problem, the cost of a node in the graph is the tripletsim
ilarity from the input trees to the tree represented by the
node. Given a starting node in the tree graph, the heuris
tic's task is to find a maximallength path of steepest
Page 2 of 12
(page number not for citation purposes)
BMC Bioinformatics 2009, 10(Suppl 1):S8
Input Triplet Number of Triplet
Profile Presentation Common Triplets Presentation
XA)
(AA
AA)
T, A
AA
A^
A AA
AA
A AA
A.
Candidate
Supertree
A
Figure I
Triplet supertree problem. Given an input profile of n
species trees (TI,..., Tn), the triplet supertree problem is to
find a supertree that maximizes the tripletsimilarity score.
The score for a supertree is calculated by first decomposing
trees into their corresponding triplet presentations, then
counting the number of common triplets between the super
tree and each input tree (S,,..., Sn), and finally aggregating all
the counts. The tripletsimilarity score for the candidate
supertree T with respect to the input profile is therefore
i=1 S
ascent in the cost of its nodes and to return the last node
on such a path. This path is found by solving the local
search problem for every node along the path. The local
search problem is to find a node with the maximum cost
in the neighborhood (all adjacent nodes) of a given node.
The neighborhood searched depends on the edit opera
tion. Edit operations of interest are SPR and TBR [ 17]. We
defer the definition of these operations to the next section.
The best known run times (naive solutions) for the SPR
and TBR based local search problems under the triplet
similarity measurement are 0(kn4) and O(kn5) respec
tively, where k is the number of input gene trees and n is
the number of taxa present in the input gene trees.
Contribution of the manuscript
We introduce algorithms that solve the local SPR and TBR
based search problems for our triplet supertree heuristics
in times 0(n3) and 0(n3) respectively, with an initial pre
processing time of 0(kn3). These algorithms allow true
largescale phylogenetic analyses using hillclimbing heu
ristics for the triplet supertree problem. Finally, we dem
onstrate the performance of our SPR and TBR based hill
climbing heuristics in comparative studies on two large
published data sets.
http://www.biomedcentral.com/14712105/10/S1/S8
Methods
Initially, for each possible triplet over the set of all taxa we
count and store the frequency displayed by all the input
trees in 0(kn3) time. Then, for each local search problem,
we use dynamic programming to efficiently preprocess
necessary triplet counts in O(n3) time. By exploiting the
structural properties of SPR and TBR related to tripletsim
ilarity, we are able to use these triplet counts to compute
the differences in tripletsimilarity for all SPR and TBR
neighborhoods, each in O(n3) time.
Basic definitions, notations, and preliminaries
In this section we introduce basic definitions and nota
tions and then define preliminaries required for this work.
For brevity the proofs of Lemmas 26 are omitted, but
available on request.
Basic definitions and notations
A tree T is a connected graph with no cycles, consisting of
a node set V(T) and an edge set E(T). T is rooted if it has
exactly one distinguished node called the root which we
denote by Ro(T).
Let T be a rooted tree. We define
on V(T) where x
Ro(T) and x. If x
ancestor of x. We also define x
case we call x a proper descendant of y, and y a proper ancestor
of x.
The set of minima under
ments are called leaves. If {x, y} e E(T) and x
call y the parent ofx denoted by PaT(x) and we call x a child
of y. The set of all children of y is denoted by ChA(y). If two
nodes in T have the same parent, they are called siblings.
The least common ancestor of a nonempty subset L c V(T),
denoted as lcaT(L), is the unique smallest upper bound of
L under
Ife e E(T), we define Tie to be the tree obtained from Tby
identifying the ends of e and then deleting e. Tie is said to
be obtained from Tby contracting e. If v is a vertex of T with
degree one or two, and e is an edge incident with v, the tree
T/e is said to be obtained from T by suppressing v.
The restricted subtree of T induced by a nonempty subset L
c V(T), denoted as TL, is the tree induced by L where all
internal nodes with degree two are suppressed, with the
exception of the root node. The subtree of T rooted at node
y e V(T), denoted as TY, is the restricted subtree induced
by {x e V(T): x
T is fully binary if every node has either zero or two chil
dren. Throughout this paper, the term tree refers to a
rooted fully binary tree.
Page 3 of 12
(page number not for citation purposes)
BMC Bioinformatics 2009, 10(Suppl 1):S8
The triplet supertree problem
We now introduce necessary definitions to state the triplet
supertree problem. A triplet is a rooted binary tree with
three leaves. A triplet T with leaves a, b, and c is denoted
abIc if lca( {a, b}) is a proper descendant of the root. Note
that we do not distinguish between abIc and baIc. The set
of all triplets of a tree T, denoted as Tr(T), is {abIc : TI {a,
b, c} = abIc}. The set of common triplets between two trees
T1 and T2, denoted as S(T1, T2), is Tr(T1) n Tr(T2). A profile
P is a tuple of trees (T1,..., TJ, we extend the definition of
leaf set to profiles as Le(P) = U1 I Le(T,). Let P be a pro
file, we call T* a supertree of P if Le(T*) = Le(P).
We are now ready to define the triplet supertree problem
(Fig. 1).
Definition 1 (Triplet similarity). Given a profile P = (T1,...,
TJ) and a supertree T* of P, we define the tripletsimilarity
score S(P, T) = II S(Ti, T*) I.
Problem 1 (The triplet supertree problem). Given a profile
P, find a supertree T* that maximizes S(P, T*). We call any
such T* a triplet supertree.
Theorem 1 ([14]). The triplet supertree problem is NPhard.
Local search problems
Here we first provide definitions for the reroot (RR), TBR,
and SPR edit operations and then formulate the related
local search problems. Figures 2 and 3 illustrate the RR
and TBR edit operations respectively.
Definition 2 (RR operation). Let T be a tree and x e V(T).
RRT(x) is defined to be the tree T if x = Ro(T). Otherwise,
RRT(x) is the tree that is obtained from T by (i) suppressing
Ro(T), and (ii) subdividing the edge {PaT(x), x} by a new root
node. We define the following extension:
RRT= u V(T) {RRT(x)}.
Let x
replacing T, with RR v (x).
Definition 3 (TBR operation). For technical reasons we first
define for a tree T the planted tree PI(T) that is the tree
obtained by adding an additional edge, called root edge, {r,
Ro(T)} to E(T).
Let T be a tree, e = (u, v) e E(T), and X, Y be the connected
components that are obtained by removing edge from T where
http://www.biomedcentral.com/14712105/10/S1/S8
v e X and u e Y. We define TBRT(v, x, y) for x e X and y e Y
to be the tree that is obtained from PI(T) by first removing edge
e, then replacing the component X by RRx(x), and then adjoin
ing a new edge f between x' = Ro(RRx(x)) and Y as follows:
1. Create a new node y' that subdivides the edge (Par(y), y).
2. Adjoin the edge f between nodes x' and y'.
3. Suppress the node u, and rename x' as v and y' as u.
4. Contract the root edge.
We say that the tree TBRT(v, x, y) is obtained from T by a tree
bisection and reconnection (TBR) operation that bisects the
tree T into the components X, Y and reconnects them above the
nodes x, y.
We define the following extensions for the TBR operation:
1. TBRT(v, x) = u, yTBRT(v, x, y)
2. TBRT(v) = u xTBRT(v, x)
3. TBR = U(u, v)E(T) TBRT(v)
An SPR operation for a tree T can be briefly described
through the following steps: (i) prune some subtree S
from T, (ii) add a root edge to the remaining tree T', (iii)
regraft S into an edge of the remaining tree T', (iv) contract
the root edge. For our purposes we define the SPR opera
tion as a special case of the TBR operation.
Definition 4 (SPR operation). Let T be a tree, e = (u, v) e
E(T), and X, Y be the connected components that are obtained
by removing edge e from T where v e X and u e Y We define
SPRT(v, y) for y e Y to be TBRT(v, v, y). We say that the tree
SPRT(v, y) is obtained from T by a subtree prune and regraft
(SPR) operation that prunes subtree Tv and regrafts it above
node y.
We define the following extensions of the SPR operation:
1. SPRr(v) = uyySPRr(v, y)
2. SPRT = U(u, v)cE(T) SPRT(v)
Problem 2 (TBR Scoring (TBRS)). Given a profile P and a
supertree T of P, find a tree T* e TBRT such that
S(P,T) = maxT'r TSBR(P,T')
Page 4 of 12
(page number not for citation purposes)
http://www.biomedcentral.com/14712105/10/S1/S8
4
b d g
h i b d g
(a)
h i d b g h i
(b)
Figure 2
Example of an RR operation. Depicted is an example of an RR operation where T' = RRr(d). The original tree T is shown in
(a). In (b), we first suppress the root node, and then introduce the new root node r above d. Finally we rearrange the tree so
that r is at root, as in (c).
Problem 3 (TBRRestricted Scoring (TBRRS)). Given a
profile P, a supertree T of P, and (u, v) e E(T), find a tree T*
e TBRT(v) such that S(P, T*) = maxT',BR S(P, T')
The problems SPR Scoring (SPRS) and SPRRestricted
Scoring (SPRRS) are defined analogously to the problems
TBRS and TBRRS respectively.
Further, we observe that to solve any of these four local
search problems, it is sufficient to find a tree within the
neighborhood that gives the maximum increase on S (P,
T), without calculating the value of each S (P, T) itself.
With this observation, it is useful to give the following def
inition.
Definition 5. Let P be a profile, T1 and T2 be two supertrees of
P, we define the score difference function, denoted as Ap(T1,
T2), to be S (P, T2) S (P, T).
Solving the SPRRS and SPRS problems
We first show how to solve the SPRRS problem. Extend
ing on this solution we introduce a new algorithm for the
SPRS problem.
Solving the SPRRS problem
Given a profile P, a supertree T of P, and (u, v) e E(T), we
compute Ap(T, T') for each T' e SPRT(v) by first pruning
and regrafting T, to Ro(T) and compute the score differ
ences for each "movedown" operation, then traverse T in
preorder to obtain the tree that gives the maximum score
difference. We first give a definition that helps us describe
a single "movedown".
Definition 6 (Immediate Triplet). Let T be a tree and v e
V(T), an immediate triplet induced by v, denoted as yz > <1
v, is a triplet yzv where there exists nodes a, b e V(T) such that
PaT(y) = PaT(z) = b and PaT(b) = PaT(v) = a.
Algorithm 1 Algorithm for the SPRRS problem
1: procedure SPRRS(P, T, (u, v))
Input: A profile P = (T1,..., TJ, a supertree T of P, and (u,
v) E E(T)
Output: T* e SPRT(v), and Ap(T, T*)
2: r < Ro(T)
3: T < SPRT(v, r)
4: Call MovedownAndCompute(P, T, v)
5: Traverse the tree T, in preorder to compute Ap( T, T')
for each T' e SPRT(v) using the values computed by Move
downAndCompute
6: T* < T' e SPRT(v) such that
Ap(T, T') = maxTSPRAp(T T)
Page 5 of 12
(page number not for citation purposes)
BMC Bioinformatics 2009, 10(Suppl 1):S8
http://www.biomedcentral.com/14712105/10/S1/S8
b d g h i b d g h i b h g
(a)
(b)
i d
(c)
Figure 3
Example of a TBR operation. Depicted is an example of a TBR operation where T' = TBRT(e, h, b). The original tree T is
shown in (a). In (b), we first remove the edge above e, that is we prune the subtree Te. Then we introduce a new node above h
which will be the new root of the pruned subtree. We also introduce a new node above b this is where we will reconnect
the subtree back to T. Finally we rearrange the tree and obtain the resulting tree F as in (c).
7: d < Ap( T, T*) Ap(T, T)
Input: A profile P = (T1,..., Tn), a supertree T of P
Output: T* e SPRT, and Ap(T, T*)
8: return (T*, d)
9: end procedure
10: procedure MOVEDOWNANDCOMPUTE(P, T, v)
Input: A profile P, a tree T, and v e V(T)
11: yz N <1 v  The immediate triplet induced by v in T
12: for all t e {y, z} do
13: T'P SPRT(v, t)
14: Compute and store Ap(T, T')
15: Call MovedownAndCompute(P, T', v)
16: end for
17: end procedure
It can be easily seen that Algorithm 1 is correctly solving
the SPRRS problem.
Solving the SPRS problem
Algorithm 2 Algorithm for the SPRS problem
1: procedure SPRS(P, T)
3: Store the value of SPRRS(P, T, (u, v))
4: end for
5: (T*, d) < the stored value of SPRRS calls that has the
maximum score increase by traversing the tree T in post
order
6: return (T*, d)
7: end procedure
Algorithm 2 gives a trivial extension of Algorithm 1 to
solve the SPRS problem.
Computing Ap(T, T') efficiently
Algorithm 1 assumed the computation of Ap(T, T') for
each movedown operation (Line 14). In this section we
show how to compute each Ap(T, T') efficiently by exploit
ing structural properties related to the tripletsimilarity.
We begin with some useful definitions.
Definition 7. Let A, B, C be pairwise mutual exclusive leaf
sets, we extend the triplet notation by AB C = {abIc : a e A, b
e B, c e C}. Further, let u, v, w be three nodes in a tree T hav
Page 6 of 12
(page number not for citation purposes)
2: for all (u, v) e E(T) do
BMC Bioinformatics 2009, 10(Suppl 1):S8
BMC Bioinformatics 2009, 10(Suppl 1):S8
ing no ancestral relationships, define uvITW = Le(T,) Le(Tj)I
Le(Tr)
Definition 8. The Boolean value of a statement (p, denoted
as (p, is 1 if (p is true, 0 otherwise.
Definition 9. Given a profile P = (T1,..., Tj) and distinct a, b,
c e Le(P), we define the triplet summation function by
sp(ab I c) = [ab ce Tr(T1)i
i=1
Let A, B, C c Le(P) be pairwise mutual exclusive leaf sets, we
extend the triplet summation function by
Op(AB  C) = Y
aeA.beB ceC
T p(ab I c)
Further, let u, v, w be three nodes in a tree T having no ances
tral relationships, we define
o, T(uv w) = op(uv Tw)
Lemma 1. Let T be a tree and yz > <1 v be an immediate tri
plet induced by a node v e V(T). If T' = SPRT(v, y), then
Tr(T') = (Tr(T)\yzTv) u vy\z (1)
(1) Proof. Let a, b, c e Le(T), we consider the following
cases:
1. If any one of a, b, c is not in the subtree Tpa(v), then
T'{a, b, c} = T {a, b, c}. Since both yz TV and vy z4 only
contain triplets formed under the subtree TpaT(V), TI {a, b,
c} and only this triplet resolution of {a, b, c} is in both
sides of equality.
2. Consider three subtrees T7, Ty, T,. If a, b, c are all in one
of the subtree, then since the subtrees T,, TY, T, do not
change by the SPR operation, T' {a, b, c} = TI {a, b, c}.
Since both yz\TV and vylz only contain triplets that are
formed by one leaf from each of T Ty, and T, subtrees,
T {a, b, c} and only this triplet resolution of {a, b, c} is in
both sides of equality.
3. Consider three subtrees TT, T, T. If two leaves of {a, b,
c} are in one subtree and the other leaf is in another sub
tree, and suppose WLOG that {a, b} are in one subtree,
then we observe that IcaT({a, b})
lcaT.({a, b}) < lcaT.({{a, b, c}), so T' {a, b, c} = T {a, b, c}
= ablc.
http://www.biomedcentral.com/14712105/10/S1/S8
Also, as in Case 2, both yzITV and vyz does not contain
triplet formed by {a, b, c}, so T {a, b, c} and only this tri
plet resolution of {a, b, c} is in both sides of equality.
4. If each of Tv, TY, and Tz contains exactly one leaf in {a,
b, c}, and suppose WLOG that a e Le(Tj), b e Le(TY), and
c e Le(Tz). Then T {a, b, c} = bca and T' {a, b, c} = abc.
Also we observe that bc~a e yzTV and ab~c e vyTz, there
fore RHS, and hence both sides contain abIc and only this
resolution of {a, b, c}.
Lemma 2. Given a profile P and a supertree T of P, let yz > <1
v be an immediate triplet induced by a node v e V(T). If T' =
SPRT(v, y), then
Ap (T, T') = p, T( Iz) op, T(yzv)
Lemma 3. Given a profile P and a supertree T of P, let distinct
v, b e V(T) such that v Tb, b Tv, and ChT(b) = {y, z}. If T =
SPRT(v, b) and T, = SPRT(v, y), then
Ap(Ti, T2) = Op, T(VY) op, T(Yzv)
Lemma 4. Given a profile P and a supertree T of P, let v, b e
V(T) such that Pa (PaT(v))
x
z}, and WLOG suppose y o F. If T1 = SPRT(v, b) and T2
SPRT(v, y), then
Ap(T, T2) = sp I vyX ) spfyx I v)]
xeC
Equations (3) and (4) provide computations for all SPR
RS neighborhoods (Line 14 of Algorithm 1). We now
show how to compute them efficiently.
Algorithm 3 Algorithm to compute triplet summation
function
1: procedure PREPROCESSTRIPLETSUM(P)
Input: A profile P = (T1,..., T.)
2: Initialize all values of uo to 0
3: for i = 1 to n do
4: for all u e V(T,) in postorder, u o Le(Ti) do
{v, w} I ChT(u)
6: for all {x, y} e Le(Tj), z e Le(Tw) do
7: Increment op(xyz)
Page 7 of 12
(page number not for citation purposes)
BMC Bioinformatics 2009, 10(Suppl 1):S8
8: end for
9: for all {x, y} e Le(Tj), z e Le(Tj) do
10: Increment up(xyz)
11: end for
12: end for
13: end for
14: end procedure
Given a profile P = (T1,..., Tj, we start by computing the
triplet summation function oup for all triplets, as shown by
Algorithm 3.
Algorithm 4 Algorithm to compute extended triplet sum
mation function
1: procedure PREPROCESSEXTENDEDTRIPLETSUM(P, T)
Input: A profile P = (T1,..., TJ, a supertree T of P
2: for all u e V(T) in postorder do
3: for all v e V(T) in postorder after u, lcaT({u, v}) 0
{u, v} do
4: for all w e V(T) in postorder after v, IcaT({u, v, w})
o {u, v, w} do
5: ifw e Le(T) then
6: ifv e Le(T) then
7: if u e Le(T) then
8: Up, (uvIw) qp(uv w)
9: UP, (uwIv) Uq(uw v)
10: UP, (vwu) * Uq(vwu)
11: else
12: {ul, u2} * ChT(u)
13: UP, T(uvIw) < o, T(ulVw) + Uo, T(u2vIw)
14: Up, T(uw v) U o (ulw ) + Up, T(u2w v)
15: Uo, T(vw u) < p, T(vwul) + p, T(vw uU2)
http://www.biomedcentral.com/14712105/10/S1/S8
16: end if
17: else
18: {vl, v2} + ChT(v)
19: Op, (uvw) + Op (uv Iw) + Op, (uv2 w)
20: oP, T(uw v) U op, T(uw v) + oP, T(uw v2)
21: P, T(vwIu) U ,p W(vlw u) + U,p T(v2w u)
22: end if
23: else
24: {wi, w2} + ChT(w)
25: op, T(uvIw) U op, (uv wl) + op, (uv w2)
26: o, T(uw v) p T(uw1 v) + oP, T(uw2v)
27: oP, (vwu) oTp(vw1 u) + o,p T(vw2 u)
28: end if
29: end for
30: end for
31: end for
32: end procedure
Next, we compute the extended triplet summation func
tion p, T, for all nodes u, v, w in T having no ancestral rela
tionships, as shown by Algorithm 4.
Algorithm 5 Algorithm to compute score difference func
tion
1: procedure PREPROCESSSCOREDIFFERENCE(P, T)
Input: A profile P = (T1,..., Tj, a supertree T of P
2: for all v e V(T) do
3: for all (b, y) e E(T): b TPaT(v) do
4: Let ChT(b) = {y, z}
5: Let Ti = SPRT(v, b), T2 = SPRT(v, y)
6: if v
Page 8 of 12
(page number not for citation purposes)
BMC Bioinformatics 2009, 10(Suppl 1):S8
7: for all p e V(T): v
