Skip to main content
Logo image

Applied Discrete Structures

Section 10.1 What Is a Tree?

Subsection 10.1.1 Definition

What distinguishes trees from other types of connected graphs is the absence of certain paths called cycles. Recall that a path is a sequence of consecutive edges in a graph, and a circuit is a path that begins and ends at the same vertex.

Definition 10.1.1. Cycle.

A cycle is a circuit whose edge list contains no duplicates. It is customary to use Cn to denote a cycle with n edges.
The simplest example of a cycle in an undirected graph is a pair of vertices with two edges connecting them. Since trees are cycle-free, we can rule out all multigraphs having at least one pair of vertices connected with two or more edges from consideration as trees.
Trees can either be undirected or directed graphs. We will concentrate on the undirected variety in this chapter.

Definition 10.1.2. Tree.

An undirected graph is a tree if it is connected and contains no cycles.

Example 10.1.3. Some trees and non-trees.

Some trees and some non-trees
Figure 10.1.4. Some trees and some non-trees
  1. Graphs i, ii and iii in Figure 10.1.4 are all trees, while graphs iv, v, and vi are not trees.
  2. A K2 is a tree. However, if n3, a Kn is not a tree.
  3. In a loose sense, a botanical tree is a mathematical tree. There are usually no cycles in the branch structure of a botanical tree.
  4. The structures of some chemical compounds are modeled by a tree. For example, butane Figure 10.1.5 consists of four carbon atoms and ten hydrogen atoms, where an edge between two atoms represents a bond between them. A bond is a force that keeps two atoms together. The same set of atoms can be linked together in a different tree structure to give us the compound isobutane Figure 10.1.6. There are some compounds whose graphs are not trees. One example is benzene Figure 10.1.7.
Structure of Butane
Figure 10.1.5. Butane
Structure of Isobutane
Figure 10.1.6. Isobutane
Structure of Benzene
Figure 10.1.7. Benzene
One type of graph that is not a tree, but is closely related, is a forest.

Definition 10.1.8. Forest.

A forest is an undirected graph whose components are all trees.

Example 10.1.9. A forest.

The top half of Figure 10.1.4 can be viewed as a forest of three trees. Graph (vi) in this figure is also a forest.

Subsection 10.1.2 Conditions for a Graph to be a Tree

We will now examine several conditions that are equivalent to the one that defines a tree. The following theorem will be used as a tool in proving that the conditions are equivalent.

Proof.

Let p1=(e1,e2,,em) and p2=(f1,f2,,fn) be two different simple paths from va to vb. The first step we will take is to delete from p1 and p2 the initial edges that are identical. That is, if e1=f1, e2=f2,, ej=fj, and ej+1fj+1 delete the first j edges of both paths. Once this is done, both paths start at the same vertex, call it vc, and both still end at vb. Now we construct a cycle by starting at vc and following what is left of p1 until we first meet what is left of p2. If this first meeting occurs at vertex vd, then the remainder of the cycle is completed by following the portion of the reverse of p2 that starts at vd and ends at vc.

Proof.

Proof Strategy. Most of this theorem can be proven by proving the following chain of implications: (1)(2), (2)(3), (3)(4), and (4)(1). Once these implications have been demonstrated, the transitive closure of on 1,2,3,4 establishes the equivalence of the first four conditions. The proof that Statement 5 is equivalent to the first four can be done by induction, which we will leave to the reader.
(1)(2) (Indirect). Assume that G is a tree and that there exists a pair of vertices between which there is either no path or there are at least two distinct paths. Both of these possibilities contradict the premise that G is a tree. If no path exists, G is disconnected, and if two paths exist, a cycle can be obtained by Theorem 10.1.11.
(2)(3). We now use Statement 2 as a premise. Since each pair of vertices in V are connected by exactly one path, G is connected. Now if we select any edge e in E, it connects two vertices, v1 and v2. By (2), there is no simple path connecting v1 to v2 other than e. Therefore, no path at all can exist between v1 and v2 in (V,E{e}). Hence (V,E{e}) is disconnected.
(3)(4). Now we will assume that Statement 3 is true. We must show that G has no cycles and that adding an edge to G creates a cycle. We will use an indirect proof for this part. Since (4) is a conjunction, by DeMorgan’s Law its negation is a disjunction and we must consider two cases. First, suppose that G has a cycle. Then the deletion of any edge in the cycle keeps the graph connected, which contradicts (3). The second case is that the addition of an edge to G does not create a cycle. Then there are two distinct paths between the vertices that the new edge connects. By Lemma 10.1.10, a cycle can then be created, which is a contradiction.
(4)(1) Assume that G contains no cycles and that the addition of an edge creates a cycle. All that we need to prove to verify that G is a tree is that G is connected. If it is not connected, then select any two vertices that are not connected. If we add an edge to connect them, the fact that a cycle is created implies that a second path between the two vertices can be found which is in the original graph, which is a contradiction.
The usual definition of a directed tree is based on whether the associated undirected graph, which is created by “erasing” its directional arrows, is a tree. In Section 10.3 we will introduce the rooted tree, which is a special type of directed tree.

Exercises 10.1.3 Exercises

1.

Given the following vertex sets, draw all possible undirected trees that connect them.
  1. Va={right,left}
  2. Vb={+,,0}
  3. Vc={north,south,east,west}.
Answer.
The number of trees are: (a) 1, (b) 3, and (c) 16. The trees that connect Vc are:
Solution to exercise 10-1-1
Figure 10.1.12.

2.

Are all trees planar? If they are, can you explain why? If they are not, you should be able to find a nonplanar tree.

3.

Prove that if G is a simple undirected graph with no self-loops, then G is a tree if and only if G is connected and |E|=|V|1.
Hint.
Use induction on |E|.

4.

Suppose a forest consists of m trees and v vertices. What are the possible values of m and how many edges does the forest have?

5.

  1. Prove that any tree with at least two vertices has at least two vertices of degree 1.
  2. Prove that if a tree has n vertices, n4, and is not a path graph, Pn, then it has at least three vertices of degree 1.
Solution.
  1. Assume that (V,E) is a tree with |V|2, and all but possibly one vertex in V has degree two or more.
    2|E|=vVdeg(v)2|V|1|E||V|12|E||V|(V,E) is not a tree.
  2. The proof of this part is similar to part (a). If we assume that there are less than three vertices of degree three, we can still infer 2|E|2|V|1 using the fact that a non-chain tree has at least one vertex of degree three or more.

6.

Prove that the center of any tree can have no more than two vertices.

7.

Let (d1,d2,,dj,dj+1,,dn) be the degree sequence of a tree with dj3 and dj+1<3. Prove that the number of edges in the tree is
(✶)2+k=1j(dk2).
Solution.
We can prove this by induction for trees with n vertices, n2. The basis is clearly true since the only tree with two vertices is a K2. Now assume that (✶) is true for some n greater than or equal to two and consider a tree T with n+1 vertices. We proceed by removing a leaf from T. If there exists a leaf connected to a vertex of degree two, we select one such leaf. The resulting tree satisfies (✶) for the number of leaves; and adding the removed leaf neither changes the number of leaves nor the value of (✶). If all interior vertices have degree three or more remove any leaf from T. Again, the number of leaves in the resulting tree is (✶), but this time when we put the removed leaf back on the tree the number of leaves will increase by one, but the value of (✶) will increase by one to match it
You have attempted of activities on this page.