You are on page 1of 4

A Tutorial on MST

Instructor: Dr. Shubh N. Singh


Recall:
ˆ A weighted graph is a graph in which each edge is associated with a
numerical value.
ˆ Weighted graphs arise in several instances, such as travel planning and

h
communications, as well as in graph-based data science.
ˆ Prim’s Algorithm:

ng
1. At the start, we initialize our vertex set V ′ of size one, and the
edge set is empty.
2. At each successive iteration, we add an edge that connects a vertex
in V ′ with a vertex not in V ′ that has minimum weight.

Si
ˆ A vertex of degree one in a tree is called leaf (plural leaves).
ˆ The degree sequence of a graph G is the non-increasing list of degree
of all the vertices in G.
N
ˆ (The Handshaking Theorem) If G is a graph, then
X
deg(v) = 2|E(G)|.
v∈V (G)

Solve each of the following.


h

1. Using Prim’s algorithm, find the MST in the following weighted graph.
ub

b d
4 3 3
c 4
4 e
2 2 3
Sh

a f

2. Using Prim’s algorithm, find the MST in the following weighted graph.
b 55 d 59 e
53
45 c 56
51 64 62
51

a 74 g 42 f

1
3. Using Prim’s algorithm, find the MST in the following weighted graph.

b 10 c

8 7
4 6
g

h
a 9 5 d
2 9
8 2

ng
f 1 e

4. Using Prim’s algorithm, find the MST in the following weighted graph.

4
b 8 Si
2
c 7 d

9
N
a 11 i 4 14 e
7
8 6 10
h

h 1 g 2 f
ub

5. Using Prim’s algorithm, find the MST in the following weighted graph.

b 1 c
Sh

3 5 8
1 f
a 6 1
3
5 4 1

e 2 d

2
6. Using Kruskal’s algorithm, find the MST in the following weighted
graph.
b d
4 3 3
c 4
4 e

2 2 3

h
a f

ng
7. Using Kruskal’s algorithm, find the MST in the following weighted
graph.
b 55 d 59 e
53
45 c
64 56
51

a 74
51
Si g
62

42 f

8. Using Kruskal’s algorithm, find the MST in the following weighted


N
graph.

b 10 c
h

8 7
4 6
g
ub

a 9 5 d
2 9
8 2

f 1 e
Sh

9. Using Kruskal’s algorithm, find the MST in the following weighted


graph.

3
b 8 c 7 d

4 2 9

a 11 i 4 14 e
7

h
8 6 10

ng
h 1 g 2 f

10. Using Kruskal’s algorithm, find the MST in the following weighted
graph.

3
b

1
Si
5
1

8
c
N
f 6
a 1
3
5 4 1
h

e 2 d
ub
Sh

You might also like