Skip to main content
`Ctrl`+`K`

# skbio.tree.TreeNode.get_max_distance

TreeNode.get_max_distance()

  Return the max tip tip distance between any pair of tips.

  Returns:
    float

      The distance between the two most distant tips in the tree

    tuple of TreeNode

      The two most distant tips in the tree

  Raises:
    NoLengthError

      A NoLengthError will be thrown if a node without length is encountered

  See also

  `distance`
  `tip_tip_distances`
  `compare_tip_distances`

  Examples

      >>> from skbio import TreeNode
      >>> tree = TreeNode.read(["((a:1,b:2)c:3,(d:4,e:5)f:6)root;"])
      >>> dist, tips = tree.get_max_distance()
      >>> dist
      16.0
      >>> [n.name for n in tips]
      ['b', 'e']