OR in Education - Prim's and Kruskal's Algorithm Student Worksheet
OR in Education - Prim's and Kruskal's Algorithm Student Worksheet
Student Worksheet
Kruskal’s algorithm
B
8
6 C
2
3
F
5
A
5
4 3
6
E 2 D
Question 1
Using Kruskal’s algorithm, identify the minimum spanning tree.
Question 2
What is the total length of the minimum spanning tree?
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………
Question 3
Using Kruskal’s algorithm, identify the minimum spanning distance between the towns.
Question 4
What is the total length of the minimum spanning distance?
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………
Prim’s algorithm questions
The network shown below shows the distances (in km) between some towns.
A cable television company wishes to link the towns shown as efficiently as possible (i.e.
using as little cable as possible). Suppose our starting node is A.
A 44 B
24
26 31
40 D
C 48
34
29 37
E 50
F
Question 5
Using Prim’s algorithm, in what order are the other nodes connected to the spanning tree?
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………
Question 6
What is the minimum amount of cable required to connect these 6 towns?
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………
Consider the network given here. Suppose we started at vertex F. Use Prim’s algorithm to
find a minimum spanning tree.
B
9
2 6 C
3
5
A
F
7
4 3
7
E 2 D
Question 7
In what order are the other nodes connected to the spanning tree?
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………
Question 8
What is the total weight of the minimum spanning tree?
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………
Mixed algorithm questions
A cable TV company is installing a system of cables to connect all the towns in a region. The
numbers in the network show distances in miles.
20 19
D 12
B
10 15
12 13
F C
8 E 14
Question 9
Starting at A, use Prim’s algorithm to determine the order of the nodes connected to the
spanning tree.
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………
Question 10
What is the total length of the tree?
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………
Question 11
Use Kruskal’s algorithm to determine the order of the nodes connected to the spanning tree.
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………
Question 12
What is the total length of the tree?
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………
Question 13
What do you notice about the two trees?
………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………