Skip to main content

MA 415G course notes

Section 3.3 Trees

The simplest connected graphs are the connected graphs that have no cycles. There are many different descriptions of such graphs, meaning that there are many ways to classify this family of graphs.

Definition 3.3.1.

A graph is acyclic if it has no cycles. A graph on \(n\) vertices that is connected and acyclic is called a tree.

Checkpoint 3.3.2.

Checkpoint 3.3.6.

Determining whether or not a graph is a tree is not always easy. For example, the following graph is given both visually and as a list of edges. Is the following graph a tree? How might you verify that your answer is correct? Discuss with your group.
Figure 3.3.7. Graph 4.
Edges in this graph: (0, 32), (1, 6), (1, 38), (2, 36), (3, 25), (4, 23), (4, 28), (5, 11), (5, 27), (5, 14), (7, 26), (7, 14), (8, 19), (8, 23), (8, 26), (9, 18), (10, 28), (12, 18), (13, 39), (15, 38), (15, 31), (16, 35), (16, 30), (17, 25), (18, 30), (19, 21), (19, 24), (20, 27), (21, 32), (22, 37), (25, 29), (26, 38), (26, 31), (27, 34), (27, 35), (27, 29), (29, 36), (29, 37), (31, 39), (32, 36), (33, 39)
The following theorem lists multiple alternative characterizations of (finite) trees.
What this theorem says is that \(G\) is a tree if it has any two of the properties of being connected, acyclic, or having \(n-1\) edges when it has \(n\) vertices.

Checkpoint 3.3.9.

In order to prove TheoremΒ 3.3.8, we will need some preliminary definitions and lemmas.

Definition 3.3.11.

Given a graph \(G\) and a vertex \(v\in V(G)\text{,}\) the connected component of \(G\) containing \(v\) is the set of all vertices that are connected to \(v\) by a path in \(G\text{.}\) The set of connected components partitions \(V\text{.}\)

Checkpoint 3.3.12.

Identify the connected components in the following graph.
Figure 3.3.13. A graph with multiple connected components.

Proof.

There are two cases to consider. Suppose we add a new edge \(e=\{x,y\}\) to \(G\text{.}\) If \(x\) and \(y\) are already in the same connected component, then adding \(e\) does not change any components. However, if \(x\) and \(y\) are in different components, then adding \(e\) will merge the components containing \(x\) and \(y\) into a single component, since now any vertex connected by a path to \(x\) is also connected by a path to \(y\text{.}\) Thus, this will reduce the number of connected components by one.

Checkpoint 3.3.15.

Discuss the proof of LemmaΒ 3.3.14. Does it make sense? Why or why not? Create a small example to verify that your understanding is correct.

Proof.

Suppose \(G\) is a graph on vertex set \([n]\text{.}\) We construct \(G\) by starting with the empty graph, i.e., the graph on \([n]\) with no edges, and adding the edges of \(G\) one at a time. Note that in this case, each individual vertex forms a connected component, hence the empty graph has \(n\) components. In order for \(G\) to be connected, every element in \([n]\) must be connected to every other element by a path. Thus, in the process of adding edges one at a time to create \(G\text{,}\) we must merge \(n\) components into a single component. Each time we add an edge, either there are no components merged or the number of components reduces by one. In order to get from \(n\) components to one component, we must merge \(n-1\) times, which requires at least \(n-1\) edges be added.

Checkpoint 3.3.17.

Proof.

Suppose \(G\) is a connected graph and \(e=\{x,y\}\) is a new edge added to \(G\text{.}\) There exists a simple path in \(G\) from \(x\) to \(y\text{,}\) and connecting the endpoints of the path using \(e\) creates a cycle.

Checkpoint 3.3.19.

Proof of TheoremΒ 3.3.8.

We will use the following logical implications to prove the classification:
Figure 3.3.20. Logical implications to establish equivalence.
First, we will prove that if \(G\) is connected and acyclic then it also has \(n-1\) edges. Construct \(G\) by starting with the empty graph and adding one edge at a time. Each time we add an edge, if the edge bridges two different connected components, then it merges those components and does not introduce any new cycle. If an edge is added where both of the endpoints of the edge are in the same connected component, then by LemmaΒ 3.3.18 this introduces a cycle. However, \(G\) is acyclic, and therefore this cannot happen. Thus, every new edge added results in a merging of components and by the argument in LemmaΒ 3.3.16, this results in \(n-1\) edges.
Second, we will prove that if \(G\) is connected with \(n-1\) edges, then it is acyclic. Suppose that \(G\) does contain a cycle \(C\text{.}\) Then removing one of the edges in \(C\) will not disconnect \(G\text{,}\) since the endpoints of the edge are still connected by the remaining edges of \(C\text{.}\) However, this will result in a graph that is connected with \(n-2\) edges, which is impossible by LemmaΒ 3.3.16. Therefore, the original graph must be acyclic.
Finally, we will prove that if \(G\) is acyclic with \(n-1\) edges, then it is connected. We again construct \(G\) by starting with the empty graph and adding edges one at a time. Each time we add an edge, we must add an edge that results in the merging of two connected components, as otherwise LemmaΒ 3.3.18 implies that there is a cycle, which is not possible since \(G\) is acyclic. Therefore, we add \(n-1\) edges, and each of these edges results in the merging of two connected components. We begin with the empty graph, having \(n\) components, and thus the result is a graph with one component, which is the same as being connected.

Checkpoint 3.3.21.

There is a lovely corollary to this theorem and the degree sum theorem, which involves the idea of a leaf.

Definition 3.3.22.

A vertex of degree one in a graph is called a leaf.

Proof.

If \(G\) is a tree, it has \(n\) vertices and \(n-1\) edges. By the degree sum formula, TheoremΒ 3.2.9, we have that
\begin{equation*} \sum_{v\in [n]}\deg(v)=2(n-1)=2n-2 \, . \end{equation*}
Since \(G\) is a tree and is therefore connected, every vertex has degree at least one. Suppose that every vertex has degree at least two. Then
\begin{equation*} \sum_{v\in [n]}\deg(v)\geq 2n \gt 2n-2 \, . \end{equation*}
This would be a contradiction to the degree sum formula. So, at least two of the vertices must have degree one in the tree.
Observe that we can now solve the problem given in CheckpointΒ 3.3.6. There are \(41\) edges in that graph, but there are \(40\) vertices, and thus it is not a tree.