Definition 1. Let Tn denote the set of labeled trees on vertex set [n]={1,2,,n}. Let Pn-2 denote the set of sequences (a1,a2,,an-2) where ai[n] for all i.

Theorem. There exists a bijection ϕ:TnPn-2.

Construction of ϕ (Tree to Prüfer sequence):

Given TTn, define ϕ(T)=(a1,a2,,an-2) by the following algorithm:

For i=1,2,,n-2:

  • Let vi be the leaf with minimum label in the current tree
  • Let ai be the unique neighbor of vi
  • Remove vi from the tree

Construction of ϕ-1 (Prüfer sequence to tree):

Given (a1,a2,,an-2)Pn-2, construct T as follows:

  • Define degree sequence: deg(v)=1+|{i:ai=v}| for all v[n]
  • For i=1,2,,n-2:
    • Let vi be the minimum element with deg(vi)=1
    • Add edge {vi,ai} to T
    • Set deg(vi)deg(vi)-1 and deg(ai)deg(ai)-1
  • Add edge between the two remaining vertices with degree 1

Proof of Bijectivity:

Lemma 1. The forward construction is well-defined.

Proof: At each step, exactly one leaf exists with minimum label since we have a tree with 2 vertices.

Lemma 2. The reverse construction produces a tree.

Proof: The degree sequence satisfies v=1ndeg(v)=2(n-1). At each step, exactly one vertex has degree 1 and is minimal. The final graph is connected with n-1 edges, hence is a tree.

Lemma 3. ϕ-1(ϕ(T))=T for all TTn.

Proof: Let (a1,,an-2)=ϕ(T). In the forward construction, vertex vi (the i-th leaf removed) has degree 1 in the initial tree. In the reverse construction with sequence (a1,,an-2), we have deg(vi)=1 initially, and vi is chosen at step i since it's the minimal vertex with degree 1. The edge {vi,ai} added in reverse construction matches the edge removed in forward construction.

Lemma 4. ϕ(ϕ-1(S))=S for all SPn-2.

Proof: Let T=ϕ-1(S) where S=(a1,,an-2). By construction of T, at step i of computing ϕ(T), the minimum leaf is vi (the vertex chosen at step i in reverse construction), and its neighbor is ai.

Corollary. ϕ establishes the bijection.

Since `ϕϕ-1=idPn-2` and `ϕ-1ϕ=idTn`, we have `ϕ:TnPn-2` is bijective.

Pub: 2026-01-02 21:09 UTCEdit: 2026-01-02 21:33 UTCOwner:User avatarhelgaViews: 159