Trees and Networks - Main Theorem
Cayley's Formula counts the number of labeled trees, revealing a surprising connection between trees and sequences.
The number of labeled trees on vertices is .
Proof via PrΓΌfer Sequences:
We establish a bijection between labeled trees on and sequences of length with elements from . There are such sequences.
Tree to Sequence (Encoding): Given a labeled tree on vertices:
- Find the leaf with smallest label, say
- Add the label of 's neighbor to the sequence
- Remove from the tree
- Repeat steps 1-3 until only 2 vertices remain
This produces a sequence of length called the PrΓΌfer sequence.
Sequence to Tree (Decoding): Given a sequence of elements from :
- Start with isolated vertices
- For to :
- Find smallest vertex not yet connected and not appearing in
- Connect to
- Connect the two remaining isolated vertices
This produces a unique tree.
Verification: We must show this is a bijection:
Well-defined: The encoding always produces a sequence (we can always find a leaf until 2 vertices remain). The decoding produces a connected acyclic graph (tree).
Inverse: Decoding(Encoding()) = and Encoding(Decoding()) = . This can be verified by tracking which vertices appear in the sequence (exactly those with degree , appearing deg times).
Bijection: Since encoding and decoding are inverses, we have a bijection.
Therefore, the number of labeled trees equals .
For : trees. They are:
- Edge set (path 1-2-3)
- Edge set (path 1-3-2)
- Edge set (path 2-1-3)
PrΓΌfer sequences: respectively.
For : trees (4 paths, 3 stars with each vertex as center, etc.).
Cayley's formula has numerous proofs: matrix-tree theorem (via determinants of Laplacian matrices), double counting using rooted trees, and probabilistic proofs using random walks. The formula extends to counting spanning trees of (complete graph), which also equals . For counting spanning trees of arbitrary graphs, the matrix-tree theorem provides a determinant formula. Kirchhoff's theorem generalizes this to electrical networks. The PrΓΌfer sequence also reveals that in a random labeled tree, vertex has degree following a binomial-like distribution.