Decision 1: Algorithms, graphs, shortest paths, route inspection and TSP – Edexcel A Level Further Mathematics (9FM0)
43 questions · page 2 of 3 · Clear filters
Question text
3.
B
42
E
50
J
37
23
21
8
7
30
35
28
A
G
C
45
32
7
41
43
10
11
34
22
D
F
H
32
Figure 4
Figure 4 represents a network with nodes, A, B, C, D, E, F, G, H and J.
The number on each edge gives the length of the corresponding edge.
(a) (i) Use Dijkstra’s algorithm to find the shortest path from A to J.
(ii) State the length of the shortest path from A to J.
(6)
One application of Dijkstra’s algorithm has order n 2 , where n is the number of nodes in
the network.
It takes a computer 0.0312 seconds to find the shortest path from a given start node to a
given end node in a network of 9 nodes.
(b) Calculate approximately how long it would take, in minutes, for the computer to
find the shortest path from a given start node to a given end node for a network of
9000 nodes.
(2)
(Total for Question 3 is 8 marks)
Question text
4. The eleven distinct numbers listed below are to be packed into bins of size 40
15
22
3
9
23
5
4
18
20
13
x
It is known that x
•
is an integer less than 40
•
is the largest number in the list
(a) Explain why it is not possible to pack the numbers into 3 bins of size 40
(1)
Given that it is possible to pack the numbers into 4 bins of size 40
(b) determine the range of values for x
(2)
(c) Use the first-fit bin packing algorithm to determine how the numbers can be packed
into bins of size 40
(3)
(d) Carry out a quick sort to produce a list of the numbers in descending order. You
should show the result of each pass and identify your pivots clearly.
(4)
When the first-fit decreasing bin packing algorithm is applied to the list, neither the 15
nor the 13 is placed in the first bin.
(e) Determine the value of x. You must give reasons for your answer.
(2)
(Total for Question 4 is 12 marks)
Question text
5.
A
34
B
21
H
42
17
8
50
20
C
G
23
12
D
10
48
22
33
F
65
E
18
J
Figure 5
[The total weight of the network is 423]
Direct roads between nine towns, A, B, C, D, E, F, G, H and J, are represented
in Figure 5. The number on each arc represents the length, in miles, of the
corresponding road.
The table below shows the shortest distances, in miles, between the nine towns.
A
B
C
D
E
F
G
H
J
A
–
34
51
31
79
20
8
55
61
B
34
–
17
65
45
54
42
21
27
C
51
17
–
82
28
71
59
22
10
D
31
65
82
–
87
22
23
86
92
E
79
45
28
87
–
65
87
30
18
F
20
54
71
22
65
–
28
75
81
G
8
42
59
23
87
28
–
63
69
H
55
21
22
86
30
75
63
–
12
J
61
27
10
92
18
81
69
12
–
Table of shortest distances
A route is needed that minimises the total distance required to traverse each road at
least once.
The route must start at F and finish at J.
(a) (i) By considering the pairings of all relevant nodes, find the roads that would need
to be traversed twice.
(ii) State the total length of this route.
(5)
(b) Starting at A, use Prim’s algorithm to find the minimum spanning tree for the
table of shortest distances. You must state the order in which you select the arcs of
your tree.
(3)
Pete needs to visit all nine towns, starting and finishing in the same town, and wishes to
minimise the total distance he travels.
(c) Starting at G, use the nearest neighbour algorithm on the table of shortest distances
to find an upper bound for the length of Pete’s route. Write down the route that gives
this upper bound.
(2)
(d) By deleting G and all of its arcs, find a lower bound for the length of Pete’s route.
(2)
Pete decides to take the route he found in (c).
(e) Interpret the route in terms of the actual towns visited.
(1)
(Total for Question 5 is 13 marks)
Question text
1.
A
E
B
D
C
Figure 1
Question 1 continued
(e) Initial time matrix
A
B
C
D
E
A
–
B
–
C
–
D
–
E
–
(f) Final iteration
A
B
C
D
E
A
–
B
–
C
–
D
–
E
–
(Total for Question 1 is 7 marks)
Question text
6. The points P, Q and R have position vectors 2 , 1 and 0 respectively.
4 5
3
(a) Determine a vector equation of the plane that passes through the points P, Q and R,
giving your answer in the form r = a + λb + μc, where λ and μ are scalar parameters.
(2)
(b) Determine the coordinates of the point of intersection of the plane with the x-axis.
(4)
Question 6 continued
Question 6 continued
Question 6 continued
(Total for Question 6 is 6 marks)
Question text
1. A gardener needs the following lengths of string. All lengths are in metres.
4.3
6.1
5.1
4.7
2.5
5.9
3.4
1.7
2.1
0.4
1.3
She cuts the lengths from balls of string. Each ball contains 10 m of string.
(a) Calculate a lower bound for the number of balls of string the gardener needs.
You must make your method clear.
(2)
(b) Use the first‑fit bin packing algorithm to determine how the lengths could be cut
from the balls of string.
(3)
(Total for Question 1 is 5 marks)
Question text
2.
B
23
4
H
8
16
33
9
3
E
23
18
A
C
6
31
17
J
K
10
F
10
14
10
14
25
D
G
25
Figure 1
[The total weight of the network is 299]
Figure 1 represents a network of cycle tracks between 10 landmarks, A, B, C, D, E, F,
G, H, J and K. The number on each edge represents the length, in kilometres, of the
corresponding track.
One day, Blanche wishes to cycle from A to K. She wishes to minimise the distance
she travels.
(a) (i) Use Dijkstra’s algorithm to find the shortest path from A to K.
(ii) State the length of the shortest path from A to K.
(6)
The cycle tracks between the landmarks now need to be inspected. Blanche must travel
along each track at least once. She wishes to minimise the length of her inspection
route. Blanche will start her inspection route at D and finish at E.
(b) (i) State the edges that will need to be traversed twice.
(ii) Find the length of Blanche’s route.
(2)
It is now decided to start the inspection route at A and finish at K. Blanche must
minimise the length of her route and travel along each track at least once.
(c) By considering the pairings of all relevant nodes, find the length of Blanche’s new
route. You must make your method and working clear.
(5)
(Total for Question 2 is 13 marks)
Question text
3. The initial distance matrix (Table 1) shows the lengths, in metres, of the corridors
connecting six classrooms, A, B, C, D, E and F, in a school. For safety reasons, some of
the corridors are one‑way only.
A
B
C
D
E
F
A
–
12
32
24
29
11
B
12
–
17
8
∞
∞
C
32
17
–
4
12
∞
D
24
∞
4
–
∞
13
E
∞
∞
12
18
–
12
F
11
∞
∞
13
12
–
Table 1
(a) By adding the arcs from vertex A, along with their weights, complete the drawing of
this network on Diagram 1 in the answer book.
(2)
Floyd’s algorithm is to be used to find the complete network of shortest distances
between the six classrooms.
The distance matrix after two iterations of Floyd’s algorithm is shown in Table 2.
A
B
C
D
E
F
A
–
12
29
20
29
11
B
12
–
17
8
41
23
C
29
17
–
4
12
40
D
24
36
4
–
53
13
E
∞
∞
12
18
–
12
F
11
23
40
13
12
–
Table 2
(b) Perform the next two iterations of Floyd’s algorithm that follow from Table 2. You
should show the distance matrix after each iteration.
(4)
The final distance matrix after completion of Floyd’s algorithm is shown in Table 3.
A
B
C
D
E
F
A
–
12
24
20
23
11
B
12
–
12
8
24
21
C
28
17
–
4
12
17
D
24
21
4
–
16
13
E
23
29
12
16
–
12
F
11
23
17
13
12
–
Table 3
Yinka must visit each classroom. He will start and finish at E and wishes to minimise
the total distance travelled.
(c) (i) Use the nearest neighbour algorithm, starting at E, to find two Hamiltonian
cycles in the completed network of shortest distances.
(ii) Find the length of each of the two cycles.
(iii) State, with a reason, which of the two cycles provides the better upper bound for
the length of Yinka’s route.
(4)
(Total for Question 3 is 10 marks)
Question text
6. The following algorithm determines the number of comparisons made when Prim’s
algorithm is applied to K n
Step 1
Start
Step 2
Input the value of n
Step 3
Let a = 1
Step 4
Let b = n – 2
Step 5
Let c = b
Step 6
Let a = a + 1
Step 7
Let b = b – 1
Step 8
Let c = c + (a × b) + (a – 1)
Step 9
If b > 0 go to Step 6
Step 10
Output c
Step 11
Stop
(a) For K 5 , complete the table in the answer book to show the results obtained at each
step of the algorithm.
(3)
B
19
17
21
15
28
C
A
23
14
24
20
13
E
D
Figure 4
The weights of the ten arcs in Figure 4 are
17
21
24
14
23
13
15
19
28
20
(b) (i) Starting at the left‑hand end of the above list, sort the list into ascending order
using bubble sort. You need only write down the state of the list at the end of
each pass.
(ii) Find the total number of comparisons performed during the sort.
(5)
(c) Find the maximum total number of comparisons required to sort the weights of the
10 arcs of K 5 into ascending order using bubble sort.
(1)
It is given that the maximum total number of comparisons required to sort the weights
of the arcs of K n into ascending order using bubble sort is
λn(n – 1)(n + 1)(n – 2)
where λ is a constant.
(d) Determine the maximum total number of comparisons required to sort the weights
of the arcs of K 50 into ascending order using bubble sort. You must make your
method and working clear.
(3)
(Total for Question 6 is 12 marks)
Question text
3.
(a)
A
B
8
17
4
D
C
12
18
13
E
12
F
Diagram 1
(b)
There are spare copies of these tables, if required, on Page 9.
3rd iteration
A
B
C
D
E
F
A
–
B
–
C
–
D
–
E
–
F
–
4th iteration
A
B
C
D
E
F
A
–
B
–
C
–
D
–
E
–
F
–
Question 3 continued
Question 3 continued
Question 3 continued
(b)
Spare copy for 3rd iteration
A
B
C
D
E
F
A
–
B
–
C
–
D
–
E
–
F
–
Spare copy for 4th iteration
A
B
C
D
E
F
A
–
B
–
C
–
D
–
E
–
F
–
(Total for Question 3 is 10 marks)
Question text
6.
You may not need to use all the rows in this table.
It may not be necessary to complete all the boxes in each row.
n
a
b
c
Output:
Question 6 continued
17
21
24
14
23
13
15
19
28
20
Question 6 continued
Question 6 continued
(Total for Question 6 is 12 marks)
Question text
1.
A
U
B
V
C
W
D
X
E
Y
Figure 1
A Hamiltonian cycle for the graph in Figure 1 begins C, V, E, X, A, W, ….
(a) Complete the Hamiltonian cycle.
(1)
(b) Hence use the planarity algorithm to determine whether the graph shown in Figure 1
is planar. You must make your working clear and justify your answer.
(3)
(Total for Question 1 is 4 marks)
Question text
3.
A
B
C
D
E
F
G
H
A
–
24
42
48
34
37
32
22
B
24
–
40
35
30
41
39
44
C
42
40
–
21
26
45
38
36
D
48
35
21
–
32
37
29
27
E
34
30
26
32
–
34
40
28
F
37
41
45
37
34
–
43
41
G
32
39
38
29
40
43
–
38
H
22
44
36
27
28
41
38
–
Table 1
Table 1 shows the shortest distances, in miles, between eight towns, A, B, C, D, E, F, G and H.
(a) Use Prim’s algorithm, starting at A, to find the minimum spanning tree for this table of
distances. You must clearly state the order in which you select the edges of your tree.
(3)
(b) State the weight of the minimum spanning tree.
(1)
A
B
C
D
E
F
G
H
J
31
27
50
29
43
25
49
35
Table 2
Table 2 shows the distances, in miles, between town J and towns A, B, C, D, E, F, G and H.
Pranav needs to visit all of the towns, starting and finishing at J, and wishes to minimise
the total distance he travels.
(c) Starting at J, use the nearest neighbour algorithm to obtain an upper bound for the
length of Pranav’s route. You must state your route and its length.
(2)
(d) Starting by deleting J, and all of its edges, find a lower bound for the length of
Pranav’s route.
(2)
(Total for Question 3 is 8 marks)
Question text
4.
A
57
B
95
72
150
230
63
125
C
F
132
289
191
160
E
84
D
Figure 3
[The total weight of the network is 1648]
Direct roads between six cities, A, B, C, D, E and F, are represented in Figure 3. The weight
on each arc is the time, in minutes, required to travel along the corresponding road.
Floyd’s algorithm is to be used to find the complete network of shortest times between the six cities.
An initial route matrix is given in the answer book.
(a) Set up the initial time matrix.
(1)
(b) Perform the first iteration of Floyd’s algorithm. You should show the time and route
matrices after this iteration.
(2)
The final time matrix after completion of Floyd’s algorithm is shown below.
A
B
C
D
E
F
A
–
57
95
147
63
220
B
57
–
72
204
120
197
C
95
72
–
242
158
125
D
147
204
242
–
84
275
E
63
120
158
84
–
191
F
220
197
125
275
191
–
A route is needed that minimises the total time taken to traverse each road at least once.
The route must start at B and finish at E.
(c) Use an appropriate algorithm to find the roads that will need to be traversed twice.
You should make your method and working clear.
(4)
(d) Write down the length of the route.
(1)
(Total for Question 4 is 8 marks)
Question text
5.
30 12 5 2 23 18 36 10 15 24
(a) The list of ten numbers above is to be sorted into descending order. Use a quick sort
to obtain the sorted list. You should show the result of each pass and identify your
pivots clearly.
(4)
The ten numbers are to be packed into bins of size n, where n is a positive integer.
When the first-fit bin packing algorithm is applied to the original list of ten numbers, the
following allocation is obtained.
Bin 1: 30 12 2
Bin 2: 5 23 10
Bin 3: 18 15
Bin 4: 36
Bin 5: 24
(b) Explain why the value of the integer n must be either 44 or 45
(3)
(c) Use the first-fit decreasing bin packing algorithm to determine how the numbers can
be packed into bins of size 45
(3)
(Total for Question 5 is 10 marks)