Вы находитесь на странице: 1из 5

MATH 1130 1 Discrete Structures

Chapter V Trees

Terminology and Characterizations of Trees

Trees
A tree is a connected graph with no cycles.

Example

A tree

Theorem Let T is a connected graph. Then T is a tree if and only if all edges of T are bridges.

Proof Let T be a tree. Suppose there is an edge xy E (T ) is not a bridge. Then T xy should
be connected and there is a simple path P in T xy between x and y. Hence, P + xy is a
cycle in T. This contradicts that T is a tree.
Conversely, suppose T has a cycle C, and x and y are two adjacent vertices in C. Then x and
y are connected by the path C xy in T. Hence, xy is not a bridge.

Theorem A tree with n vertices has n 1 edges.

Proof The theorem can be shown by induction on the number of vertices n of the tree T. If n = 1 ,
T is a null graph and has no edges. Consider n = k + 1 , for any edge e of T, T should be
broken into two separated trees, T1 and T2 , by removing e. T1 and T2 should have less

vertices than T does, and V (T1 ) + V (T2 ) = V (T ) = k + 1 .

By the induction hypothesis for T1 and T2 , E (T1 ) = V (T1 ) 1 and E (T2 ) = V (T2 ) 1 .

Thus, E (T ) = E (T1 ) + E (T2 ) + 1 = (V (T1 ) 1) + (V (T2 ) 1) + 1 = V (T ) 1 = k .

Theorem A graph is a tree if and only if there is a unique simple path between any two of its
vertices.

Reference: K.H. Rosen, Discrete Mathematics and Its Applications, 5th Edition, McGraw-Hill, 2003. Daricks Chan
MATH 1130 2 Discrete Structures

Proof If T is a tree, T should be connected and there is a simple path between any two its vertices.
We should show that the simple path connecting any two vertices is unique. Suppose, to the
contrary, that there two simple paths P1 and P2 from a vertex u to another vertex v of T.
Without loss of generality, there should be an edge e = xy in P1 and not in P2 . Let
P1 = uu1u 2 Ku m xyv1v2 K vn v . Clearly, in T xy , u and x are connected by uu1u 2 Ku m x , y
and v by yv1v2 K vn v , and u and v by P2 . Thus, x and y are connected vertices and they
should be connected by a simple path P3 in T xy . Hence, P3 + xy is a cycle in T.
This is a contradiction to the assumption that T is a tree. Conversely, if there is a unique
simple path between any two vertices of T, T is connected. And, for any vertices u and v in
T, u and v will become disconnected when any edge in the unique path of u and v is removed.
This implies that no any two vertices of T are in a cycle. Hence, T has no cycles.

Binary Trees

Rooted Trees
A rooted tree is a tree in which one vertex has been designated as the root and every edge is directed
away from the root. Vertices of degree one are called leaves; other vertices (including the root) are
called internal vertices. The level of a vertex in a rooted tree is the length of the unique path from the
root to this vertex. The height of a rooted tree is the maximum of levels of vertices.

Example Vertices in level 2 The root in level 0


Vertices in level 1

A rooted tree of height 2


An internal vertex

Leaves

m-ary Trees
A rooted tree is called an m-ary tree if every internal vertex has no more than m children. The tree
is called a full m-ary tree if every internal vertex has exactly m children. An m-ary tree with m = 2
is called a binary tree.

Example

A full binary tree

Reference: K.H. Rosen, Discrete Mathematics and Its Applications, 5th Edition, McGraw-Hill, 2003. Daricks Chan
MATH 1130 3 Discrete Structures

Theorem A full m-ary tree with i internal vertices contains n = mi + 1 vertices.

Proof Since each internal vertex of a full m-ary tree has m children, there should be mi vertices of
the tree except the root. The total number of a full m-ary tree is mi + 1 .

Corollary There are (m 1)i + 1 leaves in a full m-ary tree.

Proof The number of leaves in a full m-ary tree is equal to the total number of vertices minus the
number of internal vertices; hence there are mi + 1 i = (m 1)i + 1 leaves.

Remark: There are 2i + 1 vertices in a full binary tree, and i + 1 of them are leaves.

Theorem There are at most m h leaves in a m-ary tree of height h.

Proof The number of leaves in a full m-ary tree is equal to the total number of vertices minus the
number of internal vertices; i.e. mi + 1 i = (m 1)i + 1 . It is clear that the number of leaves
increases with the number of internal vertices in a full m-ary tree. As no vertices in level h
m 1
h
are internal vertices, there are at most 1 + m + m 2 + L + m h 1 = internal vertices in a
m 1
mh 1
full m-ary tree of height h. Then the greatest number of leaves is (m 1) +1 = mh .
m 1

Representing Circuits with Binary Trees

Example

(( p q ) (p r )) p p

p r

q p

Reference: K.H. Rosen, Discrete Mathematics and Its Applications, 5th Edition, McGraw-Hill, 2003. Daricks Chan
MATH 1130 4 Discrete Structures

Spanning Trees and Minimal Spanning Trees

Spanning Tree
Let G be a simple graph. A spanning tree of G is a subgraph of G that is a tree containing all vertices
of G.

Example

A spanning tree of a graph

Theorem A simple graph is connected if and only if it has a spanning tree.

Proof If G is a simple graph and it has a spanning tree T, then any two vertices of G are connected
by a path in T. This path also connecting the two vertices in G as T is a subgraph of G.
Therefore, G is connected. If a simple connected graph G is not a tree, at least one edge e in
G is not a bridge. Then the subgraph G e which contains all vertices of G is still
connected. If G e is not a tree, then, so as before, remove an edge, which is not a bridge,
from G e . Repeat the process until the remaining subgraph is a tree. This tree is a
spanning tree of G.

Minimum Spanning Trees


A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest
possible sum of weights of its edges.

Algorithm [Prims Algorithm] for Producing a Minimum Spanning Tree


procedure Prim (G: weighted connected undirected graph with n vertices)
T := a minimum-weight edge with its end vertices
while V (T ) V (G )
uv := an edge of minimum weight incident to a vertex u V (T ) and
another vertex v V (G ) \ V (T )
T := T + uv (v should also be added to T)
end {T is a minimum spanning tree of G}

Reference: K.H. Rosen, Discrete Mathematics and Its Applications, 5th Edition, McGraw-Hill, 2003. Daricks Chan
MATH 1130 5 Discrete Structures

Example
e
4
4
2
b f
1 7
2
6 c
5 3
a 3
5 d g
6
Tabular Method
E (T ) V (T )
b c
a 2 6
d * 3
bc
e 4 2
f * 7
g * 5
a b c
d 5 * 3
bc,ab e * 4 2
f * * 7
V (G ) \ V (T ) g * * 5
a b c e
d 5 * 3 *
bc,ab,ce
f * * 7 4
g * * 5 *
a b c d e
bc,ab,ce,cd f * * 7 * 4
g * * 5 6 *
a b c d e f
bc,ab,ce,cd,ef
g * * 5 6 * 3
bc,ab,ce,cd,ef,fg a b c d e f g

A minimum spanning tree of weight 15 e

4
2
b f
1
2
c
3
a 3
d g

Reference: K.H. Rosen, Discrete Mathematics and Its Applications, 5th Edition, McGraw-Hill, 2003. Daricks Chan

Вам также может понравиться