GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/TreeHeight

GraphTheory

  

TreeHeight

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

TreeHeight(T, r)

Parameters

T

-

a tree

r

-

a 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.

Examples

withGraphTheory:

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

TGraph 1: an undirected unweighted graph with 5 vertices and 4 edge(s)

(1)

TreeHeightT,1

3

(2)

TreeHeightT,4

2

(3)

DrawGraphT

See Also

Diameter

IsTree

SpanningTree