Revision Library

Decision: Algorithms and Graph Theory Depth - Worksheets, Questions and Revision

13 original exam-style questions - 5 pages of questions with a full mark scheme - free printable PDF.

Download PDFJump to mark scheme (page 6)Read the revision guide
« Previous: Decision Maths: Critical Path Analysis and Linear ProgrammingNext: Decision: Linear Programming and Critical Path Depth »
Revision Library
revisionlibrary.co.uk
A-Level · Further Decision Mathematics (Algorithms and Graph Theory Depth)

FP.D5 Decision: Algorithms and Graph Theory Depth

EDEXCEL 9FM0 · Calculator allowed · about 120 minutes
Total Marks
Name: _______________________________    Date: ____ / ____ / ______
Answer ALL questions. Show all your working.
1
The following list of six numbers is to be sorted into ascending order:
8, 3, 10, 5, 1, 7
(a)Perform a bubble sort on the list, comparing and swapping adjacent items from left to right. Show the list in full after each pass, and continue until you have completed one full pass in which no swaps are made.(4)
(b)State the number of comparisons made during the first pass.(1)
(Total for Question 1 is 5 marks)
2
The lap times, in seconds, recorded for seven laps of a go-kart track, in the order the laps were driven, are:
42, 17, 56, 8, 31, 24, 63
(a)Using the first item of each sublist as the pivot, perform a quicksort on this list to sort it into ascending order. At each stage, state the pivot used and the two resulting sublists (items less than the pivot, and items greater than or equal to the pivot). Continue until every sublist contains at most one item, then state the final sorted list.(5)
(b)State the total number of pivots used to sort the list completely.(1)
(Total for Question 2 is 6 marks)
3
Kwame runs a small courier company. One morning he must pack parcels of the following weights, in kg, into delivery bins that can each hold a maximum of 30 kg:
13, 8, 19, 11, 6, 14, 9, 17
(a)Calculate a lower bound for the number of bins needed to pack all eight parcels.(2)
(b)Apply the first-fit algorithm to the parcels, in the order given, packing them into bins of capacity 30 kg. State the contents of each bin, and the number of bins used.(3)
(c)Sort the parcel weights into decreasing order and apply first-fit decreasing to the same set of parcels, packing into bins of capacity 30 kg. State the contents of each bin, and the number of bins used.(3)
(Total for Question 3 is 8 marks)
4
A haulage firm must load crates of the following weights, in kg, onto lorries that can each carry a maximum of 50 kg:
22, 28, 19, 31, 12, 38
(a)Using a full-bin method, find combinations of crates that exactly fill a 50 kg lorry, and show that all six crates can be loaded using exactly three lorries with no wasted capacity.(3)
(b)Calculate a lower bound for the number of lorries required, and state, with a reason, whether the packing found in part (a) is optimal.(2)
(Total for Question 4 is 5 marks)
5
A water company is planning new pipeline connections between seven reservoirs, A to G. The table below gives the cost, in GBP 1000s, of laying a direct pipeline between each pair of reservoirs that could feasibly be connected:
AB = 7, AC = 9, BC = 5, BD = 8, CD = 6, DE = 4, EF = 3, EG = 9, FG = 6, CE = 10, BE = 11, DF = 12
(a)Use Kruskal's algorithm to find a minimum spanning tree for this network. List the edges in increasing order of cost, stating whether each is accepted or rejected as you reach it, until every reservoir is connected.(5)
(b)State the total cost of the minimum spanning tree found in part (a).(1)
(c)The next edge Kruskal's algorithm would consider is BD, of cost 8. Explain why this edge cannot be selected.(1)
(Total for Question 5 is 7 marks)
6
Yusuf, a network engineer, is planning fibre-optic cable connections between six towns, P, Q, R, S, T, U. The distance matrix below shows the length, in km, of cable needed for every possible direct connection:

P Q R S T U
P - 6 4 9 11 13
Q 6 - 5 7 10 12
R 4 5 - 3 8 14
S 9 7 3 - 6 9
T 11 10 8 6 - 4
U 13 12 14 9 4 -
(a)Starting at P, apply Prim's algorithm to the matrix to find a minimum spanning tree. At each stage, state the town added to the tree and the length of cable used to connect it.(6)
(b)State the total length of cable required for the minimum spanning tree found.(1)
(Total for Question 6 is 7 marks)
7
A network of road junctions, A to G, used by a fleet of breakdown-recovery vans, has direct roads with journey times, in minutes: AB = 4, AC = 7, BC = 2, BD = 6, CD = 3, CE = 8, DE = 1, DF = 5, EF = 4, EG = 7, FG = 2
(a)Use Dijkstra's algorithm, starting at A, to find the shortest time from junction A to every other junction. Show clearly the working values considered, and the order in which each junction receives its final (permanent) label.(8)
(b)State the shortest route from A to G, and its length.(2)
(Total for Question 7 is 10 marks)
8
Deepak, a parks ranger, must inspect every path in Thornfield Park at least once, starting and finishing at the main gate, A. The park's paths form a network with vertices A to H, and path lengths, in metres: AB = 6, AC = 5, AH = 10, BC = 4, BD = 7, CD = 3, CE = 8, DE = 6, DF = 9, EF = 4, EG = 7, FG = 5, FH = 6, GH = 3
(a)Write down the vertices of odd degree in this network.(1)
(b)Find the length of the shortest path between each possible pairing of these four odd vertices into two pairs, and hence state the total length of each of the three possible pairings.(6)
(Total for Question 8 is 7 marks)
9
This question continues from Question 8, using the same park network and path lengths.
(a)Hence find the length of the shortest route, starting and finishing at A, that covers every path in the park at least once.(2)
(b)State which two paths Deepak must walk along twice during this shortest route.(1)
(Total for Question 9 is 3 marks)
10
This question concerns further properties of graphs and networks.
(a)A connected planar graph has 9 vertices and 14 edges. Use Euler's formula for planar graphs, v - e + f = 2, to find the number of faces of the graph (including the unbounded outer face).(2)
(b)State what is meant by a bipartite graph, and calculate the number of edges in the complete bipartite graph K(4,5), which has one set of 4 vertices and another set of 5 vertices, with every vertex in one set joined to every vertex in the other set, and no edges within either set.(2)
(c)State what is meant by a Hamiltonian cycle in a graph, and explain how this differs from an Eulerian circuit.(2)
(d)Explain why every tree must be a bipartite graph.(2)
(Total for Question 10 is 8 marks)
11
This question concerns the efficiency of sorting algorithms as the size of a list, n, increases.
(a)State the order of the bubble sort algorithm, in terms of the number of items n, for the worst-case number of comparisons required.(1)
(b)Given that, in the worst case, a bubble sort on a list of n items requires exactly n(n - 1)/2 comparisons, calculate this number of comparisons for a list of n = 60 items.(2)
(c)A quicksort algorithm has worst-case order O(n2), the same as bubble sort, but average-case order O(n log n). Explain why quicksort is generally preferred over bubble sort in practice, despite sharing the same worst-case order.(2)
(Total for Question 11 is 5 marks)
12
A logistics manager is planning work on the same road network connecting a depot and several towns, and has three separate problems to solve:
Problem 1: connect every town to the depot using cable of minimum total length (the towns do not need to be able to reach each other quickly afterwards, only to be linked into a single network).
Problem 2: find the quickest possible route for a single van to drive from the depot to one specific town.
Problem 3: find the shortest possible route for a gritting lorry that must drive along every road in the network at least once, starting and finishing at the depot.

Discuss which type of algorithm, a minimum spanning tree algorithm (Kruskal's or Prim's), Dijkstra's algorithm, or the route inspection algorithm, should be used to solve each problem. Your answer should explain what feature of each problem identifies the correct technique, and explain why using an incorrect technique would fail to answer the question actually being asked.
(Total for Question 12 is 6 marks)
13
Aaliyah is organising a charity obstacle-course event with five checkpoints, P, Q, R, S, T, linked by permanently open trail paths. The distances between checkpoints connected by a trail, in metres, are: PQ = 120, PR = 200, PS = 340, QR = 90, QT = 260, RS = 150, RT = 210, ST = 180 (there is no direct trail between any other pair of checkpoints).
(a)The organisers need to run a single length of event cable connecting all five checkpoints, using the least total length of cable. Use Kruskal's algorithm to find this minimum length, showing the edges you accept and at least one edge you reject, with a reason.(4)
(b)A safety marshal, Owen, must travel from the checkpoint at P to the checkpoint at T, using the original trail network (not necessarily the minimum cable route found in part (a)). Use Dijkstra's algorithm, starting at P, to find the length of the shortest route from P to T. Show the order in which each checkpoint receives its final label, and state the shortest route.(5)
(c)Crates of bottled water, of mass 14, 22, 9, 18, 27, 11 and 16 kg, must be loaded into vans, each with a capacity of 45 kg. Calculate a lower bound for the number of vans required, then apply first-fit decreasing to pack the crates. State the contents of each van, and state whether the lower bound has been achieved.(4)
(Total for Question 13 is 13 marks)
Mark scheme · FP.D5 Decision: Algorithms and Graph Theory Depth

Question 1

Question 2

Question 3

Question 4

Question 5

Question 6

Question 7

Question 8

Question 9

Question 10

Question 11

Question 12

Question 13

Mark your answers

This checks your answers in your browser, stores nothing on a server and needs no account.

Question 1

5 marks
Did your answer earn the marks?

Question 2

6 marks
Did your answer earn the marks?

Question 3

8 marks
Did your answer earn the marks?

Question 4

5 marks
Did your answer earn the marks?

Question 5

7 marks
Did your answer earn the marks?

Question 6

7 marks
Did your answer earn the marks?

Question 7

10 marks
Did your answer earn the marks?

Question 8

7 marks
Did your answer earn the marks?

Question 9

3 marks
Did your answer earn the marks?

Question 10

8 marks
Did your answer earn the marks?

Question 11

5 marks
Did your answer earn the marks?

Question 12

6 marks
Did your answer earn the marks?

Question 13

13 marks
Did your answer earn the marks?
Mark my answers