(optional) integer specifying the index of an edge to bisect/prune,
generated randomly if not specified. Alternatively, set to -1 to return a complete list
of all trees one step from the input tree.
parent
the first column of the edge matrix of a tree of class phylo, i.e. tree$edge[, 1]
child
the second column of the edge matrix of a tree of class phylo, i.e. tree$edge[, 2]
nTips
(optional) Number of tips.
Value
Returns a tree with class phylo (if returnAll = FALSE) or
a set of trees, with class multiPhylo (if returnAll = TRUE).
a list containing two elements, corresponding in turn to the rearranged parent and child parameters
a list containing two elements, corresponding in turn to the rearranged parent and child parameters
Functions
NNISwap: faster version that takes and returns parent and child parameters
RootedNNI: Perform NNI rearrangement, retaining position of root
RootedNNISwap: faster version that takes and returns parent and child parameters
Details
Performs a single iteration of the nearest-neighbour interchange algorithm.
Based on the corresponding phangorn function, but re-coded to improve speed.
Branch lengths are not supported.
References
The algorithm is summarized in
Felsenstein2004TreeSearch