2. Trees - School of Mathematics and Statistics

Victoria University of Wellington
School of Mathematics and Statistics
MATH 361
Graph Theory
2. Trees
A tree is a connected graph with no cycles. A forest is a graph with no cycles.
Trees of one sort or another arise in a variety of situations. The directory
structure of a computer is a tree—trees arise in computer science in many other
ways. Statistics students will be familiar with decision trees. Some of you will
know about binary search trees. Gardeners know about oak trees. There are
family trees and more generally evolutionary trees.
If e is an edge of the graph G, then G\e denotes the graph obtained by removing
e and leaving all other edges and vertices intact.
An edge e of a connected graph G is an isthmus if G\e is disconnected.
Theorem 2.1. An edge e of the connected graph G is an isthmus if and only
if it belongs to no cycles.
Proof. Say e is an isthmus of G. Now G\e is not connected so there must exist
vertices w and z that are not connected by a walk in G\e. This shows that e
must lie on every walk from w to z in G. Now consider a walk that goes from w
to z via e. Assume that e lies on a cycle of G. Replace e in the walk by the rest
of the cycle. The result is a walk from w to z in G\e; a contradiction. Hence e
belongs to no cycle of G.
What about the converse? We need to show if e belongs to no cycles, then e is
an isthmus of G.
With Theorem 2.1 in hand we can now give a characterisation of trees.
Corollary 2.2. A graph is a tree if and only if it is connected and every edge
is an isthmus.
• What’s a characterisation? We use the word a lot in mathematics;
and it’s important. A characterisation is a theorem that tells us that
1
2
a mathematical object that is defined by one property is really just
the same as one that is defined by a different property. Thus, a tree is
defined to be a connected graph with no cycles. But the characterisation
of Corollary 8.2 tells us that we could just as well have defined a tree to
be a connected graph all of whose edges are isthmuses.
If you draw pictures, the next lemma may seem obvious. But how to prove it?
“Proof: obvious from pictures” doesn’t seem quite satisfactory to me.
Lemma 2.3. If e is an isthmus of the connected graph G, then G\e has exactly
two components.
Proof. Say e = uv. Assume that G\e has more than three components. Then
there is a component C of G\e such that neither u nor v is a vertex of C. A
path from a vertex c ∈ C to a vertex d ∈
/ C must use e as there is no such path
in G\e. This means that there must be a path from c to either u or v in G\e.
But no such path exists.
There is a bewildering diversity of trees with, say, 1000 vertices. Behind this
diversity they all have one thing in common — they all have exactly 999 edges
— and we can prove it!
By the way, how many non-isomorphic trees are there with 1000 vertices?
Theorem 2.4. A graph G with v vertices is a tree if and only if it is connected
and has v − 1 edges.
Proof. Assume that G is a tree. We use strong induction on the number of
vertices of G to prove that G has v − 1 edges.
If v = 1, the theorem certainly holds. (Why?) Now suppose v > 1 and that the
result holds for all trees with less than v vertices. Let e be an edge of G and
consider G\e. By Lemma 8.3, G\e has two components, and each of these are
trees with less than v vertices. Say the components of G\e are T1 and T2 having
v1 and v2 vertices respectively. Then v1 + v2 = v. By the induction assumption,
T1 has v1 − 1 edges and T2 has v2 − 1 edges. Now the edges of G are either
edges of T1 , edges of T2 , or e. Hence G has
(v1 − 1) + (v2 − 1) + 1 = v1 + v2 − 1 = v − 1
edges.
Conversely, suppose G is connected and is not a tree. Then G has an edge e
that is not an isthmus. Remove this edge and obtain a connected graph with
3
less edges that G. This process can be repeated until a connected graph all of
whose edges are isthmuses is obtained. By Corollary 2.2 this graph is a tree
and by the first part of the proof it will have v − 1 edges. Hence G has more
than v − 1 edges. Thus, if G is connected and is not a tree, then G does not
have v − 1 edges.
• Theorem 2.4 was another characterisation of trees.
• Note the proof technique of Theorem 8.4. We want to prove A holds if
and only if B holds. The standard way is to show that A implies B and
also to show that B implies A. In Theorem 8.4 we used the technique
of showing A implies B and not A implies not B. It is an easy exercise
in logic to show that this method also works.
Here is another useful fact about trees, but it is not a characterisation. Why?
Corollary 2.5. A tree with more than one vertex has at least two vertices of
degree one.
Proof. Choose a maximal path P = v1 , e1 , v2 , e2 , . . . , en−1 , vn in the tree T .
Assume that vn does not have degree 1. Then there is an edge en = vn w incident
with vn . Now w ∈ v1 , v2 , . . . vn as otherwise v1 , e1 , v2 , e2 , . . . , en−1 , vn , e, w is a
longer path. Say w = vi , Then vi , ei , . . . , en−1 , vn , e, vi = w is a cycle in G;
contradicting the fact that T is a tree. Therefore vn , and similarly v1 , have
degree 1, and the result follows.
Spanning Trees. A spanning tree of the graph G = (V, E) is a tree whose
vertex set is V and whose edge set is a subset of E. The proof of the converse
of Theorem 2.4 effectively proves
Theorem 2.6. Every connected graph has a spanning tree.
In practice finding spanning trees of graphs is very important. Essentially a
spanning tree represents a minimal way of getting a connected subgraph containing all the vertices. Typically one seeks a spanning tree of a certain type.
Computer science students may be familiar with depth-first search which constructs a spanning tree that is as path-like as possible, and breadth-first search
which constructs a spanning tree that is as fan-like as possible.
A graph may have many different spanning trees. How many spanning trees
does Kn have?
4
Rooted Trees: In many applications, trees come with a special vertex, usually
called the root. The root typically represents some sort of starting place. In a
family tree, the root would be the original ancestor. In a unix computer system
to get to the root of the directory structure you have to log in as root. I’m really
only mentioning rooted trees here to prevent confusion. In other contexts trees
are sometimes presented as if they are always rooted and students who have
been exposed to this sometimes develop the expectation that all trees must be
rooted. This is not true. None of the trees considered in this section have been
rooted.