You are on page 1of 13

Graph Theory

The Minimum
Spanning Tree
Problem
Spanning Tree
A spanning tree T of a connected graph G is a spanning
subgraph of G such that T is a tree. Hence, a spanning
tree does not have cycles and it cannot be disconnected.
Example: Two different (non-isomorphic) spanning trees T1
and T2 of connected graph G are shown below:
Theorem: Every connected graph contains a spanning
tree.
Proof. Let G be a connected graph of order n. If G has no
cycles, then, of course, G itself is a tree.
Otherwise, suppose that G contains cycles. Let e1 be an
edge lying on a cycle of G. Then, e1 is not a bridge and so
G − e1 is connected.
If G − e1 contains cycles, then let e2 be an edge lying on a
cycle of G − e1. Then G − e1 − e2 is connected.
Eventually, we arrive at a set X = {e1, e2, …, ek} of edges of
G such that G − X is a tree. Clearly, the tree G − X
constructed through this procedure is a subgraph of G that
has the same vertex set as G. Accordingly, G – X is a
spanning tree of G.

3
Alternative Proof.
Let G be a connected graph of order n. In order to
construct a spanning tree T, we start with the empty graph
H of order n with vertex set V(H) = V(G). Add an edge f1
of G to H. Then add another edge f2 of G to H. Next, add
another edge f3 of G to H, where f3 ∉ {f1, f2} and such that
no cycle is produced. We continue this procedure until we
have added edges f1, f2, …, fn−1 of G to H, producing a
graph T of order n, size n − 1 and no cycles. Thus, T is a
tree with V(T) = V(G), so that T is a spanning tree of G.

4
5
The Minimum Spanning Tree Problem has applications
in the design of computer, communications and
transportation networks.

We shall discuss two algorithms namely Kruskal


Algorithm and Prim’s Algorithm to solve the Minimum
Spanning Tree Problem.

6
Kruskal Algorithm:
For a connected weighted graph G of order n, a spanning
tree T of G is constructed as follows:

1. Place all the vertices of graph G isolated from each


other.
2. For the first edge e1 of T, select any edge of G of
minimum weight.
3. For the second edge e2 of T, select any remaining edge
of G of minimum weight.
4. For the third edge e3 of T, choose any remaining edge of
G of minimum weight that does not produce a cycle with
the previously selected edges.
5. Continue in this manner by adding n-1 edges until a
spanning tree is produced.
7
Example:
Constructing minimum weight spanning tree using Kruskal
Algorithm.

8
Prim’s Algorithm:
For a connected weighted graph G of order n, a spanning
tree T of G is constructed as follows:

1. Place all the vertices of graph G isolated from each other.


2. For an arbitrary vertex u for G, an edge of minimum
weight incident with u is selected as the first edge e1 of T.
3. For subsequent edges e2, e3, …, en−1, select an edge of
minimum weight among those edges having exactly one of
its vertices incident with an edge already selected.

9
Example:
Constructing minimum weight spanning tree using Prim’s
Algorithm.

10
Exercise 4.3
4.26: Prove that an edge e of a connected graph G is a
bridge if and only if e belongs to every spanning tree of G.
Solution:
Let e be a bridge of a connected graph G.
Then the edge deletion subgraph G−e is disconnected.
Let T be an arbitrary spanning tree for G. Then T is a
connected subgraph of G.
If T does not contain e, then it would be a subgraph of G-e.
This contradicts the fact that G−e is disconnected.
Therefore, e is an edge in T.
For the converse, we prove the contrapositive statement.
Suppose e is not a bridge of G. Then G - e is connected, and
hence contains a spanning tree T. Since V(G) = V(G-e), T is
also a spanning tree of G that does not contain e.
11
4.29: Let G be a connected weighted graph whose edges
have distinct weights. Prove that G has a unique
minimum spanning tree.
Solution:
Suppose there are two distinct minimum spanning trees T1
and T2 of a connected graph G. Among all the edges that are
contained in exactly one of T1 or T2, let e1 be the edge of
smallest weight.
Without loss of generality, let e1 ∈ T1 and e1 ∉ T2. Then T2+e1
contains a cycle and one of the edges of this cycle, say e2 is
not in T1.
Since e2 is an edge different from e1 and is contained in T2
only, it must be that w(e1) < w(e2).
Now T=T2 + e1 – e2 is a spanning tree of G whose weight is
w(T) = w(T2) + w(e1) – w(e2) < w(T2). This is a contradiction,
12
since we suppose T2 a minimum spanning tree of G.
HOME WORK
Exercise 4.3
Problems 4.25 – 4.29.

13

You might also like