Professional Documents
Culture Documents
Presented
By
V.Muthumeena
Minimum Spanning Tree
Undirected Graph G
The total cost of G is the sum of the weights on all its edges.
Given Graph G
Cost: 20
Least Cost: 6
Applications
5
A B
4 6 2
2 D 3
C
3 1 2
E F
4
Select A
5
A B
4 6 2
2 D 3
C
3 1 2
E F
4
E is of least cost
E
From E, D is of Least Cost
2 D
1
E
From D, F is of Least Cost
2 D
1 2
E F
D has equal weight 2. so B is also used
A B
2
2 D
1 2
E F
From B to F, it forms a Cycle.
(Discard)
A B
2
2 D
Cycl
e
1 2
E F
The remaining vertex C is used
A B
2
2 D
C 1 2
3 E F
Minimum Spanning Tree
A B
2 D 3
C
3 1 2
E F
Time Complexity
5
A B
4 6 2
2 D 3
C
3 1 2
E F
4
Least Cost of given Graph is 1
1
E
The next Least Cost is 2
B
2
1
E
Least Cost 2
A B
2
2 D
1
E
Least Cost 2
A B
2
2 D
1 2
E F
Next Least Cost is 3,from B to F
A B
2
2 3 Cycl
D e
1 2
E F
Cycle is Discarded
A B
2
2 D
1 2
E F
The Next Least Cost is 3 with vertex C
A B
2
2 D
1 2
C
3 E F
Minimum Spanning Tree
A B
2
2 D
C
3 1 2
E F
Time Complexity