kruskal and prim - · pdf filekruskal and prim 1. the network in the diagram above shows the...
TRANSCRIPT
City of London Academy 1
KRUSKAL AND PRIM
1.
The network in the diagram above shows the distances, in metres, between 10 wildlife
observation points. The observation points are to be linked by footpaths, to form a network along
the arcs indicated, using the least possible total length.
(a) Find a minimum spanning tree for the network in the diagram above, showing clearly the
order in which you selected the arcs for your tree, using
(i) Kruskal’s algorithm, (3)
(ii) Prim’s algorithm, starting from A. (3)
Given that footpaths are already in place along AB and FI and so should be included in the
spanning tree,
(b) explain which algorithm you would choose to complete the tree, and how it should be
adapted.
(You do not need to find the tree.) (2)
(Total 8 marks)
City of London Academy 2
2.
The diagram above represents the distances, in metres, between eight vertices, A, B, C, D, E, F, G
and H, in a network.
(a) Use Kruskal’s algorithm to find a minimum spanning tree for the network.
You should list the arcs in the order in which you consider them. In each case, state whether
you are adding the arc to your minimum spanning tree. (3)
(b) Complete the matrix below, to represent the network.
A B C D E F G H
A – 31 30 – – – – –
B 31 – – – – – 38
C 30 – – 24 – –
D – – 18 – –
E – – 24 18 – 28 –
F – – – 28 – 21 –
G – – – – 21 –
H – 38 – – – –
(2)
(c) Starting at A, use Prim’s algorithm to determine a minimum spanning tree. You must
clearly state the order in which you considered the vertices and the order in which you
included the arcs. (3)
(d) State the weight of the minimum spanning tree. (1)
(Total 9 marks)
City of London Academy 3
3. The table below shows the least costs, in pounds, of travelling between six cities, A, B, C, D, E
and F.
A B C D E F
A – 36 18 28 24 22
B 36 – 54 22 20 27
C 18 54 – 42 27 24
D 28 22 42 – 20 30
E 24 20 27 20 – 13
F 22 27 24 30 13 –
Vicky must visit each city at least once. She will start and finish at A and wishes to minimise the
total cost.
(a) Use Prim’s algorithm, starting at A, to find a minimum spanning tree for this network. (2)
(b) Use your answer to part (a) to help you calculate an initial upper bound for the length of
Vicky’s route. (1)
(c) Show that there are two nearest neighbour routes that start from A. You must make your
routes and their lengths clear. (3)
(d) State the best upper bound from your answers to (b) and (c). (1)
(e) Starting by deleting A, and all of its arcs, find a lower bound for the route length. (4)
(Total 11 marks)
4. Prim’s algorithm finds a minimum spanning tree for a connected graph.
(a) Explain the terms
(i) connected graph,
(ii) tree,
(iii) spanning tree. (3)
(b) Name an alternative algorithm for finding a minimum spanning tree. (1)
City of London Academy 4
Cambridge London Norwich Oxford Portsmouth Salisbury York
Cambridge (C) – 60 62 81 132 139 156
London (L) 60 – 116 56 74 88 211
Norwich (N) 62 116 – 144 204 201 181
Oxford (O) 81 56 144 – 84 63 184
Portsmouth (P) 132 74 204 84 – 43 269
Salisbury (S) 139 88 201 63 43 – 248
York (Y) 156 211 181 184 269 248 –
Figure 1
Figure 1 shows the distances by road, in miles, between seven cities.
(c) (i) Use Prim’s algorithm, starting at London, to find the minimum spanning tree for
these cities. You must clearly state the order in which you selected the edges of your
tree, and the weight of the final tree.
(ii) Draw your tree using the vertices given in Figure 2 below.
Figure 2 (5)
(Total 9 marks)
City of London Academy 5
5.
A B C D E F
A – 135 180 70 95 225
B 135 – 215 125 205 240
C 180 215 – 150 165 155
D 70 125 150 – 100 195
E 95 205 165 100 – 215
F 225 240 155 195 215 –
The table shows the lengths, in km, of potential rail routes between six towns, A, B, C, D, E and F.
(a) Use Prim’s algorithm, starting from A, to find a minimum spanning tree for this table. You
must list the arcs that form your tree in the order that they are selected. (3)
(b) Draw your tree using the vertices given in the diagram below.
(1)
(c) State the total weight of your tree. (1)
(Total 5 marks)
City of London Academy 6
6.
A B C D E F
A – 24 – – 23 22
B 24 – 18 19 17 20
C – 18 – 11 14 –
D – 19 11 – 13 –
E 23 17 14 13 – 21
F 22 20 – – 21 –
The table shows the distances, in metres, between six vertices, A, B, C, D, E and F, in a network.
(a) Draw the weighted network using the vertices given in Diagram 1 below.
Diagram 1 (3)
(b) Use Kruskal’s algorithm to find a minimum spanning tree. You should list the edges in the
order that you consider them and state whether you are adding them to your minimum
spanning tree. (3)
(c) Draw your tree on Diagram 2 below and find its total weight.
City of London Academy 7
Diagram 2 (2)
(Total 8 marks)
7.
(a) State two differences between Kruskal’s algorithm and Prim’s algorithm for finding a
minimum spanning tree. (2)
(b) Listing the arcs in the order that you consider them, find a minimum spanning tree for the
network in the diagram above, using
(i) Prim’s algorithm,
(ii) Kruskal’s algorithm. (6)
(Total 8 marks)
8. (a)
18 20 11 7 17 15 14 21 23 16 9
The list of numbers shown above is to be sorted into ascending order. Apply quick sort to
obtain the sorted list. You must make your pivots clear. (5)
City of London Academy 8
The diagram above represents a network of paths in a park. The number on each arc represents the
length of the path in metres.
(b) Using your answer to part (a) and Kruskal’s algorithm, find a minimum spanning tree for
the network in the diagram above. You should list the arcs in the order in which you
consider them and state whether you are adding it to your minimum spanning tree. (4)
(c) Find the total weight of the minimum spanning tree. (1)
(Total 10 marks)
9.
M A B C D E
M – 215 170 290 210 305
A 215 – 275 100 217 214
B 170 275 – 267 230 200
C 290 100 267 – 180 220
D 210 217 230 180 – 245
E 305 214 200 220 245 –
The table shows the cost, in pounds, of linking five automatic alarm sensors, A, B, C, D and E, and
the main reception, M.
(a) Use Prim’s algorithm, starting from M, to find a minimum spanning tree for this table of
costs. You must list the arcs that form your tree in the order that they are selected. (3)
(b) Draw your tree using the vertices given in the diagram below.
21
G
9
I
16
H
23
F
14
11
117
C20A
18
B
17
D
1115
E
City of London Academy 9
(1)
(c) Find the total weight of your tree. (1)
(d) Explain why it is not necessary to check for cycles when using Prim’s algorithm. (2)
(Total 7 marks)
10.
A B C D E F G
A — 48 117 92 — — —
B 48 — — — — 63 55
C 117 — — 28 — — 85
D 92 — 28 — 58 132 —
E — — — 58 — 124 —
F — 63 — 132 124 — —
G — 55 85 — — — —
The table shows the lengths, in metres, of the paths between seven vertices A, B, C, D, E, F and G
in a network N.
(a) Use Prim's algorithm, starting at A, to solve the minimum connector problem for this table
of distances. You must clearly state the order in which you selected the edges of your tree,
and the weight of your final tree. Draw your tree using the vertices given in the diagram
below.
M A
E
D C
B
City of London Academy 10
(5)
(b) Draw N using the vertices given in the diagram below.
(3)
(c) Solve the Route Inspection problem for N. You must make your method and working clear.
State a shortest route and find its length.
(The weight of N is 802)
Shortest route:
.........................................................................................................................
Length:
.................................................................................................................................... (7)
(Total 15 marks)
A
BC
D
E
F
G
A
BC
D
E
F
G
City of London Academy 11
11.
The network in the diagram above shows the distances, in metres, between 10 wildlife
observation points. The observation points are to be linked by footpaths, to form a network along
the arcs indicated, using the least possible total length.
(a) Find a minimum spanning tree for the network in the diagram above, showing clearly the
order in which you selected the arcs for your tree, using
(i) Kruskal’s algorithm, (3)
(ii) Prim’s algorithm, starting from A. (3)
Given that footpaths are already in place along AB and FI and so should be included in the
spanning tree,
(b) explain which algorithm you would choose to complete the tree, and how it should be
adapted. (You do not need to find the tree.) (2)
(Total 8 marks)
A
DG
C F I
JHB
15
17 21
32
30
1920
24
38
21
25
1227
31
3945
E
City of London Academy 12
12.
A B C D E F
A – 7 3 – 8 11
B 7 – 4 2 – 7
C 3 4 – 5 9 –
D – 2 5 – 6 3
E 8 – 9 6 – –
F 11 7 – 3 – –
The matrix represents a network of roads between six villages A, B, C, D, E and F. The value in
each cell represents the distance, in km, along these roads.
(a) Show this information on the diagram below.
(2)
(b) Use Kruskal’s algorithm to determine the minimum spanning tree. State the order in which
you include the arcs and the length of the minimum spanning tree. Draw the minimum
spanning tree.
(5)
A B
C
DE
F
A B
C
DE
F
City of London Academy 13
(c) Starting at D, use Prim’s algorithm on the matrix given below to find the minimum
spanning tree. State the order in which you include the arcs.
A B C D E F
A – 7 3 – 8 11
B 7 – 4 2 – 7
C 3 4 – 5 9 –
D – 2 5 – 6 3
E 8 – 9 6 – –
F 11 7 – 3 – –
(3)
(Total 10 marks)
13. (a) Define the terms
(i) tree,
(ii) spanning tree,
(iii) minimum spanning tree. (3)
(b) State one difference between Kruskal’s algorithm and Prim’s algorithm, to find a minimum
spanning tree. (1)
Figure 1
B
A
C
F
EN
H5
10
116
10
15
13
14
14
9 127
8
City of London Academy 14
(c) Use Kruskal’s algorithm to find the minimum spanning tree for the network shown in Fig.
1. State the order in which you included the arcs. Draw the minimum spanning tree in
Diagram 1 below and state its length.
Diagram 1
Order arcs included……………………………………………………………………………….
Length of minimum spanning tree………………………………………………………………... (4)
Figure 2
Figure 2 models a car park. Currently there are two pay-stations, one at E and one at N. These two
A
B
C
F
E
H
N
B
A
C
F
EN
H50
100
110
60
100
150
130
140
140
90 12070
80
City of London Academy 15
are linked by a cable as shown. New pay-stations are to be installed at B, H, A, F and C. The
number on each arc represents the distance between the pay-stations in metres. All of the
pay-stations need to be connected by cables, either directly or indirectly. The current cable
between E and N must be included in the final network. The minimum amount of new cable is to
be used.
(d) Using your answer to part (c), or otherwise, determine the minimum amount of new cable
needed. Use Diagram 2 to show where these cables should be installed. State the minimum
amount of new cable needed.
Diagram 2
(3)
(Total 11 marks)
14. (a) Describe the differences between Prim’s algorithm and Kruskal’s algorithm for finding a
minimum connector of a network. (3)
(b) Listing the arcs in the order that you select them, find a minimum connector for the
network in the diagram above, using
(i) Prim’s algorithm; (ii) Kruskal’s algorithm. (4)
(Total 7 marks)
A
B
C
F
E
H
N
A B
C
D
E
F
G
15
17
18 16
24
32
25
35 14
20
21
City of London Academy 16
15.
The diagram above shows a number of satellite towns A, B, C, D, E and F surrounding a city K.
The number on each edge give the length of the road in km.
(a) Use Dijkstra’s algorithm to find the shortest route from A to E in the network.
Show your working in the boxes provided on the answer sheet. (8)
It is planned to link all the sites A, B, C, D, E and F and K by telephone lines laid alongside the
roads.
(b) Use Kruskal’s algorithm to find a minimum spanning tree for the network and hence obtain
the minimum total length of cable required. Draw your tree. (6)
(Total 14 marks)
A
B C
D
E
F
K
2010
36
30 10
1215
815
28
30
14
City of London Academy 17
Sheet for use in answering this question
(a)
Length of Shortest Path:
...…………………………………………………………………………………….
Determination of shortest route:
...…………………………………………………………………………………….
...…………………………………………………………………………………….
...…………………………………………………………………………………….
...…………………………………………………………………………………….
...…………………………………………………………………………………….
(b) Minimum spanning tree
Total weight of minimum spanning tree: ……………………………………………
2010
36
30 10
1215
815
28
30
14
A
B C
D
E
F
K
Vertex
Temporary Labels
PermanentLabels
KEY:
City of London Academy 18
MARK SCHEME
1. (i) FH, AD, DE, CE, (not DC), (not AC), CF, HI, (not FI), IJ M1A1A1 3
(ii) AD, DE, EC, CF, FH, HI, IJ stop M1A1A1 3
(b) Start off the tree with AB and FI, then apply Kruskal M1 A1 2 [8]
2. (a) DE GF DC EG (not EF not CF) AC (not AB) GH M1 A1 A1 3
Note
1M1: Kruskal’s algorithm – first 4 arcs selected chosen correctly.
1A1: All seven non-rejected arcs chosen correctly.
2A1: All rejections correct and in correct order and at correct time.
(b)
A B C D E F G H
A - 31 30 - - - - -
B 31 - - 24 - - - 38
C 30 - - 22 24 29 - - B2, 1, 0 2
D - 24 22 - 18 - - 34
E - - 24 18 - 28 26 -
F - - 29 - 28 - 21 -
G - - - - 26 21 - 33
H - 38 - 34 - - 33 -
Note
1B1: condone two (double) errors
2B1: cao
(c) AC CD DE BD GE GF GH M1 A1 A1 3
Note
1M1: Prim’s algorithm – first four arcs chosen correctly, in order,
or first five nodes chosen correctly, in order.{A,C,D,E,B….}
1A1: First six arcs chosen correctly or all 8 nodes chosen correctly,
in order. {A,C,D,E,B,G,F,H}
2A1: All correct and arcs chosen in correct order.
(d) Weight: 174 B1 1
Note
,
EG
BC
,
EG
BC
not CE
BD
City of London Academy 19
1B1: cao
Starting at Minimum arcs required
for M1
Nodes order
A AC CD DE DB ACDEB(GFH) 15234(768)
B BD DE DC BDEC(GFAH) (7)1423(658)
C CD DE DB CDEB(GFAH) (7)4123(658)
D DE DC DB DECB(GFAH) (7)4312(658)
E ED DC DB EDCB(GFAH) (7)4321(658)
F FG GE ED DC DB FGEDCB(AH) (7)654312(8)
G GF GE ED DC DB GFEDCB(AH) (7)654321(8)
H HG GF GE HGFE(DCBA) (8765)4321
[9]
3. (a)
M1 A1 2
Notes
1M1: Spanning tree found. Allow 1×2×43 across top of table or 93
1A1: CAO must see tree or list of arcs
(b) Minimum Spanning tree length 93, so upper bound is £186 B1ft 1
Note
1B1ft: 186 their ft93 × 2
(c) A C F E B D A M1
18 24 13 20 22 28 Length 125 A1
A C F E D B A
18 24 13 20 22 36 Length 133 A1 3
Notes
1M1: One Nearest Neighbour each vertex visited at least
once (condone lack of return to start)
1A1: One correct route and length CAO – must return to start.
2A1: Second correct route and length CAO – must return to start.
(d) Best upper bound is £125 B1ft 1
Note
1B1ft: ft but only on three different values.
City of London Academy 20
(e) Delete A
M1 A1
RMST weight = 77
Lower bound = 77 + 18 + 22 = £117 M1 A1 4
Notes
1M1: Finding correct RMST (maybe implicit) 77 sufficient,
or correct numbers. 4 arcs.
1A1: CAO tree or 77.
2M1: Adding 2 least arcs to A, 18 and 22 or 40 only
2A1: CAO 117 [11]
4. (a) (i) All pairs of vertices connected by a path,
but not describing complete graph. B1
(ii) No cycles B1
(iii) All nodes connected (accept definition of
minimum spanning tree) B1 3
(b) Kruskal’s (algorithm) B1 1
(c) (i) L-O 56 Using Prim. first 2 correct M1
L-C 60
C-N 62
O-S 63 Next 2 A1
S-P 43
C-Y 156 Finish A1
Total length 440 (miles) Total A1 =B1
(ii) Tree correct
City of London Academy 21
B1 5
Note
Accept weights as indicating arcs.
Misreads – award M1 A0 A0 for these:
• Vertices, not edges given L O C N S P Y
• Numbers across top, edges either incorrect
or not given: 3 1 4 2 6 5 7.
Also accept these, misreading And not starting
at L – again M1A0A0
Started at Minimum arcs nodes Numbers
C CL,LO,CN,….. CLONSPY 1243657
N NC,CL,LO,OS,SP,CY NCLOSPY 2314657
O OL,LC,CN,OS,…. OLCNSPY 3241657
P PS,SO,OL,LC,CN.CY PSOLCNY 5463127
S SP.SO,… SPOLCNY 5463217
Y YC,CL,LO,CN,.. YCLONSP 2354761
[9]
5. (a) AD, AE, DB; DC, CF M1 A1; A1 3
Note
1M1: Using Prim – first 2 arcs probably but
condone starting from another vertex.
1A1: first three arcs correct
2A1: all correct.
(b)
B1 1
Note
City of London Academy 22
1B1: CAO
(c) Weight 595 (km) B1 1
Note
1B1: CAO condone lack of km.
Apply the misread rule, if not listing arcs or not starting at A.
So for M1 (only)
Accept numbers across the top (condoning absence of 6)
Accept full vertex listing
Accept full arc listing starting from vertex other than A
[AD AE DB DC CF] {1 4 5 2 3 6} ADEBCF
BD AD AE CD CF {3 1 5 2 4 6} BDAECF
CD AD AE BD CF {3 5 1 2 4 6} CDAEBF
DA AE DB CD CF {2 4 5 1 3 6} DAEBCF
EA AD DB DC CF {2 4 5 3 1 6} EADBCF
FC CD AD AE BD {4 6 2 3 5 1} FCDAEB [5]
6. (a)
M1
A1
A1 3
Note
1M1: More than 10 arcs
1A1: all arcs correct
2A1: all values correct
(b) CD, DE, reject CE, BE, reject BC, reject BD, BF, reject EF, AF M1 A1
11 13 14 17 18 19 20 21 22 A1 3
Note
1M1: First three arcs correctly chosen
1A1: All used acrs selected correctly
2A1: All rejected arcs selected in correct order
City of London Academy 23
(c)
B1
Weight of tree 83 (m) B1 2
Note
1B1: CAO for arcs – numbers not needed. NO ft.
2B1: CAO 83, condone units [8]
7. (a) e.g.
• Prims starts with any vertex, Kruskal starts with the shortest arc.
• It is not necessary to check for cycles when using Prim.
• Prims adds nodes to the growth tree, Kruskal adds arcs.
• The tree ‘grows’ in a connected fashion when using Prim.
• Prim can be used when data in a matrix form.
Other correct statements also get credit. B2,1,0 2
1B1: Generous one coprrect difference. If bod give B1
2B1: Generous two distinct, correct differences.
(b) (i) e.g. AC, CF, FD, DE, DG, AB. M1, A1, A1 3
(ii) CF, DE, DF, not CD, not EF, DG, not FG, not EG, AC, not AD, AB.
[18, 19, 20, not 21, not 21, 22, not 23, not 24, 25, not 26, 27]
M1, A1, A1 3
1M1: Prim’s algorithm – first three arcs chosen correctly, in order,
or first four nodes chosen correctly, in order.
1A1: First five arcs chosen correctly; all 7 nodes chosen correctly,
in order.
2A1: All correct and arcs chosen in correct order.
2M1: Kruskal’s algorithm – first 4 arcs selected chosen correctly.
1A1: All six non-rejected arcs chosen correctly.
2A1: All regions correct and in correct order and ta correct time.
City of London Academy 24
[8]
8. (a) e.g.
M1
A1
A1ft
A1ft
A1 5
(b) CF M1
GI
{BC or BF(*) – accept one, reject one
{CD (*) A
EF (*)
DF (*)
HI (*) A1
BE (*)
AB (*)
AC (*)
EG (*)
Tree complete A1 4
(*) Needs letters
(c) 107 m B1 1 [10]
9. (a) MB, BE, MD, DC, CA M1A1A1 3
(b)
B1ft 1
(c) 170 + 200 + 210 + 180 + 100 = 860 B1 1
B
A
C F
DG
E
2719
22
20
18
25
18
11
11
7
7
20
7
7
11
9
9
11
14
9
9
11
11
11
7
9
14
14
17
15
15
15
18
18
16
16
16
14
20
20
17
17
21
17
17
18
18
18
18
23
21
16
20
20
20
16
23
21
21
9
16
23
23
23
E
D C
A
B
M (170)
(230)
(200) (110)
(180)
City of London Academy 25
(d) (A cycle is formed when an arc is used that connects two vertices
already connected to each other in the tree) B2,1,0 2
Prim’s algorithm always selects arcs that bring a vertex not in
the tree into the tree, so cycles can’t happen [7]
10. (a) AB, BG, BF | GC, CD, DE {1 2 5 6 7 4 3} M1 A1 A1 3
weight 337 m B1
B1ft 2
(b)
M1 A1 A1 3
(c) AB + CF = 48 + 160 = 208 M1 A1
AC + BF = 117 + 63 = 180 A1
AF + B C = 111 + 140 = 251 A1 4
e.g. A1
length 802 + 180 = 982 m M1 A1ft 3 [15]
11. (a) (i) FH,AD,DE,CE, (not DC), , (not AC), CF, HI,
(not FI), IJ stop M1 A1 A1 3
(ii) AD, DE, EC, , CF, FH, HI, IJ stop M1 A1 A1 3
(b) Start off the tree with AB and FI, then apply Kruskal B2, 1, 0 2 [8]
A
B C
D
EFG
A
BC
D
EFG
48
5563
117
85
92
132
124
58
28
A B F B G C A C D E F D A
EG
BC
EG
BC
City of London Academy 26
12. (a) B1
B1 2
(b) M1
BD, , BC, Not CD, DE A1, A1
B1
Length = 18 km B1 5
(c) DB, DF, BC, CA, DE [5,2,4,1,6,3,] M1 A1 A1 3 [10]
13. (a) (i) A connected graph with no cycles, loops or multiple edges B1
(ii) A tree that includes all vertices B1
(iii) A spanning tree of minimum total length B1 3
(b) E.g.
In Kruskal the shortest arc is added (unless it completes a
cycle), in Prim the nearest unattached vertex is added
There is no need to check for cycles when using Prim,
but there is when using Kruskal B1 1
In Prim the tree always “grows” in a connected fashion
Kruskal starts with the shortest edge, Prim with any vertex
(c) BH, NF, HN, HA, BE, NC; length = 48 M1 A1; B1
B1 4
(d)
A B
C
DE
F
11
7
74
3
3
2
9
8
5
6
A B
C
DE
F
F D
CA
5
7
8
613
A
B
C
E
F
H
9N
City of London Academy 27
B1
New cable – 390m M1 A1 3 [11]
14. (a) e.g.: In Prim the tree always ‘grows’ in a connected fashion; B3,2,1,0 3
In Kruskal the shortest arc is added (unless it completes a cycle),
in Prim the nearest unattached vertex is added;
There is no need to check for cycles when using Prim;
Prim can be easily used when network given in matrix form
Prim stats with a vertex, Kruskal with an edge
(b) (i) Either AC, AB, BD, BE, EF, EG (if starts at A or C)
or BD, BA, AC, BE, EF, EG (if starts at B or D)
or EF, EG, BE, BD, BA, AC (if starts at E or F)
or GE, EF, BE, BD, BA, AC (if starts at G) M1 A1
(ii) EF, AC, BD, BA, EG, BE M1 A1 4 [7]
15. (a)
Length of Shortest Path: 57 km B1
Determination of shortest route:
Label E – Label D = 57 – 43 = 14 (DE)
Label D – Label C = 43 – 35 = 8 (CD) M1 A1
Label C – Label B = 35 – 20 = 15 (BC)
Label B – Label A = 20 – 0 = 20 (AB)
Hence shortest route is A B C D E A1 8
50
70
80
60130
2010
36
3010
1215
815
28
30
14
A
B C
D
E
F
K
Vertex
Temporary Labels
PermanentLabel
0
0
20
20
30
30
30
30
35
35
36
45
43
43
60 58 57
57
City of London Academy 28
(b) Minimum spanning tree
CD (8)
BK (10)
KF (10)
CK (12)
DE (14)
Not KD (15) Cycle
Not BC (15) Cycle
AB (20)
Total weight of minimum spanning tree: 74 km (tree) B1
(weight) B1 6 [14]
EXAMINERS' REPORTS
1. No Report available for this question.
2. Around 45% of the candidates gained full marks on this question. Candidates were directed to list the arcs in the order in which they
included them in the tree, but many candidates did not do so.
In part (a) a number of candidates only stated the arcs they were including in their tree and did not state the arcs that they rejected, as
they rejected them. Some candidates only referred to the length of the arc rather than by its end vertices, this makes it difficult for the
examiners to determine which arc is being considered.
Part (b) was usually completed correctly.
In part (c) many candidates showed their working on the table but then did not list the arcs in the correct order, often adding BD too late.
Many candidates completed part (d) correctly.
3. This proved a good first question with over a third of the candidates scoring full marks and over 50% getting at least 10 marks.
In part (a) many candidates did not list the arcs or draw the tree, BD was often included. Almost all were able to correctly find an initial
upper bound based on their tree.
In (c) most candidates were able to find the two nearest neighbour routes but a surprisingly large number did not return to A, others
found the NN route from A to B and A to D and then, alarmingly, doubled it.
Those who completed (c) correctly usually completed (d) correctly.
Many completed part (e) correctly but BD was, once again, often included in the residual minimum spanning tree.
4. The definitions in part (a) challenged many, particularly that of a ‘connected graph’ which challenged even the better candidates,
with some defining a complete graph and others being unclear about the nature of the connection between nodes. There were the usual
confusions of technical terms, ‘nodes connected by vertices’ etc. Part (b) was often correct, although often misspelled, but Prim and
Dijkstra were also popular incorrect answers. Most candidates were able to make progress with part (c), but many lost marks because
they did not list the edges in order of selection, or did not start at L as demanded in the question. The correct tree and its weight were
often seen.
5. This was a good starter and was well answered. Some candidates headed the columns correctly but then did not list the arcs correctly;
they should be encouraged to list each arc as it is selected. As expected the commonest error was to look for the smallest entry in the
latest column rather than in all numbered columns.
6. Almost all the candidates gained full marks in part (a), with only a few ambiguous numbers on the diagonal arcs. There were also
many fully correct solutions seen to part (b), although a few did not make the rejected arcs clear. Good presentation can be a great time
saver here, many gave an ordered list of all arcs with just ticks and crosses by the rejections, others wrote long sentences about their
decision to reject, due to cycles forming. Not all candidates stated the weight of the tree.
A
B C
D
K
E
F
20
10
10
128
14
City of London Academy 29
7. Part (a) caused problems for some candidates. Candidates were asked for differences between the two algorithms and many simply
made statements such as Prim uses nodes without going on to say the Kruskal uses edges. A popular answer was to mention ordering
the arcs into ascending order for Kruskal; if this used as a difference candidates must indicate why this is important when using the
algorithm. There was the usual muddled use of basic technical terminology. Some candidates muddled the two algorithms. Part (b) as
usually well-answered although some just drew their MST and did not list the arcs, in order, as instructed. Some wasted time in Prim by
converting to the matrix form. Some did not make their rejections clear when applying Kruskal’s algorithm.
8. (a) Many excellent answers were seen here and the vast majority used the pivot selection seen on the mark scheme. There were
however a number of flawed solution seen also. The most common errors were; random or inconsistent pivot choices; misordering of
21, 23, 16 on the first pass, misordering of 11 and 9 on the third pass and not selecting 20 as a pivot; only selecting one pivot per line.
Some candidates used colour to indicate their pivots which should be discouraged. A very few bubble sorts were seen. In part (b) almost
all the candidates were able to select the first two arcs, CF and GI but the three arcs of length 11 challenged many. There was often a
lack of clarity concerning the order in which edges were rejected. Those who listed all the arcs, in order, and then ticked or crossed them
gained the marks most efficiently. Some candidates wasted a great deal of time (and space) drawing numerous diagrams, each
successive one having an extra arc.
9. There were many fully correct answers to (a) seen, but also many who applied the nearest neighbour algorithm instead. Many seemed
to confuse arcs with vertices and did not list their arcs as required. Most candidates drew a tree in part (b) and almost all who got the
correct tree also correctly found its weight. Many candidates were able to describe the mechanics of the algorithm in part (d), with the
commonly seen reference to ‘crossing out rows’, but only the best were able to think about HOW the algorithm worked and secure both
marks.
10. This proved an accessible question, but careless slips resulted in few gaining full credit. Not all candidates used Prim’s algorithm
correctly and of those that did, some did not clearly state the order in which the edge were selected – as directed in the question. A
disappointing number of candidates used the nearest neighbour algorithm instead of Prim’s algorithm. Many omitted to state the weight
of the tree. The vast majority were able to draw the network in part (b). The majority did three pairings but many did not find all the
shortest routes between the pairs. Some discarded any route involving more than one edge and some did not state the totals of their
pairings. A few did not state a route and some found a semi-Eulerian solution.
11. There was a varied response to this question, with some very good and some quite poor responses seen. Part (a) was generally better
attempted than part (b). In part (a) the candidates were asked to make the order in which they selected the arcs clear, many did not do
this. Many candidates wasted time by drawing a succession of diagrams showing the addition of one arc at a time. Many candidates lost
marks in Kruskal’s algorithm by not showing the rejection of the arcs that created loops. In some attempts at Prim’s algorithm, many
did not list the arcs and others referred to rejecting arcs to prevent cycles from forming. Many wasted time in drawing a matrix for Prim.
Part (b) was often poorly done with many candidates opting for Prim despite the two arcs not being connected. Of those who correctly
selected Kruskal, only a few were able to give a coherent explanation.
12. Almost all of the candidates were able to draw the arcs correctly but it was not always clear which numbers went with which arcs,
which lead to mistakes later. Most candidates were able to perform Kruskal’s algorithm correctly although a number omitted to state
that arc CD was rejected. Most went on to correctly draw the minimum spanning tree, but units were often omitted when stating its
weight. Prim’s algorithm was less well done. Some did not show that they had used the matrix, some started at A and many listed
vertices instead of arcs.
13. The majority of candidates found part (a) tricky. There were some very poor definitions, poor use of technical terms and muddled
thinking seen. Candidates often did not write in complete sentences, making it very difficult to understand the point they were trying to
make. Part (b) was usually better done although candidates confused arcs, vertices, nodes and edges and made some worrying remarks
about cycles. Part (c) was usually completed correctly. Part (d) caused problems for some candidates, with some incorrect diagrams and
incorrect answers of 54m, 540m and 39m often seen.
14. Very few candidates attempted a comparison in part (a). Most just described the two methods. A significant number confused the
two algorithms. There was some poor use of technical terms seen. Part (b) was very well done with most candidates gaining full marks,
but a few did not list the arcs as requested. A surprising number of candidates seem to think that Prim’s algorithm can only be applied
to a matrix and wasted a lot of time in creating the matrix. Others wasted time (and often went onto at least two extra sides of paper) by
drawing a ‘cartoon sequence’ showing the state of the tree after each arc addition, rather than simply listing the arcs in order.
15. No Report available for this question.