Skip to main content
Fig. 1 | Algorithms for Molecular Biology

Fig. 1

From: Median quartet tree search algorithms using optimal subtree prune and regraft

Fig. 1

An overview of the Q-SPR problem and the algorithm. A The query tree T, a set of reference trees \(\mathcal {R}\) (one shown), and a node \(p\) are given. An SPR move removes a subtree \({T}^\vee _{p}\) (\(P\) for short) and places it somewhere on the rest of the T, denoted by \({T}^\wedge _{p}\) (\(B\) for short). The Q-SPR problem seeks the placement above node u denoted by \({{T}^\wedge _{p}} \overset{u}{\circ }{T}^\vee _{p}\) (or \({B} \overset{u}{\circ }P\) for short) with the maximum number of shared unrooted quartets with the reference tree(s). B The recursive equation of Lemma 1: each of the counters corresponds to a certain type of solo quartet, color-coded here. Subtracted counters are to fix double-counting by other counters, as shown in Table 3. C Reference tree R is represented as an HDT. For each node u of \(B\), the leaves are colored such that they correspond to the sides of that node. Outside u is colored 0, the larger child is colored 1, and the rest are colored \(2\ldots d_u\). The recoloring of \(B\) results in the recoloring of the HDT nodes representing R. Note that query nodes are always colored \(-1\) and are never recolored. Overall, we need \(O(n \log (n))\) leaf recoloring during the top-down traversal of \(B\), each of which can require a \(O(\log (n))\) bottom-up traversal of the HDT

Back to article page