4.1 Trees and Cayley’s theorem

Definition 4.1 (Trees ).

A graph with no cycles is called a forest. A connected forest is called a tree.

Exercise(A) 4.2.

Show that TFAE11 1 the following are equivalent for a graph G on n vertices.

  1. 1.

    G is a forest.

  2. 2.

    G has nβ0(G) edges.

Exercise 4.3.

Show that a graph G is a tree iff it is connected and has n1 edges.

Exercise 4.4.

Prove that there exists two vertices of degree 1 in a tree.

A labelled tree on [n] is a tree with vertex set [n]. Note that two labelled trees are equal only if their edge sets are equal. Thus isomorphic labelled trees are not necessarily equal for us. A spanning subgraph TG is said to be a spanning tree of G if T is a tree. Now it is easy to observe that a labelled tree on [n] is nothing but a spanning tree of Kn, the complete graph on [n].

Theorem 4.5 (Cayley’s formula ).

The number of labelled trees on n (or number of spanning trees of Kn) vertices is nn2

Proof via Prufer code (H. Prufer (1918)) ..

We shall construct a bijection

P:𝒮(n):={labelled trees on [n]}[n]n2.

Given a tree T on [n], we generate a sequence of trees T1,,Tn1 inductively as follows : Set T1=T. Given tree Ti on ni+1 vertices, let xi be the least labelled vertex of degree 1 and delete the edge incident on xi to obtain Ti+1. Denote by yi, the neighbour of xi. Observe that Tn1 is K2 and the process terminates at Tn when the tree has only one vertex. Now define P as

P(T)=(y1,,yn2).

Clearly P is a map from 𝒮(n) to [n]n2. We shall prove that it is a bijection by constructing P1 using induction. For n=2, P is trivially a bijection.

Some observations : (i) (y2,,yn2) is the Prufer code of T2. (ii) The degree
di:=j=1n2𝟏[yj=i]+1 (Try to prove this yourself by induction on n and then see the proof below). (iii) As a consequence we have that
xk:=min{i:i{x1,,xk1,yk,,yn2}} (again prove by induction on k using (ii)).

Suppose P is a bijection for n1 and let a=(a1,,an2)[n]n2. Now, let x=min{i:i(a1,,an2)}. Consider a=(a2,,an2) and by induction assumption a is the unique Prufer code of a tree T on [n]{x} since P is a bijection on [n]{x} by induction assumption. Define T:=T{x,a1}. Clearly, T is a tree as xV(T) and P(T)=a. If T′′ is a tree such that P(T′′)=a, then by the property (ii) of Prufer code, [n]{a1,,an2} is nothing but vertices of degree 1. By definition of x, it has the least label among such vertices and thus by construction (x1,y1)=(x,a1). Hence, P(T2′′)=a. By uniqueness of T, we have that T2′′=T and hence T′′=T. So P1 is well-defined on [n]n2 and P is 11 and onto. Thus P is a bijection.

Trivially (ii) holds for n=2. Assume that it holds for all trees on n1 vertices. Let T be a tree on [n]. By (i) and induction hypothesis, for ix1, we have that di(T2)=j=2n2𝟏[yj=i]+1. Since di(T2)=di(T) for all ix1,y1 and dx1(T)=1, dy1(T)=dy1(T2)+1, (ii) holds for T as well. ∎

Theorem 4.6 (Tree counting theorem ).

The number of labelled spanning trees on n vertices with degree sequence d1,,dn is (n2d11,dn1)=(n2)!i=1n(di1)! for n3.

Exercise 4.7.

Show that Cayley’s theorem follows as a corollary of the tree counting theorem.

Proof.

Denote by t(n;d1,,dn) the number of trees with degree sequence d1,,dn. The theorem holds for n=3. Assume that it is true for n1. Assume that dj=1.

Suppose j is joined to i in a tree T, then T(i,j) is a tree on [n]j with degree sequence d1,,di1,,dn. Thus we get that

t(n;d1,,dn)=i=1,ijnt(n1;d1,,di1,dj^,,dn),

where dj^ means dj is absent. Note that it is not possible that di=1 and for di=1, t(n1;d1,,di1,,dn)=0. Now check inductively that t(n;d1,,dn)=(n2d11,dn1).

Exercise(A) 4.8.

Give an alternative proof of tree counting theorem using Prufer codes.

Remark 4.9 (More proofs of tree counting theorem).

As with any such a fundamental result, there are multiple proofs.

  1. 1.

    We shall see a more powerful tree counting argument (known as Kirchoff’s matrix tree theorem) using matrix theory later.

  2. 2.

    There is another proof via bijection due to Joyal and a recent double counting argument due to Pitman.

All these five proofs can be found in [Aigner et al. 2010, Chapter 30].