Cayley's formula
Statement
The number of distinct labeled trees on the vertex set (for ) is .
Why is it true?
It answers a purely combinatorial question — how many different ways can distinguishable points be wired into a tree-shaped network — with a strikingly simple closed formula, and the encoding trick used to prove it (Prüfer sequences) turns "count the trees" into "count the sequences," a much easier problem.
Proof sketch
Fix the vertex set and, for , define the Prüfer sequence of a labeled tree : repeatedly find the leaf with the smallest label, write down the label of its unique neighbor, and delete that leaf; stop once vertices remain. This records labels (one per deletion, since we start with vertices and stop at ), so every labeled tree produces a sequence in .
There are exactly such sequences, since each of the positions is independently any of the labels. It remains to show this encoding is a bijection, so that labeled trees are in exact one-to-one correspondence with these sequences.
The key fact is that in the Prüfer sequence, label appears exactly times: every time one of 's neighbors is deleted as a leaf, is written down once, and itself is only ever deleted (contributing no writes) once all but one of its incident edges are gone. In particular, the labels that never appear in the sequence are exactly the original leaves. This lets us decode: given a sequence , repeatedly take the smallest label not currently used as a remaining sequence entry or already attached, join it by an edge to the first remaining sequence entry, remove that label from further consideration and remove that entry from the sequence; after all entries are consumed, join the labels left over by a final edge.
This decoding procedure exactly reverses the encoding step by step — at each stage it identifies the same smallest-label leaf and the same neighbor that the encoder would have recorded, by induction on the number of vertices remaining. So encoding and decoding are mutually inverse, giving a bijection between labeled trees on vertices and sequences in . Since there are such sequences, there are exactly labeled trees on vertices.
Topics that use this theorem
Step-by-step proofs
No step-by-step proof yet for this theorem.
References
- Reinhard Diestel (2017). Graph Theory
- David R. Karger, Philip N. Klein, Robert E. Tarjan (1995). A randomized linear-time algorithm to find minimum spanning trees · DOI:10.1145/201019.201022
- Aaron Schild (2017). An almost-linear time algorithm for uniform random spanning tree generation · arXiv:1711.06455 [preprint, not peer-reviewed]