For , a Prüfer sequence is the encoding of a labelled tree on by a sequence
Repeated labels are allowed, and their order matters. To encode the tree, repeatedly remove its smallest-labelled leaf of a graph together with its incident edge, recording the label of its unique neighbour. Stop when two vertices remain; do not record their final edge. Removing a leaf of a graph leaves a tree, so the procedure makes exactly deletions. The choice of the smallest label makes the encoding deterministic. [ref]
For a concrete example, take six vertices and the set of edges
Initially label the vertices of vertex degree one. Remove and record its neighbour . Now has become a leaf of a graph, so remove and record . Next remove and record again; then remove and record . The final edge joins and . Thus the Prüfer sequence is
The deletion order is : removing a leaf of a graph can make its neighbour a leaf of a graph, so the eligible labels change as the tree shrinks.
Figure 1.
Encoding a six-vertex tree as the Prüfer sequence , then reconstructing its five edges
. Details.
To decode, keep a set of remaining labels, initially , and the remaining sequence, initially . While the sequence is nonempty, let be the smallest label in absent from the entire remaining sequence. Add an edge between and its first entry, then remove from and delete that first entry. Finally join the two labels left in . For the example:
Remaining sequence before the stepSmallest absent remaining labelEdge added
Empty; Final pair
The decoder always has a choice: if the remaining sequence has length , then has labels, so at least two of them are absent. Its first entry is still in , and differs from the chosen absent label. Every removed vertex attaches to a vertex that survives longer; following these attachments eventually reaches the final pair. Consequently the decoded graph is connected, and its edges make it a tree. In this construction, each occurrence of contributes an incident edge, and gets one more edge at its final attachment. Thus a remaining label is absent from the remaining sequence exactly when it labels a leaf of a graph. Encoding and decoding choose the same smallest label at each step and undo each other. This bijection proves Cayley's formula and explains why every freely chosen sequence is valid. [ref]
For there is exactly one empty sequence, and decoding adds the sole edge. For there is one tree, with vertex degree zero, but no length- Prüfer sequence. This is the exception both to the encoding convention and to the Prüfer degree formula.
Heinz Prüfer's 1918 paper "Neuer Beweis eines Satzes über Permutationen" appeared in Archiv der Mathematik und Physik, third series, volume 27, pages 142–144. It gives an encoding proof of the labelled tree count. The historical title means "New proof of a theorem on permutations"; the modern Prüfer sequence permits repeated labels, so it is not a permutation. [ref]

Articles by others on the same topic (NaN)

A Prüfer sequence is a way to encode a labeled tree with \( n \) vertices into a unique sequence of length \( n-2 \). This sequence provides a convenient method for representing trees and has applications in combinatorics and graph theory. Here’s how a Prüfer sequence works: 1. **Definition of a Tree**: A tree is a connected acyclic graph. For \( n \) vertices, a tree has exactly \( n-1 \) edges.