Skip to main content

Section 2.2 Trees

Definition 2.2.1.

A graph is a tree if and only if it is connected and has no cycles.

Proof.

Given a tree with n vertices, the number of edges is n-1.

Let G be a tree with two vertices. This tree will have one edge connecting the two vertices. Add another vertex. To prevent the creation of a cycle, that new vertex may only be connected to one pre-existing point. Therefore, we only add one edge, for a total of two. Add another vertex. For the same reasons, we now have three edges. This way of adding vertices in the only option we have, since otherwise we risk creating a cycle. In other words, every vertex in our graph needs an edge except for some initial vertex, which shares an edge with an adjacent vertex. Hence, the number of edges in any tree is n-1.

Definition 2.2.3.

A vertex of a tree is a leaf if and only if it has degree one.

Proof.

Let \(v_0\) be a vertex in graph G. We know \(v_0\) exists since graphs cannot be empty.

If \(v_0\) has degree one, we are done. If not, \(v_0\) has degree two or higher. Let \(v_1\) be a vertex adjacent to \(v_0\text{.}\)

If \(v_1\) has degree one, we are done. If not, \(v_1\) has degree two or higher. Let \(v_2\) be a vertex adjacent to \(v_1\text{.}\)

If \(v_2\) has degree one, we are done. If not, \(v_2\) has degree two or higher. Let \(v_3\) be a vertex adjacent to \(v_2\text{.}\)

We can continue this process, but only to a finite set of vertices, since by definition a tree is a finite set containing no cycles. Thus, whatever vertex \(v_n\) we end up at, will have degree one, and hence the theorem holds true.

Problem 2.2.5.

Can you strengthen the result above?

Solution.

We will prove that every tree with at least 2 vertices has 2 or more leaves.

Direct proof: Suppose a graph A is a path with vertices \(v_1, v_2, v_3, \ldots, v_n\text{.}\) Let \(n > 1\text{.}\) Then the edges of A are \(v_1v_2, v_2v_3, v_3v_4, \ldots , v_{n-1}v_n\text{,}\) and the edge \(v_n v_1\) does not exist by the definition of a path.

Now suppose graph G is a tree that is identical to path A but with an additional m vertices. Let m be equal to or greater than 0. By the definition of a tree, G is connected and contains no cycles. There are three ways to add the additional m vertices to tree G:

First, we add a vertex to \(v_1\) or \(v_n\text{,}\) thus elongating the path. This vertex must be of degree one to avoid creating a cycle, thus keeping the number of leaves the same.

Secondly, we add a vertex to \(v_2, v_3, v_4, \ldots, or v_{n-1}\text{.}\) This vertex must be of degree one to avoid creating a cycle, thus adding a leaf to G.

If we do not add any points to A (if m = 0), then there are 2 leaves — \(v_1\) and \(v_n\text{.}\)

In all cases, the number of leaves on G remains at 2 or increases, thus every tree has 2 or more leaves.

Proof.

Let G be a connected graph with a cycle.

Let X, Y be two vertices in G.

I will prove directly that for any connected graph with a cycle, there exists some edge that can be removed without disconnecting the graph.

Since G has a cycle, let X and Y be vertices in the cycle.

In the cycle, a path exists from X to Y and another from Y to X. Such that the the paths don't reuse the vertices from each other.

So, at least X and Y have more than 1 path.

If we remove any edge in the cycle, a path still exists for X and Y. G remains connected.

Since there exists some edge that can be removed without disconnecting ther graph, the theorem holds.

Next we show it for any pair of vertices (not just on cycle)

Proof.

Proof by contradiction: Supose there is a graph G which has at least two nodes, and does not have one unique path between two nodes. Also supose G is not a tree. We will refur to these two nodes as n and m. The nodes must have either 0 or at least 2 unique paths between each other. If the nodes have 0 paths between each other than the graph is not connected. By definition a tree is connected. Therefor G is not a tree. The only other way G can exist is if it contains at least two paths between n and m. Lets name two of the paths J and L Now lets describe a new path W following these steps. (Note as J and L are unique, thus contain at least one different edge) Start at n=0 Step 1: look at the nth node from each path, if they are the same increment n and go to step 1. Step 2: Wdd the nth edge of J to the left hand side of W, and the nth node of L to the righthand side of W. Step 3: If W is not a cycle, increment n and go to step 1. We are essentially traversing the two paths, and creating a new path containing from where they diverge to where they converge. Because J and L both are paths from n to m, they must converge. If J and L did not diverge they would not be distinct. Thus they must diverge. W is now a cycle. Because G contains a cycle, it is not a tree. Given all posibilities of G contradict, we can conclude: A graph with atleast two nodes is a tree iff there exists only one unique path between any two nodes.

Proof.

Let G be a graph of n vertices. Let's find a subgraph of G that is a tree that uses all n vertices. By definition, a tree is connected, and a tree of n vertices has n - 1 edges. Our subgraph must have n - 1 edges. If there are less than n - 1 edges, the graph is disconnected. If the graph has more than n - 1 edges, there is a cycle in our subgraph, which we are avoiding. Thus a tree is an edge-minimal connected graph on n vertices.