0% found this document useful (0 votes)
29 views11 pages

MST - Lecture - 01

The document discusses spanning trees and minimum spanning trees of graphs. It defines spanning trees as subgraphs that contain every vertex of the graph. Minimum spanning trees are spanning trees that have the minimum possible total edge weight. The document describes Prim's and Kruskal's algorithms for finding minimum spanning trees in weighted graphs.

Uploaded by

Iftakhar Utsho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views11 pages

MST - Lecture - 01

The document discusses spanning trees and minimum spanning trees of graphs. It defines spanning trees as subgraphs that contain every vertex of the graph. Minimum spanning trees are spanning trees that have the minimum possible total edge weight. The document describes Prim's and Kruskal's algorithms for finding minimum spanning trees in weighted graphs.

Uploaded by

Iftakhar Utsho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 11

Minimum Spanning Tree(MST)

1
Spanning Trees
Def. Let G be a simple graph. A spanning tree of G is a
subgraph of G that is a tree containing every vertex of G.
Example 1 Find a spanning tree of G.
Sol.
Remove an edge from any circuit.
(repeat until no circuit exists)

Ch10-2
Four spanning trees of G:

Thm 1 A simple graph is connected if and only if it has


a spanning tree.
Ch10-3
Spanning Trees(cont..)
A spanning tree is a subset of Graph G, which has all the vertices
covered with minimum possible number of edges. Hence, a spanning
tree does not have cycles and it cannot be disconnected..
By this definition, we can draw a conclusion that every connected and
undirected Graph G has at least one spanning tree. A disconnected
graph does not have any spanning tree, as it cannot be spanned to all
its vertices.

Ch10-4
General Properties of Spanning
Tree
 A connected graph G can have more than one spanning tree.
 All possible spanning trees of graph G, have the same number of
edges and vertices.
 The spanning tree does not have any cycle (loops).
 Removing one edge from the spanning tree will make the graph
disconnected, i.e. the spanning tree is minimally connected.
 Adding one edge to the spanning tree will create a circuit or loop,
i.e. the spanning tree is maximally acyclic.

Ch10-5
Minimum Spanning Tree
• Suppose G = (V,E) is a connected graph having weight on each edge.
Def. minimum spanning tree of G: a spanning tree of G
with smallest sum of weights of its edges.

• If all weights are same, then every spanning tree is minimum.


• If each edge has a distinct weight, then there will only be one, unique MST.
• Example:

Figure: A weighted , undirected graph G and its minimum spanning tree


6
Minimum Spanning Trees
G: connected weighted graph (each edge has an weight  0)
Def. minimum spanning tree of G: a spanning tree of G
with smallest sum of weights of its edges.
Algorithms for Minimum Spanning Trees
Algorithm 1 (Prim’s Algorithm)
Procedure Prim(G: connected weighted undirected graph with n vertices)
T := a minimum-weight edge
for i := 1 to n2
begin
e := an edge of minimum weight incident to a vertex in T and not
forming a simple circuit in T if added to T
T := T with e added
end {T is a minimum spanning tree of G}
Ch10-7
Example 2 Use Prim’s
algorithm to find a minimum
spanning tree of G.

Sol.

(Maintain only one process tree)

Ch10-8
Algorithm 2 (Kruskal Algorithm)
Procedure Kruskal(G: connected weighted undirected graph with n vertices)
T := empty graph
for i := 1 to n1
begin
e := any edge in G with smallest weight that does not form a simple
circuit when added to T
T := T with e added
end {T is a minimum spanning tree of G}

Ch10-9
Example 3 Use Kruskal
algorithm to find a minimum
spanning tree of G.

Sol.

Process tree will typically have several

Ch10-10
Another example of MST..

Ch10-11

You might also like