maxWidth | R Documentation |
This function calculates the maximum width maxWidth(T)
for a
given rooted tree T
. The tree must not necessarily be binary.
maxWidth(T)
is defined as
maxWidth(T)=\max_{i=0,...,h(T)} w(i)
in which h(T)
denotes the height of the tree T
and w(i)
denotes
the number of vertices in T
that have depth i
. The maximum width
is a balance index.
For details on the maximum width, see
also Chapter 23 in "Tree balance indices: a comprehensive survey" (https://doi.org/10.1007/978-3-031-39800-1_23).
maxWidth(tree)
tree |
A rooted tree in phylo format. |
maxWidth
returns the maximum width of a tree.
Sophie Kersting
C. Colijn and J. Gardy. Phylogenetic tree shapes resolve disease transmission patterns. Evolution, Medicine, and Public Health, 2014(1):96-108, 2014. ISSN 2050-6201. doi: 10.1093/emph/eou018.
tree <- ape::read.tree(text="((((,),),(,)),(((,),),(,)));")
maxWidth(tree)
tree <- ape::read.tree(text="((,),((((,),),),(,)));")
maxWidth(tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.