# Largest clustering information distance from a single NNI move
NNIMaxStep(8) # exactly two bits for any multiple of four
NNIMaxStep(6) # a little less otherwise
# Read off the maximizing local topology
m6 <- NNIMaxStep(6)
attr(m6, "subtrees")
attr(m6, "splits")
# Vectorized over leaf counts
NNIMaxStep(4:8)
# Computed for a given tree
library("TreeTools", quietly = TRUE)
NNIMaxStep(BalancedTree(19))
# Normalized
NNIMaxStep(12, normalize = TRUE)
Run the code above in your browser using DataLab