You are on page 1of 6

Math 232 - Discrete Math Notes

9.1 Introduction to Trees

An acyclic graph is a graph with no cycles (also known as a forest). A tree is a connected
acyclic graph. Thus each component of a forest is tree, and any tree is a connected forest.

An equivalent condition for T to be a tree: If v, w are nodes of T then there is a unique


simple path from v to w. We will prove the equivalence later!

A rooted tree R is a tree with a vertex designated as special, a “root.” These trees are usually
drawn with their roots at the top and in such a way that the distance between the root an
vertex v designates the level of the vertex v and is vertically aligned on its level. The height
of a rooted tree is the eccentricity of the root.

Draw all non-isomorphic rooted trees on 4 vertices...

A center in a graph is a vertex with minimal eccentricity (radius). Show that a tree has
either one or two centers.

pf : No need to consider any trees on fewer than 3 vertices (WHY?). If the radius of the
tree on n ≥ 3 vertices is one, then there is a vertex with eccentricity 1, which means it is
connected to all other points. Claim: this center is unique. Assume otherwise, then another
point is connected to all other points as well, including the known center. Taking an edge
from this point to the known center, another edge out to a third distinct point, and finally
an edge back to this point gives a cycle. That contradicts that this graph is a tree.
Now let T be a tree with radius r > 1. Remove all vertices of degree 1 and their associated
edges. This creates a graph of radius r − 1, which we can assume by induction has either 1
or 2 centers, which would obviously be the centers T .

This suggests a simple algorithm for finding a center (and thus the radius): Delete nodes of
degree one and their edges until the center is achieved (that is, one or two points are left).
Try it on a few trees.

1
9.2 Terminology and Characterization of Trees

Let T be a rooted tree with root v0 . Suppose x, y, z are vertices in T and v0 , v1 , ..., vn is a
simple path in T .

For i = 0, 1, ..., n − 1:

We call vi a parent of vi+1 and vi+1 a child of vi . We call v0 , v1 , ..., vi ancestors of vi+1 , vi+2 , ..., vn
and vi+1 , vi+2 , ..., vn descendants of v1 , v2 , ..., vi .

If x, y are both children of z then we call x and y siblings. If x has no children, then x is
called a terminal vertex or a leaf. If x has children, then x is called an internal vertex or
branch vertex. The subtree rooted at x is the rooted tree given by x, all descendants of x,
and all edges involving x and the descendants.

Theorem Let T be a graph with n vertices. The following are equivalent:

(1) T is a connected and acyclic.


(2) T is a connected and has n − 1 edges.
(3) T is acyclic and has n − 1 edges.
(4) If v, w are nodes of T then there is a unique simple path from v to w.

pf : (1) ⇒ (2): Induct on n. Base case: n = 1 and zero edges are needed. Suppose a
connected acyclic graph on n vertices has n − 1 edges. Now consider a connected acyclic
graph T on n + 1 vertices. Choose a simple path of maximum length. This path necessarily
begins and ends on vertices of degree 1. (WHY??) Label either one of these endpoints by
v. Let Tv be the subgraph of T where v and its associated edge are removed. Then Tv is
connected and acyclic on n vertices. By the inductive hypothesis, Tv has n − 1 edges and
therefore T has n edges.

(2) ⇒ (3): Suppose T contains at least one cycle. We can remove edges (not vertices) from
some cycle(s) in T until arriving at T ∗ , a connected and acyclic subgraph on n vertices. So
(using our proof above) T ∗ has n − 1 edges and therefore T has at least n edges, which is a
contradiction.
(3) ⇒ (4): Note that the existence of a path between any two nodes is equivalent to T being
connected. Suppose T is not connected. Then let T1 , T2 ,...,Tk be the connected (acyclic)
components of T having respectively n1 , n2 , ..., nk vertices respectively. Then

n − 1 = (n1 − 1) + (n2 − 1) + · · · + (nk − 1) < (n1 + n2 + · · · + nk ) − 1 = n − 1,

which is a contradiction, so T is connected. So there exists a simple path between any two
nodes.

Now suppose that there are distinct paths P1 and P2 between v and w. Let b be the first
vertex in P1 after v that is not in P2 and let a precede b in P1 (a is also in P2 ). Let c be the
first vertex in P1 after a that is also in P2 . [DRAW!]

Then there is a cycle by going from a to c along P1 and then back along P2 . That is a
contradiction. So a path between any two nodes of T must be unique.

(4) ⇒ (1): Since there is a simple path between any pair of nodes, it follows that the graph
is connected. Suppose there is a cycle. Any cycle can be reduced to a simple cycle [see
proof on page 395 of text]. So assume v = v0 , v1 , ..., vn = v is a simple cycle. But then for
1 ≤ i < j ≤ n we have two distinct simple paths vi , vi+1 , ..., vj and vi , vi−1 , ...v0 , vn−1 , ..., vj
between vi and vj which is a contradiction, so T is acyclic.

¤
9.3 Spanning Trees

A tree T is a spanning tree of a graph G if T is a subgraph of G containing all vertices of G.

Theorem: A graph G has a spanning tree if and only if G is connected.

pf : Assume G has a spanning tree. Then this tree, which is also a subgraph, has a path
between any pair of vertices. All vertices of G are members of this subgraph, so there is a
path between any pair of vertices of G. Therefore G is connected.

Now suppose G is connected. If G is acyclic, we are done (as it is already its own spanning
tree). Suppose G has a cycle. Remove an edge from the cycle, but no vertices. The subgraph
is still connected. Continue this process until the remaining graph is acyclic. At this point
a spanning tree has been achieved.

Draw some random graphs and find spanning trees. By no means is a spanning tree for a
particular graph unique...
9.5 Binary Trees

A binary tree is a rooted tree where each vertex has zero, one or two children. If it has two
children, there is a left child and right child. If it has one child, that child is designated as
a left or right. A binary tree is full if all vertices have zero or two children

Consider, for example, single-elimination tournaments: each contestant is eliminated after


one loss. The graph of the tournament is a full binary tree, where the leaves are contestants.
The winner is represented by the root, all games going back from the level 1 championship
are represented by branch vertices. The height of the rooted tree represents the number of
rounds. Note that if the number of contestants is not a power of two, some teams receive a
bye.

Claim: n − 1 matches are played.

The number of matches equals the number of branch vertices. The number of contestants
equals the number of leaves (terminal vertices).

Let i be the number of branch vertices. In a full binary tree, each branch vertex has two
children, so the total number of vertices is 2i + 1 (the root is not a child). Taking away the
number of internal vertices gives i + 1 leaves (terminal vertices).

So n contestants gives n = i + 1 → i = n − 1 matches.

So 2n−1 possible outcomes to a single-elimination tournament with n teams.

After an initial “point-based” round, the Fifa World Cup consists of a 16-team single-
elimination tournament (ignoring the stupid 3rd place game). How many possible outcomes
are there? 215 .
9.8 Isomorphisms of Trees

You might also like