Tree rearrangement
{{Short description|Method in computational phylogenetics}}
Tree rearrangements are deterministic algorithms devoted to search for optimal phylogenetic tree structure. They can be applied to any set of data that are naturally arranged into a tree, but have most applications in computational phylogenetics, especially in maximum parsimony and maximum likelihood searches of phylogenetic trees, which seek to identify one among many possible trees that best explains the evolutionary history of a particular gene or species.
Basic tree rearrangements
Image:NNI.svg|Nearest neighbor interchange (NNI)
Image:SPR.svg|Subtree pruning and regrafting (SPR)
Image:TBR.svg|Tree bisection and reconnection (TBR)
The simplest tree-rearrangement, known as nearest-neighbor interchange, exchanges the connectivity of four subtrees within the main tree. Because there are three possible ways of connecting four subtrees,{{cite book
| last1=Felsenstein | first1=Joseph
| date=2004
| title=Inferring Phylogenies
| publisher=Sinauer Associates: Sunderland, MA
| isbn=9780878931774}} and one is the original connectivity, each interchange creates two new trees. Exhaustively searching the possible nearest-neighbors for each possible set of subtrees is the slowest but most optimizing way of performing this search. An alternative, more wide-ranging search, subtree pruning and regrafting (SPR), selects and removes a subtree from the main tree and reinserts it elsewhere on the main tree to create a new node. Finally, tree bisection and reconnection (TBR) detaches a subtree from the main tree at an interior node and then attempts all possible connections between edges of the two trees thus created. The increasing complexity of the tree rearrangement technique correlates with increasing computational time required for the search, although not necessarily with their performance.{{cite journal
| last1=Takahashi | first1=Kei
| last2=Nei | first2=Masatoshi
| title=Efficiencies of fast algorithms of phylogenetic inference under the criteria of maximum parsimony, minimum evolution, and maximum likelihood when a large number of sequences are used
| journal=Molecular Biology and Evolution
| volume=17
| issue=8
| date=August 2000
| pages=1251–1258
| doi=10.1093/oxfordjournals.molbev.a026408 | pmid=10908645
| doi-access=free}}
SPR can be further divided into uSPR: Unrooted SPR, rSPR: Rooted SPR. uSPR is applied to unrooted trees, and goes like this: break any edge. Join one end of the edge (selected arbitrarily) to any other edge in the tree. rSPR is applied to rooted trees*, and goes: break any edge except the edge leading to the root node. Join one end of the edge (specifically: the end of the edge that is FURTHEST from the root) and attach it to any other edge of the tree.{{cite journal
| last1=Bordewich | first1=Magnus
| last2=Semple | first2=Charles
| date=2005
| title=On the computational complexity of the rooted subtree prune and regraft distance
| journal=Annals of Combinatorics
| volume=8
| issue=4
| pages=409–423
| doi=10.1007/s00026-004-0229-z| s2cid=13002129
| url=https://dro.dur.ac.uk/613/
}}
The number of SPR{{cite journal
| last1=Whidden | first1=Chris
| last2=Beiko | first2=Robert G.
| last3=Zeh | first3=Norbert
| date=2016
| title=Fixed-parameter and approximation algorithms for maximum agreement forests of multifurcating trees
| journal=Algorithmica
| volume=74
| issue=3
| pages=1019–1054
| doi=10.1007/s00453-015-9983-z| arxiv=1305.0512
| s2cid=14297537
}} or TBR{{cite journal
| last1=Chen | first1=Jianer
| last2=Fan | first2=Jia-Hao
| last3=Sze | first3=Sing-Hoi
| date=2015
| title=Parameterized and approximation algorithms for maximum agreement forest in multifurcating trees
| journal=Theoretical Computer Science
| volume=562
| pages=496–512
| doi=10.1016/j.tcs.2014.10.031 | doi-access=free}} moves needed to get from one tree to another can be calculated by producing a Maximum Agreement Forest comprising (respectively) rooted or unrooted trees. This problem is NP hard but Fixed Parameter Tractable.
Tree fusion
The simplest type of tree fusion begins with two trees already identified as near-optimal; thus, they most likely have the majority of their nodes correct but may fail to resolve individual tree "leaves" properly; for example, the separation ((A,B),(C,D)) at a branch tip versus ((A,C),(B,D)) may be unresolved. Tree fusion swaps these two solutions between two otherwise near-optimal trees. Variants of the method use standard genetic algorithms with a defined objective function to swap high-scoring subtrees into main trees that are high-scoring overall.{{cite conference
| last1=Matsuda | first1=H.
| date=1996
| title=Protein phylogenetic inference using maximum likelihood with a genetic algorithm
| book-title=Pacific Symposium on Biocomputing 1996
| pages=512–523
| url=http://psb.stanford.edu/psb-online/proceedings/psb96/matsuda.pdf}}
Sectorial search
An alternative strategy is to detach part of the tree (which can be selected at random, or using a more strategic approach) and to perform TBR/SPR/NNI on this sub-tree. This optimized sub-tree can then be replaced on the main tree, hopefully improving the p-score.{{cite journal
| last1=Goloboff | first1=Pablo A.
| date=1999
| title=Analyzing Large Data Sets in Reasonable Times: Solutions for Composite Optima
| journal=Cladistics
| volume=15
| issue=4
| pages=415–428
| doi=10.1006/clad.1999.0122| pmid=34902941
| doi-access=free
}}