Close
Close window
TreeHeight - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

GraphTheory

TreeHeight

compute tree height

Calling Sequence

TreeHeight(T, r)

Parameters

T

-

tree

r

-

(optional) vertex

Description

TreeHeight returns the height of the tree T with the vertex r as root. In other words it returns the maximum distance of the vertices of T from r.

If the root r is omitted, TreeHeight returns the diameter of G.

Examples

>

withGraphTheory:

>

TGraph1,2,2,3,2,4,4,5

TGraph 1: an undirected graph with 5 vertices and 4 edges

(1)
>

TreeHeightT,1

3

(2)
>

TreeHeightT,4

2

(3)
>

DrawGraphT

Compatibility

The GraphTheory[TreeHeight] command was updated in Maple 2021.


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /