
# 5.5: Trees

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

Another useful special class of graphs:

Definition: acyclic tree

A connected graph $$G$$ is a tree if it is acyclic, that is, it has no cycles. More generally, an acyclic graph is called a forest.

Two small examples of trees are shown in figure 5.1.5. Note that the definition implies that no tree has a loop or multiple edges.

Theorem 5.5.2

Every tree $$T$$ is bipartite.

Note

Proof.
Since $$T$$ has no cycles, it is true that every cycle of $$T$$ has even length. By corollary 5.4.3, $$T$$ is bipartite.

$$\square$$

Definition: pendant vertex

A vertex of degree one is called a pendant vertex, and the edge incident to it is a pendant edge.

Theorem 5.5.4

Every tree on two or more vertices has at least one pendant vertex.

Proof

We prove the contrapositive. Suppose graph $$G$$ has no pendant vertices. Starting at any vertex $$v$$, follow a sequence of distinct edges until a vertex repeats; this is possible because the degree of every vertex is at least two, so upon arriving at a vertex for the first time it is always possible to leave the vertex on another edge. When a vertex repeats for the first time, we have discovered a cycle.

$$\square$$

This theorem often provides the key step in an induction proof, since removing a pendant vertex (and its pendant edge) leaves a smaller tree.

Theorem 5.5.5

A tree on $$n$$ vertices has exactly $$n-1$$ edges.

Proof

A tree on 1 vertex has 0 edges; this is the base case.

If $$T$$ is a tree on $$n\ge 2$$ vertices, it has a pendant vertex. Remove this vertex and its pendant edge to get a tree $$T'$$ on $$n-1$$ vertices. By the induction hypothesis, $$T'$$ has $$n-2$$ edges; thus $$T$$ has $$n-1$$ edges.

$$\square$$

Theorem 5.5.6

A tree with a vertex of degree $$k\ge 1$$ has at least $$k$$ pendant vertices. In particular, every tree on at least two vertices has at least two pendant vertices.

Proof

The case $$k=1$$ is obvious. Let $$T$$ be a tree with $$n$$ vertices, degree sequence $$\ds\{d_i\}_{i=1}^n$$, and a vertex of degree $$k\ge2$$, and let $$l$$ be the number of pendant vertices. Without loss of generality, $$1=d_1=d_2=\cdots=d_l$$ and $$d_{l+1}=k$$. Then $$2(n-1) = \sum_{i=1}^n d_i = l+k+\sum_{i=l+2}^n d_i \ge l+k+2(n-l-1).$$ This reduces to $$l\ge k$$, as desired.

If $$T$$ is a tree on two vertices, each of the vertices has degree 1. If $$T$$ has at least three vertices it must have a vertex of degree $$k\ge 2$$, since otherwise $$2(n-1)=\sum_{i=1}^n d_i = n$$, which implies $$n=2$$. Hence it has at least $$k\ge2$$ pendant vertices.

$$\square$$

Trees are quite useful in their own right, but also for the study of general graphs.

Definition: spanning trees

If $$G$$ is a connected graph on $$n$$ vertices, a spanning tree for $$G$$ is a subgraph of $$G$$ that is a tree on $$n$$ vertices.

Theorem 5.5.8

Every connected graph has a spanning tree.

Proof

By induction on the number of edges. If $$G$$ is connected and has zero edges, it is a single vertex, so $$G$$ is already a tree.

Now suppose $$G$$ has $$m\ge1$$ edges. If $$G$$ is a tree, it is its own spanning tree. Otherwise, $$G$$ contains a cycle; remove one edge of this cycle. The resulting graph $$G'$$ is still connected and has fewer edges, so it has a spanning tree; this is also a spanning tree for $$G$$.

$$\square$$

In general, spanning trees are not unique, that is, a graph may have many spanning trees. It is possible for some edges to be in every spanning tree even if there are multiple spanning trees. For example, any pendant edge must be in every spanning tree, as must any edge whose removal disconnects the graph (such an edge is called a bridge.)

Corollary 5.5.9

If $$G$$ is connected, it has at least $$n-1$$ edges; moreover, it has exactly $$n-1$$ edges if and only if it is a tree.

Proof

If $$G$$ is connected, it has a spanning tree, which has $$n-1$$ edges, all of which are edges of $$G$$.

If $$G$$ has $$n-1$$ edges, which must be the edges of its spanning tree, then $$G$$ is a tree.

$$\square$$

Theorem 5.5.10

\)G\) is a tree if and only if there is a unique path between any two vertices.

Proof

if: Since every two vertices are connected by a path, $$G$$ is connected. For a contradiction, suppose there is a cycle in $$G$$; then any two vertices on the cycle are connected by at least two distinct paths, a contradiction.

only if: If $$G$$ is a tree it is connected, so between any two vertices there is at least one path. For a contradiction, suppose there are two different paths from $$v$$ to $$w$$: $$v=v_1,v_2,\ldots,v_k=w \quad\hbox{and}\quad v=w_1,w_2,\ldots,w_l=w.$$ Let $$i$$ be the smallest integer such that $$v_i\not= w_i$$. Then let $$j$$ be the smallest integer greater than or equal to $$i$$ such that $$w_j=v_m$$ for some $$m$$, which must be at least $$i$$. (Since $$w_l=v_k$$, such an $$m$$ must exist.) Then $$v_{i-1},v_i,\ldots,v_m=w_j,w_{j-1},\ldots,w_{i-1}=v_{i-1}$$ is a cycle in $$G$$, a contradiction. See figure 5.5.1.

$$\square$$

Figure 5.5.1. Distinct paths imply the existence of a cycle.

Definition 5.5.11 A cutpoint in a connected graph $$G$$ is a vertex whose removal disconnects the graph.

Theorem 5.5.12

Every connected graph has a vertex that is not a cutpoint.

Proof

Remove a pendant vertex in a spanning tree for the graph.

$$\square$$