GraphTheory
PrueferCode
compute Pruefer code
Calling Sequence
Parameters
Description
Examples
Details
References
Compatibility
PrueferCode(L)
PrueferCode(T)
T
-
tree
L
list, Vector, or Array of positive integers
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.
with⁡GraphTheory:
PrueferCode⁡6,7,1,5,2,3,11,4,9,12
Graph 1: an undirected graph with 12 vertices and 11 edge(s)
T ≔ Graph⁡10,1,8,2,3,2,7,4,6,5,6,6,7,6,8,7,9,8,10
T≔Graph 2: an undirected graph with 10 vertices and 9 edge(s)
PrueferCode⁡T
8,2,7,6,6,7,6,8
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 nn−2.
"Prüfer sequence", Wikipedia. https://en.wikipedia.org/wiki/Pruefer_sequence
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
Download Help Document
What kind of issue would you like to report? (Optional)