MST - Lecture - 01
MST - Lecture - 01
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:
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.
Sol.
Ch10-8
Algorithm 2 (Kruskal Algorithm)
Procedure Kruskal(G: connected weighted undirected graph with n vertices)
T := empty graph
for i := 1 to n1
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.
Ch10-10
Another example of MST..
Ch10-11