compute Pruefer code
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.
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)
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.
Download Help Document