PrueferCode - Maple Help

Online Help

All Products    Maple    MapleSim


GraphTheory

  

PrueferCode

  

compute Pruefer code

 

Calling Sequence

Parameters

Description

Examples

Details

References

Compatibility

Calling Sequence

PrueferCode(L)

PrueferCode(T)

Parameters

T

-

tree

L

-

list, Vector, or Array of positive integers

Description

• 

PrueferCode(L) returns a tree which corresponds to the Prüfer encoding of L. The input L must be a list, Vector, or 1-D Array whose elements are positive integers less than or equal to numelems(L)+2.

• 

PrueferCode(T) returns a list of positive integers comprising the Prüfer encoding of a tree T.

Examples

withGraphTheory:

PrueferCode6,7,1,5,2,3,11,4,9,12

Graph 1: an undirected unweighted graph with 12 vertices and 11 edge(s)

(1)

TGraph10,1,8,2,3,2,7,4,6,5,6,6,7,6,8,7,9,8,10

TGraph 2: an undirected unweighted graph with 10 vertices and 9 edge(s)

(2)

PrueferCodeT

8,2,7,6,6,7,6,8

(3)

Details

• 

The Prüfer encoding of a tree was first used by Heinz Prüfer to prove Cayley's formula, which states that the number of trees on n labeled vertices is nn2.

References

  

"Prüfer sequence", Wikipedia. https://en.wikipedia.org/wiki/Pruefer_sequence

Compatibility

• 

The GraphTheory[PrueferCode] command was introduced in Maple 2021.

• 

For more information on Maple 2021 changes, see Updates in Maple 2021.

See Also

IsTree

Newick