Professional Documents
Culture Documents
uk V 07 1 1
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
Example: Show how the following items are to be packed into boxes each of which has a capacity of 10Kg.
3kg
2kg
Sorting Algorithms
There are many sorting algorithms, so you must check carefully to see which, if any, you need to memorise for the examination.
Questions often ask about the relative efficiency of sorting algorithms by comparing the number of comparisons (c) and swaps that
are made to sort the same list of numbers, as seen in this example:
Bubble Sort
List 1st 2nd 3rd
pass pass pass First pass: the first number in the list is compared with the second and whichever is
6 1 1 1 smaller assumes the first position. The second number is then compared with the third
1 3 3 3 and the smaller is placed in the second position, and so on. At the end of the first pass,
3 6 5 5 the largest number will be at the bottom. For the list of five numbers on the right, this
7 5 6 6 involves 4 comparisons and 3 swaps.
5 7 7 7 Second pass: repeat first pass but exclude the last number (on the third pass the last two
c 4 3 2 numbers are excluded and so on).
s 3 1 0 The list is repeatedly processed in this way until no swaps take place in a pass.
total number of comparisons: 9 For a list of 5 numbers, the list will definitely be sorted after the 4th pass (why?), so this is
the maximum number of passes. The maximum number of comparisons is 4+3+2+1=10
total number of swaps: 4 and the maximum number of swaps is 10. You should be able to generalise this to a list
of n numbers.
In this case the quick sort takes fewer comparisons and swaps than the bubble sort, though it does take one more pass to achieve
the sort. It is worth noting that the relative efficiency of the different types of algorithm will vary depending on how mixed up
the list is.
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
Terminology Example:
An activity is a task which needs to be done and takes an The table shows the activities involved in creating a small patio
amount of time/resources to complete. in a garden.
Precedence tables show the activities that need to be done
together with their duration and their immediate predecessors. Activity Task Time Preceding
Precedence networks show the sequence of the activities. The Name (hrs) Activities
network must have one start node and one end node.
An event is the start/finish of one or more activities. A Clear Garden 4
Dummy activities are used to keep the correct logic and to B Measure area 1
ensure each activity is uniquely defined by (i, j) where i is its C Design Patio 2 B
starting event and j is the finishing event.
D Purchase fencing 1 B
E Buy pots and plants 3 A,C
This is correct F Plant all pots 1 E
This is incorrect G Purchase paving 1 C
H Construct Garden 6 A, D,G
It can be a good idea to do an initial sketch as its often possible
to make your diagram clearer by repositioning activities to avoid The network for this precedence table
them crossing over one another.
Forward pass establishes the earliest times that events can E(3)
happen. A(4)
F(1)
Backward pass establishes the latest time that an event can
happen.
Critical activites are those whose timing is critical if the project G(1)
is to be completed in the minimum time. The critical activities C(2)
B(1)
will form a path through the network H(6)
Float is the amount of time by which an activity can be delayed
D(1)
or extended.
Independent float does not affect other activities.
Interfering float is shared between two or more activities.
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
A(4)
F(1)
0 0 10 10
G(1)
C(2)
B(1) 3 3
H(6)
Float
0 1 2 3 4 5 6 7 8 9 10 If only three people are available for the first three hours,
A but a fourth friend can then come and help for an hour, we
B could move activity D within its float time to make this
C possible.
D
E This would make the cascade chart look like this
F
G
H
4
3 The resource histogram would now look like this
2 2
1
0 1 2 3 4 5 6 7 8 9 10
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
To
A
This shows a graph and its A B C
Incidence matrix. A 1 1
B 1 1
C From
C 1 1 2
B
Alan Biology
Donna Music
Example
The table shows the number of vertices of degree Order of vertex 1 2 3 4
1, 2, 3 and 4 for three different graphs. Graph 1 3 0 1 0
Draw an example of each of these graphs. Graph 2 0 0 4 1
Graph 3 0 2 2 1
solution
graph 1 graph 2 graph 3
Find the number of edges and the sum of the degrees of all the vertices of the graphs. What do you notice?
Graph 1: number of edges 3 sum of degrees of vertices 1+1+1+3 = 6
Graph 2: number of edges 8 sum of degrees of vertices 3+3+3+3+4=16
Graph 3: number of edges 7 sum of degrees of vertices 2+2+3+3+4 = 14
The sum of the degrees of the vertices is always twice the number of edges.
Also note that there are always an even number of odd vertices.
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
Minimisation problems are solved in exactly the same way. Just remember that this time you are looking for the vertex
which makes the objective function the lowest.
Integer Programming
If the solution to the problem has to have integer values then points with integer value coordinates, close to the optimal point
can be checked. This is likely to reveal the optimal solution but it is not guaranteed to. For example suppose the Objective
Function is 2 x + 3 y and that this should be maximised. The optimal point may be (30.6, 40. 8) but do not assume that
(30.40) will give the best solution; you must look at all the points with integer coordinates that are nearby: (31, 40), (30, 41),
(30, 40) and (31, 41).
However (31, 41) and (31, 40) are not in the feasible region. You can check this by substituting in the values into the
constraints. Of the two points nearby which are in the feasible region, namely (30, 41) and (30, 40), it can be seen that
(30, 41) provides the best profit.
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching each
specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
Example:
A manufacturer makes three products x, y and z which give profits of 160, Staff time Storage
120 and 120 per tonne respectively. Production is constrained by (hours /tonne) (m3 /tonne)
availability of staff and storage as summarised in this table: x 5 5
y 5 3
Formulate a linear programming problem. z 6 4
availability 30 20
Objective function Constraints
Objective function is maximise P = 160x + 120y + 120z Subject to: 5x + 5y + 6z + s1 = 30 (staff time)
P 160x 120y 120z = 0 5x + 3y + 4z + s2 = 20 (storage)
x 0, y 0, z 0 s1 0, s2 0
Solving the problem
Considering the problem in the example on the previous page, we must now set up an initial tableau.
Setting up the initial tableau Look for the largest negative value in the
P x y z s1 s2 RHS Ratio test objective row. This is in the x column, so we
will choose to increase x first.
1 -160 -120 -120 0 0 0 Since 4 < 6 so we choose 5 in row 3 as the
0 5 5 6 1 0 30 30/5 = 6 pivot element.
The idea now is to make the pivot 1 so divide
0 5 3 4 0 1 20 20/5 = 4 the pivot row by 5.
First iteration
Look for the largest negative value in the
P x y z s1 s2 RHS Ratio test objective row. This is in the y column, so we
row 1 + 160 row 3 1 0 -24 8 0 32 640 will choose to increase y.
Since 5 < 10 we choose 2 in row 2 as the
row 2 5 row 3 0 0 2 2 1 -1 10 10/2 = 5 pivot element.
The idea is to make the pivot 1 so divide the
row 3 0 1 0.6 0.8 0 0.2 4 4/0.4 = 10 pivot row by 2.
Second iteration
P x y z s1 s2 RHS The solution is optimal since there are no
row 1 + 24 row 2 1 0 0 32 12 20 760 negative values in the objective row.
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching each
specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
Solution
A F
Start by drawing a bipartite graph to model the situation
B G
C H
D M
E S
We have now reached E which was not in the initial matching so *
we have a breakthrough.
The laternating path is F A G C H E
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
Example A 3 C
In this directed network: 5 4
a) What is the maximum flow along the path SACT? 2
3
S T
b) Find an initial flow of value 7. 4
8
c) Find the maximum flow in the network. 6
3
3 4
c) Flow augmenting paths A C 3
0 4
5 01
SBCT with capacity 1 4 3 21
2
2
1 2
SBCDT with capacity 1 3 1
SABCDT with capacity 1 2 10
S 3 T
21 1 4 3 4
1 2
0 2 8
6 54 3 Diagrams showing the flow
6
0 augmenting paths can be
This gives a maximum total flow very messy. Try to keep
of 10. The flow is shown on this 4 yours as tidy as possible
diagram, along with the saturated arcs. 4 5 and always list the flow
B D 6
4 augmenting paths you have
A 3 C used
4 4
1
3 Cuts
S T A cut partitions the vertices into two sets, one containing the
2
6 source and one containing the sink.
6
The capacity of a cut is the total of all the cut edges with
4 D
direction going from source to sink
B
A 3 C
Find the capacity of the cuts shown on the directed network:
5 4
Note that only three cuts have been shown here, but there are many
more cuts in this network. 2
3
S T
C1 is the cut {S}, {A, B, C, D, T} 4
8
It has capacity 5 + 6 = 11 6
C2 is the cut {S, B}, {A, C, D, T} Note that we do not add the C1 B 4 D
capacity of arc AB as it is directed C2
It has capacity 5 + 0 + 3 + 4 = 12 from the sink side of the cut to the
C3
C3 is the cut {S, A, B}, {C, D, T} source side
It has capacity 3 + 3 + 4 = 10
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
The main ideas are covered in Before the exam you should know:
AQA Edexcel MEI OCR How to show all the working clearly, there are more
D1 D1 D1 D1 marks for the working than for getting the right answer.
The distinction between Kruskals and Prims algorithms.
How to apply Prims algorithm to both a network and a
table correctly.
That Prims and Kruskals algorithms will usually give
The main ideas in this topic are the same MST but often select the edges in a different
Appling Kruskals and Prims Algorithms to order. Make sure you show sufficient working so that the
find the minimum spanning tree of a network. examiner can see which algorithm you have used.
How to work with networks or tables and be able to
Applying Dijkstras Algorithm to find the
convert between the two.
shortest (or least value path from one vertex
That you must always show all the working values as
to any other vertex in the network.
well as the permanent labels when using Dijkstras
algorithm.
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
1 2 1 3 2 1
Prims Algorithm on a Table A B C D E F A B C D E F A B C D E F
1. Choose a column and cross out its row. Here D A - 4 4 A - 4 4 A - 4 4
has been chosen. Delete row D. B 4 - 2 B 4 - 2 B 4 - 2
2. Choose the smallest number in the column D C 4 2 - 3 2 6 C 4 2 - 3 2 6 C 4 2 - 3 2 6
and circle it. If there is a choice, choose either. D 3 - 3 D 3 - 3 D 3 - 3
3. For the number you have just circled, cross out E 2 - 3 E 2 - 3 E 2 - 3
its row and put an arrow above its row at the F 6 3 3 - F 6 3 3 - F 6 3 3 -
top of the table. 3 2 1 4 5 6 3 2 1 4 5
3 2 1 4
4. Choose the smallest number not already A B C D E F A B C D E F
A B C D E F
crossed out from the arrowed columns and
A - 4 4 A - 4 4 A - 4 4
circle it.
5. For the number you have just circled, cross out B 4 - 2 B 4 - 2 B 4 - 2
its row C 4 2 - 3 2 6 C 4 2 - 3 2 6 C 4 2 - 3 2 6
6. and put an arrow above its row at the top of D 3 - 3 D 3 - 3 D 3 - 3
the table. E 2 - 3 E 2 - 3 E 2 - 3
7. Continue till all vertices have been included in F 6 3 3 - F 6 3 3 - F 6 3 3 -
the tree.
Length of minimum spanning tree 14
Dijkstras Algorithm for the shortest path 1. Label the start vertex with permanent label 0 and order label 1.
1 0 2. Assign temporary labels to all the vertices that can be reached
D directly from the start.
A 3 3. Select the vertex with the smallest temporary label and make its
4 3 6 F label permanent. Add the correct order label.
1. Step 1 4. Put temporary labels on each vertex that can be reached directly
4
C 3 from the vertex you have just made permanent. The temporary
2 2
E label must be equal to the sum of the permanent label and the
B
direct distance from it. If there is an existing temporary label at a
vertex, it should be replaced only if the new sum is smaller.
5. Repeat steps 3 and 4 until the finishing vertex has a permanent
label.
1 0 6. To find the shortest paths(s), trace back from the end vertex to the
D start vertex. Write the route forwards and state the length.
A 3
4 3 6 F 5 7
2. Steps 2 4 1 0
C 3 7
and 3 2 2 D
A 3
B E 4 10 9
2 4 4 3 6 F
4 5. Steps 4 and 5 4
C 3
2 2
1 0 B E
D 3 4
A 2 4 4 6
3 10 4
4 4 6
3 6 F
4 5 7
3. Steps 4 C 3 1 0 7
2 2
and 5 3 4 E D 6 9
B A
4 4 3 10 9
2 4 3
4 6 F
6. Steps 4 4
C 3
1 0 and 5 2 2
7 B 3 4 E
D 4 6
A 3 2 4 4
4 10 9
3 6
6 F 4
4. Steps 4 4
C 3
and 5 2 2
B 3 4 E
4 6 7. Step 6 Solution:
2 4 4 Shortest path ACEF
6
4 Length 9
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching
each specification exactly.
the Further Mathematics network www.fmnetwork.org.uk V 07 1 1
The main ideas are covered in Before the exam you should know
AQA Edexcel MEI OCR That an Euler cycle is a tour which travels along every
D1 D1 D2 D1 edge of a network.
The meaning of: order of a vertex (node), traversable
graph and Eulerian graph.
The main ideas in this topic are
That the direct route between two vertices is not
An Eulerian network has all its vertices even. always the shortest.
Apply the Chinese Postman Algorithm to That you need to identify ALL the odd vertices in the
obtain the closed trail of minimum weight. route inspection problem.
12 10
Solution: 6
9
(a) Odd vertices are A, C, D and E. A 6 18 F
Consider all the possible pairings of odd vertices: C
AC = 6 and DE = 14 total = 20
11 8 12
AD = 11 and CE = 6 total = 17
AE = 12 and CD = 8 total = 20
D
The pairing of least weight is AD and CE = 17.
The sum of the weights in the network is 124.
Repeating AD and CE gives a total weight = 124 + 17 = 141.
A suitable route is A B E F D A C B F C E C D A.
Page 1 of 1
Disclaimer: Every effort has gone into ensuring the accuracy of this document. However, the FM Network can accept no responsibility for its content matching each
specification exactly.