Decision
Decision
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further
Mathematics.
Pure Mathematics Year 1/AS Statistics and Mechanics Year 1/AS Pure Mathematics Year 2 Pearson Edexcel A level Mathematics
Series Editor: Harry Smith Series Editor: Harry Smith
Series Editor: Harry Smith
Statistics and Mechanics Year 2
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Series Editor: Harry Smith
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level
Mathematics. Mathematics.
Mathematics. Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level
Pearson Edexcel A level Mathematics Pure Mathematics Year 2
This book can be used alongside the Year 1 book to cover all the content needed for the Pearson Edexcel Mathematics.
Pearson Edexcel AS and A level Mathematics Pure Mathematics Year 1/AS
This book covers all the content needed for the Pearson Edexcel AS level Pure Mathematics exam. It can
Edexcel AS and A level Mathematics Statistics and Mechanics Year 1/AS
This book covers all the content needed for the Pearson Edexcel AS level Statistics and Mechanics exam.
also be used alongside the Year 2 book to cover all the content needed for the Pearson Edexcel A level A level Pure Mathematics exams.
line digital
Pure Mathematics exams. level Statistics and Mechanics exam. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling A level Statistics and Mechanics exam.
• Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling as well as supporting the new calculators. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling
• Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling
as well as supporting the new calculators. as well as supporting the large data set and new calculators. • FREE additional online content to support your independent learning, including full worked solutions as well as supporting the large data set and new calculators.
• FREE additional online content to support your independent learning, including full worked solutions for every question in the book (SolutionBank), GeoGebra interactives and Casio calculator tutorials. • FREE additional online content to support your independent learning, including full worked solutions
• FREE additional online content to support your independent learning, including full worked solutions
on
for every question in the book (SolutionBank), GeoGebra interactives and Casio calculator tutorials. for every question in the book (SolutionBank), GeoGebra interactives and Casio calculator tutorials. • Includes access to an online digital edition (valid for 3 years once activated). for every question in the book (SolutionBank), GeoGebra interactives and Casio calculator tutorials.
• Includes access to an online digital edition (valid for 3 years once activated). • Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of • Includes access to an online digital edition (valid for 3 years once activated).
• Includes access to an online digital edition (valid for 3 years once activated).
• Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of mixed and review exercises. • Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of
• Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of
mixed and review exercises. mixed and review exercises.
mixed and review exercises.
Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books
Pearson Edexcel AS and A level Mathematics books
Year 1/AS Year 2 Year 1/AS Year 2
Year 1/AS Year 2 Year 1/AS Year 2
ed
n
line digital line digital
on line digital on
on line digital
on
ed
ed
n
n
ludes a
lu d e s a
ludes a
ed
it
it
ed
ludes a
n
ion
ion
it
ludes a
it
ion
ion
inc
inc
itio
inc
inc
Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books
Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books
Compulsory Options Compulsory Options
Compulsory Options Compulsory Options
Pearson Edexcel AS and A level Mathematics Pearson Edexcel AS and A level Mathematics Pearson Edexcel A level Mathematics Pearson Edexcel A level Mathematics
Pure Mathematics Statistics and Mechanics Pure Mathematics Statistics and Mechanics
n
Year 1/AS Year 1/AS Year 2 Year 2
inc
For more information visit: www.pearsonschools.co.uk/edalevelmaths2017 For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
For more information visit: www.pearsonschools.co.uk/edalevelmaths2017 For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
www.pearsonschools.co.uk www.pearsonschools.co.uk
www.pearsonschools.co.uk
[email protected] www.pearsonschools.co.uk [email protected]
[email protected]
[email protected]
1 1 2 2
CVR_MATH_SB_AL_0274_CVR.indd 1 1/18/19 10:05 AM CVR_MATH_SB_AL_2020_CVR.indd 1 1/22/19 11:56 AM
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further
Mathematics. Mathematics. Mathematics. Mathematics. Mathematics.
Pearson Edexcel AS and A level Further Mathematics Further Mechanics 1
This book covers all the content needed for the optional Pearson Edexcel AS and A level Further
Pearson Edexcel AS and A level Further Mathematics Core Pure Maths Book 1/AS
This book covers all the content needed for the compulsory Pearson Edexcel AS level Core Pure
Pearson Edexcel AS and A level Further Mathematics Further Statistics 1
This book covers all the content needed for the optional Pearson Edexcel AS and A level Further
Pearson Edexcel AS and A level Further Mathematics Further Pure Mathematics 1
Pearson Edexcel AS and A level Further Mathematics Decision Mathematics 1
This book can be used alongside the Year 1 book to cover all the content needed for the Pearson Edexcel This book covers all the content needed for the optional Pearson Edexcel AS and A level Further Pure
Mathematics exam. It can also be used alongside Book 2 to cover all the content needed for the Statistics 1 exams. Mechanics 1 exams. AS and A level Further Mathematics exams. Mathematics 1 exams.
compulsory Pearson Edexcel A level Core Pure Mathematics exams. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling.
• Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling.
• Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions
• FREE additional online content to support your independent learning, including full worked solutions for every question in the book (SolutionBank) and GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives.
for every question in the book (SolutionBank) and GeoGebra interactives. • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated).
• Includes access to an online digital edition (valid for 3 years once activated). • Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers, and plenty of
• Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of mixed and review exercises. mixed and review exercises. mixed and review exercises. mixed and review exercises.
mixed and review exercises.
Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books
Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2
line digital line digital line digital line digital line digital
on on on on on
ed
ed
ed
ed
ed
n
n
ludes a
ludes a
ludes a
lu d e s a
ludes a
it
itio
it
it
itio
ion
ion
ion
n
n
inc
inc
inc
inc
inc
Decision Mathematics 1
Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books
Compulsory Options Compulsory Options Compulsory Options Compulsory Options Compulsory Options
Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics
Core Pure Mathematics Further Statistics 1 Further Mechanics 1 Decision Mathematics 1 Further Pure Mathematics 1
1 1 1 1 1
CVR_MATH_SB_AL_0397_FCVR.indd 1 CVR_MATH_SB_AL_0434_CVR.indd 1 1/18/19 9:41 AM 1/17/19 1:29 PM
CVR_MATH_SB_AL_0359_FCVR.indd 1 CVR_MATH_SB_AL_0380_FCVR.indd 1 1/22/19 10:38 AM 1/18/19 9:30 AM
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further
Mathematics. Mathematics. Mathematics. Mathematics. Mathematics.
This book covers all the content needed for the optional Pearson Edexcel AS and A level Further Statistics 2
Pearson Edexcel AS and A level Further Mathematics Further Mechanics 2
Pearson Edexcel AS and A level Further Mathematics Further Statistics 2
Pearson Edexcel A level Further Mathematics Core Pure Maths Book 2
This book covers all the content needed for the optional Pearson Edexcel AS and A level Further
Pearson Edexcel AS and A level Further Mathematics Further Pure Mathematics 2
This book can be used alongside Book 1 to cover all the content needed for the compulsory Pearson This book covers all the content needed for the optional Pearson Edexcel AS and A level Further Pure
Pearson Edexcel AS and A level Further Mathematics Decision Mathematics 2
This book covers all the content needed for the optional Pearson Edexcel AS and A level Decision
Edexcel A level Core Pure Mathematics exams. exams. Mechanics 2 exams. Mathematics 2 exams. Mathematics 2 exams.
• Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling.
• FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions for • FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions
for every question in the book (SolutionBank) and GeoGebra interactives. every question in the book (SolutionBank), GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives.
• Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated).
• Includes worked examples with guidance, lots of exam-style questions, practice papers, and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers, and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers, and plenty of
mixed and review exercises. mixed and review exercises. mixed and review exercises. mixed and review exercises. mixed and review exercises.
Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books
Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2
line digital line digital line digital line digital line digital
on on on on on
ed
ed
ed
ed
ed
n
n
ludes a
ludes a
ludes a
ludes a
ludes a
it
itio
it
it
itio
ion
ion
ion
n
n
inc
inc
inc
inc
inc
Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books
Compulsory Options Compulsory Options Compulsory Options Compulsory Options Compulsory Options
Pearson Edexcel A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics
D1
Core Pure Mathematics Further Statistics 2 Further Mechanics 2 Decision Mathematics 2 Further Pure Mathematics 2
www.pearsonschools.co.uk
[email protected]
Book 2 For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
www.pearsonschools.co.uk
[email protected]
FS2
For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
www.pearsonschools.co.uk
[email protected]
FM2
For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
www.pearsonschools.co.uk
[email protected]
D2 For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
www.pearsonschools.co.uk
[email protected]
FP2
2 2 2 2 2
CVR_MATH_SB_AL_3343_FCVR.indd 1 1/17/19 1:49 PM CVR_MATH_SB_AL_3305_FCVR.indd 1 CVR_MATH_SB_AL_0465_CVR.indd 1 1/17/19 1:34 PM 1/17/19 1:30 PM
CVR_MATH_SB_AL_3381_FCVR.indd 1 CVR_MATH_SB_AL_ 3329_FCVR.indd 1 1/17/19 12:54 PM 1/17/19 12:53 PM
www.pearsonschools.co.uk
[email protected]
1
CVR_MATH_SB_AL_0397_FCVR.indd 1 1/22/19 1:55 PM
11 – 19 PROGRESSION
Decision Mathematics 1
D1
Series Editor: Harry Smith
Authors: Susie Jameson, Peter Sherran, Keith Pledger, Harry Smith
Pearson has robust editorial processes, including answer and fact checks, to ensure the
accuracy of the content in this publication, and every effort is made to ensure this publication
is free of errors. We are, however, only human, and occasionally errors do occur. Pearson is not
liable for any misunderstandings that arise as a result of errors in this publication, but it is
our priority to ensure that the content is accurate. If you spot an error, please do contact us at
[email protected] so we can make sure it is corrected.
ii
iii
Overarching themes
The following three overarching themes have been fully integrated throughout the Pearson Edexcel
AS and A level Mathematics series, so they can be applied alongside your learning and practice.
1. Mathematical argument, language and proof
• Rigorous and consistent approach throughout
• Notation boxes explain key mathematical language and symbols
• Dedicated sections on mathematical proof explain key principles and strategies
• Opportunities to critique arguments and justify methods
2. Mathematical problem solving The Mathematical Problem-solving cycle
iv
Exercise questions
are carefully graded
so they increase
in difficulty and
gradually bring you
up to exam standard
Exercises are
packed with exam-
style questions
to ensure you
are ready for the
exams
A level content is
clearly flagged
Differentiation 12A
1 a Examples of estimates of gradients:
Gradient of tangent at x = −1 is 2 c i Gradient of AD = y2 − y1
y2 − y1 3 −1 x2 − x1
=
x2 − x1 (−1) − (−0.5) 0.8 − 0.19
=
= −4 0.6 − 0.9
Gradient of tangent at x = 0 is = −1.21 (3 s.f.)
y2 − y1 1 − (−1)
=
x2 − x1 (−0.5) − (0.5) ii Gradient of AC = y2 − y1
= −2 x2 − x1
Gradient of tangent at x = 1 is 0.8 − 0.6
=
y2 − y1 (−1) − (−1)
SolutionBank
0.6 − 0.8
=
x2 − x1 2−0 = −1
=0
Gradient of tangent at x = 2 is iii Gradient of AB = y2 − y1
y2 − y1 (−1) − 1 x2 − x1
=
available in SolutionBank.
=1 9.0601 − 9 0.0601
iv Gradient
= = = 6.01
2p − 2 = 2(1.5) − 2 = 1 3.01 − 3 0.01
Use of technology
Explore topics in more detail, visualise Online Find the point of intersection
problems and consolidate your understanding graphically using technology.
using pre-made GeoGebra activities.
GeoGebra-powered interactives
Interact with the maths you are learning
using GeoGebra's easy-to-use tools
www.pearsonschools.co.uk/d1maths
You can also access the extra online content by scanning this QR code:
vi
Find:
a the output when the input is 11
b the input when the output is 99.
At the end of the street turn right and Affix base (B) to leg (A) Dice two large onions.
go straight over the crossroads, take the using screw (F ) and ... Slice 100 g mushrooms.
third left after the school, then ... Grate 100 g cheese.
Example 1
Example 2
1 Let n = 1, A = 1, B = 1.
2 Print A and B.
3 Let C = A + B.
These are not equations.
4 Print C.
They are instructions that mean:
5 Let n = n + 1, A = B, B = C. ● replace n by n + 1 (add 1 to n)
● A takes B’s current value
6 If n < 5 go to 3.
● B takes C’s current value
7 If n = 5 stop.
Example 3
a A B
Each time the number in the left-hand column is
29 34 halved and the number in the right-hand column
is doubled.
14 68
7 136 Step 4 means that rows where the number in the
3 272 left-hand column is even must be deleted before
summing the right-hand column.
1 544
Total 986
So 29 × 34 = 986
b A B
66 56
33 112
Each deleted row has an even number in its left-
16 224
hand column.
8 448
4 896
2 1792
1 3584
Total 3696
So 66 × 56 = 3696
Exercise 1A
1 Use the algorithm in Example 3 to evaluate:
a 244 × 125 b 125 × 244 c 256 × 123
a Implement this algorithm with the input numbers 2 _4 and 1 _3
1 1
1 Let A = 1, n = 1.
2 Print A.
3 Let A = A + 2n + 1.
4 Let n = n + 1.
5 If n < 10, go to 2.
6 Stop.
The boxes in a flow chart are linked by arrowed lines. As with an algorithm written in words, you need
to follow each step in order.
Example 4
Box 1 Start
Box 2 Let n = 0
Box 4 Let E = 2n
Box 5 Print E
Is No
Box 6 n > 10? A decision box will contain a question to
which the answer is either ‘yes’ or ‘no’.
Yes
Box 7 Stop
a n E Box 6 b n E Box 6
0 0
1 2 no 1 3 no
2 4 no 2 6 no
3 6 no 3 9 no
4 8 no 4 12 no
In a trace table each
5 10 no 5 15 no
step must be made
6 12 no 6 18 no
clear.
7 14 no 7 21 no
8 16 no 8 24 no
9 18 no 9 27 no
10 20 yes 10 30 yes
Output is 2, 4, 6, 8, 10, 12, Output is 3, 6, 9, 12, 15, 18, 21, 24,
14, 16, 18, 20 27, 30
This gives the first ten multiples of
3 rather than the first ten multiples
of 2.
Example 5
This flow chart can be used to find the roots of an equation of the form ax2 + bx + c = 0.
Start
Input a, b, c.
Let d = b2 – 4ac
Is Yes
Print ‘no real roots’
d < 0? You should recognise d
No as the discriminant of
Is Yes the equation.
Let x = – b Print ‘equal roots are’ x
d = 0? 2a ← Pure Year 1, Section 2.5
No
Let x1 = – b + d
2a
Let x2 = – b – d
2a
Stop
a a b c d d < 0? d = 0? x1 x2
__
11
6 −5 −11 289 no no 6 −1
__
11
roots are 6 and −1
b a b c d d < 0? d = 0? x
1 −6 9 0 no yes 3
equal roots are 3
c a b c d d < 0?
4 3 8 −119 yes
no real roots
Example 6
Apply the algorithm shown by the flow chart on the right to the data: Start
u1 = 10, u2 = 15, u3 = 9, u4 = 7, u5 = 11
What does the algorithm do? Box 1 Let n = 1 and A = u1
Box 5 9
Box 6 Yes Is Yes
Box 6
Box 2 4 n < 5?
Box 3 7 No
Box 4 Yes Box 7 Print ‘Output is’ A
Box 5 7
Box 6 Yes
Stop
Box 2 5
Box 3 11
This is quite complicated because it has questions
Box 4 No
and a list of data. Tackle one step at a time.
Box 6 No
Box 7 Output is 7
The algorithm selects the smallest number The box numbers have been included to help
from a list. you to follow the algorithm. You do not need to
include them in your exam.
Exercise 1B
1 Apply the flow chart in Example 5 to the following equations.
a 4x2 − 12x + 9 = 0 b −6x2 + 13x + 5 = 0 c 3x2 − 8x + 11 = 0
c Which box would need to be altered if the algorithm had to be applied to a list of 8 numbers?
Is Yes
r = 0? Print b Stop
No
Let a = b, b = r
(4 marks) No
b Explain what is achieved by this flow chart. (2 marks) Stop
A=A–B
c Given that A = kB for some positive integer
k, write down the output of the flow chart. (1 mark)
10
Example 7
Use a bubble sort to arrange this list into ascending order.
24 18 37 11 15 30
24 18 37 11 15 30 1st comparison: swap Hint In your exam you may be asked to show
18 24 37 11 15 30 2nd comparison: leave each comparison for one pass, but generally
you will only be required to give the state of
18 24 37 11 15 30 3rd comparison: swap
the list after each pass.
18 24 11 37 15 30 4th comparison: swap
18 24 11 15 37 30 5th comparison: swap 37 is already in its final position. It is now not
18 24 11 15 30 37 End of first pass in the working list. We now return to the start
After the second pass the list becomes of the working list for the second pass.
18 11 15 24 30 37
After the third pass, the last three items are
After the third pass the list is
guaranteed to be in their final positions. In
11 15 18 24 30 37 this particular case, the list is fully ordered
After the fourth pass the list is but the algorithm requires another pass to
11 15 18 24 30 37 be made.
No swaps were made in the fourth pass, so the
list is in order.
Example 8
A list of n letters is to be sorted into alphabetical order, starting at the left-hand end of the list.
a Describe how to carry out the first pass of a bubble sort on the letters in the list.
b Carry out the first pass of a bubble sort to arrange the letters in the word ALGORITHM into
alphabetical order, showing every step of the working.
c Show the order of the letters at the end of the second pass.
11
Example 9
39 57 72 39 17 24 48 39 < 57 so swap
57 39 72 39 17 24 48 39 < 72 so swap Watch out Read the question carefully. You
57 72 39 39 17 24 48 39 ≮ 39 so leave need to sort the list into descending order.
57 72 39 39 17 24 48 39 ≮ 17 so leave
57 72 39 39 17 24 48 17 < 24 so swap
57 72 39 39 24 17 48 17 < 48 so swap
57 72 39 39 24 48 17
After 1st pass: 57 72 39 39 24 48 17
After 2nd pass: 72 57 39 39 48 24 17
Note that the 48 is now between the two 39s.
After 3rd pass: 72 57 39 48 39 24 17 Do not treat the two 39s as one term.
After 4th pass: 72 57 48 39 39 24 17
After 5th pass: 72 57 48 39 39 24 17 Make sure that you make a statement like
No swaps in 5th pass, so the list is in order. this to show that no swaps have been made
and you have completed the algorithm.
Exercise 1C
1 Apply a bubble sort to arrange each list into:
a ascending order b descending order
i 23 16 15 34 18 25 11 19
ii N E T W O R K S Hint For part iii, order
iii A5 D3 D2 A1 B4 C7 C2 B3 alphabetically then numerically.
So C2 comes after A5 but
For each part, you only need to show the state of the list at
before C7.
the end of each pass.
2 Perform a bubble sort to arrange these place names into alphabetical order.
Chester York Stafford Bridlington Burton Cranleigh Evesham
12
Here is the quick sort algorithm, used to sort a list into ascending order.
1 Choose the item at the midpoint of the list to If the list has an even number of
be the first pivot. items, the pivot should be the
item to the right of the middle.
2 Write down all the items that are less than the
pivot, keeping their order, in a sub-list. Do not sort the items as you
write them down.
3 Write down the pivot.
4 Write down the remaining items (those greater
than the pivot) in a sub-list.
5 Apply steps 1 to 4 to each sub-list. This is a recursive algorithm. It is
like ‘zooming in’ on the answer.
6 When all items have been chosen as pivots, stop.
The number of pivots has the potential to double at each pass. There is 1 pivot at the first pass, there
could be 2 at the second, 4 at the third, 8 at the fourth, and so on.
Example 10
Use quick sort to arrange the numbers below into ascending order.
21 24 42 29 23 13 8 39 38
13
n+1
21 24 42 29 23 13 8 39 38 For n items, the pivot will be the _____ th item,
2
rounding up if necessary.
There are 9 numbers in the list so the middle
21 13 8 9+1
will be _____
= 5, so the pivot is the 5th number
2
in the list. Circle it.
21 13 8 23
Write all the numbers less than 23.
21 13 8 23 24 42 29 39 38
Write the pivot in a box , then write the
remaining numbers.
21 13 8 23 24 42 29 39 38
Now select a pivot in each sub-list.
8 13 21 23 24 29 42 39 38
There are now four sub-lists so we choose 4
pivots (circled).
8 13 21 23 24 29 38 39 42
We can only choose two pivots this time. Each
8 13 21 23 24 29 38 39 42 number has been chosen as a pivot, so the list
is in order.
Example 11
Use quick sort to arrange the list below into descending order.
37 20 17 26 44 41 27 28 50 17
14
Exercise 1D
1 Use a bubble sort to arrange the list
8 3 4 6 5 7 2
into:
a ascending order b descending order
E/P 5 A list of n items is to be written in ascending order using the bubble sort.
a Find an expression, in terms of n, for the maximum number of comparisons to be made.
(2 marks)
b Describe a situation where the bubble sort might be quicker than the quick sort. (2 marks)
c Decide whether the bubble sort or the quick sort will be quicker in the following cases:
i 1 2 3 7 4 5 6
ii 2 3 4 5 6 7 1
Explain how you made your decisions. (4 marks)
15
Challenge
You will need a pack of ordinary playing cards, with any jokers removed.
a Use the quick sort algorithm to sort the cards into ascending order,
from Ace to King within each suit and with the suits in the order
Hearts, Clubs, Diamonds, Spades. Follow these steps:
1 Shuffle the pack thoroughly and hold it face up.
2 Remove the 27th card and place it face up. This is your pivot card. Hint The final order
3 Go through the pack from the top. Place the cards into two piles should be:
depending on whether they are lower or higher than the pivot card. A♥, 2♥, …, K♥, A♣, 2♣, …,
K♣, A♦, …, K♦, A♠, …, K♠
4 Repeat these steps with each new pile, choosing the card halfway
through the pile as the pivot card.
Record the total number of passes needed to sort the deck
completely.
b Once the cards are in order, what single change could be made so
that a bubble sort would require 51 passes to put the cards back in
order?
b
a
b
b b
a
a a a a a
Similar problems are: loading cars of different lengths onto a ferry with several lanes of equal length,
a plumber needing to cut sections from lengths of copper pipe, or recording music tracks onto a set
of CDs.
You need to be able to implement three different bin-packing algorithms, and be aware of their
strengths and weaknesses.
■ The three bin-packing algorithms are: first-fit, first-fit decreasing and full-bin.
It is useful first to find a lower bound for the number Notation An optimal solution is one
of bins needed. There is no guarantee that you will be that cannot be improved upon. For bin
able to pack the items into this number of bins, but it packing, an optimal solution will use the
will tell you if you have found an optimal solution. smallest possible number of bins.
16
Example 12
0.3 + 0.7 + 0.8 + 0.8 + 1.0 + 1.1 + 1.1 + 1.2 Sum the heights and divide by the bin size. You
+ 1.5 = 8.5 m must always round up to determine the lower
8.5
____ bound.
= 4.25 bins
2
So a minimum of 5 bins will be needed. Watch out In practice, it may not be possible
to pack these boxes into 5 bins. All that the lower
bound is telling us, is that at least five bins will
be needed.
Example 13
Use the first-fit algorithm to pack the following items into bins of size 20. (The numbers in brackets
are the size of the item.) State the number of bins used and the amount of wasted space.
A(8) B(7) C(14) D(9) E(6) F(9) G(5) H(15) I(6) J(7) K(8)
Bin 1: A(8) B(7) G(5) A(8) goes into bin 1, leaving space of 12.
Bin 2: C(14) E(6) B(7) goes into bin 1, leaving space of 5.
Bin 3: D(9) F(9) C(14) goes into bin 2, leaving space of 6.
Bin 4: H(15) D(9) goes into bin 3, leaving space of 11.
Bin 5: I(6) J(7) E(6) goes into bin 2, leaving space of 0.
Bin 6: K(8) F(9) goes into bin 3, leaving space of 2.
G(5) goes into bin 1, leaving space of 0.
This used 6 bins and there are
H(15) goes into bin 4, leaving space of 5.
2 + 5 + 7 + 12 = 26 units of waste of space.
I(6) goes into bin 5, leaving space of 14.
J(7) goes into bin 5, leaving space of 7.
K(8) goes into bin 6, leaving space of 12.
17
■ The first-fit decreasing algorithm requires the items to be in descending order before
applying the algorithm.
First-fit decreasing algorithm
Advantages: You usually get a fairly good solution. Online See the operation of the
It is easy to implement. first-fit decreasing algorithm using
Disadvantage: You may not get an optimal solution. GeoGebra.
Example 14
Apply the first-fit decreasing algorithm to the data given in Example 13.
Sort the data into descending order: H(15) goes into bin 1, leaving space of 5.
H(15) C(14) D(9) F(9) A(8) K(8) B(7) C(14) goes into bin 2, leaving space of 6.
J(7) E(6) I(6) G(5) D(9) goes into bin 3, leaving space of 11.
Bin 1: H(15) G(5) F(9) goes into bin 3, leaving space of 2.
Bin 2: C(14) E(6) A(8) goes into bin 4, leaving space of 12.
K(8) goes into bin 4, leaving space of 4.
Bin 3: D(9) F(9)
B(7) goes into bin 5, leaving space of 13.
Bin 4: A(8) K(8)
J(7) goes into bin 5, leaving space of 6.
Bin 5: B(7) J(7) I(6)
E(6) goes into bin 2, leaving space of 0.
This used 5 bins and there are I(6) goes into bin 5, leaving space of 0.
2 + 4 = 6 units of wasted space. G(5) goes into bin 1, leaving space of 0.
■ Full-bin packing uses inspection to select items that will combine to fill bins. Remaining
items are packed using the first-fit algorithm.
Full-bin packing
1 Use observation to find combinations of items that will fill a bin. Pack these items first.
2 Any remaining items are packed using the first-fit algorithm.
Example 15
A(8) B(7) C(10) D(11) E(13) F(17) G(4) H(6) I(12) J(14) K(9)
The items above are to be packed in bins of size 25.
a Determine the lower bound for the number of bins.
b Apply the full-bin algorithm.
c Is your solution optimal? Give a reason for your answer.
18
a 111 ÷ 25 = 4.44
So lower bound is 5 bins.
b 8 + 7 + 10 = 25
11 + 14 = 25
13 + 12 = 25
The first three bins are full bins.
so a solution is:
Bin 1: A(8) B(7) C(10)
We now apply the first-fit algorithm to the
Bin 2: D(11) J(14)
remainder.
Bin 3: E(13) I(12)
F(17) goes into bin 4, leaving space of 8.
Bin 4: F(17) G(4)
G(4) goes into bin 4, leaving space of 4.
Bin 5: H(6) K(9)
H(6) goes into bin 5, leaving space of 19.
c The lower bound is 5 and 5 bins were K(9) goes into bin 5, leaving space of 10.
used, so the solution is optimal.
Example 16
A plumber needs to cut the following lengths of copper pipe. (Lengths are in metres.)
A(0.8) B(0.8) C(1.4) D(1.1) E(1.3) F(0.9) G(0.8) H(0.9) I(0.8) J(0.9)
The pipe comes in lengths of 2.5 m.
a Calculate the lower bound of the number of lengths of pipe needed.
b Use the first-fit decreasing algorithm to determine how the required lengths may be cut from the
2.5 m lengths.
c Use full-bin packing to find an optimal solution.
0.8 + 0.8 + 1.4 + 1.1 + 1.3 + 0.9 + 0.8 + 0.9 + 0.8 + 0.9
a ____________________________________________________
2.5
= 3.88
Since a sort was not asked for, this can
So at least 4 lengths are required.
be done by inspection.
b Sorting into descending order,
C(1.4), E(1.3), D(1.1), F(0.9), H(0.9), J(0.9), A(0.8), B(0.8),
G(0.8), I(0.8) C goes into bin 1, leaving space of 1.1.
Bin 1: C(1.4) D(1.1) E goes into bin 2, leaving space of 1.2.
D goes into bin 1, leaving space of 0.
Bin 2: E(1.3) F(0.9)
F goes into bin 2, leaving space of 0.3.
Bin 3: H(0.9) J(0.9)
H goes into bin 3, leaving space of 1.6.
Bin 4: A(0.8) B(0.8) G(0.8)
J goes into bin 3, leaving space of 0.7.
Bin 5: I(0.8)
A goes into bin 4, leaving space of 1.7.
c By inspection,
B goes into bin 4, leaving space of 0.9.
C(1.4) + D(1.1) = 2.5
G goes into bin 4, leaving space of 0.1.
F(0.9) + A(0.8) + B(0.8) = 2.5 I goes into bin 5, leaving space of 1.7.
J(0.9) + G(0.8) + I(0.8) = 2.5
A full-bin solution is:
Bin 1: C(1.4) D(1.1) In part a we found that at least 4
Bin 2: F(0.9) A(0.8) B(0.8) lengths would be needed, so this
Bin 3: J(0.9) G(0.8) I(0.8) solution is optimal since it uses 4
Bin 4: E(1.3) H(0.9) lengths.
19
Exercise 1E
1 18 4 23 8 27 19 3 26 30 35 32
The above items are to be packed in bins of size 50.
a Calculate the lower bound for the number of bins.
b Pack the items into the bins using:
i the first-fit algorithm ii the first-fit decreasing algorithm iii the full-bin algorithm
2 Laura wishes to record the following television programmes onto DVDs, each of which can hold
up to 3 hours of programmes.
Programme A B C D E F G H I J K L M
Length (minutes) 30 30 30 45 45 60 60 60 60 75 90 120 120
a Apply the first-fit algorithm, in the order A to M, to determine the number of DVDs that
need to be used. State which programmes should be recorded on each disc.
b Repeat part a using the first-fit decreasing algorithm.
c Is your answer to part b optimal? Give a reason for your answer.
Laura finds that her DVDs will only hold up to 2 hours of programmes.
d Use the full-bin algorithm to determine the number of DVDs she needs to use. State which
programmes should be recorded on each disc.
E 3 A small ferry loads vehicles into 30 m lanes. The vehicles are loaded bumper to bumper.
Vehicle Length (m) Vehicle Length (m)
A car 4m F car 4m
B car 1 trailer 7m G lorry 12 m
C lorry 13 m H lorry 14 m
D van 6m I van 6m
E lorry 13 m J lorry 11 m
a Describe one difference between the first-fit and full-bin methods of bin packing. (1 mark)
b Use the first-fit algorithm to determine the number of lanes needed to load all the
vehicles. (4 marks)
c Use a full-bin method to obtain an optimal solution using the minimum number of lanes.
Explain why your solution is optimal. (4 marks)
E 4 The ground floor of an office block is to be fully recarpeted, with specially made carpet
incorporating the firm’s logo. The carpet comes in rolls of 15 m.
The following lengths are required.
A 3m D 4m G 5m J 7m
B 3m E 4m H 5m K 8m
C 4m F 4m I 5m L 8m
20
a Use the first-fit decreasing algorithm to determine which programs should be recorded onto
each disc. (3 marks)
b Calculate a lower bound for the number of discs
Problem-solving
needed. (2 marks)
Consider the programs over
c Explain why it is not possible to record these programs
20 MB in size.
on the number of discs found in part b. (1 mark)
The number of steps needed to complete an algorithm is often used to determine its order.
For the bubble sort, most of the steps are to do with making comparisons between pairs of numbers.
If a list has n items, then the first pass will require (n − 1) comparisons.
Assuming that some swaps are made, a second pass will be needed and this will require a further
(n − 2) comparisons.
In the worst case, this process continues so that (n − 3) comparisons are needed for the third pass,
(n − 4) comparisons for the fourth pass and so on, right down to a single comparison in the final
pass.
21
Since this is a quadratic expression, the bubble sort is taken to have quadratic order.
Watch out A different algorithm may require 50n2 + 11n + 90 steps to complete a
problem of size n. This algorithm would also be described as having quadratic order.
Example 17
Input n
Let a = 2
Is n Yes
a=a+1 divisible A Stop
by a?
Yes Is No
a < n? B Stop
22
Example 18
1250
_____
= 2.5 The size of the problem has increased from 500
500
to 1250, which is a factor of 2.5. The algorithm has
0.036 × 2.5 = 0.09
linear order, so the time taken will increase by the
The time taken to search a list containing same factor.
1250 values is approximately 0.09 seconds.
Example 19
23
Exercise 1F
1 An algorithm for multiplying two n × n matrices has cubic order.
A computer program applies this algorithm to multiply two 300 × 300 matrices, completing the
operation in 0.14 seconds.
Estimate the time needed by this computer to apply the algorithm to multiply two:
a 600 × 600 matrices b 1000 × 1000 matrices
E/P 2 a Explain why the first-fit bin-packing algorithm has quadratic order. (2 marks)
A computer uses the first-fit bin-packing algorithm to determine the number of shipments
needed to transport 400 lengths of piping. The total computation time is 0.72 seconds.
b Estimate the computation time needed to apply this algorithm to 6200 lengths of piping.
(1 mark)
c Give a reason why your answer to part b is only an estimate. (1 mark)
E 3 The first-fit decreasing algorithm has quadratic order. It takes a computer 0.028 seconds to apply
the first-fit decreasing algorithm to 50 items.
a Explain briefly what is meant by a quadratic order algorithm. (2 marks)
b Estimate how long it would take the computer to apply the algorithm to 500 items. (1 mark)
E/P 5 At a careers day, n students meet with n potential work-experience employers. The employers
rate each student out of 10, and the students rate each employer out of 10. An algorithm for
matching students to employers is described below.
24
Mixed exercise 1
E/P 2 a Use the bubble-sort algorithm to sort, in descending order, the list
25 42 31 22 26 41
giving the state of the list on each occasion when two or more values are interchanged. (4
marks)
b Find the maximum number of interchanges needed to sort a list of six pieces of data
using the bubble-sort algorithm. (2 marks)
E 3 8 4 13 2 17 9 15
This list of numbers is to be sorted into ascending order.
Perform a quick sort to obtain the sorted list, giving the state of the list after each
rearrangement. (5 marks)
E 4 111 103 77 81 98 68 82 115 93
a The list of numbers above is to be sorted into descending order. Perform a quick sort to
obtain the sorted list, giving the state of the list after each rearrangement and indicating the
pivot elements used. (5 marks)
b i Use the first-fit decreasing bin-packing algorithm to fit the data into bins of
size 200. (3 marks)
ii Explain how you decided in which bin to place the number 77. (1 mark)
E 5 Trishna wishes to record eight television programmes. The lengths of the programmes, in
minutes, are:
75 100 52 92 30 84 42 60
Trishna decides to use 2-hour (120 minute) DVDs only to record all of these programmes.
a Explain how to implement the first-fit decreasing bin-packing algorithm. (2 marks)
b Use this algorithm to fit these programmes onto the smallest number of DVDs possible,
stating the total amount of unused space on the DVDs. (3 marks)
Trishna wants to record an additional two 25-minute programmes.
c Determine whether she can do this using only 5 DVDs, giving reasons for your answer.
(3 marks)
25
E 6 A DIY enthusiast requires the following 14 pieces of wood as shown in the table.
Length in metres 0.4 0.6 1 1.2 1.4 1.6
Number of pieces 3 4 3 2 1 1
The DIY store sells wood in 2 m and 2.4 m lengths. He considers buying six 2 m lengths of wood.
a Explain why he will not be able to cut all of the lengths he requires from these six
2 m lengths. (2 marks)
b He eventually decides to buy 2.4 m lengths. Use a first-fit decreasing bin-packing algorithm
to show how he could use six 2.4 m lengths to obtain the pieces he requires. (4 marks)
c Obtain a solution that requires only five 2.4 m lengths. (4 marks)
E/P 7 The algorithm described by the flow chart below is to be Hint This question uses the
applied to the five pieces of data below. modulus function. If x ≠ y, |x − y|
u1 = 6.1, u2 = 6.9, u3 = 5.7, u4 = 4.8, u5 = 5.3 is the positive difference between
x and y, e.g. |5 − 6.1| = 1.1.
a Obtain the final output of the algorithm using the five
values given for u1 to u5. (4 marks)
b In general, for any set of values u1 to u5, explain what the algorithm achieves. (2 marks)
Start
Box 1 i = 1, A = u1
Temp = | 5 – u1 |
Box 2 i=i+1
Box 3 M = | 5 – ui|
Is
Box 4 M < Temp?
Yes
A = ui
Box 5 No
Temp = M
Is Yes
Box 6
i < 5?
No
Box 7 Print A
Stop
26
E 8 A plumber is cutting lengths of PVC pipe for a bathroom installation. The lengths needed, in
metres, are:
0.3 2.0 1.3 1.6 0.3 1.3 0.2 0.1 2.0 0.5
The pipe is sold in 2 m lengths.
a Carry out a bubble sort to produce a list of the lengths needed in descending order. Give the
state of the list after each pass. (4 marks)
b Apply the first-fit decreasing bin-packing algorithm to your ordered list to determine the total
number of 2 m lengths of pipe needed. (3 marks)
c Does the answer to part b use the minimum number of 2 m lengths? You must justify your
answer. (2 marks)
Challenge
An algorithm for factorising an n-digit integer is found to have order
1.1n . A computer uses the algorithm to factorise 8 788 751, taking
0.734 seconds.
a Estimate the time needed for the computer to factorise:
i 3 744 388 667 ii a number with 100 digits
Internet security is based on large, hard-to-factorise numbers.
A cryptographer wants to choose a number which will take at least one
year to factorise using this algorithm.
b Determine the minimum number of digits the cryptographer should
use for their number.
c Suggest a reason why the run time of this algorithm might vary
widely depending on the choice of number to be factorised.
27
2 In a flow chart, the shape of each box tells you about its function.
5 In a quick sort, you select a pivot then split the items into two sub-lists:
• One sub-list contains items less than the pivot.
• The other sub-list contains items greater than the pivot.
• You then select further pivots from within each sub-list and repeat the process.
6 The three bin-packing algorithms are first-fit, first-fit decreasing, and full-bin:
• The first-fit algorithm works by considering items in the order they are given.
• The first-fit decreasing algorithm requires the items to be in descending order before
applying the algorithm.
• Full-bin packing uses inspection to select items that will combine to fill bins.
Remaining items are packed using the first-fit algorithm.
7 The three bin-packing algorithms have the following advantages and disadvantages:
8 The order of an algorithm can be described as a function of its size. If an algorithm has order
f(n), then increasing the size of the problem from n to m will increase the run time of the
f(m)
algorithm by a factor of approximately ____
f(n)
28
C B
a
29
Example 1
Example 2
30
Example 3
The network shows the times taken, in minutes, by a car to travel along some sections of road.
C
A
5 8
B
1
10
2
E 5 D
Calculate the minimum time needed to travel from A to D and give the route taken.
Route Time needed (mins) Watch out A weighted network is not usually
ABCD 5 + 8 + 1 = 14 drawn to scale. The quickest route may not be
ABED 5 + 2 + 5 = 12 the route which appears to be the shortest – you
AED 10 + 5 = 15 need to consider the weight on each arc.
Exercise 2A
1 This graph represents the friendships within a group of students.
Alex
Fred Harriet
Becky
Chris
Govinda
Dhevan Esme
31
2 This table gives information about the A level subjects studied by some students.
Student Subjects
A Maths, Chemistry
B Maths, Chemistry, Biology, Art
C Physics, Chemistry, Biology
D Maths, Physics, Art, English
E Biology, English, Art
F English, Maths, Art, Physics
a Copy and complete this graph to represent this information. Use the arcs to show which
subjects each student studies.
A B C D E F
32
A student estimates that each stop on the London Underground takes 80 seconds, and each
change takes 3 minutes.
b Work out the quickest possible journey time from
i Kings Cross St Pancras to Waterloo
ii Holborn to St James’s Park
iii Victoria to Baker Street.
In real life the quickest way to get from Kings Cross St Pancras to Waterloo is usually to change at
Oxford Circus.
c Compare this to your answer to part b i and suggest a potential problem with the student's model.
P 4 This weighted network shows the flight times of a particlar airline, in minutes, between some
different airports in the UK and Ireland.
A
A Aberdeen
118 E
G B Belfast
45 C Cork
B 85 N
40 D Dublin
38
73 E Edinburgh
L
D G Glasgow
65 M
L Leeds-Bradford
92
55 M Manchester
C N Newcastle
a Write down the flight time between Glasgow and Manchester.
b Name the route with the longest flight time.
c Suggest which city might be the home base of this airline. Give a reason for your answer.
P 5 This network shows the lengths, in km, of a network of mountain bike trails.
P 16 U
17
9 12 15
Q
4 18
T V
3
19
5
R 4
S
A student states that the shortest possible route to bike from P to V is 27 km long.
a State which route the student has chosen to calculate this distance.
b State, with a reason, whether the student is correct.
Challenge H G
The diagram shows a wire network in the shape of a cube. E F
An ant walks from vertex A to vertex G along the edges of the cube.
Find the total number of possible different routes which: D
C
a are of minimum length
b do not pass through any vertex more than once. A B
33
CE is an arc or an edge.
D E
F Graph G
In graph G, above
● the vertices (or nodes) are: A, B, C, D, E and F
Watch out
(this list of vertices is sometimes called the vertex set)
The intersection of the edges AC
● the edges (or arcs) are: AB, AC, AF, BC, BD, CE and DE
and BD is not a vertex.
(this list of edges is sometimes called the edge set).
■ A subgraph of G is a graph, B
Subgraph 1 B
each of whose vertices belongs
A C
to G and each of whose edges A C
belongs to G. It is simply a part
D Some F
of the original graph. F E
possible
subgraphs. Subgraph 2
A C
D
F E
■ The degree or valency or order of a vertex is the number of edges incident to it.
K Vertex Degree Notation
Degree 2 because 2 edges meet here.
J 2 A vertex and
L K 2 an edge are
L 1 incident if the
vertex is at either
J M 4
M end of the edge.
N
N 1
34
■ A trail is a walk in which no edge is visited more than once. Links A trail which traverses
■ A cycle is a walk in which the end vertex is the same as the every arc and starts and ends
start vertex and no other vertex is visited more than once. at the same vertex is called an
■ A Hamiltonian cycle is a cycle that includes every vertex. Eulerian circuit. → Section 4.1
R
U
W
■ Two vertices are connected if there is a path between them. A graph is connected if all its
vertices are connected.
E R T
G
F H V
S
U
This is a connected graph. This graph is not connected.
A path can be found between any two vertices. There is no path from R to V, for example.
C loop
B Vertex C has degree 3.
■ A simple graph is one in which there are no loops and there is at most one edge connecting
any pair of vertices.
multiple
edges This is not a simple graph because it
D
has two edges from D to E.
E
F
C
35
■ If the edges of a graph have a direction associated with them they are known as directed
edges and the graph is known as a directed graph, often abbreviated to digraph.
Q
P R
T
S
■ In any undirected graph, the sum of the degrees of the vertices is equal to
2 × the number of edges. As a consequence, the number of odd vertices must be even,
including possibly zero. This result is known as Euler’s handshaking lemma.
Example 4 A
a Find the sum of the valencies of the vertices in this graph.
B
b Verify that your answer to part a is twice the number of edges F C
in the graph.
a Vertex Valency E D
A 3
B 3
C 3 Notice that the number of vertices of odd degree
is even (there are 4 of them).
D 3
E 4 If each vertex represents a person and each edge
indicates that two people have shaken hands,
F 2
then the number of people who have shaken
Total 18 hands an odd number of times must be even.
b The graph has 9 edges.
Sum of valencies = 18 = 2 × 9
= 2 × number of edges
Example 5
A graph has 5 nodes and 8 edges. The valencies of the nodes are x, x − 1, x + 1, 2x − 1 and x − 1.
Find the value of x.
Sum of valencies
= x + x − 1 + x + 1 + 2x − 1 + x − 1
= 6x − 2
Sum of valencies = 2 × number of edges
= 2 × 8 = 16 Problem-solving
6x − 2 = 16
Use Euler’s handshaking lemma to formulate an
6x = 18
equation in x.
x=3
36
Exercise 2B
1 Draw a connected graph with:
a one vertex of degree 4 and four vertices of degree 1
b three vertices of degree 2, one of degree 3 and one of degree 1
c two vertices of degree 2, two of degree 3 and one of degree 4.
C J
I H
B E
c P d U V
T Q
W
X
Z
S R
N
5 Repeat question 4 parts c, d and e using this graph: K
Q
L P
J R
M S
P 6 Show that it is possible to draw a graph with:
a an even number of vertices of even degree
b an odd number of vertices of even degree.
c It is not possible to draw a graph with an odd number of vertices of odd degree. Explain why not.
37
4 8
S R
D
T
E U W
F G V
■ A spanning tree of a graph, G, is a subgraph which includes all the vertices of G and is also
a tree.
For example, starting with this graph:
B D
A F
C E
C E C E
38
■ A complete graph is a graph in which every vertex is directly connected by a single edge to
each of the other vertices.
K3 K4
K6
■ Isomorphic graphs are graphs which show the same information but may be drawn differently.
For example,
A
D
C E
B
F
is isomorphic to:
J K L U V
and R W
T
M N P Q S X
For two graphs to be isomorphic, they must have the same numbers of vertices of the same degrees,
and these vertices must also be connected together in the same ways: if there is an edge between two
vertices in one graph, then there is also an edge between the two corresponding vertices in the other
graph.
If graphs are isomorphic it is possible to pair equivalent vertices.
In this case,
● A can be paired with J in the first graph and R in the second.
● B can be paired with M in the first graph and T in the second.
● C can be paired with N in the first graph and S in the second.
● D can be paired with L in the first graph and V in the second.
● E can be paired with Q in the first graph and W in the second.
● F can be paired with P in the first graph and U in the second.
● G can be paired with K in the first graph and X in the second.
39
Exercise 2C
1 State which of the following graphs are trees.
a b c d
P 2 There are 11 spanning trees for the graph shown on the right. A B
Draw them all.
C
E D
B
3 Identify a complete subgraph of this graph that has 4 vertices.
C
A
D
F E
4 Identify which of graphs A, B and C are isomorphic
to the graph shown on the right.
C
A B
40
B
Example 6 E
A B C D E F
D
A 0 1 0 0 0 0
Watch out You should be able to write down
B 1 0 1 0 2 1 the adjacency matrix given the graph, and draw a
C 0 1 0 1 1 0 graph given the adjacency matrix.
D 0 0 1 0 0 1
This indicates that there are 2 direct connections
E 0 2 1 0 0 1 between B and E.
F 0 1 0 1 1 2
This indicates a loop from F to F. It could be
travelled in either direction, and hence counts as 2.
Example 7
41
T
Example 8
11
8 6 V
Use a distance matrix to represent this directed network. R U
7
9
4 9
R S T U V W
R — 4 11 — — — S 10 W
Exercise 2D
1
D
B G
C F
A
E
c A B C D d A B C D
A 0 1 0 1 A 0 2 0 1
B 1 0 1 1 B 2 0 1 0
C 0 1 0 1 C 0 1 0 1
D 1 1 1 0 D 1 0 1 0
42
The same cannot be done with K5. It follows that This version of K4 shows the
K4 is planar, but K5 is not. same connections, but this
time no edges cross.
K4
43
A If a graph contains a Hamiltonian cycle then it is possible to apply an algorithm to determine whether
the graph is planar.
■ The planarity algorithm can be applied to graphs that contain a Hamiltonian cycle. The steps
are as follows:
A pair of edges that cross inside the Hamiltonian cycle would also cross if they were both drawn
outside the Hamiltonian cycle. This algorithm attempts to partition the edges not in the Hamiltonian
cycle into two sets: those that can be drawn inside the cycle, and those that can be drawn outside it. If
the algorithm determines that the graph is planar, you can draw it without crossings by drawing any
edges labelled ‘I’ inside the Hamiltonian cycle, and any edges labelled ‘O’ outside.
Example 9
A B
Use the planarity algorithm to determine
whether this graph is planar.
H E
C D
G F
44
A
Step 1: A Hamiltonian cycle is ABDEFGCHA.
Steps 2, 3:
A B
Draw your Hamiltonian cycle as a regular octagon,
H D
then add the remaining edges to create a graph
that is isomorphic to the given graph. Be careful
when labelling your vertices. The order around
C E
the polygon should be the same as the order in
the Hamiltonian cycle.
G F
45
Example 10
A
An electronics company attaches components A, B, C, D, E and F to a circuit board. These
components are to be connected by wires that are not allowed to cross. The table gives information
about the connections.
Step 1: A Hamiltonian cycle is ABCDEFA. You should use the given Hamiltonian cycle.
Steps 2, 3: Draw a graph showing all the connections
A B in the table.
F C
E D
Step 4: AD, AE, BD, BE, BF, CE, DF
Step 5: AD(I), AE, BD, BE, BF, CE, DF Problem-solving
Step 6: Edge just labelled ‘I’: AD You could produce a written argument to
Unlabelled edges that cross AD: BE, BF, CE mirror the working shown in the algorithm:
AD(I), AE, BD, BE(O), BF(O), CE(O), DF BE, BF and CE must all be in the same set
(inside or outside), as they are all crossed
Step 6: Edges just labelled ‘O’: BE, BF, CE
by AD.
Unlabelled edges that cross BE, BF or CE: AE,
AE and DF must therefore also be in the
BD, DF same set (inside or outside), as they each
AE and DF cross each other, so the graph is non- cross at least one of BE, BF and CE.
planar. The connections cannot be made without But AE and DF cross, so the graph cannot
wires crossing. be drawn without crossings.
Exercise 2E
E 1 a Explain why there is no Hamiltonian cycle that begins B
ABC... (2 marks)
A C
b Complete a Hamiltonian cycle that starts with ABE… (1 mark)
F
c Use the planarity algorithm to show that this graph is
planar. (3 marks)
E D
46
B F
C G
D H
E/P 4 The diagram shows three houses that must each be connected to gas (G ), water (W ) and
electricity (E ) supplies.
G W E
Use the planarity algorithm on a suitable graph to show that it is not possible to do this in
such a way that no two supply lines cross each other. (6 marks)
Challenge
A B
E
C
D
a Explain why the planarity algorithm cannot be used to
determine whether or not this graph is planar.
b Show that the graph is planar.
47
Mixed exercise 2
1 A, B, C and D are four towns. The distance matrix shows the direct distances by road between
the towns in kilometres.
A B C D
A — 11 15 9
B 11 — — 8
C 15 — — 16
D 9 8 16 —
Draw a weighted graph to show this information.
f g h i
c Draw a spanning tree for this network and state the weight of your spanning tree.
P 5 Write an expression for the number of edges in a spanning tree containing v vertices.
Q
6 Write down all the possible routes from P to R
in this digraph. R
P
T
48
E B
D C
E/P 8 a Explain why it is not possible to draw a graph with exactly four vertices with degrees 3, 1, 2
and 1. (1 mark)
A connected graph has exactly four vertices and 10 edges. The degrees of the vertices are k2 – 3k,
k + 1, 8 – k and k – 4 respectively.
b Find the value of k. (3 marks)
B F
C G
D H
E/P 10 A B
F
C
E
D
49
Challenge
A The diagram shows a connected planar graph. The finite regions
of the graph are shaded in different colours.
2 If a graph has a number associated with each edge (usually called its weight), then the graph is
known as a weighted graph or network.
3 A subgraph is a graph, each of whose vertices belongs to the original graph and each of whose
edges belongs to the original graph. It is part of the original graph.
4 The degree (or valency or order) of a vertex is the number of edges incident to it.
50
5 If the degree of a vertex is even, you say that it has even degree. If the degree of a vertex is
odd it has odd degree.
6 A walk is a route through a graph along edges from one vertex to the next.
9 A cycle is a walk in which the end vertex is the same as the start vertex and no other vertex is
visited more than once.
11 Two vertices are connected if there is a path between them. A graph is connected if all its
vertices are connected.
13 A simple graph is one in which there are no loops and there is at most one edge connecting
any pair of vertices.
14 If the edges of a graph have a direction associated with them they are known as directed
edges and the graph is known as a directed graph (or digraph).
15 In any undirected graph, the sum of the degrees of the vertices is equal to 2 × the number of
edges. As a consequence, the number of odd nodes must be even. This result is called Euler's
handshaking lemma.
17 A spanning tree of a graph is a subgraph which includes all the vertices of the original graph
and is also a tree.
18 A complete graph is a graph in which every vertex is directly connected by a single edge to
each of the other vertices.
19 Isomorphic graphs are graphs which show the same information but may be drawn differently.
20 Each entry in an adjacency matrix describes the number of arcs joining the corresponding
vertices.
21 In a distance matrix, the entries represent the weight of each arc, not the number of arcs.
A 22 A planar graph is one that can be drawn in a plane such that no two edges meet except at a
vertex.
23 The planarity algorithm may be applied to any graph that contains a Hamiltonian cycle.
It provides a method of redrawing the graph in such a way that it becomes clear whether or
not it is planar.
51
52
Example 1
Use Kruskal’s algorithm to find a minimum spanning tree for this network. List the arcs in the
order that you consider them. State the weight of your tree.
D
4 8 In a network of n vertices a spanning tree will always
E 6 C have (n − 1) arcs. In this case there will be 4 arcs in
6
5 the spanning tree.
5
B
7
A
By inspection the order of the arcs is AE and BC could have been written in either
DE(4), AE(5), BC(5), AD(6), BD(6), AB(7), order, as both have weight 5. In the same way, AD
CD(8). and BD could have been written in either order.
Start with DE.
D
4 8
E C
6 6
5
5
B
7
A
Add AE.
D
4 8 You do not need to draw each of these diagrams.
E C The list of arcs, in order, with your decision about
6 6
5 rejecting or adding them, is sufficient to make
5 your method clear.
B
7
A
53
Example 2
Order of arcs
length 8: AD and BC
length 10: AC and CD Online Explore Kruskal's algorithm using
length 11: EF GeoGebra.
length 12: CE and DE
length 13: DF Remember that you can choose AD and BC in
length 14: BE either order, AC and CD in either order, and CE
Spanning tree and DE in either order.
Start with AD. 8 D
A
C You may find it helpful to draw out the tree as
you go. It makes it easier to check for cycles.
F
B E
54
Add BC.
A
8
D
Watch out You need to consider all the arcs in
C turn, even when they have equal weight. If you
start with AD then you have to consider BC next.
8 F
B E
Add AC. 8
A D
10 C
8 F
B E
8 D
Add CE. A
10 C
8 F
12 11
B E
One solution is
8 D Looking at the list of arcs, you can see that,
A
C although you included both arcs of length 8, you
10
only included one arc of length 10 and one arc of
8 F
12 length 12. You can never select both length 10 or
11
both length 12 arcs. However, you must always
B E
choose one of each. This helps to determine the
(using AC and CE)
other three solutions.
The other three solutions are
8 D
A
10 C
12
8 F
11
B E
(using AC and DE)
8 D
A
C 10
8 F
12 11
B E
(using CD and CE)
55
A 8 D
C 10 12
8 F
11
B E
(using CD and DE)
The weight of each tree is
All four solutions are minimum spanning trees, so
8 + 8 + 10 + 11 + 12 = 49
they will all have the same total weight.
Exercise 3A
1 Use Kruskal’s algorithm to find minimum spanning trees for each of these networks. State the
weight of each tree. You must list the arcs in the order in which you consider them.
a A 25 B b A 7 C
4 B 7
14 16 C 18 6
17 12
5 4 2 5 D
H 20 12 D E
21 7
15
11 3 F 8
18
G 6 E
G 24 F
c A 3.8 B
C
4.2 2.1
4.1
4.3 D
2.2 E
H 1.4
4.1 3.8 1.7 2.1
2.3
J 3.1 G 3.2 F
56
E 4 The diagram shows nine estates and the distances between them in kilometres. A cable TV
company plans to link up the estates.
Claver
0.8 1.4
Morris Salis 2.8 Cedars
1.7 1.9
2.3 1.6 Haversham
3.3 2.9
2.8 2.8 2.1
Ritchie
1.1
Plumptree 3.1 Edwards Shrewsbury
a Find a minimum spanning tree for the network using Kruskal’s algorithm. List the arcs in the
order that they were added to the tree. (4 marks)
b Use your answer to part a to find the minimum length of cable required to link all the estates
together. (1 mark)
Example 3
B 15
F Online Explore Prim's algorithm using
10 9 GeoGebra.
8
12 A
C 12
Watch out In your exam, you may be asked to
9 11
8 use Prim’s or Kruskal’s algorithm. You must know
E which is which.
D 14
Use Prim’s algorithm to find a minimum spanning tree for the network above. List the arcs in the
order in which you add them to your tree.
57
E
D Now consider arcs that link either A or F to a
Add AD to the tree. vertex not in the tree: AB(9), AD(9), AE(11),
B AC(12), FE(12) and FB(15).
F
8
A
C Add the arc of least weight, from A or F, that
introduces a new vertex to the tree. In this case
9 there are two arcs of least weight, AD and AB.
E You can choose either. In this case, AD is chosen.
D
Add DC to the tree.
B F
8 The arcs linking A, F and D to the remaining
A
vertices are AB(9), AE(11), AC(12), FE(12),
C FB(15), DC(8), DE(14). The one of least weight is
DC.
8 9
E
D
58
Exercise 3B
1 Repeat Question 1 in Exercise 3A using Prim’s algorithm. Start at vertex A each time.
E/P 4 Q 38 T 27 W
27 35 15 41
18 29
31 S 33 V
P 19 Y
29
33 24 34 28 48
R 37 U 29 X
The network shows ten villages and the costs, in thousands of pounds, of connecting them with
a new energy supply.
a Use Prim’s algorithm, starting at P, to find the energy supply network that would connect all
ten villages for minimum cost. (3 marks)
b Draw your minimum connector and state its cost. (2 marks)
c Unforeseen problems with the link between villages W and X mean that the cost of connecting
them rises to £34 000. Explain how this affects your minimum spanning tree. (2 marks)
E/P 5 a Explain why it is not necessary to check for cycles when using Prim’s algorithm. (1 mark)
B
21 J
4 D 24
A 8 F 9 17
10 10 8
8
12 9 K
8 I
C
19
7
11 G
E 16
8 L
6
H
b Use Prim’s algorithm, starting at A, to find a minimum spanning tree for this network.
You must make your order of arc selection clear. (3 marks)
c State, with a reason, whether this minimum spanning tree is unique. (2 marks)
59
Example 4
1
↓
A B C D E
A – 27 12 23 74 Delete row A, and number column A.
B 27 – 47 15 71
C 12 47 – 28 87
D 23 15 28 – 75
E 74 71 87 75 –
1
↓
A B C D E
A – 27 12 23 74
B 27 – 47 15 71 The lowest undeleted entry in column A is 12, so
C 12 47 – 28 87 put a ring round it. The first arc is AC.
D 23 15 28 – 75
E 74 71 87 75 –
The first arc is AC.
60
1 2
↓ ↓
A B C D E The new vertex is C. Delete row C, and number
A – 27 12 23 74 column C.
B 27 – 47 15 71
C 12 47 – 28 87 The lowest undeleted entry in columns A and C
D 23 15 28 – 75 is 23, so put a ring round it. The second arc is AD.
E 74 71 87 75 –
The second arc is AD.
1 2 3
↓ ↓ ↓ The new vertex is D. Delete row D, and number
A B C D E column D.
A – 27 12 23 74
B 27 – 47 15 71 The lowest undeleted entry in columns A, C and
C 12 47 – 28 87 D is 15. Put a ring round it. The third arc is DB.
D 23 15 28 – 75
E 74 71 87 75 –
The third arc is DB.
1 4 2 3
↓ ↓ ↓ ↓
A B C D E
A – 27 12 23 74
The new vertex is B. Delete row B, and number
B 27 – 47 15 71
column B.
C 12 47 – 28 87
D 23 15 28 – 75 The lowest undeleted entry in columns A, C, D and
E 74 71 87 75 – B is 71. Put a ring round it. The fourth arc is BE.
The fourth arc is BE.
1 4 2 3 5
↓ ↓ ↓ ↓ ↓
A B C D E
A – 27 12 23 74
B 27 – 47 15 71
C 12 47 – 28 87
D 23 15 28 – 75
The new vertex is E. Delete row E and number
E 74 71 87 75 –
column E.
The minimum spanning tree is:
A B All rows have now been deleted, so the algorithm
23 15
12 71 is complete.
D
C
E Watch out You do not need to show all of these
Its weight is 12 + 23 + 15 + 71 = 121 tables. The final annotated table, plus a list of arcs
in order, is sufficient to make your method clear.
61
Example 5
62
Exercise 3C
Answer templates for questions marked * are available at www.pearsonschools.co.uk/d1maths
1* Apply Prim’s algorithm to the distance matrices below. List the arcs in order of selection and
state the weight of your minimum spanning tree.
a A B C D E F b R S T U V
A – 15 20 34 25 9 R – 28 30 31 41
B 15 – 36 38 28 14 S 28 – 16 19 43
C 20 36 – 43 38 22 T 30 16 – 22 41
D 34 38 43 – 26 40 U 31 19 22 – 37
E 25 28 38 26 – 31 V 41 43 41 37 –
F 9 14 22 40 31 –
63
2* The table shows the distance, in miles, between five cities. It is intended to link these
five cities by a transit system.
E/P 3* The matrix shows the costs, in euros per 1000 words, of translating appliance
instruction manuals between eight languages.
A B C D E F G H
A – 84 53 35 – 47 – 42
B 84 – 71 113 142 61 75 –
C 53 71 – – – – 59 –
D 35 113 – – 58 67 151 –
E – 142 – 58 – 168 159 48
F 47 61 – 67 168 – – 73
G – 75 59 151 159 – – 52
H 42 – – – 48 73 52 –
a Use Prim’s algorithm, starting from language D, to find the cost of translating an
instruction manual of 3000 words from D into the seven other languages. (4 marks)
b Draw your minimum spanning tree. (1 mark)
A manual is written in language E and needs to be translated into language G.
The table shows that it costs 159 euros per 1000 words to translate from language E to G.
c Give a reason why:
i it might be decided not to translate directly from E to G
ii it might be decided to translate directly. (2 marks)
64
E/P 4* The table shows the distances, in miles, between nine oil rigs and the depot X.
Pipes are to be laid to connect the rigs and the depot.
X A B C D E F G H I
X – 65 80 89 74 26 71 41 41 74
A 65 – 27 41 22 37 20 29 25 43
B 80 27 – 30 24 55 16 46 40 42
C 89 41 30 – 50 84 24 70 49 26
D 74 22 24 50 – 51 35 34 47 63
E 26 37 55 84 51 – 52 18 23 68
F 71 20 16 24 35 52 – 45 31 27
G 41 29 46 70 34 18 45 – 25 64
H 41 25 40 49 47 23 31 25 – 44
I 74 43 42 26 63 68 27 64 44 –
a Use Prim’s algorithm, starting at X, to find a minimum spanning tree for
the network. You must make the order of arc selection clear. (3 marks)
A computer program finds this minimum Watch out The specific way in which an algorithm
spanning tree in 0.7 seconds. Given that is implemented can affect its efficiency. There are
the computer program implements Prim’s alternative implementations of Prim’s algorithm
algorithm with cubic order, that have quadratic complexity. In your exam you
b estimate the time it would take this will be told what order you need to use in your
computer program to find a minimum calculations. → Mixed exercise, Challenge
spanning tree for a different network
of 24 oil rigs and the depot. (2 marks)
Oil rig A exhausts its supply and is closed down.
c The distance between the depot and oil rig I is found to be incorrect.
Give a possible value for this distance that:
i will not affect the minimum spanning tree you found in part a
ii will affect the minimum spanning tree you found in part a.
Give a reason for each of your choices. (4 marks)
65
1 Label the start vertex, S, with the final label, 0. The algorithm makes
use of labels. Start
2 Record a working value at every vertex, Y, that is directly at the initial vertex
connected to the vertex, that has just received its final label, X. and move through
• Working value at Y = final label at X + weight of arc XY the network, putting
• If there is already a working value at Y, it is only replaced if the working values (often
new value is smaller. called temporary labels)
• Once a vertex has a final label, it is not revisited and its working on each vertex.
values are no longer considered. Each pass finds the
shortest route to one of
3 Look at the working values at all vertices without final labels. the vertices and records
Select the smallest working value. This now becomes the final its final label (also
label at that vertex. (If two vertices have the same smallest called its permanent
working value, either may be given its final label first.) label). Once a vertex
has its final label it is
4 Repeat steps 2 and 3 until the destination vertex, T, receives its
‘sealed’ and its working
final label.
values are no longer
5 To find the shortest path, trace back from T to S. Given that B considered. Continue
already lies on the route, include arc AB whenever: in this way until the
final label of B − final label of A = weight of arc AB destination vertex is
reached.
Example 6
Use Dijkstra’s algorithm to find the shortest route from S to T in the network below.
A
4 Notation To make the working clear you replace the
5 D
4 3 vertices with boxes like this:
6 B 8
S T Vertex Order of labelling Final label
2 Working values
2 12
66
C 12
C 12
2
A
5 4
5 D
4
S 1 0 6 B 3
6 8
T Look at the working values at A, B
2 2
and C. The smallest is 2 (at C). This
C 2 2 12 will become the next final label. C is
2 now completed. It is the 2nd vertex
to be completed.
A
5 4
5 D Add working values to each vertex
that is directly connected to C.
4
S 1 0 6 B Note that the algorithm has picked
3
up the short cut to B. S → B has
6 4 8
weight 6, but S → C → B has total
T
2 2 weight 4.
14
C 2 2 12
2
67
A
5 4
5 D The smallest working value is 4 at B.
4 8 This becomes the final label at B.
S 1 0 6 B 3 4 3 B becomes the 3rd completed vertex.
6 4 8 Add working values to D and T
T because these are directly connected
2 2 to B.
14 12
C 2 2 12
2
The smallest working value is the 5
A 4 5 at A. A becomes the 4th vertex to be
5 4 completed. It has a final value of 5.
5 D
4 8 The only working value to add would
S 1 0 6 B 3 4 3 be a 9 at D. However this is larger
6 4 8 than the 8 already there, so it does
T
not need to be recorded.
2 2
14 12
C 2 2 12
2
A 4 5
5 4
5 D 5 8 The final diagram looks like this.
4 8
S 1 0 6 B 3 4 3 Hint You do not need to draw lots
6 4 8
of diagrams to show your working.
T 6 11 Working through just one diagram
2 2
14 12 11 and completing all the boxes will
C 2 2 12 make the method clear.
2 → Example 7
68
■ You can use Dijkstra’s algorithm to find the shortest route between the start vertex and any
other vertex with a final label.
Example 7
C 12 F
A 1 0 18 D 4 15 9 G 7 24 8 H 8 29
18 16 15 24 29
8 8 6
9
C 2 8 F 5 20 Check that your method
8 12 20 can be followed clearly.
69
■ It is possible to use Dijkstra’s algorithm on networks with directed arcs. This is like trying to
find a driving route where some of the roads are one-way streets.
Example 8
The network below represents part of a road system in a city. Some roads are one-way and these
are indicated by directed arcs. The number on each arc represents the time, in minutes, to travel
along that arc.
a Show that there are two quickest routes B 4 D 11 G
from A to I. Explain how you found
9 2
your routes from your labelled diagram. 2 3 1
C F 5
Road HI is closed due to roadworks. 5 1 H
2 7 2
b Find the quickest route from A to I, 5 8
avoiding HI.
A 5 E 14 I
70
Exercise 3D
Answer templates for questions marked * are available at www.pearsonschools.co.uk/d1maths
1* Use Dijkstra’s algorithm to find the shortest route from S to T in each of the following networks.
In each case, explain how you determined the shortest path from your fully labelled diagram.
a C 3 F b A 2 C 10 T
10
A
1 2 6 4 8
5 4 5 2
7 5
6 G 8 D 2 F 2
16 T S 1 H
D
S 2 4
6 1 3 6
8 10 9 5
6
E 4 H B 3 E 5 G
3
B
A B C
P 2* The network shows part of a road system in 17 5
a city. The number on each arc gives the time, 24 20 17 14
16 8 16
in minutes, it takes to travel along that arc. F
8 E 6 4 G 9
Use Dijkstra’s algorithm to find: D H
a the quickest route from A to Q 9
3
17
18
8 14 8 5 3
and its length 8 J 11 K 15 L 2
I M
b the quickest route from A to L
and its length 13 27
22 16 22 29
4
c the quickest route from M to A and its length
d the quickest route from P to A and its length. N 3 P 13 Q
71
72
1 Complete an initial distance table for the network. If there is no direct route from one vertex to
another, label the distance with the infinity symbol.
2 Complete an initial route table by making every entry in the first column the same as the label
at the top of the first column, making every entry in the second column the same as the label
at the top of the second column and so on.
3 In the first iteration, copy the first row and the first column values of the distance table into a
new table. Lightly shade these values.
A B C D
A –
B –
C –
D –
73
A
4 Consider each unshaded position in turn. Compare the value in this position in the previous
table with the sum of the corresponding shaded values.
If X + Y > Z then copy Z into the new table, A is written into the route table to show that
i.e. there is no change – the object is to keep the direct distance BC has been replaced
the smallest values in the table. by BA + AC, i.e. the route has taken a
detour through A. Any other changes in this
If X + Y , Z, copy X + Y into the new table
iteration will also result in a detour through
and write A in the corresponding position A and so A is written in the route table, in
in the route table. Once all values in the each case, in the position corresponding to
unshaded area have been considered, the changed value.
the first iteration is complete.
5 For the second iteration, copy the second row and the second column from the last iteration
into a new distance table. Lightly shade these values.
A B C D
A –
B –
C –
D –
6 Repeat step 4 with the new unshaded positions. This time any changes will result in a detour
through B and so you should write B in the new route table, in each case, in the position
corresponding to the changed value.
7 If there are n vertices then completing the algorithm will require n iterations continuing in the
same way.
Example 9
This distance graph shows the direct distances, by road, between four A 4
B
towns A, B, C and D, in miles. The road from D to A is a one-way road C
7
as shown by the arrow. 1 9
74
A
a Initial tables: The table on the left is the initial
A B C D A B C D distance table but, where there is no
direct route, the ∞ symbol is used.
A – 4 7 ∞ A A B C D
B 4 – ∞ 9 B A B C D The table on the right is the initial
C 7 ∞ – ∞ C A B C D route table.
D 1 9 ∞ – D A B C D
The first row and column of the
distance table are copied into a blank
table and these values are now shaded.
In each unshaded position, the sum
of the shaded values is compared
with the value in the initial table. The
smaller value is written into this table.
First iteration:
The figures in brackets are the ones
A B C D A B C D that have been changed. For example,
A – 4 7 ∞ A A B C D 4 + 7 = 11 < ∞ so two of the ∞ symbols
B 4 – [11] 9 B A B [A] D are replaced with 11. Also, 1 + 4 = 5 < 9
so 5 replaces the 9 in the bottom row.
C 7 [11] – ∞ C A [A] C D
Finally, 1 + 7 = 8 < ∞ so 8 replaces the
D 1 [5] [8] – D A [A] [A] D ∞ symbol in the bottom row.
75
A
Fourth iteration: In the final iteration, once again, no
A B C D A B C D changes are made because each value
in the previous table is smaller than
A – 4 7 13 A A B C B
the sum of the shaded values.
B 4 – 11 9 B A B A D
C 7 11 – 20 C A A C B
To find this route, look at row C and
D 1 5 8 – D A A A D column D in the route table. The letter
The final distance and route tables are: in this position is B, which means that
a detour is taken through B. So far, the
A B C D A B C D
route is CBD.
A – 4 7 13 A A B C B Now look at row C and column B. The
B 4 – 11 9 B A B A D letter in this position is A, which means
C 7 11 – 20 C A A C B that the route passes through A in
D 1 5 8 – D A A A D going from C to B. So far, the route is
CABD.
b The route of minimum length from C to D is CABD. Since there are only four vertices in the
graph, there can be no further detours.
You can verify this with the route table
Problem-solving
by checking CA, AB, and BD:
The corresponding entry in the final distance table tells you the ● CA gives A (no detour)
length of this route. The entry in row C and column D is 20, so ● AB gives B (no detour)
the total length of this route is 20 miles. ● BD gives D (no detour)
Example 10
76
A a Apply the final iteration of Floyd’s algorithm to give the final distance and route tables for the
network.
b Sarah needs to get from gate D to gate F. State the minimum time needed to make this journey,
and determine the route she should take.
a Final iteration:
Distance table Route table
A B C D E F G H A B C D E F G H
A – 2 5 [5] 3 11 9 4 A A B B [H] E G C E
B 6 – 3 5 9 9 7 10 B D B C C D G C E
C 3 5 – 2 6 6 4 7 C D D C D D G G E
D 1 3 6 – 4 12 10 5 D A A B D A G C E
E [3] [5] [8] [2] – [8] [6] 1 E [H] [H] [H] [H] E H [H] [H]
F [5] 1 4 [4] 2 – 8 3 F [H] B B [H] E F C E
G [7] 3 6 [6] 4 2 – 5 G [H] F F [H] F F G F
H 2 4 7 1 5 7 5 – H D D D D D G G H
Shade the final row and column of the distance For each entry that has changed in the
table. For each unshaded position, compare the distance table, change the corresponding entry
value in this position in the previous table (Z) in the distance table to ‘H’.
with the sum of the corresponding two shaded
numbers (X + Y), and enter the minimum of
X + Y and Z as the new entry. In this case, 11
values are changed as part of the final iteration.
77
Exercise 3E
A
1* This network shows the distances, in miles, between four locations P 9 Q
E
P, Q, R and S. 5 3
a Use Floyd’s algorithm to produce a table of shortest distances.
12 7
You should give the distance table and route table for each R
iteration. (7 marks)
b Explain how you can use your route table to show that the S
shortest route from R to S is RQS. (2 marks)
2* In this network, the number next to each edge denotes the length A
3
B
of the edge. Use Floyd’s algorithm to determine the shortest
distance between all pairs of nodes. 8 10 4
5
C
D
6
M 7 L
E/P 4 Floyd’s algorithm is applied to a weighted graph. The tables shown below are the final distance
table and final route table.
A B C D A B C D
A – 7 3 11 A A B C D
B x – 9 17 B A B A A
C 12 y – z C B B C B
D 8 15 11 – D A A A D
a Explain how you know that the graph contains directed edges. (1 mark)
b Use the tables to work out the values of x, y and z. (4 marks)
78
E/P They have shown the main attractions and the walking 15 14
times between them on a network.
A 8 11 10 D
Jared wants to enter the park at location A, and would like
to know the shortest distance from there to each of the 25 6
main attractions. Amy would like to give her students
E 21 F
information about the shortest distances and corresponding
routes between any pair of the main attractions.
a Suggest a suitable algorithm for each situation, giving reasons for your choices. (2 marks)
b Apply two iterations of Floyd’s algorithm to this network, showing both the distance table
and the route table after each iteration. (5 marks)
P 7 a Floyd’s algorithm is applied to an n × n distance matrix. State the number of comparisons that
are made with each iteration.
b Give the order of Floyd’s algorithm.
c A computer program takes 0.012 seconds to apply Floyd’s algorithm to a 30 × 30 distance
matrix. Estimate the time required for the same computer program to apply the algorithm to a
100 × 100 distance matrix.
Mixed exercise 3
79
E 4* It is intended to network five computers at a large race track. There is one computer at
the office and one at each of the four different entrances. Cables need to be laid to link the
computers. Cable laying is expensive, so a minimum total length of cable is required.
The table shows the shortest distances, in metres, between the various sites.
Office Entrance 1 Entrance 2 Entrance 3 Entrance 4
Office – 1514 488 980 945
Entrance 1 1514 – 1724 2446 2125
Entrance 2 488 1724 – 884 587
Entrance 3 980 2446 884 – 523
Entrance 4 945 2125 587 523 –
a Starting at Entrance 2, demonstrate the use of Prim’s algorithm and hence find a minimum
spanning tree. You must make your method clear, indicating the order in which you selected
the arcs in your final tree. (4 marks)
b Calculate the minimum total length of cable required. (2 marks)
80
E/P 5 A
29 B 19 C
9
30 27 26
E 8 F 17 D
H 18
22 24 12 20
14 14
26 G
J I
K
The diagram above shows a weighted network. The weights of each arc are given in the
following table:
AB AE AH BC CD CF CG DG EF EJ EK FI FJ GI HK JK
29 27 30 19 9 26 17 18 8 12 24 20 14 14 22 26
a Use a quick sort to write these arcs in order of weight, smallest first. (4 marks)
b Use Kruskal’s algorithm to find a minimum spanning tree for this network. (3 marks)
c Draw your minimum spanning tree and state its total weight. (2 marks)
For any connected network,
e = number of edges in the minimum spanning tree
v = number of vertices in the network.
d Write down the relationship between e and v. (2 marks)
81
E 21 D
82
C 6 G
One councillor proposes choosing a set of roads that link all of the towns, such that the total
length of the included roads should be as small as possible. These roads would then be cleared
as a priority.
a Name a suitable algorithm to find this network. (1 mark)
b Apply the algorithm and draw the selected roads, stating the total length of the roads that
would need to be cleared under this proposal. (4 marks)
The snowplough depot is located in town A. Another councillor proposes that the shortest
distance and corresponding route to each town from town A should be found.
c Name a suitable algorithm that will provide this information. (1 mark)
d Apply the algorithm, and state the minimum distance from town A to town G, and the
corresponding route. (4 marks)
A third councillor questions whether the depot is in the best location, and suggests that a table
is produced showing the minimum distance between every pair of towns.
e Name a suitable algorithm that will provide this information. (1 mark)
Challenge
A computer scientist wants to develop a more efficient implementation
of Prim’s algorithm. For each vertex Y not contained in the growing tree,
she stores a value min(Y ), which is the weight of the shortest arc joining
Y to the tree. She can then select the next vertex to add by choosing
the smallest value of min(Y).
When a new vertex, X, is added to the tree, she considers each vertex Y
not contained in the new tree. She compares the weight of the arc XY
with the current value of min(Y ). If min(Y) is greater than the weight of
XY, she replaces min(Y ) with the new, shorter value.
She is then able to select the smallest of the updated values of min(Y )
to determine which vertex to add next.
Show that this implementation of Prim’s algorithm has order n 2.
83
6 Dijkstra’s algorithm finds the shortest route between the start vertex and each intermediate
vertex completed on the way to the destination vertex.
7 It is possible to use Dijkstra’s algorithm on networks with directed arcs, such as a route with
one-way streets.
A 8 Floyd’s algorithm can be used to find the shortest path between every pair of vertices in a
network.
• Floyd’s algorithm applied to a network with n vertices produces two tables as a result of n
iterations. One table shows the shortest distances and the other contains information about
the corresponding paths taken.
84
85
Eulerian and semi-Eulerian graphs can be drawn without removing your pen from the paper, and
without repeating any arcs.
Start
End
End
Start
More than two vertices have odd degree, so this This graph is not connected so it is neither
graph is neither Eulerian nor semi-Eulerian. It is Eulerian nor semi-Eulerian. It is not possible
not possible to draw this graph without removing to draw this graph without removing your
your pen from the paper or repeating an edge. pen from the paper or repeating an edge.
Example 1 B
A
a State whether this graph is Eulerian, semi-Eulerian or neither.
C
b If possible, find a trail that traverses each edge of this graph E
exactly once.
D
F
86
a Vertex A B C D E F
Use the degree of each vertex to work out
Degree 2 3 3 2 4 2 whether the graph is Eulerian, semi-Eulerian or
Exactly 2 odd vertices so graph is semi- neither.
Eulerian.
b BAFEDCEBC The trail must start and end at the odd vertices
Example 2
A connected graph has 5 nodes. The orders of the nodes are 4, 6, 3, p and 2.
a Explain why the graph cannot be Eulerian.
b Explain why the graph must be semi-Eulerian.
c Give the number of edges contained in the network in terms of p.
d Draw a graph with two nodes which is neither Eulerian nor semi-Eulerian.
Exercise 4A
1 List the valency of each vertex and hence determine if each of the graphs below is
i Eulerian ii semi-Eulerian iii neither.
For those that are Eulerian or semi-Eulerian, find a route that traverses each edge exactly once.
a B E b H I c L
A D R M
G
C F
K J P
Q N
87
E/P 4 a Explain why it is impossible to draw a graph with 6 vertices such that the orders of
the nodes are 4, 5, 6, 7, 8 and 9. (2 marks)
b A connected graph has 5 nodes and 9 arcs. The orders of the vertices are 2x + 1,
2x, 4x − 1, 4x and 6x.
i Find the value of x.
ii State whether the graph is Eulerian, semi-Eulerian or neither, giving a reason for
your answer. (4 marks)
c Draw a semi-Eulerian graph with 6 vertices. (2 marks)
88
Challenge
The diagram represents the city of Königsberg
(now Kaliningrad, Russia). The Pregel river runs A
through the city and creates two large islands
in the centre. The two islands (C and D) were
linked to each other and the mainland (A and B) C D
by seven bridges.
River Pregel
The citizens of Königsberg wished to find a route
which allowed them to cross all the bridges in B
the city exactly once.
a By constructing a graph to model this situation, prove that it is impossible to find such a route.
Johannes works at A, Gregor works at B and Peter works at D. There is a hotel at C.
b Johannes builds an eighth bridge so that he can start at A and finish at his home at C, crossing each
bridge once. However, he does not want Gregor to be able to find a similar route from B to C. Where
should Johannes build his eighth bridge?
c Gregor decides to build a ninth bridge so that he can start at B and finish at his home at C, crossing each
bridge once. He does not want Johannes to be able to find a similar route from A to C. Where should
Gregor build his ninth bridge?
d Peter decides to build a tenth bridge, so that every person in the city can cross all the bridges in turn and
return to their starting point. Where should Peter build the tenth bridge?
Example 3
11
A B
The diagram shows a network of trails on a BMX course. The number on
each edge is the length, in metres, of the trail. Hannah wants to start at 10 7
E
A, traverse every trail on the network, then return to A. Find the length
9 8
of the shortest path she could take.
D C
12
89
If the network is semi-Eulerian, you need to traverse some edges more than once.
■ If a network has exactly two odd vertices, then the length of the shortest route will be equal
to the total weight of the network, plus the length of the shortest path between the two odd
vertices.
Example 4
The diagram shows a network of undersea cables. The number on each arc is the length, in
kilometres, of that cable. A diver needs to inspect the cables, and needs to find a route of minimum
length that traverses every cable and starts and finishes at S.
2 6 3
P Q Problem-solving
2 5 The numbers in circles show the degree of
2 each vertex. You can label graphs like this
3 7
U
S 4 in your exam to speed up your working.
2 4 2
T R
3 8
(Total weight of network is 37)
a State the cables that will need to be traversed twice.
b State the minimum length of the diver’s route.
a There are two odd vertices, Q and T. There are two odd vertices, so this network is
The shortest path connecting Q and T is semi-Eulerian.
QST, which has length 4 + 5 = 9.
6
P Q Problem-solving
5 You can redraw the network and add extra arcs
2
3 5 to represent the shortest path from Q to T. You
U 7
4
S have added 1 extra arc to each odd vertex, and
2 4 either 0 or 2 extra arcs to the other vertices, so
T R this new network is Eulerian.
8
The cables that need to be traversed
twice are ST and QS.
b Total length of route = T
otal weight +
You are adding the lengths of the arcs that need
Length of path to be traversed twice. This is the total weight of
from Q to T the redrawn graph.
= 37 + 9 = 46 km
90
If the network has more than two odd vertices, then you need to consider all the possible pairings
of the odd vertices. You need to include additional arcs to join the odd vertices. Select the arcs with
the smallest total additional weight and add this to the total weight of the network. This method
produces an algorithm that can be used with any connected network.
■ Here is the route inspection algorithm.
Example 5
D C
3 9 3
91
4 B
Example 6 17 C
12 4
22 12
The diagram represents a network of roads. The numbers on the 3
19
A 19 35
arcs represent the lengths of each road in miles. The roads need 7
15
E
to be resurfaced. The council wants to find the shortest possible 5 G
5
4
21 21 D
route which traverses every road and starts and ends at A. 8
30
a Determine the length of this route. You must show your method 20
4 29
and working, and state clearly which roads must be traversed twice. H
14
The council decides that, in order to save money, the route can 3
F
start and end at different vertices. (Total weight of network is 301)
b State which two vertices should be chosen to minimise the length of the new route. Give a reason
for your answer, and state the length of the new route.
a The odd vertices are A, E, F and G. Label the degree of each vertex and identify the
The minimum path lengths for each possible odd vertices.
pairing are:
AE + FG = 26 + 22 = 48 Find the shortest path between each possible
AF + EG = 35 + 7 = 42 pairing of odd vertices. You can do this by
AG + EF = 19 + 20 = 39 ← least sum inspection, but check carefully. The shortest path
The most efficient pairing is A with G and between:
E with F. A and E is AGE of length 26
So repeat arcs AG and EF. F and G is FHG of length 22
Shortest route = 301 + 39 = 340 miles A and F is AHF of length 35
b Least length of all pairs of odd vertices is
EG with length 7. Problem-solving
So start at A and finish at F. You must select two odd vertices. Choose them
to minimise the length of the path between the
Then only arc EG must be repeated.
remaining odd vertices. Watch out: the single pair
New route has total length 301 + 7 = 308
with the least distance might not be one of the
miles.
pairs you identified in part a.
Exercise 4B
Answer templates for questions marked * are available at www.pearsonschools.co.uk/d1maths
1* For each network, find a route of minimal length which traverses every arc and starts and ends at
vertex A. In each case, state the length of your route and the arcs that must be repeated.
a A b A 9 B 7 C
22
18 B
F 29 8 9
16 7 10
35 25
31 C
21 18 G E 11 D
24
19 (Total weight of network is 61)
E
27
D
92
c B 150 C d A 53 B
115
100 80 60
48 E
175 50 47
A 110 D C 120 52
F D
90 140 65
130 80 90 110 50 F
E 65
G G 70 H
(Total weight of network is 1055) (Total weight of network is 995)
2* Each of the diagrams below shows a network of roads that need to be inspected. In each case,
find the length of the shortest route that traverses each arc at least once and returns to the start
vertex. List any roads that will need to be traversed twice.
a A 110 B 100 C b A
35
B
37
125 130 50
75 80
110 61
F 55
76 C
82
F 85 E 93 D
G 130
(Total weight of network is 908) 125 92
75
D
A 170 B
E/P 4* The diagram shows the paths in a park. The number on each arc 180 300 180
gives the length, in metres, of that path. The vertices show the park F C
350 250
entrances, A, B, C, D, E and F.
200 100
A gardener needs to inspect each path for weeds.
E 180 D
She will walk along each path once and wishes to minimise
her route. (Total weight of network is 1910)
93
Example 7
A night watchman has to patrol a network of paths as shown in the A 14 B
diagram. The number shown on each arc represents the time taken, in
minutes, to walk between the labelled points. 9 G 21
18
a Use the route inspection algorithm, starting at A and finishing at C, 6 25
to find the minimum time taken to traverse each arc at least once. 11
15 F C
b State a possible route.
An extra path is added joining B and F directly. After the addition of E 19
this path, the minimum time needed to traverse all the paths, starting 16
D
at A and finishing at C, is reduced by twice the length of time needed (Total weight of
to traverse this path. network is 154)
c Calculate the time needed to traverse the new path, BF.
94
A
a There are 6 odd nodes: A, B, C, E, F, G. Identify the odd nodes.
Since the required route must start at A
and finish at C, these nodes remain odd. The constraint regarding the start and finish
You now choose pairings of the remaining positions effectively simplifies the problem to a
odd nodes B, E, F, G. consideration of 4 odd nodes.
By inspection, these path lengths are:
BE + FG = 20 + 25 = 45
BF + EG = 29 + 15 = 44
BG + EF = 21 + 15 = 36 When using the route inspection algorithm
Repeating the paths BG and EF minimises you should always state which arcs need to be
the total time required. traversed twice.
The minimum total time is 154 + 36 = 190
minutes.
b The modified network is now:
A 14 B
21
9 G Draw the modified network. Add extra arcs from
21 18 B to G and from E to F to show that these are
6 25 the repeated arcs. The nodes at B, G, E and F are
11 now even, so the network is semi-Eulerian.
15 F C
15 19
E
16
D
A possible route is ABGAEFGBCFEDC.
c With the extra path, the network now looks
like this.
A 14 B
Problem-solving
21
9 G Draw the network with the new path. You don’t
x 18 know its weight, so label it x. You can find the
6 25 new shortest route and use this to write an
11 equation involving x.
15 F C
E 19
16
D
A, C, E and G are the only odd vertices.
Nodes A and C remain odd, so find the
You need to repeat arcs EA and AG, with total
shortest way to join E and G:
weight 15.
EA + AG = 15
Minimum time to traverse all paths =
You know that the total length of the route is
154 + x + 15
reduced by twice the length of BF, or 2x, so the
So 154 + x + 15 = 190 − 2x
new route must have total weight 190 – 2x. Write
3x = 21
an equation and solve it to find x.
x=7
The new path BF takes 7 minutes to
traverse.
95
Example 8
B
A
The network represents the roads that must be travelled by a police 8 12
patrol car. The length of each road in kilometres is shown on each arc. A 7 C
The patrol starts at A and can finish at either of two police stations, G 6
2 9
10
at G or D. 5
F 11 D
a Find the length of the shortest route such that every road is
traversed at least once. 4 6
b State which police station the patrol car finishes at, and which roads E
must be traversed twice. (Total weight of
network is 80)
Exercise 4C
Answer templates for questions marked * are available at www.pearsonschools.co.uk/d1maths
1* Find the length of the shortest route in this network that A 7 B 8 C 3 D 1 E 9 F
starts at B, traverses every edge at least once and finishes
at G. You should show your method clearly, and state any 21
15 4 10 11
7
edges that must be traversed twice.
G
H
(Total weight of network is 96)
96
3* The diagram shows a network of roads. The weights of the arcs B 180 C
E/P represent the lengths of the roads in metres. A traffic warden
240 60 210
wishes to traverse every road at least once, by the shortest route, G
110
starting and finishing at A. She knows that the road joining 90 D
A 170
vertices E and F has double yellow lines so she wants to traverse 230
160 180
it twice. 320
E
270
a Find the other roads, in addition to EF, that the traffic warden F
will need to traverse twice. (5 marks) (Total weight of
b Write down the total minimum length of her route. (1 mark) network is 2220)
On a certain day road BG is closed, and she does not need to include it in her route.
c Find the new minimum length of her route. (3 marks)
E/P 4* Each arc in this network represents a sewage pipe. The numbers on the arcs represent the lengths
of the pipes in metres.
P 48 Q
S
92 37 120 158 31
136 61
W
35
T
R
29 84 22
V U
(Total weight of network is 853)
a Use Dijkstra’s algorithm to find the shortest path from P to S. State the path and its
length. (5 marks)
97
A The network is to be inspected using a robot that travels along the sewage pipes. The robot must
start and end at vertex P, and must traverse each pipe at least once.
b Explain why the shortest path between any pair of odd vertices in the network lies
within the path found in part a.(2 marks)
c Find the length of the shortest route the robot can take, showing your working
clearly. You should state which pipes the robot must traverse twice. (4 marks)
Mixed exercise 4
Answer templates for questions marked * are available at www.pearsonschools.co.uk/d1maths
1 For each of these graphs, state, with a reason, whether the graph is Eulerian, semi-Eulerian or
neither:
a B C b W X
A V Y
D
U Z
E
E/P 3 A connected graph has exactly 4 vertices and 35 edges. The orders of the vertices are
32x − 700, 3x + 1 – 60, 20 − x and x.
a Calculate x. (4 marks)
b State whether the graph is Eulerian, semi-Eulerian or neither.
You must justify your answer. (2 marks)
98
E/P 7* The network shows the major roads that are to B 3.1 E
be gritted by a council in bad weather. 4.7 4.1 2.5
The number on each arc is the length of the D 2.3
5.4 2.1 I
road in kilometres. A G
1.9
3.2
a List the degree of each of the vertices. (1 mark) 5.1
5.3 2.2 3.4
b Starting and finishing at A, use an 3.3
algorithm to find a route of minimum C
length that covers each road at least once. F 2.8 H
You should clearly state, with reasons, (Total weight of network is 51.4)
which (if any) roads will be traversed
twice. (4 marks)
99
E/P 9 *a
Describe an algorithm that is used to solve A
11 8 C
the route inspection (Chinese postman) B
problem. (2 marks) 12 14
D 10
b Apply the algorithm and find a route, 7 I
12
starting and finishing at A, that solves E
the route inspection problem for the 10 12
16
network shown. (4 marks) 15 15
15 H
c State the total length of your 13 18
route. (1 mark) 25
F J
The situation is now altered so that, instead of 8 15 13
starting and finishing at A, the route starts at
G K
one vertex and finishes at another vertex.
(Total weight of network is 249)
d i State the starting vertex and the finishing
vertex which minimises the total length of
the route. Give a reason for your selections.
ii State the length of your route. (3 marks)
e Explain why, in any network, there is always an even number of vertices of
odd degree. (2 marks)
100
Challenge B
31 C
32
*Each arc in this network represents a section of an obstacle course.
Contestants must start and finish at A, and every section must be A 2
3
traversed at least once. Jess has worked out the time needed, in minutes, 20
for each section and these are shown as weights on the arcs. 8
H 5 D
4
a Use Dijkstra’s algorithm to find the shortest time needed to travel 6 18
from A to B and list the vertices visited in order.
G
12 2 E
b Deduce which sections Jess needs to repeat to complete the course F
in the minimum time, and calculate this time. (Total weight of network is 143)
101
102
The travelling salesman problem involves finding a tour of minimum total weight. There is no efficient
algorithm for solving this problem. In real-life situations, it is much more useful to make use of an heuristic
algorithm. This is an algorithm which will find a good solution which is not necessarily the optimal solution.
In practice we can find an upper bound and lower bound for the solution
Upper bounds
and use these to ‘trap’ the optimal solution. If our upper and lower bounds
are close, then a solution between the two may be acceptable.
Better upper bounds
You will therefore find upper bounds and select the smallest, and then find
lower bounds and select the largest, trying to ‘trap’ the optimal solution
Best upper bound
in as narrow an interval as possible.
Hint If you know that your shortest route is between 123 and 145 miles,
say, and you find a route that is 123 miles long, then you know you have
Optimal solution
found the optimal route. If you find a route that is 130 miles long you may
decide that it is ‘optimal enough’ and use it.
You need to know the difference between the two variations of the Best lower bound
travelling salesman problem.
■ In the classical problem, each vertex must be visited exactly once Better lower bounds
before returning to the start.
■ In the practical problem, each vertex must be visited at least once Lower bounds
before returning to the start.
If you convert the network into a complete network of least distances, the classical and practical
travelling salesman problems are equivalent.
To create a complete network of least distances you ensure that the triangle inequality holds for all
triangles in the network.
■ The triangle inequality states
the longest side of any triangle < the sum of the two shorter sides.
If you have a network where the triangle inequality Watch out This inequality is satisfied if the
does not hold in one or more triangles, you simply longest side is equal to the sum of the two
replace the longest arc in those triangles by the shorter sides.
sum of the two smaller ones, thereby creating a
network which shows the shortest distances.
103
A The distance matrix for a complete network of Hint If you have to find or complete a table of
least distances is called a table of least least distances, you will usually be able to do
distances. It shows the shortest path between so by inspection. If you have to use Dijkstra’s
any two points in the network. algorithm to find a shortest path you will be told
A to do so in the question.
Example 1 11
B
13
Create a table of 27 8
least distances for the C
D
network opposite. 18 14 Watch out The shortest distance
E
between a pair of vertices may not always
The top row shows the shortest routes starting at A. be the direct route so check carefully for
non-direct shorter routes.
A B C D E
A – 11 13 19 31
Look at routes from A.
B – There are direct routes from AB and AC and
C – you can see these are the shortest routes.
D – Using inspection you complete the table to
E – show the shortest routes AD and AE.
You need to check AE carefully. Using ACE
You can use this to fill in the first column.
the route is 31. Using ABDE the route is
A B C D E 33, so you record 31 as the value.
A – 11 13 19 31 This enables you to complete the top row
B 11 – of the table.
C 13 –
Since this is not a directed network, the
D 19 –
shortest distance from A to D is the same
E 31 –
as the shortest distance from D to A.
Move on to the remaining routes starting from B.
A B C D E The direct route BC on the network
is given as 27, but if you use BAC as
A – 11 13 19 31
your route you get 24, so 24 is the least
B 11 – 24 8 22
distance from B to C.
C 13 24 –
D 19 8 – You complete BD and BE by observation,
E 31 22 – using BDE as the shortest route from B
to E.
Once again you use the table’s symmetry to complete
the second column.
Considering the remaining routes starting at C, you get
Starting at C you have two routes to find:
A B C D E
CD and CE. The direct arc CE is the
A – 11 13 19 31 shortest route.
B 11 – 24 8 22 For CD you need to check CED (length
C 13 24 – 32 18 32) and CABD (length 32), so you can
D 19 8 32 – record 32. (You do not need to check CBD
since you found that the direct route CB
E 31 22 18 –
was longer than the route CAB earlier.)
104
A
Finally you complete the last entries, giving the
completed table of least differences.
A B C D E
A – 11 13 19 31
B 11 – 24 8 22
C 13 24 – 32 18
D 19 8 32 – 14
E 31 22 18 14 –
Example 2
The network on the right shows the distances, in km, between the
central sorting office at S and six post offices A, B, C, D, E and F.
A 2 B
S A B C D E F
S – 2 5 13
3 5
A – 2 19 17 3 8
B 2 – 5 17 5
F C
S 2
C 2 5 – 12 21 7
D 19 17 12 – 13 14 15
E 17 19 21 13 – 14 12
F 5 3 7 14 –
E 13 D
The table shows a partially completed table of least distances.
Complete the table of least distances for the network on the right,
stating your shortest route for each of the entries.
105
Exercise 5A
A Answer templates for questions marked * are available at www.pearsonschools.co.uk/d1maths
10 10 A B C D E F
3 C A – 10 13 15
A
11 D 6 B 10 – 3
20 3 C – 3
2
5
D 13 3 – 2 5
F 8 E E 15 3 2 –
F 5 –
106
P 4 Construct a complete network in which the solutions to the classical and practical travelling
salesman problems are different.
Challenge
1 Explain why a solution to the classical travelling salesman problem must
exist for any complete network.
2 The following algorithm is suggested for finding a solution to the classical
travelling salesman problem on a complete network:
● Find all possible Hamiltonian cycles in the network and compute the
weight of each
● Select the cycle with the least weight
1 Find the minimum spanning tree for the network (using Prim’s Note You are seeking a
algorithm or Kruskal’s algorithm). This guarantees that each minimum route. There is
vertex is included. therefore a logic in trying
to use, as a starting point,
2 Double this minimum connector (in effect you keep on retracing the minimum spanning
your steps) so that completing the cycle is guaranteed. tree, which you know how
3 Finally, seek ‘shortcuts’. (Make use of some of the non-included to find.
arcs that enable you to bypass a repeat of some of the
minimum spanning tree.)
107
A The initial upper bound found by doubling each arc on a minimum spanning tree is shown in this
diagram.
B B
A A
C E C E
D D
F G F G
Example 3
a Use Kruskal’s algorithm to find a minimum A 9 B
spanning tree for the network on the right. 3 3
b Hence find an initial upper bound for the 5 8
C 5
travelling salesman problem. D 7
4 5
F
E 8
9
a Using Kruskal’s algorithm: G
Putting the arcs in order: AC, AD, CE, BF, CD, DE, DF,
BD, FG, AB, EG Arcs that have the same weight can
Include AC, AD, CE, BF, reject CD, reject DE, be placed in any order.
include DF, reject BD, include FG. Tree complete. ← Section 3.1
This gives the following minimum spanning tree
A B
3 3
C 5
D 7
4 If you are not directed to a particular
F
algorithm, you could use either Prim’s
E 8 algorithm or Kruskal’s algorithm.
G
108
Example 4
A The table of least distances for a network is given below. Find an initial upper bound for the
travelling salesman problem for this network.
A B C D E
A – 11 13 19 31
B 11 – 24 8 22
The network associated with this
C 13 24 – 32 18 table of least distances is shown
D 19 8 32 – 14 in Example 1 on page 104.
E 31 22 18 14 –
Starting at A:
1 2 4 3 5
↓ ↓ ↓ ↓ ↓
A B C D E
When using a table it is easier to use
A – 11 13 19 31
Prim’s algorithm. ← Section 3.3
B 11 – 24 8 22
C 13 24 – 32 18
D 19 8 32 – 14
E 31 22 18 14 –
A 11 B
13 8
C D
14
The initial upper bound found in the previous two examples is not very good, since you repeat each
arc in the minimum spanning tree.
■ You can improve the initial upper bound by looking for shortcuts.
109
Example 5
A
Starting from the initial upper bound found in Example 4, use a shortcut to reduce the upper
bound to below 70.
A 11 B
13 8
C D
18 14
13 8
C D
18 14
E
Improved upper bound is now 11 + 8 + 14 + 18 + 13 = 64
Example 6
The table shows the distances, in miles, between eight cities. A politician has to visit each city,
starting and finishing at A. She wishes to minimise the total distance travelled.
A B C D E F G H
A – 47 84 382 120 172 299 144
B 47 – 121 402 155 193 319 165
C 84 121 – 456 200 246 373 218
D 382 402 456 – 413 220 155 289
E 120 155 200 413 – 204 286 131
F 172 193 246 220 204 – 144 70
G 299 319 373 155 286 144 – 160
H 144 165 218 289 131 70 160 –
a Find a minimum spanning tree for this network.
b Hence find an upper bound for this problem.
c Use shortcuts to reduce this upper bound to a value below 1300 miles.
110
A
a Using Prim’s algorithm
1 2 3 8 4 6 7 5
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
A B C D E F G H
A – 47 84 382 120 172 299 144
B 47 – 121 402 155 193 319 165
C 84 121 – 456 200 246 373 218
D 382 402 456 – 413 220 155 289
E 120 155 200 413 – 204 286 131
F 172 193 246 220 204 – 144 70
G 299 319 373 155 286 144 – 160
H 144 165 218 289 131 70 160 –
111
A Selecting shortcuts
In Example 6 there are many other shortcuts that could be tried.
For example, here are three others.
● BD saves 265 miles, so this shortcut alone would have been sufficient.
402
B 47
A E H F G D
84
120 131 70 144 155
C 84
Tour ABDGFHEACA, length 1237 miles
● CB + AF + FD saves 238 miles.
220
B
A E H F G D
121 47
84 120 131 70 144 155
C
172
Tour ABCAEHFGDFA, length 1264 miles
● CD alone saves 248 miles.
B 47
A E H F G D
47
120 131 70 144 155
C 84
456
Tour ABAEHFGDCA, length 1254 miles
Of these, the best upper bound is 1237 miles since this is the smallest.
■ Aim to make the upper bound as low as possible to reduce the interval in
which the optimal solution is contained.
Exercise 5B
1 A 24 B
9
10 30 25 11 C
8
E 28 D
a Find a minimum spanning tree for the network above and hence find an initial upper bound
for the travelling salesman problem.
b Use a shortcut to find a better upper bound.
c State the route given by your improved upper bound and state its length.
112
A 2 A council employee needs to service five sets of traffic lights located at A, B, C, D and E.
E The table shows the distance, in miles, between the lights. She will start and finish at A and
wishes to minimise her total travelling distance.
A B C D E
A – 13 11 19 14
B 13 – 12 7 16
C 11 12 – 11 8
D 19 7 11 – 14
E 14 16 8 14 –
E 4 The table shows the times, in minutes, taken to travel between a surgery S and five farms V, W,
X, Y and Z. A vet needs to visit animals at each of the farms and wishes to minimise the total
travel time. He will start and finish at the surgery, S.
S V W X Y Z
S – 75 30 55 70 70
V 75 – 55 30 40 15
W 30 55 – 65 45 55
X 55 30 65 – 15 10
Y 70 40 45 15 – 20
Z 70 15 55 10 20 –
a Use Prim’s algorithm, starting at S, to find a minimum spanning tree for the network above
and hence find an initial upper bound for the travelling salesman problem. (4 marks)
b Use the method of shortcuts to reduce the upper bound to below 200 minutes. (3 marks)
c State the route given by your improved upper bound and state the total time taken on this
route. (2 marks)
113
Example 7
a When A is deleted, the table for the residual network becomes This is the same network that
1 4 2 3 you found upper bounds for
↓ ↓ ↓ ↓ in Examples 4 and 5 on pages
B C D E 109 and 110.
B – 24 8 22
C 24 – 32 18
D 8 32 – 14
E 22 18 14 –
114
A
The residual minimum spanning tree is
B D E C
8 14 18
Weight of residual minimum spanning tree = 8 + 14 + 18 = 40
The two least arcs from A are AB (11) and AC (13)
B D E C
8 14 18
11 13
Problem-solving
The spanning tree can be drawn in a straight line, and the two least arcs join A to the start
and end of this line, so the solution represents a Hamiltonian cycle. You could also compare
the lower bound with a known upper bound. In Example 5 you found an improved upper
bound of 64 for this network. Since upper bound = lower bound the solution must be optimal.
Example 8
a By deleting vertices A then G, find two lower bounds to the travelling salesman problem for the
network above.
b Select the better lower bound of the two found in part a, giving a reason for your answer.
c Taking your answer to b and using the better upper bound, 1237 miles, found in Example 6,
write down the smallest interval that must contain the length of the optimal route.
115
A
a i Deleting A and using Prim’s algorithm starting at B
1 2 7 3 5 6 4
↓ ↓ ↓ ↓ ↓ ↓ ↓
B C D E F G H
B – 121 402 155 193 319 165
C 121 – 456 200 246 373 218
D 402 456 – 413 220 155 289
E 155 200 413 – 204 286 131
F 193 246 220 204 – 144 70
G 319 373 155 286 144 – 160 You need to make your method
for finding the RMST clear. The
H 165 218 289 131 70 160 –
order of arc selection is sufficient
Order of arc selection: BC, BE, EH, HF, FG, GD to demonstrate that you
The residual minimum spanning tree is: have applied Prim’s algorithm
C B E H F G D correctly.
121 155 131 70 144 155
Weight of RMST = 776 miles
Two least arcs from A are AB (47) and AC (84)
C 121 B 155 E 131 H 70 F 144 G 155 D
This is not a Hamiltonian cycle.
In general you do not get
84 47
a solution to the travelling
A salesman problem when finding
Lower bound by deleting A = 776 + 47 + 84 = 907 miles a lower bound.
ii Deleting G and using Prim’s algorithm starting at A
1 2 3 7 4 6 5
↓ ↓ ↓ ↓ ↓ ↓ ↓
A B C D E F H
A – 47 84 382 120 172 144
B 47 – 121 402 155 193 165
C 84 121 – 456 200 245 218
D 382 402 456 – 413 220 289
E 120 155 200 413 – 204 131
F 172 193 246 220 204 – 70
H 144 165 218 289 131 70 –
116
G
Lower bound by deleting G = 672 + 144 + 155 = 971 miles Notation
b The better lower bound is the higher one, 971 miles, the Choose your inequalities
one obtained by deleting G. carefully. When you can see that
the lower bound does not give
This will reduce the size of the interval containing the
a Hamiltonian cycle, you use
optimal solution.
,, since you know it does not
c The better lower bound is 971 miles, the better upper
represent a solution. The upper
bound is 1237 miles. bound could be the optimal
971 miles , optimal solution < 1237 miles solution so use < for this bound.
Exercise 5C A 13 B
16
1 The network shows the least distances, in miles,
11 13
between 5 towns. 8 7
10
a By deleting vertex A, find a lower bound to the
travelling salesman problem for the network opposite. E 16 C
b State, with reasons, whether your answer represents 12 9
an optimal solution. D
117
A 4 The table shows the time, in minutes, taken to travel between a surgery S and five farms
E/P V, W, X, Y and Z. A vet needs to visit animals at each of the farms and wishes to minimise the
total travel time. He will start and finish at the surgery, S.
S V W X Y Z
S – 75 30 55 70 70
V 75 – 55 30 40 15
W 30 55 – 65 45 55
X 55 30 65 – 15 10
Y 70 40 45 15 – 20
Z 70 15 55 10 20 –
a By deleting vertices S then V, find two lower bounds for the vet’s route. (4 marks)
b Select the better lower bound, giving a reason for
your answer. (1 mark)
An upper bound for the solution is given as 190 minutes.
Hint This upper bound was found
c Write down the smallest interval that you can be
as a solution to Q4 in Exercise 5B.
confident contains the optimal solution. (2 marks)
118
Example 9
A Apply the nearest neighbour algorithm, using A
A B C D E
A – 8 7 29 13 then B then C as starting vertices, to find an upper
bound to the travelling salesman problem.
B 8 – 9 24 14
C 7 9 – 23 6
D 29 24 23 – 21
E 13 14 6 21 –
Start at B.
Look down the B column. The smallest number is 8, BA. Delete row B.
Look down the A column (only). The smallest number is 7, AC. Delete row A.
Look down the C column (only). The smallest number is 6, CE. Delete row C.
Look down the E column (only). You have now visited each vertex but D, so
you must choose ED, 21.
You have now visited each vertex, so you return directly from D to B, 24.
Start at C.
Look down the C column. The smallest number is 6, CE. Delete row C.
Look down the E column (only). The smallest number is 13, EA. Delete row E.
Look down the A column (only).The smallest number is 8, AB. Delete row A.
Look down the B column (only). You have now visited each vertex but D, so
you must choose BD, 24.
You have now visited each vertex, so you return directly from D to C, 23.
You now have three answers; 80, 66 and 74. Select 66 as the best upper
bound, since this gives the shortest tour.
119
Example 10
A
A B C D E F G H This is the table of distances from Example 8.
A – 47 84 382 120 172 299 144 We found that the optimal solution lay in the
following interval
B 47 – 121 402 155 193 319 165
971 miles , optimal solution < 1237 miles.
C 84 121 – 456 200 246 373 218
a Use the nearest neighbour algorithm,
D 382 402 456 – 413 220 155 289
using A then B as starting vertices, to find
E 120 155 200 413 – 204 286 131 upper bounds for the travelling salesman
F 172 193 246 220 204 – 144 70 problem.
G 299 319 373 155 286 144 – 160 b Review the interval containing the optimal
H 144 165 218 289 131 70 160 – solution and amend it if necessary, giving
a reason for your answer.
Start at A.
Look down the A column. The smallest number is 47, AB. Delete row A.
Look down the B column (only). The smallest number is 121, BC. Delete row B.
Look down the C column (only). The smallest number is 200, CE. Delete row C.
Look down the E column (only). The smallest number is 131, EH. Delete row E.
Look down the H column (only). The smallest number is 70, HF. Delete row H.
Look down the F column (only). The smallest number is 144, FG. Delete row F.
Look down the G column (only). The smallest number is 155, DG. Delete row G.
You have now visited each vertex, so you return directly from D to A, 382.
Start at B.
Look down the B column. The smallest number is 47, BA. Delete row B.
Look down the A column (only). The smallest number is 84, AC. Delete row A.
Look down the C column (only). The smallest number is 200, CE. Delete row C.
Look down the E column (only). The smallest number is 131, EH. Delete row E.
Look down the H column (only). The smallest number is 70, HF. Delete row H.
Look down the F column (only). The smallest number is 144, FG. Delete row F.
Look down the G column (only). You have now visited each vertex but D, so
you must choose GD, 155.
You have now visited each vertex, so you return directly from D to B, 402.
120
Exercise 5D
A 1 (This is the same problem as described in Exercise 5C question 2)
A council employee needs to service five sets of traffic lights located at A, B, C, D and E.
The table shows the least distances, in miles, between the lights. She wishes to minimise her total
travelling distance.
A B C D E
A – 13 11 19 14
B 13 – 12 7 16
C 11 12 – 11 8
D 19 7 11 – 14
E 14 16 8 14 –
a Starting at D, find a nearest neighbour route to give an upper bound for the council
employee’s route.
b Show that there are two nearest neighbour routes starting from E.
c Select the value that should be given as the upper bound. Give a reason for your answer.
S V W X Y Z
S – 75 30 55 70 70
V 75 – 55 30 40 15
W 30 55 – 65 45 55
X 55 30 65 – 15 10
Y 70 40 45 15 – 20
Z 70 15 55 10 20 –
121
A 4 A printing company prints six magazines R, S, T, U, V and W, each week. The printing
E equipment needs to be set up differently for each magazine and the table shows the time, in
minutes, needed to set up the equipment from one magazine to another.
R S T U V W
R – 150 210 150 120 240
S 150 – 210 120 210 240
T 210 210 – 120 150 180
U 150 120 120 – 180 270
V 120 210 150 180 – 300
W 240 240 180 270 300 –
a If the magazines were printed in the order RSTUVWR, how long would it take in total to set
up the equipment? (2 marks)
b Show that there are two nearest neighbour routes starting from U. (2 marks)
c Show that there are three nearest neighbour routes starting from V. (3 marks)
d Select the value that should be given as the upper bound. Give a reason for your
answer. (1 mark)
E/P 5 The table shows the least driving distances between Aberdeen (A), Berwick-upon-Tweed (B),
Carlisle (C ), Dundee (D), Edinburgh (E ), Fort William (F ) and Glasgow (G ). The distances are
given in miles. The least distance between Aberdeen and Dundee is x miles, where x < 126.
A B C D E F G
A – 192 216 x 129 157 146
B 192 – 92 123 64 196 110
C 216 92 – 168 92 211 95
D x 123 168 – 56 126 81
E 129 64 92 56 – 131 43
F 157 196 211 126 131 – 116
G 146 110 95 81 43 116 –
A band is planning a tour. The band wants to plan an itinerary that will visit each town at least
once. The band would like to minimise the total distance travelled.
The band finds the nearest neighbour routes from Berwick-upon-Tweed and Aberdeen, and finds
that the sum of the lengths of these routes is 1419 miles.
a Find x, showing your working clearly. (4 marks)
b Hence find an upper bound for the optimal length of the band’s route. (1 mark)
122
Mixed exercise 5
A
1 F
1086
419
B
752 E
982 853
620
G
831 427
A
450 1102
733 D
C 450
a Use an appropriate algorithm to find a minimum connector for the network above. You must
make your method clear.
b Hence find an initial upper bound for the travelling salesman problem.
c Use the method of shortcuts to find an upper bound below 6100.
123
E 4 a Explain the difference between the classical and practical travelling salesman problems.
(1 mark)
The table shows the travel time, in minutes, between seven town halls P, Q, R, S, T, U and V.
Kim works at P and must visit each of the other town halls to deliver leaflets. She wishes to
minimise her route.
P Q R S T U V
P – 19 30 45 38 33 29
Q 19 – 28 27 50 23 55
R 30 28 – 51 29 49 50
S 45 27 51 – 77 21 71
T 38 50 29 77 – 69 37
U 33 23 49 21 69 – 56
V 29 55 50 71 37 56 –
b Find a minimum connector for the network. You must make your method clear by listing the
arcs in order of selection. (3 marks)
124
A c Use the minimum connector and shortcuts to find an upper bound below 220. You must list
the shortcuts you use and your final route. (2 marks)
d Starting at P, find a nearest neighbour route and state its length. (3 marks)
e Find a lower bound for the length of the route by deleting P. (3 marks)
f Looking at your answers to c, d and e, use inequalities to write down the smallest interval
containing the optimal solution. (1 mark)
E/P 5 A computer supplier has outlets in seven cities A, B, C, D, E, F and G. The table shows the
distances, in km, between each of these seven cities. John lives in city A and has to visit each of
these cities to advise on displays. He wishes to plan a route starting and finishing at A, visiting
each city and covering a minimum distance.
A B C D E F G
A – 103 89 42 54 143 153
B 103 – 60 98 56 99 59
C 89 60 – 65 38 58 77
D 42 98 65 – 45 111 139
E 54 56 38 45 – 95 100
F 143 99 58 111 95 – 75
G 153 59 77 139 100 75 –
a Obtain a minimum spanning tree for this network explaining briefly how you applied the
algorithm that you used. (Start with A and state the order in which you selected the arcs used
in your tree.) (3 marks)
b Hence determine an initial upper bound for the length of the route travelled by John. (1 mark)
c Explain why the upper bound found in this way is unlikely to give the minimum route length.
(2 marks)
d Starting from your initial upper bound and using an appropriate method, find an upper
bound for the length of the route which is less than 430 km. (2 marks)
e By deleting city A, determine a lower bound for the length of John’s route. (3 marks)
f Explain under what circumstances a lower bound obtained by this method might be an
optimum solution. (2 marks)
E 6 A sales representative, Sheila, has to visit clients in six cities, London, Cambridge, Oxford,
Birmingham, Nottingham and Exeter. The table shows the distances, in miles, between these six
cities. Sheila lives in London and plans a route starting and finishing in London. She wishes to
visit each city and drive the minimum distance.
L C O B N E
London (L) – 80 56 120 131 200
Cambridge (C ) 80 – 100 98 87 250
Oxford (O) 56 100 – 68 103 154
Birmingham (B) 120 98 68 – 54 161
Nottingham (N ) 131 87 103 54 – 209
Exeter (E ) 200 250 154 161 209 –
125
A a Starting from London, use Prim’s algorithm to obtain a minimum spanning tree. Show your
working. State the order in which you selected the arcs and draw the tree. (3 marks)
b i Hence determine an initial upper bound for the length of the route planned by Sheila.
ii Starting from your initial upper bound and using shortcuts, obtain a route which is less
than 660 miles. (3 marks)
c By deleting Exeter from the table determine a lower bound for the length of Sheila’s route.
(3 marks)
E/P 7 The table shows the least distances, in miles, by road between seven towns labelled A, B, C, D, E,
F and G. The least distance between F and D is x miles.
A B C D E F G
A – 16 21 17 12 15 19
B 16 – 24 18 30 26 20
C 21 24 – 31 22 35 23
D 17 18 31 – 28 x 33
E 12 30 22 28 – 27 28
F 15 26 35 x 27 – 30
G 19 20 23 33 28 30 –
Tom is putting up posters for a fund-raising event, and wants to plan a route that will visit each
town.
He applies the nearest neighbour algorithm, starting and finishing at A, and obtains a total
distance of 140 miles.
a Find the value of x. (3 marks)
b Find the length of the nearest neighbour route starting and finishing at B. (2 marks)
c Starting by deleting G and its arcs, find a lower bound for the length of Tom’s route. (3 marks)
d Write down the smallest interval that must contain the optimal length of Tom’s route. (1 mark)
Challenge
Show that the nearest neighbour algorithm has cubic order. Clearly
explain each step of your working.
126
2 There are two variations of the travelling salesman problem. In the classical problem, each
vertex must be visited exactly once before returning to the start. In the practical problem,
each vertex must be visited at least once before returning to the start.
127
128
129
a Use Kruskal’s algorithm to obtain E 11* The matrix represents a network of roads
a minimum spanning tree for the between six villages A, B, C, D, E and F.
network, giving the order in which you The value in each cell represents the
selected the arcs. (6) distance, in km, along these roads.
b Draw your minimum spanning tree
A B C D E F
and find the least cost of pipelines. (3)
A – 7 3 – 8 11
← Sections 2.4, 3.1
B 7 – 4 2 – 7
C 3 4 – 5 9 –
E/P 10 a The table shows the distances, in D – 2 5 – 6 3
metres, between six nodes A, B, C, D,
E 8 – 9 6 – –
E and F of a network.
F 11 7 – 3 – –
A B C D E F
a Show this information on a diagram.
A – 10 12 13 20 9
(3)
B 10 – 7 15 11 7
b Use Kruskal’s algorithm to determine
C 12 7 – 11 18 3
the minimum spanning tree. State the
D 13 15 11 – 27 8 order in which you include the arcs and
E 20 11 18 27 – 18 the length of the minimum spanning
F 9 7 3 8 18 – tree. Draw the minimum spanning
tree. (4)
i Use Prim’s algorithm, starting at
A, to solve the minimum connector c Starting at D, use Prim’s algorithm on
problem for this table of distances. the matrix given to find the minimum
Explain your method and indicate spanning tree. State the order in
the order in which you selected the which you include the arcs. (4)
edges. (6) ← Sections 2.4, 3.1, 3.3
C 19 E 20 I
130
c State the weight of a minimum A 15 The diagram shows the direct distances in
spanning tree. (1) E miles, by road, between 4 villages A, B, C
← Sections 3.1, 3.2, 3.3 and D.
B
E 13* C
A 10
20 16 3
1
A G 7
26
11 12 C
34 D D 11
24 33
B T
21
25 5
S 22 18
E H
34
10
a Use Floyd’s algorithm to produce a
F table of least distances. (7)
a Use Dijkstra’s algorithm to find the Show the distance table and the route
shortest route from S to T in this table after each iteration.
network. Show all necessary working b State the shortest distance from A
by drawing a diagram. State your to D. (1)
shortest route and its length. (6) c Show how to use the route table to find
b Explain how you determined the the shortest route from A to D. (2)
shortest route from your labelling. (2) ← Sections 3.5
c It is now necessary to go from S to T
via H. Obtain the shortest route and its
E/P 16 Floyd’s algorithm is applied to a network.
length. (2)
The final distance and route tables are
← Section 3.4
shown below.
E 14* The diagram shows a network of roads. Distance table Route table
Erica wishes to travel from A to L as A B C D A B C D
quickly as possible. The number on each A – 5 y z A A B B B
edge gives the time, in minutes, to travel
B 5 – 3 6 B A B C D
along that road.
C x 13 – 7 C D D C D
A B C D
4 6 6 D 10 6 7 – D A B C D
1 2 8 4 Deduce the values of x, y and z.
F G You must show enough working to justify
E H
4 5 2 your answers. (5)
5 7 3 1
← Section 3.5
I 2 J 4 K 1 L
131
E 0.2 0.7
7 8 A
0.3 0.6
9 0.4
D G 0.7 0.5 B
17
F 0.8
B1 G
13
7
(Total weight of network is 6)
B2
A local council is responsible for
21 maintaining pavements in a district.
C 3 14 F
A The roads for which it is responsible are
represented by arcs in the diagram. The
10 9 11
road junctions are labelled A, B, C, ..., G.
The number on each arc represents the
E
length of that road in km.
(Total weight of network is 129) The council has received a number
The diagram shows a network of roads of complaints about the condition of
connecting villages. The length of each the pavements. In order to inspect the
road, in km, is shown. Village B has pavements, a council employee needs to
only a small footbridge over the river walk along each road twice (once on each
which runs through the village. It can be side of the road) starting and ending at
accessed by two roads, from A and D. the council offices at C. The length of the
132
route is to be minimal. Ignore the widths A The total length of the route should be as
of the roads. small as possible.
a Explain how this situation differs P 200 Q
from the standard route inspection 75
165 110
problem. (1)
U 126 95 R 136
b Find a route of minimum length
and state its length. (5) V 223 S
← Section 4.2 338 645
147
E 20* G
B T
3 3
F 5
12 9
The total length of all the roads is 2260 m.
5 6
2
I Using the route inspection algorithm,
C 12 E
A 10 4 (East a determine which roads must be
(West 15 3 2 Gate)
traversed more than once (6)
Gate)
D H b calculate the length of the shortest
(Total weight of network is 91) route. (2)
← Section 4.3
The diagram shows the network of paths
in a country park. The number on each
E/P 22 G 0.8 A
path gives its length in km. The vertices A
and I represent the two gates in the park 0.9
0.7
and the vertices B, C, D, E, F, G and H 0.2
F 1.5 0.6
represent places of interest. B
a Use Dijkstra’s algorithm to find the 0.8 1.1
shortest route from A to I. Show all 1.3 C
necessary working and state your E
0.9 0.7
shortest route and its length. (6) D
The park warden wishes to inspect each (Total weight of network is 9.5)
of the paths to check for frost damage.
An engineer needs to check the state of
She has to cycle along each path at least
a number of roads to see whether they
once, starting and finishing at A.
need resurfacing. The roads that need to
b i Use an appropriate algorithm to be checked are represented by the arcs
find which paths will be covered in the diagram. The number on each arc
twice and state these paths. (2) represents the length of that road in km.
ii Find a route of minimum length. To check all the roads, he needs to travel
(3) along each road at least once. He wishes
iii Find the total length of this to minimise the total distance travelled.
shortest route. (2)
a Use the route inspection algorithm,
← Sections 3.4, 4.2
starting at A and finishing at G, to find
the minimum time taken to traverse
A 21 The diagram shows the road network of a
small housing development. The number each arc at least once. (4)
E/P
on each arc represents the length of the b State a possible route. (4)
road in metres. A security guard has to The engineer believes that he can reduce
patrol the length of each road at least the distance travelled by starting at D and
once, starting at T and finishing at P. finishing G.
133
A c State whether the engineer is correct A The diagram shows a network of roads
in his belief. If so, calculate how much connecting six villages A, B, C, D, E
shorter his new route is. If not, and F. The lengths of the roads are given
explain why not. (4) in km.
← Section 4.3 a Complete a table of least distances for
this network, by inspection. (2)
E 23 a Explain the difference between the
The table can now be taken to represent a
classical and practical travelling
complete network.
salesperson problems. (2)
b Use the nearest neighbour algorithm,
B 18 E
starting at A, on your completed table
8 20 10 14 in part a. Obtain an upper bound to
D 11
19 9 17 H the length of a tour in this complete
A F
18 network, which starts and finishes at A
22
13 13 20 and visits every village exactly once. (4)
C 31 c Interpret your answer in part b in
G
terms of the original network of roads
The network above shows the distances, connecting the six villages. (1)
in kilometres, between eight McBurger d By choosing a different vertex as
restaurants. An inspector from head your starting point, use the nearest
office wishes to visit each restaurant. His neighbour algorithm to obtain a
route should start and finish at A, visit shorter tour than that found in part b.
each restaurant at least once and cover a State the tour and its length. (4)
minimum distance. ← Sections 5.1, 5.4
b Obtain a minimum spanning tree
for the network using Kruskal’s
algorithm. You should draw your tree E 25 The table shows the least distances, in km,
and state the order in which the arcs between five towns, A, B, C, D and E.
were added. (4)
A B C D E
c Use your answer to part b to determine
A – 153 98 124 115
an initial upper bound for the length of
B 153 – 74 131 149
the route. (1)
C 98 74 – 82 103
d Starting from your initial upper bound
and using an appropriate method, find D 124 131 82 – 134
an upper bound which is less than E 115 149 103 134 –
135 km. State your tour. (4)
Nassim wishes to find an interval which
← Sections 5.1, 5.2 contains the solution to the travelling
salesman problem for this network.
E/P 24* A 20 B
a Making your method clear, find an
12 10 initial upper bound starting at A and
15 16
E C using:
16 19 i the minimum spanning tree
F
20 15 method (4)
ii the nearest neighbour algorithm. (4)
D b By deleting E, find a lower bound. (4)
134
135
A c By deleting A, find a lower bound for A e Hence obtain a lower bound for the
the solution to the travelling salesman length of Susie’s route. (2)
problem. (4) f Using your solution to part d, obtain a
d Use your answers to parts b and c to route of length less than 500 km which
make a comment on the value of the visits each vertex exactly once. (2)
optimal solution. (1) ← Sections 5.2, 5.3, 5.4
e Draw a diagram to show your best
route. (2)
Challenge
← Sections 3.3, 5.2, 5.3
1 a Explain why any simple graph with two or
more vertices must contain at least two
E 29 A retailer has shops in seven cities A, B, vertices with the same degree.
C, D, E, F and G. The table below shows b The diagram shows an edge-colouring of K6,
the distances, in km, between each of where every edge has been coloured either
these seven cities. Susie lives in city A and red or blue.
has to visit each of the shops. She wishes A B
to plan a route starting and finishing at A
and covering a minimum distance.
A B C D E F G F C
A – 55 125 160 135 65 95
B 55 – 82 135 140 100 83
C 125 82 – 85 120 140 76
E D
D 160 135 85 – 65 132 63
E 135 140 120 65 – 90 55 For the above edge-colouring, it is possible
to find sets of three vertices which are all
F 65 100 140 132 90 – 75
linked by edges of the same colour. Here are
G 95 83 76 63 55 75 – two examples:
a Starting at A, use an algorithm to A B A B
find a minimum spanning tree for this
network. State the order in which you F C F C
added vertices to the tree and draw
your final tree. Explain briefly how you
E D E D
applied the algorithm. (6)
b Hence determine an initial upper bound i Find two additional sets of three vertices
for the length of Susie’s route. (1) in the above graph which are all linked by
edges of the same colour.
c Starting from your initial upper bound,
ii Prove that for any edge-colouring of the
obtain an upper bound for the route
K6 with two colours, it will be possible to
which is less than 635 km. State the
find a set of three vertices which are all
route which has a length equal to your linked by edges of the same colour.
new upper bound and cities which are
iii By constructing a suitable graph, show
visited more than once. (2)
that this result is not true for K 5.
d Obtain the minimum spanning tree ← Section 3.3
for the reduced graph produced by
deleting the vertex G and all edges
joined to it. Draw the tree. (4)
136
137
138
Example 1
Mrs Cook is making cakes to sell for charity. She makes two types of cake, fruit and chocolate.
Amongst other ingredients, each fruit cake requires 1 egg, 250 g of flour and 200 g of sugar.
Each chocolate cake requires 2 eggs, 250 g of flour and 300 g of sugar.
Mrs Cook has 36 eggs, 7 kg of flour and 6 kg of sugar.
She will sell the fruit cakes for £3.50 and the chocolate cakes for £5.
She wishes to maximise the money she makes from these sales. This is an assumption that is
made in linear programming
You may assume she sells all the cakes that she makes.
problems and is not usually
Formulate this as a linear programming problem. stated.
139
Type of cake Eggs Flour Sugar Price It is sometimes useful to summarise the
information in a table.
Fruit 1 250 g 200 g £3.50
Chocolate 2 250 g 300 g £5.00
Total available 36 7000 g 6000 g
First define the decision variables. You need to make the units agree.
Let f be the number of fruit cakes made.
Let c be the number of chocolate cakes made. The decision variables always start ‘Let x
be the number of ...’ etc.
Next, state the objective.
Maximise because Choose a letter There are two parts to the objective:
Mrs Cook wishes to represent a word maximise or minimise and an
to maximise her Mrs Cook's objective function.
income. income.
maximise P = 3.5f + 5c
Mrs Cook will get £3.50 Each chocolate cake You don't need to include units in the
for each fruit cake she sold raises £5. If c cakes objective function, but make sure that all
sells. If she sells f of them are sold, Mrs Cook will the units agree.
she will make £3.5f. make £5c.
Finally, identify the constraints. These will be inequalities.
eggs: f + 2c < 36
flour: 250f + 250c < 7000 Mrs Cook needs 1 egg for each fruit cake
and 2 to make each chocolate cake. There is
This simplifies to a maximum of 36 eggs that can be used.
f + c < 28
sugar: 200f + 300c < 6000 Each fruit cake requires 250 g and each
chocolate cake 250 g. There are up to
This simplifies to
7000 g available.
2f + 3c < 60
non-negativity: f > 0 c > 0 Each fruit cake requires 200 g and each
These are often written together as chocolate cake 300 g. There are 6000 g
f, c > 0 available.
140
Example 2
A company buys two types of diary to send to its customers, a desk top diary and a pocket diary.
They will need to place a minimum order of 200 desk top and 80 pocket diaries.
They will need at least twice as many pocket diaries as desk top diaries.
They will need a total of at least 400 diaries.
Each desk top diary costs £6 and each pocket diary costs £3.
The company wishes to minimise the cost of buying the diaries.
Formulate this as a linear programming problem.
141
Example 3
A company produces two types of syrup, A and B. The syrups are a blend of sugar, fruit and juice.
Syrup A contains 30% sugar, 50% fruit and 20% juice.
Syrup B contains 20% sugar, 35% fruit and 45% juice.
Each litre of syrup A costs 50p and each litre of syrup B costs 40p.
There is a maximum daily production of 40 000 litres of syrup A and 45 000 litres of syrup B.
A confectionery manufacturer places an order for 60 000 litres of syrup but requires
• below 25% sugar
• at least 40% fruit
• no more than 35% juice.
The company will blend syrups A and B to meet the confectionery manufacturer’s requirements.
The company wishes to minimise its costs.
Letting x be the number of litres of syrup A used, and y be the number of litres of syrup B used,
formulate this as a linear programming problem.
142
Exercise 6A
E/P 1 A chocolate manufacturer is producing two hand-made assortments, gold and silver, to
commemorate 50 years in business.
It will take 30 minutes to make all the chocolates for one box of gold assortment and 20 minutes
to make the chocolates for one box of silver assortment.
It will take 12 minutes to wrap and pack the chocolates in one box of gold assortment and 15
minutes for one box of silver assortment.
The manufacturer needs to make at least twice as many silver as gold assortments.
The gold assortment will be sold at a profit of 80p, and
Watch out Remember to define
the silver at a profit of 60p.
your variables clearly, and include
There are 300 hours available to make the chocolates and a non-negativity constraint.
200 hours to wrap them. The profit is to be maximised.
Letting the number of boxes of gold assortment be x and the number of boxes of silver
assortment be y, formulate this as a linear programming problem. (5 marks)
E/P 2 A floral display is required for the opening of a new building. The display must be at least 30 m
long and is to be made up of two types of planted displays, type A and type B.
Type A is 1 m in length and costs £6 and
Type B is 1.5 m in length and costs £10
The client wants at least twice as many type A as type B, and at least 6 of type B.
The cost is to be minimised.
Letting x be the number of type A used and y be the number of type B used, formulate this as a
linear programming problem. (5 marks)
143
E/P 3 A toy company makes two types of board game, Cludopoly and Trivscrab. As well as the board,
each game requires playing pieces and cards.
The company uses two machines, one to produce the pieces and one to produce the cards. Both
machines can only be operated for up to ten hours per day.
The first machine takes 5 minutes to produce a set of pieces for Cludopoly and 8 minutes to
produce a set of pieces for Trivscrab.
The second machine takes 8 minutes to produce a set of cards for Cludopoly and 4 minutes to
produce a set of cards for Trivscrab.
The company knows it will sell at most three times as many games of Cludopoly as Trivscrab.
The profit made on each game of Cludopoly is £1.50 and £2.50 on each game of Trivscrab.
The company wishes to maximise its daily profit.
Let x be the number of games of Cludopoly and y the number of games of Trivscrab.
Formulate this problem as a linear programming problem. (5 marks)
E/P 4 A librarian needs to purchase bookcases for a new library. She has a budget of £3000 and 240 m2
of available floor space. There are two types of bookcase, type 1 and type 2, that she is permitted
to buy.
Type 1 costs £150, needs 15 m2 of floor space and has 40 m of shelving.
Type 2 costs £250, needs 12 m2 of floor space and has 60 m of shelving.
She must buy at least 8 type 1 bookcases and wants at most _ 3 of all the bookcases to be type 2.
1
E/P 5 A garden supplies company produces two different plant feeds, one for indoor plants and one for
outdoor plants.
In addition to other ingredients, the plant feeds are made by combining three different natural
ingredients A, B and C.
Each kilogram of indoor feed requires 10 g of A, 20 g of B and 20 g of C.
Each kilogram of outdoor feed requires 20 g of A, 10 g of B and 20 g of C.
The company has 5 kg of A, 5 kg of B and 6 kg of C available each week to use to make these feeds.
The company will sell at most three times as much outdoor as indoor feed, and will sell at least
50 kg of indoor feed.
The profit made on each kilogram of indoor and outdoor feed is £7 and £6 respectively.
The company wishes to maximise its weekly profit.
Formulate this as a linear programming problem, defining your decision variables. (6 marks)
E 6 Sam makes three types of fruit smoothies, A, B and C. As well as other ingredients all three
smoothies contain oranges, raspberries, kiwi fruit and apples, but in different proportions. Sam
has 50 oranges, 1000 raspberries, 100 kiwi fruit and 60 apples. The table below shows the number
of these 4 fruits used to make each smoothie and the profit made per smoothie. Sam wishes to
maximise the profit.
144
Letting x be the number of A smoothies, y the number of B smoothies and z the number of C
smoothies, formulate this as a linear programming problem. (5 marks)
E/P 7 A dairy manufacturer has two factories, R and S. Each factory can process milk and yoghurt.
Factory R can process 1000 litres of milk and 200 litres of yoghurt per hour.
Factory S can process 800 litres of milk and 300 litres of yoghurt per hour.
It costs £300 per hour to operate factory R and £400 per hour to operate factory S. In order
to safeguard jobs it has been agreed that each factory will operate for at least _ 3 of the total,
1
Example 4
A linear programming problem is given as:
minimise C = 0.5x + 0.4y
subject to
x,y
2x > y
3x > 2y
x + y > 60 000
x, y > 0
On a graph, represent the feasible region for this problem, and label it R.
145
x,y Problem-solving
y
x=y
Graphical solutions to linear
programming problems should be
keep drawn accurately on graph paper
using a ruler and a sharp pencil.
The non-negativity constraints on
reject x and y mean that you only need
to draw the positive axes.
O x
40 000 Testing (40 000, 0) puts it in the
region to reject since 40 000 is
not < 0.
keep
O x
40 000 Testing (40 000, 0) puts it in the
region to keep since
2 × 40 000 > 0
3x > 2y y
3x = 2y
reject
The line 3x = 2y passes through
keep (0, 0), (20 000, 30 000) and
(40 000, 60 000).
O x
40 000
Testing (40 000, 0) puts it in the
region to keep since
3 × 40 000 > 2 × 0
146
x + y > 60 000
y
keep
reject
40 000
00
00
00
00
00
00
10
20
30
40
50
60
70
function.
Exercise 6B
1 Represent each set of inequalities on a graph. Shade any regions of the graph that fail to satisfy
all the inequalities, and label the feasible region R.
a 2x + 3y . 18 b 2x > 3y c x + y < 20 d 2x – 3 , y
y.x 3x + 4y < 24 5x + 6y > 60 y.3
y<5 x>3 2x > y y . 6 – 2x
x, y > 0 y > 1 y < 10 x>0
147
P 4 A company manufactures two types of mp3 player, type A and type B. The company decides that
each month:
• at least 200 type A mp3 players should be produced
• the number of type A mp3 players should be between 10% and 40% of the total number of
mp3 players produced
• a maximum of 3000 mp3 players can be produced.
The company makes a profit of £75 on each type A mp3 player produced and a profit of £55 on
each type B mp3 player produced. The firm wishes to maximise its monthly profit.
Show the feasible region for this linear programming problem on a suitable graph.
E 5 This graph is being used to solve a linear programming problem. Three of the constraints have
been drawn on the graph and the rejected regions shaded.
y a Write down the constraints shown on the
40 graph. (3 marks)
Two further constraints are:
30
x + y > 20
3x + 4y < 120
20
b Copy the graph and add two lines and
10 shading to represent these constraints. Hence
determine the feasible region and label it R.
(2 marks)
O x
10 20 30 40 50
148
Example 5
Nigel is making ice cream for sale at a charity fair. He makes two flavours of ice cream: vanilla
and chocolate. Let the number of litres of vanilla ice cream made be x and the number of litres of
chocolate ice cream made be y. Nigel decides to use linear programming to determine the number
of litres of each type of ice cream he should make. The constraints and the feasible region, R, are
illustrated in the diagram below.
y
x = 13
y=x
20
18
16
14
12
10
R
8
6
y=5
3x + 5y = 60
2
O x
2 4 6 8 10 12 14 16 18 20
Determine the optimal solution for this problem, given that the objective is to
a maximise the profit on sales, P = 2x + y,
b minimise the production costs, C = 5x + 2y.
149
a
y
The diagram shows the parallel lines of the form
20 P = 2x + y, for various values of P.
These are all objective lines. The value of P is
18
given for each line.
12
P = 30
10
8 P = 20
6
P = 10
4
2 P=4
O x
2 4 6 8 10 12 14 16 18 20
2x + y = 4 2x + y = 10 2x + y = 20 2x + y = 30
Problem-solving
Imagine a ruler sliding over the feasible region on page 149 so that it is always
parallel to the profit lines above. The maximum value of P will be in the feasible
region at the point furthest from the origin (the last point the ruler touches as it
slides out of the feasible region).
150
2x + y = 20 2x + y = 30
y
x = 13
y=x
20
18
16
14
12
10
R
8
6
y=5
4 3x
+5
y=
60
2
O 2 4 6 8 10 12 14 16 18 20 x
From the diagram, the optimal point is (13, 13), giving an optimal value for P of
2 × 13 + 13 = 39.
So Nigel should make 13 litres of vanilla ice cream, and 13 litres of chocolate ice cream, and
makes a profit of £39.
151
b Draw an objective line with a ruler and label it. The line should be
accurately plotted and be long enough for its gradient to be checked.
5x + 2y = 40
y
x = 13
20 y=x
18
16
14
Choose a value of C and draw the objective
12 line. If you choose a multiple of both 5 and 2
then the objective line will pass through integer
10 values on the coordinate axis, making it easier
to draw. The line 5x + 2y = 40 passes through
R
8 (0, 20) and (8, 0).
Then slide the ruler towards the feasible
6 region, keeping it parallel to the objective line.
y=5
2 3x + 5y = 60
O 2 4 6 8 10 12 14 16 18 20 x
5x + 2y = 30
The minimum value will occur at the first point covered by the objective line as it moves into
the feasible region. In this case the optimal point is found where the line y = x meets the
line 3x + 5y = 60. Solving these equations simultaneously gives x = 7.5 and y = 7.5.
So at this point C = 5x + 2y = 7 × 7.5 = 52.5.
So Nigel should make 7.5 litres of vanilla ice cream and 7.5 litres of chocolate ice cream,
with production costs of £52.50.
■ For a maximum point, look for the last point covered by an objective line as it leaves the
feasible region.
■ For a minimum point, look for the first point covered by an objective line as it enters the
feasible region.
It is very important, when using the objective line method, that the ruler is
kept parallel to an objective line. To do this you need two straight edges:
rul
re
squa
Place the ruler along an objective line, then place the set square (or second set
ruler) at the base of the ruler.
Hold the set square firmly and slide the ruler along the edge of the set square.
152
Example 6
Using the feasible region determined by the inequalities
x > 2 4x + 3y < 12 2y < x x, y > 0
find the optimal point and the optimal value when the objective is to:
a maximise P = 2x + y b maximise P = x + 2y
a y
x=2
2
ob
2y = x
jec
tive
line
1
ab = ax + by always passes
+y
R 4x + 3y = 12
A
O x
1 2 3 The objective line must be
Draw an objective line. labelled.
The diagram shows the feasible region and the objective line
2x + y = 2, which passes through (1, 0) and (0, 2).
The final point is point A, where x = 3, y = 0.
Optimal point is (3, 0). Optimal value is P = 2 × 3 + 0 = 6.
b y
x=2
2
2y = x
1 obj
ect B
ive
line
x+
2y R 4x + 3y = 12
=2
A
O x
1 2 3
The diagram shows the feasible region and the objective line
x + 2y = 2, which passes through (2, 0) and (0, 1).
The final point is point B. Online Explore how
B is at the intersection of 2y = x and 4x + 3y = 12. the optimal solution
can be found using the
Solving these equations simultaneously gives y = 1 _1 _ 2
11 and x = 2 11
objective line method with
Optimal point is (2 _
11 , 1 11 ). Optimal value is P = 2 11 + 2 11 = 4 11
2 _ 1 _ 2 _ 2 _ 4
GeoGebra.
153
Example 7
In a linear programming problem the constraints are given by
3x + y > 90
2x + 7y > 140
x + y > 50
x, y > 0
a Minimise C = 3x + 2y. b Minimise C = 3x + 7y.
70
60
R
50
40
A
30
x + y = 50
20
obj
ob
ect
ive
jec
10 line
tiv
el
B 3x + 7y = 210
ine
O 10 20 30 40 50 60 70 80 x
3x + 2y = 60 2x + 7y = 140
154
b The objective line has equation 3x + 7y = 210 and passes through (70, 0)
and (0, 30).
The first point in the feasible region is B.
B lies at the intersection of
2x + 7y = 140
and x + y = 50
Solving simultaneously gives
x = 42, y = 8
which gives C = 3 × 42 + 7 × 8 = 182
Example 8
Using the same feasible region as in Example 7, find an optimal solution given that the objective is
to minimise C = x + y.
y
Problem-solving
90 As the objective line slides into
the feasible region, it lies along
3x + y = 90 the line segment AB. This
80
means that all points along
this part of the line are optimal
70
solutions.
60
R
50
40
ob A
30 je
ct
ive
lin x + y = 50 Watch out The point (10, 40)
20 e also lies on this line, but it is
not a solution, since it does not
10 B lie in the feasible region.
x + y = 30 2x + 7y = 140
O 10 20 30 40 50 60 70 80 x
A (20, 30) C = 20 + 30 = 50
B (42, 8) C = 42 + 8 = 50 Online Explore how
(25, 25) C = 25 + 25 = 50 the optimal solution
(40, 10) C = 40 + 10 = 50 can be found using the
The optimal solutions are the points on the line x + y = 50 for objective line method with
which 20 < x < 42 GeoGebra.
155
You may have noticed that the optimal point occurs at one (or more) of the vertices of the feasible
region. You can use this fact to find optimal points using the vertex testing method.
■ To find an optimal point using the vertex method:
1 First find the coordinates of each vertex of the feasible region.
2 Evaluate the objective function at each of these points.
3 Select the vertex that gives the optimal value of the objective function.
Example 9
Use the vertex testing method to solve the following linear programming problem:
minimise x + 3y
subject to y<x
3x + 5y > 60
y>5
x < 13
x, y > 0
y
x = 13 This is the feasible
y=x region determined
20
in Example 5.
18
16
14
12 B
3x + 5y = 60
10
R
8 A
6
DC y=5
O x
2 4 6 8 10 12 14 16 18 20
156
y
4x + y = 28
16
14 y=x
12 Problem-solving
If the points of intersection are not
10 obvious integer values, you should
use simultaneous equations to
8 determine their coordinates. You
5x + 3y = 30 should always draw a graph to make
6 sure you don't waste time finding
points of intersection that lie outside
A the feasible region.
4 B
E
x + 2y = 8 R 9x + 11y = 99
2 D
C
O 2 4 6 8 10 12 x
157
Exercise 6C
1 The diagram shows a feasible region, R.
y
4x + y = 1400
600
500
400
300
x + 3y = 1200
200
R
100
3x + 2y = 1200
158
O x
20
40
60
80
0
0
0
0
10
12
14
16
Find the optimal point and the optimal value, using:
a the vertex testing method, with the objective ‘minimise E = 2x + y’
b the vertex testing method, with the objective ‘minimise F = x + 4y’
c the objective line method, with the objective ‘minimise G = 3x + 4y’
d the objective line method, with the objective ‘minimise H = x + 6y’
20
10
O x
5
10
15
20
25
30
35
40
45
50
3x + y = 60
159
24
22
6x + 5y = 120
20
18
16
B
14
12
3x + y = 12
10
8
R
3y = x
6 C
A
4
2
D
O x
2 4 6 8 10 12 14 16 18 20
Determine which vertex, A, B, C or D, is the optimal point for each of the following objectives.
a maximise x b minimise x
c maximise y d minimise y
e maximise 6x + y f minimise 6x + y
g maximise 2x + 5y h minimise 2x + 5y
i maximise 3x + 2y j minimise 3x + 2y
160
5 Solve the linear programming problem posed in Exercise 6A, question 5 (page 144).
6 Solve the linear programming problem posed in Exercise 6A, question 7 (page 145).
161
Challenge
Here is an example of a non-linear programming problem:
maximise P = 3x + y
subject to x>1
5y – 4x > 0
x2 + y < 10
a Sketch the feasible region for this problem.
b By considering the gradient of the objective line, find the maximum
value of P within the feasible region.
Example 11
Given that x and y must be integers, solve the following linear programming problem.
Maximise P = x + 2y
subject to 3x + 4y < 36
13x + 9y < 117
5y – 4x < 10
6x + 5y > 30
y>2
162
y
Draw a graph of the feasible
region. Show the integer
14
solutions using dots.
13x + 9y = 117
12
5y – 4x = 10
10
8
Using the objective line method,
the optimal point is at the
6 intersection of
6x + 5y = 30 5y – 4x = 10 and
4 3x + 4y = 36, but this does not
3x + 4y = 36
have integer solutions.
2
objective line
O 2 4 6 8 10 12 x
There are two methods that can be used to locate the optimal
integer value.
Method 1
Watch out This method is only
If it is possible to plot the integer value solutions accurately,
possible if the feasible region is
simply select the last integer solution covered by the objective
sufficiently clear to identify the
line as it leaves the feasible region, moving away from the integer solutions accurately. This
origin. may depend on the scales used
In this case, it is (5, 5) giving P 5 15. on the axes.
Method 2
Locate the optimal (non-integer) solution, then test the integer Watch out It could be that
solutions that are close to it. Evaluate the objective function the integer solution lies some
and, most importantly, check whether the integer solutions lie distance from the optimal
in the feasible region. solution.
The optimal solution is (4 __
31 , 5 31 )so test (4, 5), (4, 6), (5, 5)
16 __19
163
Example 12
Minimise x+y
You need to decide whether integer solutions
subject to 3x + 5y > 1500
were required from the content of the question.
5x + 2y > 1000 For example, you cannot have fractions of flower
x, y > 0 displays! ← Exercise 6A, Question 2
given that x and y must be integers.
500
5x + 2y = 1000
400
R
300
200
3x + 5y = 1500
100
objective line
Using the objective line method, the optimal point is Watch out The scale on this graph
at the intersection of 5x + 2y = 1000 is such that you cannot plot all integer
and 3x + 5y = 1500, solutions in the feasible region, so
you test integer solutions close to the
which is (105 __
19 , 236 19 ).
5 __16
optimal vertex.
164
You cannot use the objective line to help any more. Using a table may help to
Investigate integer solutions close to this point. organise your working.
Exercise 6D
1 Solve the following linear programming problems, given that integer values are required for the
decision variables.
a Maximise 3x + 2y c Maximise 5x + 2y
subject to x + 5y > 10 subject to 2y > x
3x + 4y < 24 5x + 4y < 800
4x + 3y < 24 y < 4x
x, y > 0 x, y > 0
b Minimise 2x + y d Maximise 2x + y
subject to 5x + 6y > 60 subject to 3x + 5y < 1500
4x + y > 28 3x + 16y > 2400
x, y > 0 y<x
x, y > 0
E/P 3 A chocolate manufacturer is producing two hand-made assortments, gold and silver, to
commemorate 50 years in business.
It will take 30 minutes to make all the chocolates for one box of gold assortment and
20 minutes to make the chocolates for one box of silver assortment.
165
It will take 12 minutes to wrap and pack the chocolates in one box of gold assortment and 15
minutes for one box of silver assortment.
The manufacturer needs to make at least twice as many silver as gold assortments.
The gold assortment will be sold at a profit of 80p, and the silver at a profit of 60p.
There are 300 hours available to make the chocolates and 200 hours to wrap them.
Maximise the profit, P. (9 marks)
E/P 4 A floral display is required for the opening of a new building. The display must be at least 30 m
long and is to be made up of two types of planted displays, type A and type B.
Type A is 1 m in length and costs £6.
Type B is 1.5 m in length and costs £10.
The client wants at least twice as many type A as type B, and at least 6 of type B.
a Write each of the constraints as an inequality. (3 marks)
b Represent the inequalities on a diagram and identify the feasible region. (3 marks)
c Find the minimum cost and justify your answer. (3 marks)
E/P 5 A toy company makes two types of board game, Cludopoly and Trivscrab. As well as the board
each game requires playing pieces and cards.
The company uses two machines, one to produce the pieces and one to produce the cards. Both
machines can only be operated for up to ten hours per day.
The first machine takes 5 minutes to produce a set of pieces for Cludopoly and 8 minutes to
produce a set of pieces for Trivscrab.
The second machine takes 8 minutes to produce a set of cards for Cludopoly and 4 minutes to
produce a set of cards for Trivscrab.
The company knows it will sell at most three times as many games of Cludopoly as Trivscrab.
The profit made on each game of Cludopoly is £1.50 and £2.00 on each game of Trivscrab.
a Write each of the constraints as an inequality. (3 marks)
b Represent the inequalities on a diagram and identify the feasible region. (3 marks)
c Find the maximum profit and justify your answer. (3 marks)
E/P 6 A librarian needs to purchase bookcases for a new library. She has a budget of £3000 and 240 m2
of available floor space. There are two types of bookcase, type 1 and type 2, that she is permitted
to buy.
Type 1 costs £150, needs 15 m2 of floor space and has 40 m of shelving.
Type 2 costs £250, needs 12 m2 of floor space and has 60 m of shelving.
She must buy at least 8 type 1 bookcases and wants at most _ 3 of all the bookcases to be type 2.
1
166
Mixed exercise 6
E/P 1 Mr Baker is making cakes and fruit loaves for sale at a charity cake stall. Each cake requires 200 g
of flour and 125 g of fruit. Each fruit loaf requires 200 g of flour and 50 g of fruit.
He has 2800 g of flour and 1000 g of fruit available.
Let the number of cakes that he makes be x and the number of fruit loaves he makes be y.
a Show that these constraints can be modelled by the inequalities
x + y < 14 and 5x + 2y < 40. (4 marks)
Each cake takes 50 minutes to cook and each fruit loaf takes 30 minutes to cook. There are
8 hours of cooking time available.
b Obtain a further inequality, other than x > 0 and y > 0, which models this time constraint.
(2 marks)
c On graph paper illustrate these three inequalities, indicating clearly the feasible region.
(3 marks)
d It is decided to sell the cakes for £3.50 each and the fruit loaves for £1.50 each. Assuming that
Mr Baker sells all that he makes, write down an expression for the amount of money P, in
pounds, raised by the sale of Mr Baker’s products. (1 mark)
e Explaining your method clearly, determine how many cakes and how many fruit loaves Mr
Baker should make in order to maximise P. (2 marks)
f Write down the greatest value of P. (1 mark)
E/P 2 A junior librarian is setting up a section of a library to loan CDs and DVDs. He has a budget of
£420 to spend on storage units to display these items.
Let x be the number of CD storage units and y the number of DVD storage units he plans to
buy.
Each type of storage unit occupies 0.08 m3, and there is a total area of 6.4 m3 available for the
display.
a Show that this information can be modelled by the inequality (2 marks)
x + y < 80
The CD storage units cost £6 each and the DVD storage units cost £4.80 each.
b Write down a second inequality, other than x > 0 and y > 0, to model this constraint. (2 marks)
The CD storage unit displays 30 CDs and the DVD storage unit displays 20 DVDs. The chief
librarian advises the junior librarian that he should plan to display at least half as many DVDs
as CDs.
c Show that this implies that 3x < 4y. (2 marks)
d On graph paper, display your three inequalities, indicating clearly the feasible region.
The librarian wishes to maximise the total number of items, T, on display. Given that (3 marks)
T = 30x + 20y
e determine how many CD storage units and how many DVD storage units he
should buy, briefly explaining your method. (2 marks)
167
E/P 3 The headteacher of a school needs to hire coaches to transport all the year 7, 8 and 9 pupils to
take part in the recording of a children’s television programme. There are 408 pupils to be taken
and 24 adults will accompany them on the coaches. The headteacher can hire either 54 seater
(large) or 24 seater (small) coaches. She needs at least two adults per coach. The bus company
has only seven large coaches but an ample supply of small coaches.
Let x and y be the number of large and small coaches hired respectively.
a Show that the situation can be modelled by the three inequalities:
i 9x + 4y > 72 ii x + y < 12 iii x < 7 (3 marks)
b On graph paper display the three inequalities, indicating clearly the feasible region. (3 marks)
A large coach costs £336 and a small coach costs £252 to hire.
c Write down an expression, in terms of x and y, for the total cost of hiring the coaches. (1 mark)
d Explain how you would locate the best option for the headteacher, given that she wishes to
minimise the total cost. (2 marks)
e Find the number of large and small coaches that the headteacher should hire in
order to minimise the total cost and calculate this minimum total cost. (2 marks)
P 4 The graph below was drawn to solve a linear programming problem. The feasible region, R,
includes the points on its boundary.
y
y = 2x – 8
9
8
4y – x – 18 = 0
3
R
2
4x + 5y = 47
O x
1 2 3 4 5 6 7 8 9 10 11 12
168
E/P 5 A company produces plates and mugs for local souvenir shops. The plates and mugs are
manufactured in a two-stage process. Each day there are 300 minutes available for the completion
of the first stage and 400 minutes available for the completion of the second stage. In addition the
mugs require some hand painting. There are 150 minutes available each day for hand painting.
The above table shows the production time, in minutes, required for the plates and the mugs.
All plates and mugs made are sold. The profit on each plate sold is £2 and the profit on each
mug sold is £4. The company wishes to determine how many plates and mugs to make so as to
maximise its profits each day.
Let x be the number of plates made and y the number of mugs made each day.
a Write down the three constraints, other than x > 0, y > 0, satisfied by x and y. (5 marks)
b Write down the objective function to be maximised. (1 mark)
c Using the graphical method, solve the resulting linear programming problem. Determine the
optimal number of plates and mugs to be made each day and the resulting profit. (4 marks)
d When the optimal solution is adopted determine which, if any, of the stages has
available time which is unused. State the amount of unused time. (2 marks)
Challenge
In three dimensions, each of the following equations represents a plane.
x + y + 2z = 160
x – z = 25
y + 2z = 100
a By setting up and solving a suitable matrix equation, or otherwise, Hint A system of three
find the point of intersection of these three planes. equations in three unknowns
A linear programming problem in x, y and z is described as follows: can represent three planes.
maximise P = 2x + 3y − z You can use matrices to
subject to x + y + 2z < 160 the systems of equations
x – z < 25 and interpret the result
y + 2z > 100 geometrically.
z > 15 ← Core Pure 1, Chapter 6
x, y > 0
The feasible region for this problem is a tetrahedron.
b Find the coordinates of the vertices of this tetrahedron.
c By considering these vertices, solve the linear programming problem,
giving the optimal values of P, x, y and z.
169
170
171
Example 1
A grower specialising in cut flowers is considering cultivating four varieties of the new ‘Sunlip’
flowers A, B, C and D in one of his fields. He estimates the time, in hours per hectare, taken for
each of four stages – sowing, thinning, picking and packing, for each variety.
For variety A sowing, thinning, picking and packing will take 3, 18, 20 and 24 hours per hectare
respectively.
For variety B sowing, thinning, picking and packing will take 4, 17, 25 and 27 hours per hectare
respectively.
For variety C sowing, thinning, picking and packing will take 3, 19, 26 and 28 hours per hectare
respectively.
For variety D sowing, thinning, picking and packing will take 5, 16, 22 and 23 hours per hectare
respectively.
For this crop he can devote up to 70 hours to sowing, 360 to thinning, 500 to picking and 550 to
packing.
He estimates the total profit, in pounds per hectare, as 67, 63, 71 and 75 for varieties A, B, C and D
respectively.
He has up to 20 hectares to use for this crop and wishes to maximise his profit.
Formulate this as a linear programming problem. Define your variables, state your objective and
write your constraints as inequalities.
172
Example 2
In order to supplement his diet Andy wishes to take some Vitatab, Weldo, Xtramin and Yestivit
tablets. Amongst other ingredients, the contents of vitamins A, B, C and iron, in milligrams per
tablet, are shown in the table.
A B C Iron
Vitatab 10 10 20 4
Weldo 15 20 10 5
Xtramin 25 15 15 3
Yestivit 20 15 20 2
Andy wishes to take tablets to provide him with at least 80, 30, 60 and 14 milligrams of vitamins A,
B, C and iron per day.
Because of other factors Andy wants at least 25% of the tablets he takes to be Vitatab and wants to
take at least twice as many Weldo as Yestivit.
The costs of the tablets are 4, 6, 12 and 7 pence per tablet. Andy wishes to minimise the cost.
Formulate this as a linear programming problem, defining your variables, stating your objective
and writing your constraints as inequalities.
Let x1, x2 , x3, x4 be the number of Vitatab, First define your decision variables.
Weldo, Xtramin and Yestivit tablets taken each
day.
Next write down the objective.
Minimise C = 4x1 + 6x2 + 12x3 + 7x4
subject to: Finally write down the constraints.
10x1 + 15x2 + 25x3 + 20x4 > 80
10x1 + 20x2 + 15x3 + 15x4 > 30 The amounts of each of the three vitamins and
20x1 + 10x2 + 15x3 + 20x4 > 60 iron that Andy wishes to take give us the first four
4x1 + 5x2 + 3x3 + 2x4 > 14 constraints.
x1 > ___ 25
100 (x1 + x2 + x3 + x4)
⇒ 3x1 > x2 + x3 + x4 He wants at least 25%, of the tablets to be Vitatab.
⇒ 3x1 − x2 − x3 − x4 > 0
x2 > 2x4 ⇒ x2 − 2x4 > 0 He wants to take at least twice as many Weldo as
Yestivit
x1, x2, x3, x4 > 0
173
A It is often easier to implement an algorithm using systems of equations, rather than systems of
inequalities.
■ Inequalities can be transformed into equations using slack Hint A slack variable acts
variables (so called because they represent the amount of slack
like a sponge, absorbing
between an actual quantity and the maximum possible value spare capacity.
of that quantity).
Example 3
Rewrite the inequality
x1 + 3x2 + 5x3 < 23
as an equation, using the slack variable, r.
The value of slack variable, r, tells us by how
x1 + 3x2 + 5x3 + r = 23 much x1 + 3x2 + 5x3 is less than 23.
r = 23 − x1 − 3x2 − 5x3
Example 4
Rewrite the constraints for Example 1 as equations using slack variables r, s, t and u.
3xA + 4xB + 3xC + 5xD < 70
18xA + 17xB + 19xC + 16xD < 360
20xA + 25xB + 26xC + 22xD < 500
24xA + 27xB + 28xC + 23xD < 550
xA, xB, xC, xD > 0
Add the four slack variables.
Exercise 7A
Hint You will need to use
In questions 1 to 4, formulate the problems as linear programming
slack variables to write your
problems. You must define your variables, state your objective and constraints as equations.
write your constraints other than non-negativity as equations.
1 A company makes three types of metal box, round, square and rectangular. Each box has to
pass through two machines to be cut and formed. The round, square and rectangular boxes need
4, 2 and 3 minutes respectively on the cutter and 2, 3 and 3 on the former. Both machines are
available for 6 hours per day.
The profit, in pence, made on each round, square and rectangular box is 12, 10 and 11
respectively. The company wishes to maximise its profit.
174
A 2 A company makes four different types of backpacks, A, B, C and D. Each type A uses 2.5 units
of material, needs 10 minutes of cutting time and 5 minutes of stitching time. These figures,
together with those for types B, C and D are shown in the table
A B C D
Material in units 2.5 3 2 4
Cutting time in minutes 10 12 8 15
Stitching time in minutes 5 7 4 9
There are 1400 units of material available each week, 150 hours per week available on the cutting
machine and 80 hours available on the stitching machine.
Market research says that they will sell at most 500 backpacks each week.
The profit, in pounds, is 8, 7, 6 and 9 for types A, B, C and D respectively. The company wishes
to maximise its profit.
3 The annual subscription to a bowls club is £40 for adults, £10 for children and £20 for seniors.
The total number of members is restricted to 100.
At most half the club must be children and at least a third must be adults.
The club wishes to maximise its income from subscriptions.
4 Mrs Brown was rather alarmed to discover from her children at bedtime that (a week ago) they
had promised she would make small cakes for a cake sale at school the next day. Not wishing to
let her children down, she puts the oven on and checks her cupboards and finds she has 3 kg of
flour, 2 kg of butter and 1.5 kg of sugar, as well as other ingredients.
Mrs Brown finds three cake recipes for rock cakes, fairy cakes and muffins. The recipe for rock
cakes uses 220 g of flour, 100 g butter and 50 g sugar and makes 10 cakes. The recipe for fairy
cakes uses 100 g each of flour, butter and sugar and makes 18 cakes. The recipe for muffins uses
250 g of flour, 50 g butter and 75 g sugar and makes 12 muffins.
Mrs Brown wishes to maximise the total number of cakes she makes.
E 5 Roma is moving house. She needs to pack all her extensive collection of china into special
cardboard boxes which will be sold to her by the removal company. There are three sizes of box,
small, medium and large. The small boxes have a capacity of 0.1 m3 and will hold a maximum
weight of 3 kg. The medium boxes have a capacity of 0.3 m3 and will hold a maximum weight
of 8 kg. The large boxes have a capacity of 0.7 m3 and will hold a maximum weight of 18 kg.
An expert from the removal company informs her that she should allow for at least 28 m3
packing capacity and for at least 600 kg.
Roma decides that at least half of the boxes she uses should be small and that she should use at
least twice as many medium as large.
She will be able to fill the boxes she buys and the cost of each small, medium and large box is
30p, 50p and 80p respectively.
Roma wishes to minimise the cost of the boxes she buys.
Formulate this situation as a linear programming problem, giving your constraints as
inequalities. (5 marks)
175
Example 5
Explain the significance of the slack variables in the graphical y
representation of the linear programming problem below. 20 D
18
Maximise P = 3x + 2y 10x + 3y = 60
16
subject to: 14
5x + 7y + r = 70 12
10x + 3y + s = 60 A
10
x, y, r, s > 0 8 B
The feasible region, R, is shown. 6
5x + 7y = 70
4 R
2
C E
The first constraint, represented by the line O 2 4 6 8 10 12 14 x
ABE, where 5x + 7y = 70, is also the line
where r = 0.
The second constraint, represented by the
line DBC, where 10x + 3y = 60, is also the
line where s = 0.
176
A
The four lines forming the boundaries of the
feasible region can be seen as being formed
by drawing the four lines x = 0, y = 0, r = 0
and s = 0. This is shown by the diagram.
y
10 A
9
8 r=0
B
7
6
x=0 Problem-solving
5
4 R At each vertex precisely two of the four variables
s=0 and slack variables are zero.
3
2
1
y=0 C
O 1 2 3 4 5 6 x
Example 6 y
20 D
18
Explain, in detail, how the algebraic simplex algorithm is
16
used to solve the following problem, relating each stage to s=0
14
the given graph.
12
Maximise P = 3x + 2y A
10
subject to: x=0 8 B
5x + 7y + r = 70 6
10x + 3y + s = 60 4 R r=0
x, y, r, s > 0 2
C E
O 2 4 6 8 10 12 14 x
y=0
177
A y
Look at the objective function. You can see that 20 D
increasing x or y will increase the objective
18
function.
16
s=0
Only increase one variable at a time so, keeping 14
y = 0, increase x. (In effect this means that you 12
A
move right along the x-axis.) 10
x=0 8 B
Keep going until you hit the line r = 0 or the line
6
s = 0. (Here you can see which one you hit first,
4 R r=0
but in more than 2 dimensions it is harder to
2
visualise the feasible region.) C E
From equation (1): If y = 0 and r = 0, then x = 14 O 2 4 6 8 10 12 14 x
y=0
From equation (2): If y = 0 and s = 0, then x = 6
Increasing x will give a ‘faster’ increase.
So you get to the vertex formed by y = s = 0 first,
Increasing x by 1 adds 3 to the value of the
given by equation (2).
function, whereas increasing y by 1 only adds
Now look to see if you have reached the optimum 2 to the value of the function.
point.
You know the values of y and s at this vertex so Once again the reason for this will become
eliminate x from the equations. apparent once you move into the simplex
tableau.
Here are the current equations:
5x + 7y + r = 70 (1) Use equation (2) because this was the
10x + 3y + s = 60 (2) equation that gave us the current vertex
P − 3x − 2y =0 (3) where y = s = 0
This gives:
5x + 7y + r = 70 (1) Problem-solving
x + __
3 __1 The simplex method can be seen as an
10 y + 10 s = 6 (5) = (2) ÷ 10
exercise in ‘advanced’ simultaneous linear
P − 3x − 2y =0 (3) equations.
Eliminate the x terms in equations (1) and (3). Use
equation (5) to do this.
178
A
To eliminate the −3x in equation (3), add 3 copies
of equation (5).
_
11 _1
2 y + r − 2 s = 40 (4) = (1) − 5(5)
x + __
3
10 y + __
1
10 s = 6 (5)
__
11 __
3
− 10 y
P + 10 s = 18 (6) = (3) + 3(5)
P = 18 + __11
10 y − __ 3
10 s
179
A y
To eliminate + __
3 __ 3
10 y from equation (5), subtract 10 20 D
copies of equation (7). 18
__
11 __
11
16
To eliminate − 10 y from equation (6), add 10 copies
14 s=0
of equation (7).
12
y + _
2 _ 1 __
80
11 r − 11 s = 11 (7) A
10
__
3 __
7 __
42 __
3
x − 55 r + 55 s = 11 (8) = (5) − 10 (7) x=0 8 B
_1 _1
P + 5 r + 5 s = 26 (9) = (6) + 10 (7) __
11 6
4 R r=0
Rearranging equation (9) to make P the subject 2
_1 _1 C E
P = 26 − 5 r − 5 s
O 2 4 6 8 10 12 14 x
At this vertex r = s = 0, so P = 26 y=0
You can see that if you increase r or s you will
decrease the profit, so you have reached the
optimal solution.
Profit = 26 when x = __
42 __
80
11 , y = 11 , r = 0 and
s = 0.
Example 7
Show, in detail, the application of the algebraic simplex algorithm to the linear programming
problem below.
Maximise P = 10x + 12y + 8z
subject to:
2x + 2y < 5
5x + 3y + 4z < 15
x, y, z > 0
180
A
Choose to increase y, since this will give the greatest increase
in the profit, and leave x and z still at zero.
As you increase y you must not leave the feasible region, so
you must stop the first time you hit a vertex.
The vertices will occur
either when x = z = r = 0 or when x = z = s = 0
Work out the y value at each of these. The vertex with the
lowest y value will be reached first.
From equation (1) when x = z = r = 0, y = _
52
From equation (2) when x = z = s = 0, y = 5
So you reach (0, _52 , 0) first.
You now need to find out what the profit is at this point, and
whether it is possible to increase it still further.
Since at this point the values of x, z and r are all zero, and you
have already increased y to its maximum, you can use equation
(1) to eliminate y from both of the other equations.
Because the coefficient of y
Divide equation (1) by 2 to reduce the coefficient of y to one. is one, you can use multiples
This creates equation (4). of this equation to eliminate
x+ y + _21 r =_
52 (4) = (1) ÷ 2 y from the other equations.
This row will correspond to
5x + 3y + 4z + s = 15 (2) the pivot row in the simplex
P − 10x − 12y − 8z = 0 (3) tableau. You will encounter
Eliminate the y terms in the other equations, by adding or this in the next example.
subtracting multiples of equation (4).
This gives the following set of equations.
x+ y + _21 r =_
52 (4)
_
3 __
15
2x + 4z − 2 r + s = 2 (5) = (2) − 3(4)
P + 2x − 8z + 6r = 30 (6) = (3) + 12(4)
(In this case (equation 4) will not give a value for z because
there is no z term! This speeds things up.)
181
A
x + y + _21 r =_
52 (4)
P + 2x − 8z + 6r = 30 (6)
x + y + _21 r =_
52 (4) (unchanged)
P = 45 − 6x − 3r − 2s
Increasing x or r or s will decrease the profit, so you cannot The fact that r = 0 means the
increase the profit further, so you have found the optimal first constraint is at capacity,
solution. and the fact that s = 0 means
that the second constraint is
Profit = 45 when x = 0, y = _52 , z = __
15
8 , r = 0 and s = 0. at capacity.
You can greatly simplify the method outlined in the examples above using a table called a simplex
tableau.
In your exam you might need to use a simplex tableau to solve linear programming problems with
a maximum of four variables and four constraints (in addition to any non-negativity constraints).
Problems could require you either maximise or minimise an objective function.
This example uses a simplex tableau to solve the problem from Example 6.
Example 8
182
A
Our initial tableau is:
Basic variable x y r s Value
r 5 7 1 0 70 The first row shows the first constraint, the
second row shows the second constraint
s 10 3 0 1 60
and the final row shows the objective
P −3 −2 0 0 0 function.
The column marked ‘basic variable’ indicates the variables that are not currently at zero. Initially you start at
the vertex (0, 0), so x = y = 0.
Any variables in a simplex tableau, that are not basic variables, have the value 0.
Compare this with our first set of equations from the algebraic solution
5x + 7y + r = 70 (1)
10x + 3y + s = 60 (2)
P − 3x − 2y = 0 (3)
If you compare these equations with the initial tableau you should see that the columns marked x, y, r, s and
value give the coefficients of those letters in the equations. You do not need to write down any of the letters
at all in the tableau.
Now scan the objective (bottom) row of the tableau for the most In the algebraic example
negative number, in this case, −3. you found that increasing
This gives the pivot column as the x column. x initially was the most
For each of the other rows, calculate the θ values where effective way of increasing
θ = (the term in the value column) ÷ (the term in the pivot column) the profit.
183
R1 − 5R2 is standard notation stating that for each entry in the row, you took the row 1 number and
subtracted 5 times the row 2 entry in the same column.
So the calculations you did for row 1 were:
In column x: 5 − 5 × 1 = 0 In column y: 7 − 5 × __ 3
10 = __
11
2
184
Third we select the smallest, positive θ value. This lies in the first
row, so this will become the next pivot row.
Fourth divide the row by the pivot to create the pivot row. In this
case we divide row 1 by __
11
2 , not forgetting to change the basic
variable.
185
A
Finally, eliminate the pivot term from the other two rows, using the
pivot row to do so. In this case eliminate y from the x and P rows.
Here is the corresponding set of equations from Example 6 Watch out In your exam
y + __ 2
r − __
1 __ 80 you might be asked to write
11 11 s = 11 (7)
__ down the equations from a
x− 3 r + __ 7 s = __ 42
(8) = (5) − __
3
10 (7)
55 55 11 given tableau.
P+ _15 r + _15 s = 26 (9) = (6) + __
11
10 (7)
Look along the objective row for the most negative. All numbers in
this row are non-negative so you know that you have reached the The standard simplex
optimal solution. method is designed to
maximise the value of
Basic variable x y r s Value
__
the objective function.
__
___
2 1 80
y 0 1 11 − 11 11 However, it is also possible
___
0 − ___ ___
3 7 42
x 1 55
55 11 to minimise an objective
__1 __1 function by maximising its
P 0 0 5 5 26
negative.
Looking at the basic variable column and the value column we see
that
P = 26, y = __
80 __42
11 and x = 11 and all other variables, and slack
variables, are zero. You should state the values
of P, each variable and each
So our full solution is
slack variable, as your final
P = 26, x = __
42 __
80
11 , y = 11 , r = 0, and s = 0 answer.
■ The simplex method always starts from a basic feasible solution, at the origin, and then
progresses with each iteration to an adjacent point within the feasible region until the
optimal solution is found.
Example 9
Minimise P = 3x − y
subject to:
2x + y < 12
x + 4y < 8
x > 0, y > 0 Problem-solving
Minimising P is equivalent to maximising Q,
P = 3x − y so you can use the standard simplex tableau
Define Q = −P = −3x + y method.
186
A
Introducing slack variables, r and s, the problem
may be expressed as: To put the objective function into the
Maximise Q = −3x + y tableau, it must first be rearranged as
subject to: Q + 3x − y = 0.
2x + y + r = 12
x + 4y + s = 8
x, y, r, s > 0
The initial tableau is:
The basic feasible solution shown in this
Basic
x y r s Value tableau is:
variable
x = 0, y = 0, r = 12, s = 8, Q = 0.
r 2 1 1 0 12
s 1 4 0 1 8
Q 3 −1 0 0 0 The only negative value in the objective row
is −1 which is in column y. This becomes the
Basic pivot column.
x y r s Value θ values
variable
r 2 1 1 0 12 12 ÷ 1 = 12
s 1 4 0 1 8 8÷4=2
Q 3 −1 0 0 0
Basic
x y r s Value θ values
variable
r 2 1 1 0 12 12 ÷ 1 = 12 Divide the values in the pivot row by the
pivot and replace the basic variable in the
s 1 4 0 1 8 8÷4=2
pivot row with the variable in the pivot
Q 3 −1 0 0 0 column. In this case, s will be replaced by y.
The value in the pivot column and pivot row is 4
which becomes the pivot.
Basic Row
x y r s Value
variable operations
r 2 1 1 0 12
__1 __1
y 4 1 0 4 2 R2 ÷ 4
Q 3 −1 0 0 0
Basic Row
x y r s Value
variable operations Use row operations with the pivot row to
r __
7
4 0 1 − __
1
4 10 R1 − R2 give zeros in the pivot column (apart from
y __1
4 1 0
__1
4 2 the 1 in the pivot position).
__
13 __1
Q 4 0 0 4 2 R3 + R2
187
A
There are no negative values in the objective row,
so the solution is optimal.
Your solution should give the minimum
Maximum value of Q = 2, when x = 0, y = 2,
value of P, where P = −Q. The values of x,
r = 10, s = 0
y, r and s will be the same for the minimum
So, the minimum value of P = −2, when x = 0, value of P as they are for the maximum
y = 2, r = 10, s = 0 value of Q.
The simplex algorithm can only be used to solve linear programming problems in which all the
constraints, other than the non-negativity conditions, are of the form a1 x1 + a2 x2 + … + an xn < K.
These constraints can all be converted into equations by adding a non-negative slack variable.
Problems involving constraints of the form a1 x1 + a2 x2 + … + an xn > K need to be treated slightly
differently, and methods for solving problems such as these are given later in this chapter.
■ Using a simplex tableau to solve a maximising linear programming problem, where the
constraints are given as equalities.
■ The steps for solving a minimising linear programming problem are identical to those given
above apart from:
• First, define a new objective function that is the negative of the original objective function.
• After you have maximised this new objective function, write your solution as the negative
of this value, which will minimise the original objective function.
In the following example the simplex tableau method is used to solve the three-variable problem
from Example 7.
188
Example 10
A
a Use simplex tableaux to solve the linear programming problem below (from Example 7).
Maximise P = 10x + 12y + 8z
subject to:
2x + 2y < 5
5x + 3y + 4z < 15
x, y, z > 0
b Verify your solution using the original problem.
Step 3
Basic
x y z r s Value
variable
r 2 2 0 1 0 5
s 5 3 4 0 1 15
P −10 −12 −8 0 0 0
The most negative entry in
Step 4 the objective row is −12, this
becomes the pivot column.
Basic
x y z r s Value θ values
variable
r 2 2 0 1 0 5 5 ÷ 2 = 2 __
1
2 Now calculate the θ values.
s 5 3 4 0 1 15 15 ÷ 3 = 5
P −10 −12 −8 0 0 0
Step 5, Step 6
Basic
x y z r s Value θ values The smallest positive θ value
variable
lies in the r row, so this will
r 2 2 0 1 0 5 5 ÷ 2 = 2 __
1
2 become the pivot row.
s 5 3 4 0 1 15 15 ÷ 3 = 5 The pivot is 2.
P −10 −12 −8 0 0 0
189
A
Step 7
Basic Row
x y z r s Value
variable operations
__1
y 1 1 0 2 0 2 __
1
2 R1 ÷ 2 Divide the first row by the
s 5 3 4 0 1 15 R2 pivot (2) and change the
P −10 −12 −8 0 0 0 R3 basic variable. This is now the
pivot row.
Step 8
Basic Row
x y z r s Value
variable operations
__1
y 1 1 0 2 0 2 __
1
2 Use this pivot row to
s 2 0 4 −1 __
1
2 1 7 __
1
2 R2 − 3R1 eliminate y from the other
P 2 0 −8 6 0 30 R3 + 12R1 two rows.
Basic
x y z r s Value
variable The y column now contains
__1
y 1 1 0 2 0 2 __
1
2 just one 1 (where the pivot
s 2 0 4 −1 __
1
2 1 7 __
1
2
was) and zeros.
P 2 0 −8 6 0 30
Repeat Steps 3 to 8
Basic
x y z r s Value θ values
variable
__1 Identify the pivot column and
y 1 1 0 2 0 2 __
1
2 2 __
2 ÷ 0 → ∞
1
calculate the θ values.
s 2 0 4 −1 __
1
2 1 7 __
1
2 7 __
1 __ 7
2 ÷ 4 = 1 8
P 2 0 −8 6 0 30
Basic
x y z r s Value θ values
variable
__1
y 1 1 0 2 0 2 __
1
2 2 __
2 ÷ 0 → ∞
1
This means that the next
s 2 0 4 −1 __
1
2
1 7 __
1
2 7 __
1 __ 7
2 ÷ 4 = 1 8 pivot row will be the second
P 2 0 −8 6 0 30 row.
Basic Row
x y z r s Value
variable operations
__1
y 1 1 0 2 0 2 __
1
2 R1 Now divide all elements in
__1 __1
z 2 0 1 − __
3
8
4 1 __
7
8 R2 ÷ 4 the second row by 4 and
P 2 0 −8 6 0 30 R3 change the basic variable to z.
Basic Row
x y z r s Value
variable operations
__1
y 1 1 0 2 0 2 __
1
2 R1 no change
__1 __1 Eliminate z from the other
z 2 0 1 − __
3
8
4 1 __
7
8 rows, using pivot row 2.
P 6 0 0 3 2 45 R3 + 8R2
190
2x + 2y + r = 5 (1)
5x + 3y + 4z + s = 15 (2)
P − 10x − 12y − 8z = 0 (3)
Basic
x y z r s Value θ values
variable
r 2 2 0 1 0 5 5 ÷ 2 = 2 __
1* We sometimes indicate the
2
smallest θ value by putting *.
s 5 3 4 0 1 15 15 ÷ 3 = 5
P −10 −12 −8 0 0 0
191
A
Basic
x y z r s Value θ values
variable
__1
y 1 1 0 2 0 2 __
1
2 2 __
2 ÷ 0 → ∞
1
s 2 0 4 −1 __
1
2 1 7 __
1
2 7 __
1 __ 7
2 ÷ 4 = 1 8
P 2 0 −8 6 0 30
Basic Row
x y z r s Value
variable operations
__1
y 1 1 0 2 0 2 __
1
2 R1 no change
__1 __
3 __1 __
7
z 2 0 1 − 8 4 1 8 R2 ÷ 4
P 6 0 0 3 2 45 R3 + 8R2
Example 11
a Use the simplex tableau method to solve the following linear programming problem.
Maximise P = 3x + 4y − 5z
subject to:
2x − 3y + 2z + r = 4
x + 2y + 4z + s = 8
y−z+t=6
x, y, z, r, s, t > 0
b State the values of the objective function and every variable at the optimal point.
c Write down the equations given by your optimal tableau.
d Use the profit equation you wrote down in part c to explain why your final tableau is optimal.
192
193
A
b P = ___
144 __32 __12 __
30
7 , x = 7 , y = 7 , z = 0, r = 0, s = 0, t = 7
Basic Row
x y z r s t Value
variable operations
__ __ __ ___
R1 ÷ __
16 2 3 32
x 1 0 7 7 7 0 7 72
__ __ __
− __ R2 − __
6 1 2 12 1
y 0 1 7 7
7 0 7 2 R1
__1 Watch out If you have to
t 0 0 − __
13
7
7 − __
2
7
1 ___
30
7 R3 + __
21 R1
write a profit equation you
___
107 __
2 __
17 ___
144
P 0 0 7 7 7 0 7 R4 + R1 need to write ‘P +’ and then
Using the first and last columns, we read off the values of P, x, the rest is read off the other
y and t. All other variables are zero. coefficients from the tableau.
Remember: the P ‘pushes
c x + __
16 _ 2 _3
7 z + 7 r + 7 s = __
32
7 in at the front’ of the profit
y + __67 z − _
71 r + _27 s = __
12
7 equation.
− __
13 _1 _2 __
30
7 z + 7 r − 7 s + t = 7
P + ___
107 _2 __17
7 z + 7 r + 7 s = ___
144
7 Problem-solving
d If we rearrange the profit equation, making P the subject we get: You need to rearrange the
P = ___
144 ___
107 _2 __17
7 − 7 z − 7 r − 7 s profit equation to make P
Increasing z or r or s would decrease the profit, so the the subject to show why your
solution is optimal. solution is optimal.
Exercise 7B
Solve the linear programming problems in questions 1 to 6 using the simplex tableau algorithm.
1 Maximise P = 5x + 6y + 4z
subject to
x + 2y + r = 6
5x + 3y + 3z + s = 24
x, y, z, r, s > 0
2 Maximise P = 3x + 4y + 10z
subject to
x + 2y + 2z + r = 100
x + 4z + s = 40
x, y, z, r, s > 0
3 Maximise P = 3x + 5y + 2z
subject to
3x + 4y + 5z + r = 10
x + 3y + 10z + s = 5
x − 2y + t = 1
x, y, z, r, s, t > 0
194
P 5 Minimise P = 3x + 6y − 32z
subject to
x + 6y + 24z + r = 672
3x + y + 24z + s = 336
x + 3y + 16z + t = 168
2x + 3y + 32z + u = 352
x, y, z, r, s, t, u > 0
P 6 Minimise P = 2x − 2y + 3z
subject to
4x + 2y + z + r = 2
2x + 4y + 2z + s = 8
3x + 3y + 4z + t = 4
x, y, z, r, s, t > 0
E 8 The following tableau was obtained as part of the solution of a maximising linear programming
problem.
P 3 4 0 1 0 0 3
195
A 9 For a linear programming problem, in x, y and z, to maximise profit P, the tableau below is the
E initial tableau.
Basic variable x y z r s t Value
r 4 1 2 1 0 0 2
s 1 2 1 0 1 0 8
t 2 4 3 0 0 1 4
P −1 2 −2 0 0 0 0
a Write down the profit equation represented by the initial tableau. (1 mark)
b Continue to solve the linear programming problem, indicating the pivot rows that you use and
making your row operations clear. (9 marks)
c State the final values of the objective function, and of each variable. (3 marks)
Example 12
Solve the linear programming problem from Example 8, given that integer solutions are required.
Maximise P = 3x + 2y
subject to:
5x + 7y < 70
10x + 3y < 60
x, y > 0
Problem-solving
For each point, you need to test whether the point
lies in the feasible region, and evaluate P.
← Section 6.4
196
Example 13
A
Solve the linear programming problem from Example 10, given that integer solutions are required.
Maximise P = 10x + 12y + 8z
subject to:
2x + 2y < 5
5x + 3y + 4z < 15
x, y, z > 0
■ When integer solutions are needed, test points around the optimal solution to find a set of
points which fits the constraints and gives a maximum for the objective function.
Exercise 7C
P 1 Solve the following linear programming problems using the simplex tableau, given that integer
solutions are required for x, y and z.
a Maximise P = 3x + 2y
subject to:
2x + 4y < 60
3x + 5y < 40
x, y > 0
b Maximise P = 10x + 12y + 8z
subject to:
x + 2z < 10
4x + 3y − 4z < 8
x, y, z > 0
197
A 2 A cake company produces cake boxes to sell to its customers. Three types of cake box are
E/P produced, Supreme, Dreamtime and Perfection. The cakes used are categorised as iced
doughnuts, French whirls or treacle tarts.
Each Supreme box contains 2 iced doughnuts, 4 French whirls and 3 treacle tarts.
Each Dreamtime box contains 3 iced doughnuts, 2 French whirls and 4 treacle tarts.
Each Perfection box contains 1 iced doughnut, 3 French whirls and 2 treacle tarts.
The cake company can prepare at most 80 iced doughnuts, at most 140 French whirls and at
most 96 treacle tarts each day.
The profits on Supreme, Dreamtime and Perfection boxes are £12, £20 and £16 respectively.
The cake company wishes to maximise its profit.
Let x, y and z be the numbers of Supreme, Dreamtime and Perfection boxes respectively,
produced each day.
a Formulate this situation as a linear programming problem, giving your constraints as
inequalities. (5 marks)
b State the further restriction that applies to the values of x, y and z in this context. (1 mark)
The simplex algorithm is used to solve this problem. After one iteration, the tableau is:
Basic variable x y z r s t Value
_1 0 _1 1 0 _3 8
r − 4 − 2 − 4
s _5
2 0 2 0 1 − _ 12 92
_3 1 _1 0 0 _1 24
y 4 2 4
P 3 0 −6 0 0 5 480
c State, with a reason, which value will become the pivot for the second iteration. (2 marks)
d Complete one further iteration of the simplex algorithm, and explain why the resulting
tableau gives an optimal solution. (5 marks)
e State the number of each type of box the company should prepare in order to maximise
its profit. (1 mark)
Challenge
P = 5x + 2y + 4z
subject to 2x + y + kz < 10
x + 4y + z < 12
4x – 2y + 3z < 28
where k is a constant.
Given that an optimal solution is obtained after one iteration of the
simplex algorithm, find the range of possible values of k.
198
Example 14
Use surplus and artificial variables to write the following inequalities as equations.
3x − 2y > 7
4x + 5y − 3z > 9
Introduce an artificial variable for each surplus
3x − 2y − s1 + a1 = 7 variable.
4x + 5y − 3z − s2 + a2 = 9
Regardless of the number of variables, each
> inequality requires just one surplus variable
and one artificial variable to convert it into an
equation. Make sure you use different labels for
the different surplus and artificial variables.
199
A ■ The two-stage simplex method for problems that include > constraints:
1 Use slack, surplus and artificial variables, as necessary, to write all the constraints as
equations.
2 Define a new objective function to minimise the sum of all the artificial variables.
3 Use the simplex method to solve this problem.
4 If the minimum sum of the artificial values is 0 Notation This method is
then the solution found is a basic feasible called the two-stage simplex
solution of the original problem, which is then method because you have
the starting point for the second stage. Use the two separate applications of
simplex method again to solve this problem. the simplex algorithm. Steps 1
to 3 given here constitute the
5 If the minimum sum of the artificial variables is not first stage.
0 then the original problem has no feasible solution.
If the original problem has a feasible solution then solving the first stage (steps 1 to 3 above),
provides a basic feasible solution that you can use in the second stage. In this case, you will find
that the new objective function has minimum value zero. This implies that all the artificial variables
are zero and can be ignored for the second stage. If the new objective function is non-zero then this
indicates that the original problem has no feasible solution and there is no need to proceed to the
second stage.
Example 15
Maximise P = 3x − 2y + z
subject to:
x + y + 2z < 10
2x − 3y + z > 5
x+y>8
x, y, z > 0
200
A Problem-solving
The initial tableau is now given as:
Notice that the last two rows of the
Basic
x y z s1 s2 s3 a1 a2 Value table contain the original objective
variable
function and the temporary objective
s1 1 1 2 1 0 0 0 0 10 function needed for stage 1. It is useful
a1 2 −3 1 0 −1 0 1 0 5 to put P in the tableau at this point
a2 1 1 0 0 0 −1 0 1 8 so that it will automatically be in an
P −3 2 −1 0 0 0 0 0 0 appropriate form for stage 2 if a basic
feasible solution is found.
I −3 2 −1 0 1 1 0 0 −13
Basic Row
x y z s1 s2 s3 a1 a2 Value
variable operations
s1 0 0 2 1 0 1 0 −1 2 R1 − __
52 R3
__1 __1 __ ___
x 1 0 5 0 − __
1
5
− __
3
5
5 3
5 29
5 R2 + __
32 R3
The new pivot is in R3 of
__1 __ __
y 0 1 − __
1
5
0 5 − __
2
5
− __
1
5
2
5 11
5 R3 × __
25 the y column. y replaces a2
P 0 0 0 0 −1 −1 1 1 13 R4 + __
5 as a basic variable.
2 R3
I 0 0 0 0 0 0 1 1 0 R5 + __
52 R3
Watch out Make sure
There are no negative values in the bottom row, so this tableau is
that the value of I is 0.
optimal.
If this is not the case, then
I = 0 so a basic feasible solution has been found for the original the original problem has
problem. no feasible solution.
201
A
Basic
x y z s1 s2 s3 Value
variable
s1 0 0 2 1 0 1 2
__1 __1 __
3 ___
29
x 1 0 5 0 − 5 − 5 5
__1 __
y 0 1 − __
1
5
0 5 − __
2
5
11
5 The I row and the artificial
variable columns can now
P 0 0 0 0 −1 −1 13
be removed from the
The basic feasible solution for the second stage is: tableau.
x = __
29 __ 11
5 , y = 5 , s1 = 2, z = s2 = s 3 = 0
Continuing in the same way produces the following tableaux.
Basic
x y z s1 s2 s3 Value
variable
s1 0 0 2 1 0 1 2
x 1 1 0 0 0 −1 8
s2 0 5 −1 0 1 −2 11 With each iteration, the
value of P should increase
P 0 5 −1 0 0 −3 24
until the optimal solution
Basic is found.
x y z s1 s2 s3 Value
variable
s3 0 0 2 1 0 1 2
x 1 1 2 1 0 0 10
s2 0 5 3 2 1 0 15
P 0 5 5 3 0 0 30
Example 16
Verify that the following linear programming problem has no feasible solution.
Maximise P = 3x − 2y + z
subject to:
x + y + 2z < 8
2x − 3y + z > 5
x + y > 10
x, y, z > 0
202
A
Changing the objective function to minimise a1 + a2.
a1 + a2 =
5 − 2x + 3y − z + s2 + 10 − x − y + s3
= 15 − 3x + 2y − z + s2 + s3
So minimising a1 + a2 is equivalent to maximising
I = −(15 − 3x + 2y − z + s2 + s3 )
Rearranging gives I − 3x + 2y − z + s2 + s3 = −15
The first tableau becomes:
Basic
x y z s1 s2 s3 a1 a2 Value
variable
The slack and artificial
s1 1 1 2 1 0 0 0 0 8 variables are basic
a1 2 −3 1 0 −1 0 1 0 5 variables. All other
a2 1 1 0 0 0 −1 0 1 10 variables are zero.
You are told in the
I −3 2 −1 0 1 1 0 0 −15
question that there is
The most negative value in the bottom row corresponds to the no feasible solution, so
x column. there won't be a second
stage. This means
x now replaces a1 as a basic variable.
that you don't need to
The smallest θ value is given by 5 ÷ 2 so the pivot is 2. include a row for P.
Carrying out row operations gives the second tableau.
Basic Row
x y z s1 s2 s3 a1 a2 Value
variable operations
__ __ __1 __
s1 0 5
2 3
2 1 2 0 − __
1
2
0 11
2 R1 − R2
__
3 __1 __1 __1 __
5
x 1 − 2 2 0 − 2 0 2 0 2 R2 ÷ 2
__
5 __1 __1 __1 __
15
a2 0 2 − 2 0 2 −1 − 2 1 2 R3 − R2
__
5 __1 __1 __
3 __
15
I 0 − 2 2 0 − 2 1 2 0 − 2 R4 + 3R2
The most negative value in the bottom row corresponds to the y column.
y now replaces s1 as a basic variable.
The smallest θ value is given by __
11 _ 5 _
5
2 ÷ 2 and the pivot is 2
Carrying out row operations gives the third tableau.
Basic Row
x y z s1 s2 s3 a1 a2 Value
variable operations
y 0 1 __
3
5
__
2
5 __1
5 0 − __
1
5
0 __
11
5 R1 × __
25
__ __ __1 ___
x 1 0 7
5 5 − __
3 1
5
0 5 0 29
5 R2 + __
3
2 R1
a2 0 0 −2 −1 0 −1 0 1 2 R3 − __
5
2 R1
I 0 0 2 1 0 1 1 0 −2 R4 + __
52 R1
This means there are no
There are no negative values in the bottom row of the main part of the values of x, y and z that
tableau, so the maximum value of I is −2 ≠ 0 satisfy all of the initial
This tells us that the original problem has no feasible solution. constraints.
203
Exercise 7D
A
1 Use the two-stage simplex method to solve the following problems.
P
a Maximise P = 2x + y
subject to: x − y > 11
x + 3y < 15
x, y > 0
b Minimise C = x −3y + z
subject to: x + 2y < 12
2x − y − z > 10
x+y+z>6
x, y, z > 0
c Maximise P = 3x − y + 2z
subject to: 5x + z < 16
3x + y + z < 12
x − y + 4z > 9
x, y, z > 0
E/P 2 Show that the following linear programming problem has no feasible solution.
Maximise P = 2x1 + x2
subject to: 5x1 + 6x2 < 75
3x1 + 4x2 > 52
x1, x2 > 0 (6 marks)
b Explain why this linear programming problem has a feasible solution. (1 mark)
c Complete the second stage of a two-stage simplex process to obtain an optimal solution to
this problem. (8 marks)
204
Example 17
Solve the following linear programming problem using the Big-M method. Maximise P = x − y + z
subject to:
2x + y + z < 20
x − 2y − z < 7
x>4
x, y, z > 0
Start by writing the inequalities as
2x + y + z + s1 = 20 equations using slack, surplus and
x − 2y − z + s2 = 7 artificial variables.
x − s 3 + a1 = 4
x, y, z, s1, s2, s3, a1 > 0 Now modify the objective function by
P = x − y + z − Ma1 subtracting the term Ma1.
a1 = 4 − x + s 3
This gives Problem-solving
P = x − y + z − M(4 − x + s3) Because M is large and positive,
= (1 + M)x − y + z − Ms3 − 4M maximizing this modified objective
Rearranging gives function will now automatically push
a1 towards zero. This means you can
P − (1 + M)x + y − z + Ms3 = −4M
essentially maximise P and minimise a1
You can now write the initial tableau as with one application of the algorithm.
Basic
x y z s1 s2 s3 a1 Value
variable
s1 2 1 1 1 0 0 0 20
s2 1 −2 −1 0 1 0 0 7
a1 1 0 0 0 0 −1 1 4
P −(1 + M) 1 −1 0 0 M 0 −4M
Notice that x, y and z are non-basic variables which means that the starting point is the origin. This is not
a feasible solution of the original problem because the artificial variable, a1, is non-zero. The Big-M method
always starts from an infeasible solution. It may take several iterations for the solution to become feasible
and may take a few more for it to become optimal.
205
A
The most negative value in the objective row is
Remember M is large and
−(1 + M) so the x column is the pivot column.
positive.
The smallest positive θ value is 4 ÷ 1 so the pivot is the 1 in the
a1 row.
x now becomes a basic variable in place of a1.
Using the pivot to make the other values in the pivot column zero
gives the next tableau.
Basic Row
x y z s1 s2 s3 a1 Value
variable operations
s1 0 1 1 1 0 2 −2 12 R1 − 2R3
s2 0 −2 −1 0 1 1 −1 3 R2 − R3
x 1 0 0 0 0 −1 1 4 R3
R4 +
P 0 1 −1 0 0 −1 1+M 4
(1 + M)R3
Basic Row
x y z s1 s2 s3 a1 Value
variable operations
s1 0 5 3 1 −2 0 0 6 R1 − 2R2
s3 0 −2 −1 0 1 1 −1 3 R2
x 1 −2 −1 0 1 0 0 7 R3 + R2
P 0 −1 −2 0 1 0 M 7 R4 + R2
There are still some negative values in the objective row. The most
negative is −2 so the z column becomes the pivot column.
The only positive θ value is 6 ÷ 3 = 2 so 3 is the pivot and z
becomes a basic variable in place of s1.
Dividing the pivot row by 3 gives:
Basic Row
x y z s1 s2 s3 a1 Value
variable operations
z 0 __
5
3 1 __1
3 − __
2
3
0 0 2 __1
3 R1
s3 0 −2 −1 0 1 1 −1 3
x 1 −2 −1 0 1 0 0 7
P 0 −1 −2 0 1 0 M 7
206
A
Using the pivot to make the other values in the pivot column zero
gives the next tableau.
Basic Row
x y z s1 s2 s3 a1 Value
variable operations
z 0 __
5
3 1 __1
3 − __
2
3
0 0 2
__1
s3 0 − __
1
3
0 3 __
1
3 1 −1 5 R2 + R1
__1 __1 __1
x 1 − 3 0 3 3 0 0 9 R3 + R1
__
7 __
2 __1
P 0 3 0 3 − 3 0 M 11 R4 + 2R1
Basic Row
x y z s1 s2 s3 a1 Value
variable operations
z 0 1 1 1 0 2 −2 12 R1 + __
2
3 R2
s2 0 −1 0 1 1 3 −3 15
x 1 0 0 0 0 −1 1 4 R3 − __
31 R2
P 0 2 0 1 0 1 M− 1 16 R4 + __
31 R2
All values in the objective row are now positive so the solution is
optimal.
The solution is: Notice that 16 is the largest
x = 4, y = 0, z = 12, s1 = 0, s2 = 15, s3 = 0, a1 = 0, P = 16 value that has been found
Checking against the original equations: for P.
2x + y + z + s1 = 8 + 0 + 12 + 0 = 20 ✓
x − 2y − z + s2 = 4 − 0 − 12 + 15 = 7 ✓
x − s 3 + a1 = 4 − 0 + 0 = 4 ✓
■ Linear programming problems that include > constraints may also be solved using the
Big-M method instead of the two-stage simplex method. The Big-M method uses an
arbitrarily large number, M, in the objective function. Its purpose is to drive the artificial
variables towards 0.
207
The Big-M method can also be used to minimise the value of the objective function.
Example 18
Use the Big-M method to solve this linear programming problem.
Minimise P = x − y + z
subject to:
2x + y + z < 20 This example uses the same constraints
x − 2y − z < 7 as the previous example, but this time the
x>4 objective is to minimise P = x − y + z.
x, y, z > 0
208
A
The most negative value in the objective row is 1 − M so the x
column becomes the pivot column.
Basic Row
x y z s1 s2 s3 a1 Value
variable operations
s1 0 1 1 1 0 2 −2 12 R1 − 2R3
s2 0 −2 −1 0 1 1 −1 3 R2 − R3
x 1 0 0 0 0 −1 1 4
R4 −
Q 0 −1 1 0 0 1 M−1 −4
(1 − M)R3
Basic Row
x y z s1 s2 s3 a1 Value
variable operations
y 0 1 1 1 0 2 −2 12
s2 0 0 1 2 1 5 −5 27 R2 + 2R1
x 1 0 0 0 0 −1 1 4 R3
Q 0 0 2 1 0 3 M−3 8 R4 + R1
All of the values in the objective row are now positive so the
solution is optimal.
Max Q = 8
Min P = −8
x = 4, y = 12, z = 0, s1 = 0, s2 = 27, s3 = 0, a1 = 0
Checking against the original equations:
2x + y + z + s1 = 8 + 12 + 0 + 0 = 20 ✓
x − 2y − z + s2 = 4 − 24 − 0 + 27 = 7 ✓
x − s 3 + a1 = 4 − 0 + 0 = 4 ✓
209
A The next example demonstrates how the Big-M method can be used to solve the same problem that
was tackled in Example 15 using the two-stage simplex method.
Example 19
a Set up the initial tableau for solving the following linear programming problem using the Big-M
method:
Maximise P = 3x − 2y + z
subject to:
x + y + 2z < 10
2x − 3y + z > 5
x+y>8
x, y, z > 0
b Find the value of the first pivot.
c Carry out one iteration and state the value of each variable at that point.
d Explain why the solution given by the first iteration is not feasible.
Basic
x y z s1 s2 s3 a1 a2 Value
variable
s1 1 1 2 1 0 0 0 0 10
a1 2 −3 1 0 −1 0 1 0 5
a2 1 1 0 0 0 −1 0 1 8
P −3(1 + M) 2(1 + M) −(1 + M) 0 M M 0 0 −13M
210
A
b The most negative value in the objective row is −3(1 + M) in the x column.
Comparing the θ ratios, the smallest is 5 ÷ 2, so the pivot is 2.
Basic
x y z s1 s2 s3 a1 a2 Value
variable
s1 1 1 2 1 0 0 0 0 10
a1 2 −3 1 0 −1 0 1 0 5
a2 1 1 0 0 0 −1 0 1 8
P −3(1 + M) 2(1 + M) −(1 + M) 0 M M 0 0 −13M
c Dividing the pivot row by 2 and replacing the basic variable a1 with x gives:
Basic Row
x y z s1 s2 s3 a1 a2 Value
variable operations
s1 1 1 2 1 0 0 0 0 10
__ __1 __1 __1 __
__
3 5 1
x 1 - 2 2 0 − 2 0 2 0 2 2 R2
a2 1 1 0 0 0 −1 0 1 8
P −3(1 + M) 2(1 + M) −(1 + M) 0 M M 0 0 −13M
Basic Row
x y z s1 s2 s3 a1 a2 Value
variable operations
__ __ __1 __
s1 0 5
2 3
2 1 2 0 − __
1
2
0 15
2 R1 − R2
__
3 __1 __1 __1 __
5
x 1 − 2 2 0 − 2 0 2 0 2
__
5 __1 __1 __1 __
11
a2 0 2 − 2 0 2 −1 − 2 1 2 R3 − R2
R4 +
P 0 − __
5 __1
2 (1 + M) 2 (1 + M) 0 − __
1
2 ( 3 + M) M __
3
2 (1 + M) 0 __
1
2 (15 − 11M)
3(1 + M)R2
The pivot column is now in standard form and this completes the first iteration.
From the table: The values of the basic
x=_
52 , y = 0, z = 0, s1 = __
15 __ 11
2 , s2 = 0, s 3 = 0, a1 = 0, a2 = 2
variables are shown in the
right-hand column. All other
d The solution given by this tableau is not feasible because
variables have value zero.
a2 = __
11
2 is an artificial variable which must be zero in a
feasible solution.
Exercise 7E
E/P 1 Here is the initial tableau for solving a linear programming problem using the Big-M method.
Basic Row
x y z s1 s2 a1 Value
variable operations
s1 1 1 2 1 0 0 6
a1 2 −3 1 0 −1 1 5
P −(1 + M) 2(1 + M) −2(1 + M) 0 −M 0 −15M
211
A a Explain why the tableau does not represent a feasible solution. (1 mark)
b Locate the pivot and explain how you made your choice. (2 marks)
c Explain without doing any calculations how you know that the solution given by the next
iteration will not be feasible. (2 marks)
d Carry out one iteration, showing your row operations. (4 marks)
E/P 2 The following linear programming problem is to be solved using the Big-M method.
Maximise P = 4x + 2y − z
subject to: x + 3y + z < 100
3x − y < 52
x > 20, y, z > 0
a Write the constraints as equations using slack, surplus and artificial variables as
appropriate. (3 marks)
b Write the initial tableau in standard form. (3 marks)
c Explain what M represents. (1 mark)
d Identify the first pivot. (2 marks)
E/P 3 Here is a linear programming problem to be solved using the Big-M method.
Minimise C = 4x + 3y
subject to: 3x − y < 110
x + 2y > 45
x, y > 0
a Explain why the problem cannot be solved by the standard simplex method. (1 mark)
b Express the inequalities as equations making use of slack, surplus and artificial
variables. (3 marks)
c Set up the initial tableau in standard form. (5 marks)
E/P 4 The Big-M method is to be used to solve the following linear programming problem.
Maximise P = 3x + 5y − z
subject to: x + y + z < 20
3x + y + 2z > 24
x, y, z > 0
a Rewrite the constraints as equations making use of slack, surplus and artificial
variables. (2 marks)
b Modify the objective in preparation for using the Big-M method, using non-basic variables.
(3 marks)
c Represent the problem in an initial tableau in standard form. (2 marks)
d Carry out iterations to solve the problem. State the value of each variable in your solution.
(8 marks)
212
Mixed exercise 7
A
1 In a particular factory 3 types of product, A, B and C, are made. The number of each of the
E/P
products made is x, y and z respectively and P is the profit in pounds. There are two machines
involved in making the products which have only a limited time available. These time limitations
produce two constraints.
In the process of using the simplex algorithm the following tableau is obtained, where r and s are
slack variables.
Basic variable x y z r s Value
_1
z 3 0 1 −8 1 75
__
2 __
17
y 11 1 0 11 0 56
_3 _3
P 2 0 0 4 0 840
a Give one reason why this tableau can be seen to be optimal (final). (1 mark)
b By writing out the profit equation, or otherwise, explain why a further increase in profit is not
possible under these constraints. (2 marks)
c From this tableau deduce
i the maximum profit,
ii the optimum number of type A, B and C that should be produced to maximise the profit.
E/P 2 A sweet manufacturer produces packets of orange and lemon flavoured sweets.
The manufacturer can produce up to 25 000 orange sweets and up to 36 000 lemon sweets per day.
Small packets contain 5 orange and 5 lemon sweets.
Medium packets contain 8 orange and 6 lemon sweets.
Large packets contain 10 orange and 15 lemon sweets.
The manufacturer makes a profit of 14p, 20p and 30p on each of the small, medium and large
packets respectively. He wishes to maximise his total daily profit.
Use x, y and z to represent the number of small, medium and large packets respectively,
produced each day.
a Formulate this information as a linear programming problem, making your objective function
and constraints clear. Change any inequalities to equations using r and s as slack variables.
(5 marks)
The tableau below is obtained after one complete iteration of the simplex algorithm.
Basic variable x y z r s Value
_2 − _2
r 1 3 4 0 1 3 1000
_1 _2 __
1
z 3 5 1 0 15 2400
P −4 −8 0 0 2 72 000
b Start from this tableau and continue the simplex algorithm by increasing y, until you have
either completed two complete iterations or found an optimal solution. (4 marks)
213
E/P 3 Tables are to be bought for a new restaurant. The owners may buy small, medium and large
tables that seat 2, 4 and 6 people respectively.
The owners require at most 20% of the total number of tables to be medium sized.
The tables cost £60, £100 and £160 respectively for small, medium and large. The owners have a
budget of £2000 for buying tables.
Let the number of small, medium and large tables be x, y and z respectively.
a Write down 5 inequalities implied by the constraints. Simplify these where appropriate.
(5 marks)
The owners wish to maximise the total seating capacity, S, of the restaurant.
b Write down the objective function for S in terms of x, y and z. (2 marks)
c Explain why it is not appropriate to use a graphical method to solve this problem. (1 mark)
It is decided to use the simplex algorithm to solve this problem.
d Show that a possible initial tableau is
Basic variable x y z r t Value
r −1 4 −1 1 0 0
t 3 5 8 0 1 100
S −2 −4 −6 0 0 0 (3 marks)
It is decided to increase z first.
e Show that, after one complete iteration, the tableau becomes
Basic variable x y z r t Value
− _5 __
37 _1 __
25
r 8 8 0 1 8 2
_3 _5 _1 __
25
z 8 8 1 0 8 2
_4 − _14 _3
1
S 0 0 4 75
(3 marks)
f Perform one further complete iteration. (3 marks)
g Explain how you can decide if your tableau is now final. (1 mark)
h Find the number of each type of table the restaurant should buy and their total cost. (2 marks)
E/P 4 Kuddly Pals Co. Ltd. make two types of soft toy: bears and cats. The quantity of material
needed and the time taken to make each type of toy is given in the table.
Toy Material (m2) Time (minutes)
Bear 0.05 12
Cat 0.08 8
Each day the company can process up to 20 m2 of material and there are 48 worker hours
available to assemble the toys.
214
A Let x be the number of bears made and y the number of cats made each day.
a Show that this situation can be modelled by the inequalities
5x + 8y < 2000
3x + 2y < 720
in addition to x > 0, y > 0. (2 marks)
The profit made on each bear is £1.50 and on each cat £1.75. Kuddly Pals Co. Ltd. wishes to
maximise its daily profit.
b Set up an initial simplex tableau for this problem. (3 marks)
c Solve the problem using the simplex algorithm. (3 marks)
The diagram shows a graphical representation of the feasible region.
y
B
O D E x
d Relate each stage of the simplex tableau to the corresponding point in the diagram. (2 marks)
E/P 5 A clocksmith makes three types of luxury wristwatch. The mechanism for each watch
is assembled by hand by a skilled watchmaker and then the complete watch is formed,
weatherproofed and packaged for sale by a fitter.
The table shows the times, in minutes, for each stage of the process.
Watch type Watchmaker Fitter
A 54 60
B 72 36
C 36 48
The watchmaker works for a maximum of 30 hours per week and the fitter for a maximum of
25 hours per week.
Let the number of type A, B and C watches made per week be x, y and z.
a Show that the above information leads to the two inequalities
3x + 4y + 2z < 100
5x + 3y + 4z < 125 (2 marks)
215
A The profit made on type A, B and C watches is £12, £24 and £20 respectively.
b Write down an expression for the profit, P, in pounds, in terms of x, y and z. (2 marks)
The clocksmith wishes to maximise his weekly profit. It is decided to use the simplex algorithm
to solve this problem.
c Write down the initial tableau using r and s as the slack variables. (3 marks)
d Increasing y first, show that after two complete iterations of the simplex algorithm
the tableau becomes
Basic variable x y z r s Value
_1 _2 − _15
y 5 1 0 5 15
__ − __ _5
11 3 2
z 10 0 1 10 20
__ __
__
74 18 16
P 5 0 0 5 5 760 (5 marks)
e Give a reason why this tableau is optimal (final). (1 mark)
f Write down the numbers of each type of watch that should be made to maximise
the profit. State the maximum profit. (2 marks)
E/P 6 A craftworker makes three types of wooden animals for sale in wildlife parks. Each animal has to
be carved and then sanded.
Each Lion takes 2 hours to carve and 25 minutes to sand.
2 _2 hours to carve and 20 minutes to sand.
1
Each Giraffe takes
1 _2 hours to carve and 30 minutes to sand.
1
Each Elephant takes
Each day the craftworker wishes to spend at most 8 hours carving and at most 2 hours sanding.
Let x be the number of Lions, y the number of Giraffes and z the number of Elephants he
produces each day.
The craftworker makes a profit of £14 on each Lion, £12 on each Giraffe and £13 on each
Elephant. He wishes to maximise his profit, P.
a Model this as a linear programming problem, simplifying your expressions so that they have
integer coefficients. (4 marks)
It is decided to use the simplex algorithm to solve this problem.
b Explaining the purpose of r and s, show that the initial tableau can be written as:
Basic variable x y z r s Value
r 4 5 3 1 0 16
t 5 4 6 0 1 24
P −14 −12 −13 0 0 0 (3 marks)
c Increasing x first, work out the next complete tableau, where the x column
includes two zeros. (2 marks)
d Explain what this first iteration means in practical terms. (2 marks)
216
A 7 Here is a linear programming problem that is to be solved using the two-stage simplex method.
E Maximise P = x + 3y
subject to: 3x + 2y < 15
2x + 5y < 20
y>2
x>0
a Express the constraints as equations using slack, surplus and artificial variables. (2 marks)
b Write a new objective function for the first stage in terms of non-basic variables. (3 marks)
c Write the initial tableau for the first stage in standard form. (3 marks)
d Complete the first stage and explain what the solution represents. (4 marks)
e Set up the tableau for the second stage. (2 marks)
P 8 The following tableau was obtained after a number of iterations of the Big-M method.
Basic
x y z s1 s2 s3 a1 Value
variable
s1 2 0 1 1 2 0 0 150
y 1 1 −1 0 1 0 0 180
a1 1 0 0 0 0 1 1 70
P −1 0 1 0 M M+5 2M 230
E/P 9 This is the first tableau for a linear programming problem to be solved using the Big-M
method.
Basic Row
x y z s1 s2 s3 a1 Value
variable operations
s1 1 1 4 1 0 0 0 4
s2 2 3 1 0 1 0 0 5
a1 2 −1 0 0 0 −1 1 8
P −(1 + 2M ) (1 + M ) −4 0 0 M 0 −8M
a Explain why this tableau does not represent a feasible solution. (2 marks)
b State the value of the next pivot, making your reasons clear. (2 marks)
c Carry out one further iteration of the simplex algorithm, showing your row operations.
(4 marks)
E/P 10 A bakery has the capacity to produce 800 pies a day. The bakery makes three types of pies, A,
B, and C.
Pie A will return a profit of £1.00 per pie. Pie B will return a profit of £0.80 per pie. Pie C will
return a profit of £0.60 per pie.
In order to satisfy demand, the factory must produce at least 200 of pie C.
217
218
2 Inequalities can be transformed into equations using slack variables (so called because
they represent the amount of slack between an actual quantity and the maximum possible
value of that quantity).
5 The simplex method always starts from a basic feasible solution, at the origin, and then
progresses with each iteration to an adjacent point within the feasible region until the
optimal solution is found.
6 To use a simplex tableau to solve a maximising linear programming problem, where the
constraints are given as equalities:
• Draw the tableaux: you need a basic variable column on the left, one column for each
variable (including the slack variables) and a value column. You need one row for each
constraint and the bottom row for the objective function.
• Create the initial tableau: enter the coefficients of the variables in the appropriate column
and row.
• Look along the objective row for the most negative entry: this indicates the pivot column.
• Calculate θ, for each of the constraint rows, where
the term in the value column
θ = _________________________
the term in the pivot column
• Select the row with the smallest, positive θ value to become the pivot row.
• The element in the pivot row and pivot column is the pivot.
• Divide all of the elements in the pivot row by the pivot, and change the basic variable at
the start of the row to the variable at the top of the pivot column.
• Use the pivot row to eliminate the pivot’s variable from the other rows: this means that the
pivot column now contains one 1 and zeros.
• Repeat bullets 3 to 8 until there are no negative numbers in the objective row.
• The tableau is now optimal and the non-zero values can be read off using the basic variable
column and value column.
219
A
7 The steps for solving a minimising linear programming problem are identical to those given
above apart from:
• First, define a new objective function that is the negative of the original objective function.
• After you have maximised this new objective function, write your solution as the negative
of this value, which will minimise the original objective function.
8 When integer solutions are needed, test points around the optimal solution to find a set of
points which fit the constraints and give a maximum for the objective function.
9 The two-stage simplex method for problems that include > constraints:
• Use slack, surplus and artificial variables, as necessary, to write all the constraints as
equations.
• Define a new objective function to minimise the sum of all the artificial variables.
• Use the simplex method to solve this problem.
• If the minimum sum of the artificial values is 0 then the solution found is a basic feasible
solution of the original problem, which is then the starting point for the second stage. Use
the simplex method again to solve this problem.
• If the minimum sum of the artificial variables is not 0 then the original problem has no
feasible solution.
10 Linear programming problems that include > may also be solved using the Big-M method
instead of the two-stage simplex method. The Big-M method uses an arbitrarily large number,
M, in the objective function. Its purpose is to drive the artificial variables towards 0.
220
221
■ A precedence table, or dependence table, is a table which shows which activities must be
completed before others are started.
Example 1
The manufacture of a sofa involves the construction of a wooden frame which is then fitted with
springs. The frame is then covered with padding and fabric. Cushions are cut out of the same fabric
which must then be stitched and filled. The assembly of the sofa is completed by attaching the cushions.
It is then inspected before being wrapped in a protective covering ready for shipping.
Represent the information above in a systematic way that makes any dependencies clear.
222
Example 2
The production of a new textbook may be broken down into activities A to G.
Activities A and B do not depend on any other activities.
Both activities C and D can only be started once A has been completed.
Activity E cannot be started until activity B has been completed and activity F cannot be started
until activities C and E have been completed. Activity G can only begin once all other activities
have been completed.
Draw a precedence table to represent this information.
Activity Depends on
A –
B –
C A
D A
E B
This appears to be the tricky part to complete.
F C, E
It’s a lot easier when you realise that you must
G D, F include just those activities that are not already
written in this column.
The production of a precedence table goes some way towards representing a project in a form
that can help you to coordinate the activities effectively. However, a diagram may be a lot easier to
understand, especially if the project is more complex.
The information provided in a precedence table Links You have already seen how network
may be transferred to an activity network to diagrams may be used to represent and help
give a visual representation of the project. analyse a variety of problem types. ← Chapter 3
There are two types of activity network but only the activity on arc type will be used here.
■ In an activity on arc network, the activities are represented by arcs and the completion of
those activities, known as events, are shown as nodes.
• Each arc is labelled with an activity letter. The beginning and end of an activity are shown
at the ends of the arc and an arrow is used to define the direction. The convention is to use
straight lines for arcs.
• The nodes are numbered starting from 0 for the Watch out Sometimes the source
first node which is called the source node. node is labelled 1 instead of 0.
• Number each node as it is added to the network.
• The final node is called the sink node.
223
Example 3
Draw an activity network for the precedence table given in Example 2.
A
Activities A and B do not depend on
0 any previous activities.
C
Activities C and D both depend on
1 activity A.
A Node 1 represents the end of activity A.
D
0
1
A
D
0
224
Exercise 8A
1 The steps involved in starting a car and moving forwards in a straight line are given below.
A Check that car is in neutral.
B Start engine.
C Depress clutch.
D Select first gear. Hint There is more than
one possible solution.
E Check that it is safe to move off.
F Release the handbrake.
G Raise the clutch and depress the accelerator.
Draw a precedence table for this process.
225
Activity Depends on
A –
B –
C A, B
D A
A
Activities A and B do not depend on any other
0 activities and so they are linked to the source node.
B
1
A D
The problem here is how to represent activity C
0 3
which depends on both activity A and activity B.
B
2
To resolve this problem you introduce a dummy activity between events 1 and 2 to show that activity
C depends on activity A as well as activity B.
■ A dummy activity has no time or cost. Its sole purpose is to show dependencies between
activities.
1
A D
A dummy activity is shown using a dotted line.
0 Dummy 30 The direction of the arrow is important. It shows
that activity A immediately precedes activity C.
B C
2
226
Example 4
Draw an activity network for this precedence table. Use exactly two dummies.
Activity Immediately preceding activities The label for this column may be written in
A – different ways.
B A
C A
D A
E B Activity E depends on activity B only, but activity
F depends on both activity B and activity C. This
F B, C
indicates the need for a dummy.
G D, F
H D
I G, H
2 E
B The first dummy is shown
Dummy
A between nodes 2 and 3.
C F
0 1 3
2 E
Activity H depends on
B
Dummy activity D only, but activity
A C F G G depends on both activity
0 1 3 5 D and activity F. This
Dummy indicates the need for a
D H second dummy.
4
2 E
B
Dummy
A C F G I
0 1 3 Activity I depends on
5 6 7
Dummy activities G and H.
D H
4
2
B E
Dummy
A C F Extend the arc for activity
0 1 3 G
5 6 7 E to the sink node so that
Dummy I there is only one end point.
D H
4
227
■ Every activity must be uniquely represented in terms of its events. This requires that there
can be at most one activity between any two events.
Once again, a dummy may be required to satisfy this condition. Here is an example to show how this
works.
This diagram shows part of an activity network. Suppose that event S depends on activities P, Q
and R.
P
P
This is not allowed because there are two
activities between events 6 and 8.
6 8 6 8
Q Q S
R R
Using a dummy allows the dependence to be shown while ensuring that all activities are uniquely
determined by their events.
7
P
Dummy
6 8
Q S
Exercise 8B
1 This activity network contains a dummy.
C 2 E
4
A 1
H
Dummy
0
D F
5
B G
3
228
4 a Draw an activity network for this precedence table using exactly two dummies.
Activity Depends on
P –
Q –
R P
S P
T P, Q (3 marks)
E/P 5 The precedence table for a project is shown below. Draw the activity network described in the
table, using the minimum number of dummies.
Activity Depends on
A –
B –
C A, B
D B
E B
F C
G C, D
H E
(3 marks)
229
Each node (vertex), of the network represents an event. It is useful to consider two separate times
associated with each event.
■ The early event time is the earliest time of arrival at the event allowing for the completion
of all preceding activities.
■ The late event time is the latest time that the event can be left without extending the time
needed for the project.
Early event time
The activity network is now adapted to show this information by using
at each vertex. Late event time
■ The early event times are calculated starting from 0 at the source node and
working towards the sink node. This is called a forward pass, or forward scan.
6 2+4=6
C(4)
2
A(2) D(3) E(2)
0 7
0 The largest of:
Dummy F(4)
6+2=8
B(7) 7 11
7 + 4 = 11 and
G(1) 7+1=8
■ The late event times are calculated starting from the sink node and working backwards
towards the source node. This is called a backward pass or backward scan.
6 11 − 2 = 9
C(4) 9 The early event time always
2 becomes the late event
A(2) 4 D(3) E(2) time at the sink node.
The late event time at the
0 7
source node is always 0. 0 Online
0 Dummy 7 F(4) Explore event
11 times in activity networks
The smallest of: B(7) 7
11
using GeoGebra.
11 − 1 = 10 and 7 − 0 = 7 7 G(1)
230
Example 5
The diagram shows part of an activity network.
Calculate the value of x.
2
x = 10
Example 5
6
The diagram shows part of an activity network.
Calculate the value of y.
5
For each event, the late time is greater than or
6 equal to the early time. You can use this fact to
E(1)
check your answers.
4 9
y F(3) 10
G(4)
The smallest of:
8
6−1=5
8
10 − 3 = 7
8−4=4
y=4
Exercise 8C
Answer templates for questions marked * are available at www.pearsonschools.co.uk/d1maths
1 The diagram shows part of an activity network. 7
Calculate the value of x.
E(5)
5 F(8) x
G(5)
9
231
232
Example 7
The diagram shows an activity network with early and late event times shown at the nodes.
Identify the critical activities.
14 F(5) 19 I(8) 27 Online Explore critical
C(8) 15 20 28 paths using GeoGebra.
6 K(1)
6 J(2)
A(6) 13 22 29
D(7)
13 G(9) 22 L(7) 29
0
0 H(8)
B(3) 3 7
10 E(4) 14
Example 8
Part of an activity network is shown below including the early and late event times given in hours.
Which are the critical activities?
7 F(8) 18 7 + 5 = 12 (critical)
7 18 12 + 6 = 18 (critical)
7 + 8 Þ 18 (not critical)
E(5) G(6)
12
12
233
Example 9
Find the critical paths in this activity 9 D(3) 12
network and identify the critical 9 12
activities. B(5)
G(2)
9
0 A(4) 4 9
E(1)
0 4 H(5)
14
C(3) 7 14
F(4)
8
Exercise 8D
Answer templates for questions marked * are available at www.pearsonschools.co.uk/d1maths
P 1 Part of an activity network is shown opposite including the 9 K(8) y
early and late event times given in hours. 9 z
Activities J and K are critical.
Find the values of x, y and z. J(x) L(10)
6
6
E/P 2 The diagram shows an activity network with early and late event times, in hours, shown at the
vertices.
13 G(5) 25 M(6) 31
C(8) 20 25 47
5 H(11) J(12) O(1)
7
A(5) 14 37 48
D(7)
14 I(9) 37 N(11) 48
0
0 E(5) K(7) P(8)
B(9) 9 13 17
9 F(4) 30 L(4) 40
234
E 4* The diagram below is the activity network relating to an engineering project. The number in
brackets on each arc gives the time taken, in days, to complete the activity.
G(9)
D(3)
K(4)
A(4) H(3)
B(3) L(7)
E(8) I(3)
C(6)
M(3)
F(2)
J(4)
235
Example 10
Determine the total float of each activity 9 D(2) 11
in this activity network. 9 11
B(6)
9 G(5)
0 A(3) 3 12
E(1)
0 3 H(4)
16
C(4) 7 16
F(4)
11
Activity A
0 A(3) 3 This is a critical activity. Any delay in the start
0 3 time will affect the duration of the project.
Total float = 0
Activities B, D and G These are all critical activities so the total float of
Total float = 0 each one is 0.
Activity C
3 is the earliest time that the activity can start.
3 C(4) 7 11 is the latest time that the activity can be
3 11 finished by.
Total float = 11 − 4 − 3 = 4 4 is the duration of the activity.
Activity E
7 is the earliest time that the activity can start.
7 E(1) 9 12 is the latest time that the activity can be
11 12 finished by.
Total float = 12 − 1 − 7 = 4 1 is the duration of the activity.
Activity F
7 is the earliest time that the activity can start.
7 F(4) 16 16 is the latest time that the activity can be
11 16 finished by.
Total float = 16 − 4 − 7 = 5 4 is the duration of the activity.
Activity H
9 is the earliest time that the activity can start.
9 H(4) 16 16 is the latest time that the activity can be
12 16 finished by.
Total float = 16 − 4 − 9 = 3 4 is the duration of the activity.
236
Exercise 8E
1 Determine the total float of each activity in this activity network.
14 F(5) 19 I(8) 27
C(8) 15 20 28
6 K(1)
J(2)
6
A(6) 13 22 29
D(7)
13 G(9) 22 L(7) 29
0
0 H(8)
B(3) 3 7
10 E(4) 14
E/P 2 The diagram shows part of an activity network with activity times measured in hours.
a P(x) 19
10 b
Q(y) R(4)
c
15
P is a critical activity.
Q has a total float of 3 hours.
a Work out the values of a, b, x and y. (4 marks)
b What is the minimum possible value of c? (1 mark)
c What is the maximum possible value of the total float of R? (2 marks)
237
The number scale shows elapsed time. So, the first hour is shown between 0 and 1 on the scale, the
second hour is shown between 1 and 2 and so on.
Example 11
Here is an activity network for a project.
Early and late event times are shown in hours at the nodes.
Draw a Gantt chart to represent the project.
7 D(2) 14
12 14
B(3) F(2)
H(2)
0 A(4) 4
12
0 4 E(3) 12 16
C(5) 16
9
G(3)
9
The Gantt chart illustrates clearly that there is no flexibility in the timing of the critical activities. It also
illustrates the degree of flexibility in the timing of each of the remaining activities.
The total float of each activity is represented by Watch out You must clearly distinguish
the range of movement of its rectangle on the each activity from its total float in your
chart. Gantt (cascade) chart. You can use dotted
lines as above, or you can shade in the
total float.
238
Exercise 8F
E 1 The diagram shows an activity network for a project. Early and late event times are shown in
days at the nodes. Draw a Gantt chart to represent the project.
6 F(7) 13
C(2)
6 13
4 H(3)
4
A(4) 9 16 20
D(5)
10 G(6) 16 J(4) 20
0
0 I(8)
B(3) 3 7
4 E(4) 8
(4 marks)
13 G(5) w M(7) 33
C(9) 20 z 33
4 H(11) J(3) O(6)
9
A(4) 15 x 39
D(6)
15 I(6) y N(5) 39
0
E(8) K(7) P(3)
0
B(7) 7 12 20
7 F(5) 27 L(8) 36
The overview of a project provided by a Gantt chart allows you to determine which activities must be
happening at any given time and those that may be happening at a given time. In practice, once a
project is underway, this provides a useful means of checking that non-critical activities have not been
delayed to the point that they have become critical.
Example 12
The Gantt chart overleaf represents a project that must be completed within 25 days. Given that
the project is on time,
a determine 3 activities that must be happening at midday on day 10.
b determine 1 additional activity that may be happening at midday on day 10.
239
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Activity C must
be happening at
A C G J
midday on day 10.
B
Activities D and
E must be
D
happening at
midday on day 10.
E
Exercise 8G
P 1 Refer to the Gantt chart shown in Example 12 for this question.
a Which activities must be happening at midday on day 8?
b Which activities must be happening at midday on day 21?
c Which activities may be happening at midday on day 22?
E/P 2 The Gantt chart below represents an engineering project. An engineer decides to carry out some
spot checks on the progress of the project.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
A C F H
240
E/P 3 a Draw a Gantt chart to represent the activity network below. (4 marks)
11
C(4)
11
7 F(7)
7
A(7) 9 G(5) 18 26
13 18 H(8) 26
0 D(6)
0 E(10)
B(3) 3
7
E/P 4 The activity network below shows the activities that are needed in order to complete a railway
line laying project. The number in brackets on each arc represents the time, in days, to complete
the activity.
20
22
C(7) I(5)
8 26
G(2)
x z L(15)
A(8) D(8)
y J(1)
0 42
0 25 42
B(12) M(13)
E(12) K(4)
12 29
H(2)
12 29
F(11)
23
23
241
A resource histogram shows the number of workers that are active at any given time. The convention,
when constructing the diagram, is to assume that each activity starts at the earliest time possible.
However, once drawn, it may be possible to use the diagram to identify which activities may be delayed
in order to minimise the number of workers required.
In some cases, the number of workers available is less than the number required to complete the
project in the minimum possible time. The start and finish times of some activities may have to be
delayed in order to meet this constraint, which then extends the time needed for project completion.
■ The process of adjusting the start and finish times of the activities in order to take into
account constraints on resources is called resource levelling.
One way to draw a resource histogram is to start from a Gannt (cascade) chart.
Example 13
Here is the Gannt chart from question 2 of exercise 8G.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
A C F H
242
A The number of workers required for each activity is shown in this table.
Activity Number of workers
A 2
B 1
C 1
D 2
E 1
F 1
G 2
H 1
Draw a resource histogram to show the number of workers required each day when each activity
begins at its earliest time.
This number of workers assumes that each activity starts at the earliest possible time.
This might not be the most efficient way to complete the project.
6
5
Workers
4
3
2
1
0
0 2 4 6 8 10 12 14 16 18 20 22 24 26
Days
With practice, there is no need to draw the table; you can put the information directly
onto the resource histogram.
243
A You can show all of the information from the table in the previous example on your resource
histogram by writing letters to show which activities are being completed on each day:
6
5
E E E E
Workers
4
D D D D E E G G G G
3
B B B D D D D D D G G G G G
2
A A A A A A A D D E E E E G
1
A A A A A A A C C C C F F F F F F F H H H H H H H H
0
0 2 4 6 8 10 12 14 16 18 20 22 24 26
Days
Notice that whenever activities A, D or G are being carried out they require two rows because they
each need two workers.
In the example above five workers are needed between days Notation The process of
3 and 7. However, by delaying the start of activity E by four
adjusting start times to optimise
days, it is possible to complete the project in the same time the allocation of workers is
with only four workers. Activity E has a total float of 5 so it will called resource levelling.
still be finished by its late time.
Example 14
The diagram shows a project modelled by an activity network. The number on each arc gives
the time, in days, required to complete each activity, and the number of workers needed for each
activity is shown in the table.
14 Activity Workers
C(8) 17 D(4) A 1
6
21 B 2
A(6) 6
E(7) 13 21
H(8) C 2
0 13
0 D 1
F(9)
E 1
B(3)
3 11 F 1
4 G(8) 13 G 2
H 1
A project manager determines that each activity should start at the earliest possible time.
a Draw a resource histogram to show the number of workers required on each day, and state the
total number of workers needed in this situation.
Due to budget cuts, only four workers are available for the project.
b Use resource levelling to show how the project can be completed with just 4 workers, and state
the time required to complete the project in this case.
244
A Draw a horizontal
a
axis for the days
Workers
1 from 0 to 21.
A A A A A A E E E E E E E H H H H H H H H Start by writing
0
0 2 4 6 8 10 12 14 16 18 20 21 the activities on
Days the critical path
along the base of
your histogram.
The critical path
on this network is
4 AEH and each of
Workers
6
C C C C C
5
C C C C C
Workers
4
G G G G G G G G C
3
B B B G G G G G G G G C C C
2
B B B F F F F F F F F F C C
1
A A A A A A E E E E E E E H H H H H H H H
0
0 2 4 6 8 10 12 14 16 18 20 21
Days
Problem-solving
As you complete your resource histogram, look at any points where an
activity ends and consider what other activities could start at that point.
Activity A ends at day 6. At this point you can start activities C and E. E has
already been included as it is on the critical path, so write in activity C. In
each column, use as few rows as possible.
245
4 start is immediately
G G G G G G G G C
3 after activity C
B B B G G G G G G G G C C C finishes. Write
2
B B B F F F F F F F F F C C D D D D it in, then draw
1
A A A A A A E E E E E E E H H H H H H H H bars around your
0
0 2 4 6 8 10 12 14 16 18 20 21 finished resource
Days histogram, and add
a vertical scale.
6
You can show your
5
finished resource
Workers
4
histogram with or
3
without the activity
2 letters. In this
1 diagram a vertical
0 line has been
0 2 4 6 8 10 12 14 16 18 20 21
added after 13
Days
days to show that
The resource histogram shows that 6 workers are required to complete activity H starts
the project in a time of 21 days if each activity starts at its early time. here.
b To reduce the number of workers to 4 Problem-solving
we must consider delaying activity
The only point where more Calculate the total
C, E, F or G which are currently active in
than 4 workers are needed float of each of
the third bar of the resource histogram.
is between days 6 and 11, so activities C, E, F
Activities F and G become active in the consider the activities that
second bar of the resource histogram. and G to determine
are being carried out in this how much they
Activity Total float period. could be delayed
C 17 − 8 − 6 = 3 without delaying
E 13 − 7 − 6 = 0 the project.
F 13 − 9 − 3 = 1
G 13 − 8 − 3 = 2 You need to delay
activity C two days
Activity C has the largest total float and requires 2 workers. Delaying
beyond its given
activity C by 5 days brings the number of workers required down to 4
late time, which
and requires the total project time to be extended by just 2 days to means the project
23 days. will be delayed by
2 days.
246
Exercise 8H
A
1 Here is a Gantt (cascade) chart for a project that takes 22 days to complete. Given that each
E
activity requires one worker, and that each activity begins at its earliest time,
0 2 4 6 8 10 12 14 16 18 20 22
A E H J K
E 2 The diagram shows an activity network. The numbers in brackets show the duration of each
activity in days, and the table shows the number of workers required for each activity. The early
and late times for each event are shown.
Activity Workers
14 F(5) 19 A 1
C(8)
15 20 B 1
6 I(2) C 2
6
A(6) 13 22 D 1
D(7)
13 G(9) 22 E 1
0
H(8) F 2
0
B(3) 3 7 G 2
10 E(4) 14 H 1
I 1
a Given that each activity starts at the earliest possible time, draw a resource histogram
for this activity network. (4 marks)
b Using your resource histogram, state the number of workers required to complete
the project on time. (1 mark)
247
A 3 The diagram shows an activity network. The numbers in brackets show the duration of
E/P each activity in weeks, and the table shows the number of workers required for each activity.
The early and late times for each event are shown.
Activity Workers
A 1
7 15
B 1
A(7) 7 E(4) G(4) 18 I(4)
C 2
0
C(2)
11 22 D 1
0 11 F(11) 22 E 1
B(5) D(6) H(4) F 2
5 15
G 2
5 22
H 1
I 1
A manager decides that each activity should start at the earliest possible time.
a Draw a resource histogram to show the number of workers required on each day,
and state the total number of workers needed in this situation. (4 marks)
b Use resource levelling to show how the project can be completed using 4 workers
and state the amount of time by which the project must be extended. (4 marks)
8 J(1) 9
C(5) 30 31 Q(1)
5 G(3) 14
K(1)
27 36
10 L(4)
32
248
A A manager says that she can complete the project on time with only 4 workers by
delaying the start of activity N by 2 hours.
c Explain why she is not correct. (1 mark)
d Given that there are only 3 workers available, work out the earliest time that the
project can be completed. (3 marks)
Example 15
The diagram shows a Gantt chart for a project.
Schedule the activities to be completed in the critical time by the minimum number of workers.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
A C G J
249
A
This Gantt chart information may be transferred to a scheduling diagram in stages.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22232425
Worker 1 A C G J
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22232425
Worker 1 A C G J
Worker 2 B D
Worker 3 E
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22232425
Worker 1 A C G J
Worker 2 B D F
Worker 3 E
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22232425
Worker 1 A C G J
Worker 2 B D F
Worker 3 E H I
Watch out Check your final diagram to make sure that all the dependency conditions are satisfied. If one
activity has been delayed, this might affect the earliest possible start time for other activities.
250
A In Example 15, a minimum of three workers were required to complete the project within the
critical time of 25 days. In general, you can calculate a lower bound for the number of workers by
considering the sum of the activity times (or, in other words, the total weight of the network).
■ The lower bound for the number of workers needed to complete a project within its critical
time is the smallest integer greater than or equal to:
sum of all of the activity times
____________________________
critical time of the project
Consider the network in Example 15:
Activity A B C D E F G H I J Total
Duration 8 6 8 7 11 10 5 3 5 4 67
This gives a lower bound as the smallest integer greater than or equal to __
67
25
__
67 = 2.68 and so a lower bound is 3.
25
This simply means that it is impossible to complete the project in the critical time using fewer than
3 workers. However, since the calculation takes no account of the degree of overlap of the activities,
it doesn’t guarantee that 3 workers is sufficient.
When the number of available workers is fewer than the minimum required to complete a project
within its critical time, the information shown on a Gantt chart cannot be relied upon as some
activities will be delayed further than shown. In this situation it is better to construct the scheduling
diagram direct from the activity network because special care is needed to ensure that the
dependency conditions are satisfied.
Example 16
The diagram shows an activity network 17 F(4) 21
representing a project with a minimum time C(9)
17 21
of 31 days. 8 I(5)
Use a scheduling diagram to find the new 8
A(8) 15 26
completion time for the project given that D(7)
21 G(5) 26
only two workers are available. J(5)
0
H(8) 31
0
B(6) 6 11 31
13 18 K(5)
E(5)
251
A
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Worker 1 A C F H J
Worker 2 B E D G I K
The minimum time needed to complete the project using two workers is 34 days.
Watch out When Worker 2 finishes activity G, the next available activity is I. Check to
make sure that activities D and F have been completed before allocating this activity.
Exercise 8I
E/P 1 The Gantt chart 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
represents a project
which must be completed A D F J
in its critical time of
22 hours. B
activities is 64 hours,
calculate a lower bound E
for the number of
workers needed to G
complete the project
in the minimum time. H
(2 marks)
I
An unforeseen problem
means that Activity B
cannot be started until
2 hours into the project.
b Explain why this will not result in a delay for the whole project. (1 mark)
c Which activities must be happening 17.5 hours into the project? (1 mark)
d Complete a scheduling diagram to complete the project in 22 hours.
State the number of workers required. (4 marks)
252
A 2 The diagram shows an activity network representing a project. The numbers on each arc
E represent the duration of each activity in days, and the early and late times are shown.
17 F(4) 21
C(9)
17 21
8 I(5)
8
A(8) 15 26
D(7)
21 G(5) 26
J(5)
0
H(8) 31
0
B(6) 6 11 31
13 18 K(5)
E(5)
E/P 3 The diagram shows an activity network representing a project. The numbers on each arc
represent the duration of each activity in hours, and the early and late times are shown.
6 F(7) 13
C(2)
7 14
4 H(3)
4
A(4) 9 17 21
D(5)
9 G(6) 17 J(4) 21
0
0 I(8)
B(3) 3 9
5 E(4) 9
Given that only two workers are available for this project, construct a scheduling
diagram and determine the minimum time needed to complete the project. (5 marks)
Mixed exercise 8
Answer templates for questions marked * are available Activity Must be preceded by
at www.pearsonschools.co.uk/d1maths
A –
253
a Explain the purpose of the dotted line from event 6 to event 8. (1 mark)
b Calculate the early time and late time for each event. (3 marks)
c Calculate the total float of activities D, E and F. (2 marks)
d Determine the critical activities. (1 mark)
e Given that the sum of all the times of the activities is 95 hours, calculate a lower bound
for the number of workers needed to complete the project in the minimum time.
You must show your working. (2 marks)
f Given that workers may not share an activity, schedule the activities so that the
process is completed in the shortest time using the minimum number of workers. (3 marks)
254
A 5* The network shows the activities that need to be undertaken to complete a project. Each activity
E/P is represented by an arc. The number in brackets is the duration of the activity in days. The early
and late event times are to be shown at each vertex and some have been completed for you.
10 D(11) 23
10 23
K(7)
A(10) E(4) H(9)
30
B(9) I(15)
0 30
0 F(2) J(15)
L(16)
C(11) 14
14
11 G(1) 14
E/P 6* A project is modelled by this activity network. The number in brackets on each arc represents the
time, in days, to complete the activity.
D(7) H(3)
A(6) E(4)
I(7)
F(9)
B(8) J(6)
G(11)
C(10) K(12)
a Work out the early and late event times for each activity. State the minimum time
needed to complete the project. (3 marks)
b Calculate a lower bound for the number of workers required to complete the project
on time. (1 mark)
255
D(8)
A(3)
E(6) H(2)
B(6) K(3)
F(4)
a Work out the early and late event times for each activity. State the minimum time
needed to complete the project. (4 marks)
b Find the critical path(s). (2 marks)
The number of workers required for each activity is shown in the table.
Activity A B C D E F G H I J K L
Number of
4 4 5 2 5 2 6 3 5 3 2 4
workers required
c Given that each activity starts as early as possible and assuming that there is no
limit on the number of workers available, draw a resource histogram for the project,
indicating clearly which activities are taking place at any given time. (4 marks)
d The building manager decides that there will only be 8 workers available at any time.
Use resource levelling to construct a new resource histogram, showing how the project
can be completed with the minimum extra time. State the minimum extra time required.
(3 marks)
Challenge
The activity network below shows the tasks that need to be carried out in
order to complete a bathroom renovation project. The numbers in brackets
show the duration of each activity in days, and the early and late event
times are shown at each vertex. The nodes are numbered from 0 to 5.
1 4
12 C(8) 20
12 28
A(12) D(15) E(9)
0 3 5
0 27 37
0 27 F(10) 37
B(25) 2
25
27
256
a Identify the activities which lie on the critical path, and calculate the total
float of each of the remaining activities.
The homeowner wishes to reduce the total time to completion of the
project. The builder identifies four activities which can be speeded up at
additional cost, and creates a table showing the cost per day of reducing
each activity’s duration:
Activity Additional cost of Maximum possible Hint So for example,
reduction (£ / day) reduction (days) the duration of activity B
B £100 8 could be reduced by 8
days at a cost of £800,
D £200 10
but it could not be
E £400 2 reduced further.
F £150 3
b Find the most cost-effective way of reducing the total project time to:
i 33 days ii 30 days
In each case, you should state which activities have been reduced, and by
how much, and give the total additional cost.
c Find the shortest possible time in which the project could be completed,
and explain why the project time cannot be further reduced.
Hint For part e, you will
The builder decides to formulate a linear programming problem to optimise need constraints:
the cost of reducing the total project time to 28 days. ● For the duration of
She defines x1, x2, x 3, x4 and x5 to be the early times at vertices 1 to 5 each activity, taking
respectively, and yB , yD, yE and yF to be the number of days by which into account any
activities B, D, E and F are reduced. reduction
d Write down a suitable objective function to minimise. ● For the maximum
e Write down constraints which will ensure that the dependencies in the project possible reductions
are maintained and that the solution satisfies all of the conditions given above. ● For the early time of
You should not attempt to solve the linear programming problem. the sink node, x5
257
4 Every activity must be uniquely represented in terms of its events. This requires that there
can be at most one activity between any two events.
5 The length of time an activity takes to complete is known as its duration. You can add weights
to the arcs in an activity network to represent these times.
6 • The early event time is the earliest time of arrival at the event allowing for the completion
of all preceding activities.
• The late event time is the latest time that the event can be left without extending the time
needed for the project.
• The early event times are calculated starting from 0 at the source node and working towards
the sink node. This is called a forward pass or forward scan.
• The late event times are calculated starting from the sink node and working backwards
towards the source node. This is called a backward pass or backward scan.
7 • An activity is described as a critical activity if any increase in its duration results in a
corresponding increase in the duration of the whole project.
• A path from the source node to the sink node which entirely follows critical activities is called
a critical path. A critical path is the longest path contained in the network.
• At each node (vertex) on a critical path the early event time is equal to the late event time.
8 An activity connecting two critical events isn’t necessarily a critical activity.
9 • The total float of an activity is the amount of time that its start may be delayed without
affecting the duration of the project.
Total float = latest finish time – duration – earliest start time
• The total float of any critical activity is 0.
10 A Gantt (cascade) chart provides a graphical way to represent the range of possible start and
finish times for all activities on a single diagram.
A 11 You need to be able to consider the number of workers needed to complete a project.
You will be told the number of workers that are needed for each activity.
• No worker can carry out more than one activity simultaneously.
• Once a worker, or workers, have started an activity, they must complete it.
• Once a worker, or workers, have finished an activity, they immediately become available to
start another activity.
12 The process of adjusting the start and finish times of the activities in order to take into
account constraints on resources is called resource levelling.
13 When you are scheduling a project:
• you should always use the first available worker
• if there is a choice of activities for a worker, assign the one with the lowest value for its late time.
14 The lower bound for the number of workers needed to complete a project within its critical
time is the smallest integer greater than or equal to:
sum of all of the activity times
__________________________
critical time of the project
258
259
‘Decide’ must produce at least 200 badges Another objective (for the same constraints
and has enough material for 500 badges. given above) is to maximise P = 3x + 2y.
Market research suggests that the number c Solve this problem, making your
produced of Badge 1 should be between method clear. State the value of P and
20% and 40% of the total number of the amount of each type of food that
badges made. should be produced. Your answers must
The company makes a profit of 30p be whole numbers (3)
on each Badge 1 sold and 40p on each ← Sections 6.1, 6.2, 6.3, 6.4
Badge 2. It will sell all that it produces,
and wishes to maximise its profit. E/P 5 The company EXYCEL makes two types
of battery, X and Y. Machinery, workforce
Let x be the number produced of Badge 1
and predicted sales determine the number
and y be the number of Badge 2.
of batteries EXYCEL make. The company
a Formulate this situation as a linear decides to use a graphical method to find
programming problem, simplifying your its optimal daily production of X and Y.
inequalities so that all the coefficients
The constraints are modelled in the
are integers. (4)
diagram below.
b On suitable axes, construct and clearly
label the feasible region. (3) y
12
c Using your graph, advise the company
on the numbers of each badge it should
10
produce. State the maximum profit
‘Decide’ will make. (3)
8
← Sections 6.1, 6.2, 6.3, 6.4
260
This problem is to be solved using the The total times available each week for
simplex algorithm. The most negative processing, blending and packing are 35,
number in the profit row is taken to 20 and 24 hours respectively. T42 Co. Ltd
indicate the pivot column at each stage. wishes to maximise the weekly profit.
b Stating your row operations, show that Let x, y and z be the number of tonnes of
after one complete iteration the tableau Morning, Afternoon and Evening blend
becomes (4) produced each week.
a Formulate the above situation as a
linear programming problem, listing
clearly the objective function, and the
constraints as inequalities. (4)
261
A An initial simplex tableau for the above A ii Explain what s means in practical
situation is terms. (1)
E/P 8 A company makes three sizes of lamps, E 9 A carpenter makes small, medium and
small, medium and large. The company is large chests of drawers. The small size
requires 2 _2 m of board, the medium size
1
trying to determine how many of each size
to make in a day, in order to maximise its 10 m of board and the large size 15 m of
profit. As part of the process the lamps board. The times required to produce a
need to be sanded, painted, dried and small chest, a medium chest and a large
polished. A single machine carries out chest are 10 hours, 20 hours and 50 hours
these tasks and is available 24 hours per respectively. In a given year there are 300 m
day. A small lamp requires one hour on of board available and 1000 production
this machine, a medium lamp 2 hours and hours available.
a large lamp 4 hours. Let the number of small, medium and
Let x = number of small lamps made per large chests made in the year be x, y and z
day respectively.
y = number of medium lamps made a Show that the above information leads
per day to the inequalities
z = number of large lamps made per x + 4y + 6z < 120
day x + 2y + 5z < 100
where x > 0, y > 0 and z > 0. The profits made on small, medium
a Write the information about this and large chests are £10, £20 and £28
machine as a constraint. (3) respectively. (2)
b i Rewrite your constraint from part a b Write down an expression for the profit
using a slack variable s. (1) £P in terms of x, y and z. (2)
262
263
A c Write the initial tableau for the first A c Construct the initial tableau for the
stage in standard form. (3) big-M method. (2)
d Complete the first stage and give the d Complete the solution and state the
basic feasible solution. (5) values of x, y, z and C. (6)
← Section 7.4 ← Section 7.5
E/P 12 The Big-M method is to be used to E 14 The precedence table for activities
solve the following linear programming involved in a small project is shown below.
problem. Activity Preceding activities
Maximise P = x + 3y + 4z A –
B –
subject to:
C –
3x + 2y + z < 24 D B
5x + 3y + 2z < 60 E A
x>2 F A
G B
y>0 H C, D
a Rewrite the constraints as equations I E
using slack, surplus and artificial J E
variables. (2) K F, G, I
L H, J, K
b Write a modified objective function in
terms of M and non-basic variables.(2) Draw an activity network to model this
c Construct the initial tableau for the project. You should not include any
Big-M method. (3) dummies in your network. (5)
← Section 8.1
d Explain why after the first iteration x
replaces a1 as a basic variable. (1) E 15 The precedence table for activities involved
in manufacturing a toy is shown below.
e Apply the Big-M method to solve the
problem. (5) Activity Preceding activities
← Section 7.5 A –
B –
E/P 13 A linear programming problem is C –
expressed as: D A
Minimise C = 2x – 3y + z E A
F B
subject to: G B
4x + 3y + 2z < 36 H C, D, E, F
x + 4z < 52 I E
J E
x + y > 10
K I
x, y, z > 0 L I
a Rewrite the constraints as equations M G, H, K
using slack, surplus and artificial a Draw an activity network to model this
variables. (2) process using exactly one dummy. (5)
b Rewrite the objective function in a b Explain briefly why it is necessary to
form suitable for using the big-M use a dummy in this case. (1)
method. (2) ← Sections 8.1, 8.2
264
E/P 16 a Draw an activity network for the project The number in brackets on each edge
described in this precedence table, using represents the time, in days, to complete
as few dummies as possible. (5) the activity.
Activity Must be preceded by: a Calculate the early time and the late
A – time for each event. (3)
B A
b Calculate the total float for each
C A
activity. (2)
D A
E C c Hence determine the critical activities.
F C Write down the length of the critical
G B, D, E, F path. (2)
H B, D, E, F Owing to the breakdown of a piece of
I F, D equipment the time taken to complete
J G, H, I activity H increases to 9 days.
K F, D
L K d Obtain the new critical path and its
length. (2)
b A different project is represented by
← Sections 8.3, 8.4, 8.5
the activity network shown below.
The duration of each activity is shown
in brackets. 18* E(8)
E 5 13
B(6) 5 13
E(2)
A(4) L(9)
A(4) G(2) D(2) I(4)
265
E 19* A project is modelled by the activity b State the total float for each non-
network shown below. The activities are critical activity. (2)
represented by the arcs. The number c On a grid, draw a cascade (Gantt)
in brackets on each arc gives the time, chart for the project. (4)
in hours, to complete the activity. The
A manager visits the project site 6.5 hours
numbers in circles give the event numbers.
after the start of the project.
G(5)
4 8 K(7) d Given that the project is on schedule,
A(9) 9 which activities must be taking place?
C(8) L(8) (2)
H(5)
1 2 5 7 ← Sections 8.4, 8.5, 8.6
B(3) D(7)
E(4) I(1) J(5)
A 21 The table gives information about
3 6 the activities involved in a software
F(5) E/P
development project.
a Explain the purpose of the dotted line
from event 4 to event 5. (1) Activity Immediately Duration Workers
preceding (days)
b Calculate the early time and the late activities
time for each event. (3) A – 3 1
c Determine the critical activities. (1) B – 2 3
d Obtain the total float for each of the C A 4 2
non-critical activities. (2) D B 3 2
e On a grid, draw a cascade (Gantt) E C, D 2 1
chart, showing the answers to parts c F E 4 3
and d. (3) G D 4 1
← Sections 8.2, 8.3, 8.4, 8.5, 8.6 H E, G 3 4
I F 3 1
E/P 20* A building project is modelled by the
activity network shown below. The activities a Draw a resource histogram for the
are represented by the arcs. The number project. You may assume that activities
in brackets on each arc gives the time, in start at their earliest possible time,
hours, taken to complete the activity. and that once started, an activity is
3 D(3) 11
completed without a break. (5)
5 E(4) 11 b State the minimum time required to
A(3) L(4)
J(2) complete the project and the number
0 9 K(5) 18 of workers required. (1)
0 B(4) F(5) 9 22 c Use resource levelling to show that
P(3)
4 I(5) M(2) the project can be completed using 5
4 G(3) 16 25 workers without extending the time for
16 N(9) 25 the project. (2)
C(6) 7
9
H(7) d Given that only 4 workers are available,
calculate the minimum time by which
a Determine the critical activities and the project will be delayed. (2)
state the length of the critical path. (2) ← Sections 8.7
266
A 22* This activity network represents a project. A c Calculate the total float time for D. (1)
E/P The number in brackets represents the Each activity requires only one person.
duration, in days, of that activity.
d Find a lower bound for the number
E(3) of workers needed to complete the
I(4) process in the minimum time. (1)
D(4) F(2)
A(3)
K(3)
Given that there are only three workers
C(1) H(1) N(2) available, and that workers may not share
J(2) an activity,
M(2)
B(2)
e schedule the activities so that the
G(3) L(3)
process is completed in the shortest
a Copy and complete the diagram to time. Use a time line. State the new
show the early and late times for each shortest time. (4)
event. (3) ← Sections 8.3, 8.4, 8.8
b State the minimum time required to
complete the project. (1)
E/P 24* A project is modelled by the activity
network shown below. The activities are
c Describe the critical path. (1)
represented by the edges. The number in
d Draw a resource histogram. Assume brackets on each edge gives the time, in
that one worker is assigned to each days, taken to complete the activity.
activity and that each activity starts at
F(6)
its earliest time. (4)
e State the number of workers used. (1) C(7) H(3)
D(2) E(7)
f Use resource levelling to show that the
project can be completed, using just
A(5) B(4) G(8)
two workers, without extending the
time for the project. (4) a Copy and complete the diagram to
← Sections 8.3, 8.4, 8.7 show the early and late times for each
event. (3)
E/P 23* The network below shows the activities
involved in the process of producing a b Hence determine the critical activities
perfume. The activities are represented and the length of the critical path. (2)
by the arcs. The number in brackets on c Obtain the total float for each of the
each arc gives the time, in hours, taken to non-critical activities. (2)
complete the activity. d Draw a cascade (Gantt) chart showing
C(23) F(10) the information obtained in parts b
and c. (3)
J(6) K(19)
A(12) L(13)
Each activity requires one worker.
H(18)
G(15) Only two workers are available.
D(14)
M(27) e Draw up a schedule and find the
B(17)
E(32) I(20) minimum time in which the two
workers can complete the project. (3)
a Calculate the early time and the late
time for each event, showing them on a ← Sections 8.3, 8.4, 8.5, 8.6, 8.8
diagram. (3)
b Hence determine the critical activities.
(1)
267
Challenge
1 A linear programming problem is given as:
Maximise P = x + 5y
subject to:
x + 4y < 24
y–x<0
x,8
x, y > 0
a Show the feasible region for this problem on a graph, and find the optimal values of x and y.
b Given the further restriction that x, y ∈ ℤ, find a solution to the problem by testing values near your
answer to part a.
c Show that the optimal integer solution does not lie near your answer to part a.
d With reference to the gradient of the objective line, describe conditions in which the optimal integer
solution may not lie close to the optimal vertex of the feasible region.
← Sections 6.1, 6.2, 6.3, 6.4
268
2* The diagram shows the time taken, in minutes, to drive along some sections of road.
C
4
16 G
9 3 8
B 7 D 14
15 F
2 I
11 16 6 10
5 7
H
16
A 8 E
a Use Dijkstra’s algorithm to find the quickest route from A to I. State the time required.(5)
Roadworks cause a delay of 5 minutes on the section GH.
b Find the new quickest route and the corresponding time required.(2)
269269
Formulate this as a linear programming problem in which the object is to maximise the total
profit. Write each constraint in its simplest form.
You should not attempt to solve the problem.(6)
5* Here is an activity network for an engineering project. The number in brackets on each arc
gives the time in hours to complete the activity.
D(5)
2 7
A(4) I(5)
H(8)
G(2)
1 4 6 8
B(3)
F(4)
C(5) J(9)
3 5
E(6)
a Draw a precedence table for the project showing the immediately preceding activities. (3)
b Explain the purpose of the dotted line between events 3 and 4.(1)
c Draw a diagram showing the early time and late times for each event.(3)
d Describe the critical path.(1)
e Calculate the total float for activity D. (2)
270
1* a Explain why there is no Hamiltonian cycle for this network that begins AB…(1)
C D
B
E
A
G
F
H
b Complete the Hamiltonian cycle for the network that begins AH…(1)
c Use the planarity algorithm to determine whether the graph is planar.
You must make your method clear.(4)
2 The following lengths of cable, in metres, are required for a building project.
42 31 36 18 27 33 41 47 12 24 16
a Carry out a quicksort to put the lengths in decreasing order of size.(4)
The cable is supplied in reels of length 80 metres.
b Use the first fit decreasing algorithm to determine the number of reels required.(3)
The quicksort algorithm has order n log n. A computer applies the quicksort to a list of 800
numbers in 0.034 seconds.
c Estimate the time required for the computer to sort a list of 5000 numbers. Explain why your
answer is only an estimate. (3)
271271
Each road must be traversed at least once to complete the inspection, starting at E and finishing
at B. The total distance travelled is to be kept to a minimum.
b Work out the minimum length of the route. (6)
c State which roads need to be traversed twice.(2)
d In a change of plan, the route is to be finished at C. Work out how this affects the total
distance travelled.(3)
4* a Name an algorithm that can be used to find the shortest path between two vertices in a
network.(1)
Floyd’s algorithm is to be applied to a network. The initial distance table and route table are
shown below.
A B C D E A B C D E
A – 5 ∞ ∞ ∞ A A B C D E
B 5 – 11 16 ∞ B A B C D E
C 10 11 – 8 6 C A B C D E
D ∞ 16 8 – 10 D A B C D E
E ∞ ∞ 6 10 – E A B C D E
272
6* The diagram shows an activity network for a publishing project. The activities are shown on
arcs and the figures in brackets represent the duration of each activity in days.
E(4)
I(5)
D(2) F(3)
A(6)
H(3)
C(1)
M(7)
J(1)
B(5)
G(6) L(4)
K(2)
a Complete the diagram by showing the early and late event times.(2)
b Draw a resource histogram for the project. Assume that each activity is started as soon as
possible and may be completed by one worker without any breaks. State the number of
workers required in this instance.(4)
c Describe how the project can be completed using just 3 workers without extending the time
for completion.(2)
273
7 a Describe the purpose of the first stage of the two-stage simplex method.(2)
A linear programming problem is described as:
Maximise P = x + 2y + z
subject to:
2x + y + z < 50
x + 3y + z < 60
x >10
The partly completed initial tableau for this problem is
Basic
x y z s1 s2 s3 a1 Value
variable
s1 2 1 1 1 0 0 0 50
s2 1 3 1 0 1 0 0 60
a1 1 0 0 0 0 −1 1 10
P
I
In the tableau, s1 and s2 are slack variables, s3 is a surplus variable, a1 is an artificial variable and
I is a modified objective function.
b Complete the tableau.(3)
c Find the optimal solution for the first stage and state the value of each of the variables. (3)
d Set up the tableau for the second stage. Give the value and position of the pivot.(2)
e Complete the solution and state the values of P, x, y and z. (6)
274
Answers
CHAPTER 1 ii
Prior knowledge 1 Step A r C r−C s Print r
1 a 47 b 24
2 300 1 79 10
2 7.900
Exercise 1A
3 2.1
1 a b c
A B A B A B 4 8.950
4 Answer is __
27
16
3 35.5
b It divides the first fraction by the second fraction. 4 67.750
3 a 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
5 67.75
b The first 10 square numbers.
4 a i 6→2 63.100
Step A r C r−C s Print r 3 4.65
1 253 12 4 65.425
2 21.083 5 65.425
3 9.083 6→2 65.342
4 16.542 3 0.083
5 16.542 4 65.384
6→2 15.294 5 65.384
3 1.248 6→2 65.383
4 15.918 3→7 0.001
5 15.918 7 Print 65.384
6→2 15.894 b Finds the square root of A.
3 0.024
Exercise 1B
4 15.906
1 a a b c d d , 0? d=0 x
5 15.906
4 −12 9 0 No Yes 1.5
6→2 15.906
Equal roots are 1.5
3→7 0
b a b c d d , 0? d = 0? x1 x2
7 r = 15.906
−6 13 5 289 No No − _1 _
5
8 Stop 3 2
275
c 2 Ch St Br Bu Cr Ev Yo
a b c d d,0
Ch Br Bu Cr Ev St Yo
3 −8 11 −68 Yes Br Bu Ch Cr Ev St Yo
Br Bu Ch Cr Ev St Yo
No real roots
Bridlington, Burton, Chester, Cranleigh, Evesham,
2 a i Output is 21 ii Output is 5 Stafford, York
b It will find the largest number in the list.
3 a 1
c Box 6 − changed to ‘Is n , 8?’
b One pass is sufficient if the items are already in
3 a 1.8041 (4 d.p.)
ascending order.
b 1.8041 (4 d.p.)
c n
The sequence produced in part b is initially quite d n passes are needed if the smallest item is at the
different to the sequence produced in part a but end of the list.
both sequences converge to the same root.
4 a i 13 ii 17 iii 15 4 a Move through the list comparing each pair of
b The algorithm finds the highest common factor of numbers. If the first number of a pair is greater
the two input values. than or equal to the second, make no change. If the
first number of a pair is less than the second, swap
5 a A B A , B? Output them.
18 7 No b 63 57 55 48 48 72 49 61 39 32
63 57 55 48 72 49 61 48 39 32
11 7 No 63 57 55 72 49 61 48 48 39 32
4 7 Yes 4 63 57 72 55 61 49 48 48 39 32
63 72 57 61 55 49 48 48 39 32
b Calculates remainder when A is divided by B. 72 63 61 57 55 49 48 48 39 32
c 0 72 63 61 57 55 49 48 48 39 32
Exercise 1C Exercise 1D
1 i
a 16 15 23 18 25 11 19 34 1 a 2 3 4 5 6 7 8
15 16 18 23 11 19 25 34 b 8 7 6 5 4 3 2
15 16 18 11 19 23 25 34 2 a 7 11 14 17 18 20 22 25 29 30
15 16 11 18 19 23 25 34 b 30 29 25 22 20 18 17 14 11 7
15 11 16 18 19 23 25 34 3 a C E H J K L M N P R S
11 15 16 18 19 23 25 34 b C E H J K L M N P R S
11 15 16 18 19 23 25 34 4 a Amy 93 Greg 91 Janelle 89 Sophie 77
Dom 77 Lucy 57 Alison 56 Annie 51
b 23 16 34 18 25 15 19 11
Harry 49 Josh 37 Alex 33 Sam 29
23 34 18 25 16 19 15 11 Myles 19 Hugo 9
34 23 25 18 19 16 15 11 b 93 91 89 77 77 57 56 51 49 37 33 29 19 9
34 25 23 19 18 16 15 11 n(n − 1)
34 25 23 19 18 16 15 11 5 a (n − 1) + (n − 2) + … 3 + 2 + 1 = ________
2
ii a E N T O R K S W b The bubble sort would be quicker, for example, if
ENORKSTW the items are to be put in increasing order and if
the only item out of place is the largest.
ENOKRSTW
c i Bubble sort. Only the 7 is out of place and it will
ENKORSTW be moved to its final position in the first pass.
EKNORSTW A second pass is still needed to complete the
EKNORSTW bubble sort. A total of 11 comparisons is needed
b N T W O R K S E for the bubble sort and 14 are needed for the
TWORNSKE quick sort.
ii Quick sort. This is the worst case for the bubble
WTROSNKE
sort. The 1 is at the wrong end of the list and
WTRSONKE only moves one place with each pass.
WTSRONKE
6 a There are 9 names in the list. The 5th name (Mellor)
WTSRONKE is taken as the pivot. Starting at the beginning of
iii a A5 D2 A1 B4 C7 C2 B3 D3 the list, each name is compared with Mellor and
A5 A1 B4 C7 C2 B3 D2 D3 placed on the appropriate side to produce two sub
A1 A5 B4 C2 B3 C7 D2 D3 lists. The process is repeated for each sub-list with
pivot of G on the left and Mi on the right.
A1 A5 B4 B3 C2 C7 D2 D3
A1 A5 B3 B4 C2 C7 D2 D3 b H S F G Me C Mi W A (M is the pivot)
A1 A5 B3 B4 C2 C7 D2 D3 H F G C A Me S Mi W (1st pass)
b D3 D2 A5 B4 C7 C2 B3 A1 F C A G H Me Mi S W (2nd pass)
D3 D2 B4 C7 C2 B3 A5 A1
D3 D2 C7 C2 B4 B3 A5 A1 Challenge
D3 D2 C7 C2 B4 B3 A5 A1 a Answers will vary.
b Put the Ace of Hearts at the end.
n
Exercise 1E comparisons for n items is ∑ (k − 1) = __21 n(n − 1)
k=1
1 a 5 bins which is a quadratic expression.
b i Bin 1: 18 + 4 + 23 + 3
b 0.72 × (_____ ) = 173 seconds (3 s.f.)
2
6200
Bin 2: 8 + 27
400
Bin 3: 19 + 26
c The exact run-time will depend on the specific
Bin 4: 30
lengths of pipe.
Bin 5: 35
3 a If the size of the problem is multiplied by k, then
Bin 6: 32
the algorithm will take approximately k2 times as
ii Bin 1: 35 + 8 + 4 + 3
long to run.
Bin 2: 32 + 18
b 0.028 × (____ ) = 0.028 × 100 = 2.8 seconds
2
Bin 3: 30 + 19 500
Bin 4: 27 + 23 50
4 If the runtime of bubble sort is an2 + bn + c and the
}
Bin 5: 26
iii Bin 1: 32 + 18 runtime of first-fit bin-packing is pn2 + qn + r then the
Bin 2: 27 + 23 full bins combined runtime will be (an2 + bn + c) + (pn2 + qn + r)
Bin 3: 35 + 8 + 4 + 3 = (a + p)n2 + (b + q)n + (c + r) which is a quadratic
Bin 4: 19 + 26 expression, so the combined process has quadratic (n2)
Bin 5: 30 order.
2 a Bin 1: A(30) + B(30) + C(30) + D(45) + E(45) 5 n4: The bubble sort (n2) is applied to a list of n2 items.
Bin 2: F(60) + G(60) + H(60)
Bin 3: I(60) + J(75) Mixed exercise 1
Bin 4: K(90) 1 15 2 27 16 1 38
Bin 5: L(120) 2 15 16 1 27 38
Bin 6: M(120) 2 15 1 16 27 38
b Bin 1: M(120) + I(60) 2 1 15 16 27 38
Bin 2: L(120) + H(60) 1 2 15 16 27 38
Bin 3: K(90) + J(75)
Bin 4: G(60) + F(60) + E(45) 2 a 42 31 25 26 41 22
Bin 5: D(45) + C(30) + B(30) + A(30) 42 31 26 41 25 22
c Lower bound 5 so b optimal. 42 31 41 26 25 22
d Bin 1: M(120) ⎫ 42 41 31 26 25 22
Bin 2: L(120) ⎪ b 15
Bin 3: A(30) + K(90) ⎪
Bin 4: F(60) + G(60) ⎪
⎬ full bins
3
Bin 5: H(60) + I(60) ⎪ 8 4 13 2 17 9 15
Bin 6: J(75) + E(45) ⎭
2 8 4 13 17 9 15
Bin 7: B(30) + C(30) + D(45)
3 a e.g. First-fit does not rely on observation. 2 8 4 13 9 15 17
b 4 2 8 4 9 13 15 17
c Bin 1: A, B, C, D; Bin 2: E, I, J; Bin 3: F, G, H
Each of the three lanes is full, so solution is optimal. 2 4 8 9 13 15 17
4 a 4 rolls
2 4 8 9 13 15 17
b 5 rolls, 15 m wasted
c Doesn’t always give an optimal solution
4 a
d e.g. Bin 1: A, C, L; Bin 2: B, D, E, F; Bin 3: G, H, I, 111 103 77 81 98 68 82 115 93
Bin 4: J, K 111 103 115 98 77 81 68 82 93
No carpet is wasted.
5 a Bin 1: H(25) + A(8) 111 115 103 98 77 81 82 93 68
Bin 2: G(25) 115 111 103 98 93 82 77 81 68
Bin 3: F(24) + B(16)
Bin 4: E(22) + C(17) 115 111 103 98 93 82 81 77 68
Bin 5: D(21) b i Bin 1: 115 + 82
b Lower bound is 4. Bin 2: 111 + 81
c There are 5 programs over 20 MB. It is not possible Bin 3: 103 + 93
for any two of these to share a bin. So at least 5 Bin 4: 98 + 77
bins will be needed, so 4 will be insufficient. Bin 5: 68
ii No room in bin 1 (3 left) or bin 2 (8 left) or bin 3
Exercise 1F (4 left) but room in bin 4.
1 a 1.12 seconds b 5.19 seconds 5 a Rank the times in descending order and use them
2 a To pack the kth item requires at most k − 1 in this order. Number the bins, starting with bin 1
comparisons (if every item placed so far is in a each time.
separate bin). Hence the total number of
277
b Bin 1: 100 2
Bin 2: 92
Bin 3: 84 + 30
Bin 4: 75 + 42
Bin 5: 60 + 52
unused tape: 65 minutes
c There is room on tape 2 for one of the 25-minute G W E
programmes but no room on any tape for the
second programme.
Exercise 2A
6 a The two 1.2 m lengths cannot be ‘made up’ to 1 a i a student ii that a pair of students are friends
2 m bins since there are only 3 × 0.4 m lengths. Two b Becky, Dhevan, Esme
of these can be used to make a full bin, c e.g. Alex and Chris, Esme and Fred
1.2 + 0.4 + 0.4, but the second 1.2 m cannot be 2 a A B C D E F
made up to 2 m since there is only one remaining
0.4 m length.
b Bin 1: 1.6 + 0.6
Bin 2: 1.4 + 1
Bin 3: 1.2 + 1.2
Bin 4: 1 + 1 + 0.4
Bin 5: 0.6 + 0.6 + 0.6 + 0.4
Bin 6: 0.4
c Bin 1: 1.6 + 0.4 + 0.4 Maths Physics Chemistry Biology Art English
Bin 2: 1.4 + 1 b Maths and art
Bin 3: 1.2 + 1.2 3 a i Marylebone, Oxford Circus, Victoria
Bin 4: 1 + 1 + 0.4 ii Marylebone, Baker St, Green Park, Victoria
Bin 5: 0.6 + 0.6 + 0.6 + 0.6 b i 11 min
7 a Output 4.8 ii 12 min 40 sec
b It selects the number nearest to 5. iii 7 min
c It would select the number furthest from 5. c e.g. It will take longer to change at some stations
8 a 1st pass: 2.0 1.3 1.6 0.3 1.3 0.3 0.2 2.0 0.5 0.1 than others.
2nd pass: 2.0 1.6 1.3 1.3 0.3 0.3 2.0 0.5 0.2 0.1 4 a 40 min
3rd pass: 2.0 1.6 1.3 1.3 0.3 2.0 0.5 0.3 0.2 0.1 b Aberdeen/Cork
4th pass: 2.0 1.6 1.3 1.3 2.0 0.5 0.3 0.3 0.2 0.1 c Dublin − it is the airport with the most connections
5th pass: 2.0 1.6 1.3 2.0 1.3 0.5 0.3 0.3 0.2 0.1
6th pass: 2.0 1.6 2.0 1.3 1.3 0.5 0.3 0.3 0.2 0.1 5 a PTV
7th pass: 2.0 2.0 1.6 1.3 1.3 0.5 0.3 0.3 0.2 0.1 b Not correct. PTQRSV is 25 km
8th pass: 2.0 2.0 1.6 1.3 1.3 0.5 0.3 0.3 0.2 0.1 Challenge
b Bin 1: 2.0; Bin 2: 2.0; Bin 3: 1.6 + 0.3 + 0.1 a 6 routes b 18 routes
Bin 4: 1.3 + 0.5 + 0.2; Bin 5: 1.3 + 0.3
5 lengths of pipe needed Exercise 2B
c Yes: Total length required is 9.6 m, so lower bound 1 a For example
is 4.8, rounded up to 5 lengths of pipe.
9 a M V C A D B K S
C A B D M V K S
A C B D K M V S
b
A B C D K M S V
A B C D K M S V
1000 log 1000 1000 × 3
b 0.3 × _____________
= 0.3 × _________
= 4.5 seconds
100 log 100 100 × 2
Challenge c
a i 0.977 seconds ii 5191 seconds
b 192
c e.g. If it checks small potential factors first, all even
numbers will be factorised very quickly compared to a
number which is a product of two large prime factors.
2 a is not simple. There are two edges connecting C
with D.
CHAPTER 2 b and c are simple.
Prior knowledge 2 d is not simple. There is a loop attached to U.
1 If a = b + c, then ABC would be on a straight line, and if 3 a and c are connected.
a . b + c, then sides b and c would not have sufficient b is not connected, there is no path from J to G, for
combined length to meet at a single point A. example.
d is not connected, there is no path from W to Z, for
example.
iii A B
Exercise 2C
1 a and b are trees.
C D c is not a tree, it is not a connected graph.
d is not a tree, it contains a cycle.
e Sum of degrees = 3 + 3 + 3 + 2 + 3 + 2 = 16 2 i
number of edges = 8
sum of degrees = 2 × number of edges for this graph
5
Vertex J K L M N P Q R S
ii
Degree 1 2 3 1 1 4 2 1 1
Here are some possible subgraphs (there are many
others).
i L P ii Q iii
S
P iv
R
L
iii J S
Sum of degrees = 1 + 2 + 3 + 1 + 1 + 4 + 2 + 1 + 1 = 16 v
number of edges = 8
sum of degrees = 2 × number of edges for this graph
6 a For example
vi
vii
4 vertices of degree 2
b For example
viii
279
x b A B
xi
C
D
3 BCEF c A B
4 A, C
5 a i A connected graph with no cycles
ii A subgraph which includes all vertices and is a
tree
b The graph is not connected.
6 a
D C
d A B
Challenge D C
3 a A
23 21
E B
20
23
22
17
41
D 18 C
b A B
8 11
9
F
15 17 13 C
8
Exercise 2D E 10 D
1 A B C D E F G 4 A B C D E F
A 0 1 1 0 2 0 0
A — 14 11 — — —
B 1 2 1 0 0 0 0
C 1 1 0 2 0 1 0 B — — 10 13 11 —
D 0 0 2 0 0 1 1 C — — — 12 — —
E 2 0 0 0 0 1 0 D — — — — — 10
F 0 0 1 1 1 0 1 E — — — — — 7
G 0 0 0 1 0 1 0
F — — — — 9 —
2 a A B
5 a A B
C
C
E D
E D
b E
E D
P R
Exercise 2E
1 a Starting with ABC leaves no return path to A to
complete the cycle.
b ABEDFCA or ABEFDCA U S
c e.g.
B
T
b The connections can be made without crossing any
A E wires.
c Q
C D
P R
F
BC (I), BF, CD, EF,
BC (I), BF (I), CD (O), EF T U
BC (I), BF (I), CD (O), EF (I)
Graph is planar.
B S
PR (I), PU, PS, QU, RS, RT, UT
PR (I), PU, PS, QU (O), RS (I), RT (I), UT
A E RT and RS must be in the same set, and hence PS
and TU must be in the same set, but they cross, so
graph is non-planar.
C D
4 A B C
F H C B
E
D C Fix edge AE and try to take edges BW and CG outside
E the cycle so that they don’t cross. This is impossible.
AE (I), GF, GD
A
GF and GD cross so graph is non-planar.
G
W
G
A B C
B
E
F H
Repeat, fixing edges BW and CG, which will also result
in edges crossing. Therefore conclude that the graph is
D C not planar.
E
Challenge
There are still two edges crossing inside the a The graph has no Hamiltonian cycle.
polygon. Neither can be removed without crossing
b Take edges AC and EC outside. No edges cross.
the edge that is already outside.
281
Mixed exercise 2 7 a 3
1 11 B b i e.g. BEAD ii e.g. ACEA
A c i e.g.
A
9 E B
15
D C
16
D C
8 A
ii e.g.
2 a, e and h are isomorphic.
b and i are isomorphic.
c and g are isomorphic. B
d and f are isomorphic.
3 a
C
8 a The sum of the degrees of the vertices must be
even. However, 3 + 1 + 2 = 7 is odd, so there is no
4-vertex graph whose vertices have these degrees.
b 5
9 a AGBECFDHA
b i b G
A B
E
H
ii
D C
F
BH (I), GC, DE
BH (I), GC (O), DE
BH (I), GC (O), DE (I)
Graph is planar.
iii G
A B
H E
4 a A distance matrix gives the weights of edges
between pairs of vertices, whereas an adjacency
matrix gives the number of edges between pairs of
D C
vertices.
b F
A B C D E F
10 a e.g. ACEBFDA
A — 20 18 16 — — b Drawing the graph inside a hexagon gives
B 20 — 15 — — 50 A
C 18 15 — 10 20 30
D C
D 16 — 10 — 23 —
E — — 20 23 — 25
F — 50 30 — 25 — F E
c e.g. B
F B
20 30
DC (I), AF, CF, CB, DE, DB
18 DC (I), AF (O), CF, CB, DE, DB
A 20
C DC (I), AF (O), CF, CB, DE (I), DB (I)
16 E DC (I), AF (O), CF (O), CB (O), DE (I), DB (I)
Graph is planar.
D
Weight = 104
5 v−1
6 PQR, PQTR, PTR, PSR
A b C
A 6
D C B 7
4
F E 2 5 D
B 3
F
G
c The graph is not planar. Working should show that
E
two arcs always cross.
BF, FG, AB, CE, BC, CD;
weight: 27weight 27
c C
Challenge 3.8
a V = 7, E = 13, R = 7; 7 + 7 − 13 = 1 A B 2.1
b 4.2 D
H E 1.4
3.8
1.7
2.3
J F
3.1
G
V = 1, E = 4, R = 4; 1 + 4 − 4 = 1 DE, EF, CD, EG, GJ, AB, GH, BH; weight 22.4
c E = R, so V + R − E = V = 1 weight: 22.4
2 a i A tree is a connected graph with no cycles.
d We will prove the following statement by induction: ii A minimum spanning tree is a tree of minimum
The relationship V + R − E = 1 holds for all connected total weight that connects all of the nodes.
planar graphs with n vertices’. Basis step: part c shows b Writing the arcs in order of their weights: YZ (15),
that this statement holds for n = 1. Induction step: VW (16), XY (17), UW (17), UX (18), WX (18),
Assume true for any planar graph with n − 1 vertices. SU (18), WZ (18), UV (19), TU (20), ST (22),
Then, given a graph G of n vertices, contract one edge TV (23)
to obtain a graph G9 of n − 1 vertices. The induction Underlined arcs are in the minimum spanning tree.
hypothesis implies that G9 satisfies the relation, and Total weight = 121
then part d implies that G also satisfies the relation. c X
S 18 U 18 17
CHAPTER 3 Y
20 17
Prior knowledge 3 15
1 a 5 W
T
b 16
A B C D E F G Z
V
A − 12 15 − − 4 9 d The minimum spanning tree is not unique. For
B 12 − 7 14 − − − example, UX can be replaced with WX.
3 a 6
C 15 7 − 9 5 11 −
D − 14 9 − 16 − − 3
1
E − − 5 16 − − 2 5
8
F 4 − 11 − − − 3 3.5
G 9 − − − 2 3 −
4 2 6
c e.g. AF (4), FG (3), GE (2), EC (5), BC (7), CD (9).
Total weight 30.
7
Exercise 3A The three shortest edges do not form a cycle.
1 a A
16
14 C B
H 12 12 E
18 D
15 11
G F
weight:
EF, BD, CD, AH, DF, AC, GH; 9898
weight
283
weight: 27 Exercise 3C
1 a Arcs in order
c C
AF (9)
A 3.8 2.1 FB (14)
AC (20)
4.2 D AE (25)
DE (26)
H E 1.4 weight = 94
1.7
3.8 b Arcs in order
2.3 RS (28)
F ST (16)
J
3.1 G SU (19)
UV (37)
weight: 22.4 weight = 100
285
b The 4th iteration route table shows that the shortest 6 a Jared : Dijkstra’s Amy : Floyd’s
route from R to S is via Q. b 1st iteration (no change)
It also shows that the shortest route from R to Q is
direct and the shortest route from Q to S is direct. A B C D E F
It follows that the shortest route from R to S is RQS. A − 15 ` ` 25 `
2
A B C D B 15 − 22 ` 8 11
A − 17 13 8 C ` 22 − 14 ` 10
B 3 − 4 6
D ` ` 14 − ` `
C 7 4 − 5
E 25 8 ` ` − 21
D 8 9 5 −
F ` 11 10 6 21 −
3 J K L M
A B C D E F
J − 6 11 4
A A B C D E F
K 6 − 9 10
B A B C D E F
L 11 9 − 7
C A B C D E F
M 4 8 7 −
D A B C D E F
4 a The distance table is not symmetrical about the
E A B C D E F
leading diagonal.
b x = 6, y = 6, z = 23 F A B C D E F
5 a The output of Floyd’s algorithm gives the shortest 2nd iteration
distance between every pair of nodes. The output of
Dijkstra’s algorithm gives the shortest distance from A B C D E F
the start node to every other. A − 15 37 ` 23 26
b i B 15 − 22 ` 8 11
A B C D E F G
C 37 22 − 14 30 10
A − 7 10 ` ` 4 11
D ` ` 14 − ` 6
B 7 − 2 5 ` ` `
E 23 8 30 ` − 19
C 10 2 − 4 3 8 `
F 26 11 10 6 19 −
D ` 5 4 − 6 ` `
E ` ` 3 6 − 7 9 A B C D E F
F 4 ` 8 ` 7 − 6 A A B B D B B
G 11 ` ` ` 9 6 − B A B C D E F
C B B C D B F
ii A B C D E F G
D A B C D E F
A − 7 10 ` ` 4 11
E B B B D E B
B 7 − 2 5 ` 11 18
F B B C D B F
C 10 2 − 4 3 8 21
7 a n2 − 3n + 2
D ` 5 4 − 6 ` `
b cubic
287
Q 12 − 15 28 Q P Q R P Exercise 4A
1 a Vertex
R ~ 15 − 10 R P Q R S A B C D E F
Degree 2 3 2 3 3 3
S 16 20 10 − S P Q R S
There are 4 nodes with odd degree so the graph is
2nd iteration neither Eulerian nor semi-Eulerian.
P Q R S P Q R S b Vertex G H I J K
P − 12 27 16 P P Q Q S Degree 3 4 3 2 4
Q 12 − 15 28 Q P Q R P
There are precisely 2 nodes of odd degree (G and I ) so
R 27 15 − 10 R Q Q R S the graph is semi-Eulerian.
S 16 20 10 − S P Q R S A possible route starting at G and finishing at I is:
G − H − K − I − J − K − G − H − I.
3rd iteration
c Vertex
P Q R S P Q R S L M N P Q R
P − 12 27 16 P P Q Q S Degree 2 4 2 4 2 4
Q 12 − 15 25 Q P Q R R All vertices have even degree, so the graph is Eulerian.
A possible route starting and finishing at L is:
R 27 15 − 10 R Q Q R S
L − M − N − P − M − R − P − Q − R − L.
S 16 20 10 − S P Q R S 2 a i Vertex A B C D E F G H
4th iteration
Degree 4 2 4 2 2 4 2 2
P Q R S P Q R S
ii Vertex
P − 12 26 16 P P Q S S A B C D E F G
Q 12 − 15 25 Q P Q R R Degree 4 4 2 4 2 4 4
R 26 15 − 10 R S Q R S b i A possible route is:
S 16 20 10 − S P Q R S A − B − C − A − F − C − E − G − H − F − D − A.
ii A possible route is:
b From route table: shortest distance from R to P is A 2 C 2 F 2 A 2 B 2 E 2 G 2 B 2 D 2 G 2 F 2 D 2 A.
via S.
3 a i Vertex
Shortest distance from R to S is direct. R S T U V W
Shortest distance from S to P is direct. Degree 2 2 3 3 2 2
So shortest route from R to P is RSP.
11 a Prim’s algorithm or Kruskal’s algorithm. Precisely 2 vertices of odd valency (T and U) so
b 20 miles semi-Eulerian.
c Dijkstra’s algorithm ii Vertex H I J K L M N
d Shortest distance = 11 miles
Route: ADEFG Degree 2 4 3 2 3 4 4
e Floyd’s algorithm Precisely two nodes of odd degree (J and L) so
Challenge semi-Eulerian.
For a network of n vertices, after the rth vertex has been b i A possible route starting of T and finishing at U is:
selected you need to compare (n − r) values of min(Y ) T 2 R 2 S 2 U 2 W 2 V 2 T 2 U.
with XY, where X is the most recently selected vertex. You ii A possible route starts at J and finishes at L:
then need to choose the smallest value of min(Y ), which J 2 K 2 L 2 M 2 J 2 I 2 M 2 N 2 I 2 H 2 N 2 L.
4a There are an odd number of odd nodes. We will start at B and finish at C so these vertices
b i x=1 need to be the two vertices with odd degree. We
ii Semi-Eulerian since there are two odd nodes. need A and D to have even degree (see table).
c Numerous possible answers e.g.: We need to change the degree of node A and of
node B.
So we build a bridge from A to B.
or
Vertex A B C D
Degree with 8 bridges odd even odd even
5 a Not connected. There are no connections from A, B
or C to D or E. Degree wanted even odd odd even
b Neither. To be Eulerian or semi-Eulerian the graph d A
must be connected.
c A B E
D C D
C
6 The graph is Eulerian since all of the nodes are even.
7 a n must be odd.
b
B 10th bridge
8 The example given in the question 1a is a
counterexample. ABEFCDA is a Hamiltonian cycle, but All vertices now need to have even degree.
the graph is not Eulerian. This means we need to change the degrees of nodes
B and C.
Challenge So the 10th bridge needs to be built from B to C.
1 a A
Vertex A B C D
Degree with 9 bridges even odd odd even
C D
Degree wanted even even even even
B
Exercise 4B
Vertex A B C D 1 a All degrees are even, so the network is traversable
and can return to its start.
Degree 3 3 5 3
A
There are more than two odd nodes, so the graph is
not traversable. F
b A
B
G
E C
C D
D
8th bridge A possible route is:
B A 2 B 2 C 2 D 2 B 2 G 2 D 2 E 2 G 2 A 2 E 2 F 2 A.
We will start at A and finish at C so these still need to length of route = weight of network
have odd degree. We can only have two odd degrees = 285
so B and D must have even degrees (see table). b The degrees of D and E are odd; the rest are even.
We need to change the degree of B and of D. So we We must repeat the shortest path between D and E,
build a bridge from B to D. which is the direct path DE.
Vertex A B C D We add this extra arc to the diagram.
A B C
Degree with 7 bridges odd odd odd odd
Degree wanted odd even odd even
c A
E D
C D A possible route is:
A 2 B 2 C 2 D 2 E 2 D 2 B 2 E 2 A.
9th bridge length of route = weight of network + arc DE
= 61 + 11
B = 72
289
c The degrees of B and E are odd; the rest are even. The length of the shortest route
We must repeat the shortest path from B to E. = weight of network + 202
By inspection this is BCE, length 260. = 938 + 202
We add these extra arcs to the diagram. = 1140
B C Adding CG and DE to the diagram gives:
A
B
A D
F
F
C
E
G G
A possible route is:
A 2 B 2 C 2 D 2 E 2 C 2 B 2 F 2 C 2 E 2 F 2 G 2 A.
D
length of route = weight of network + BCE
= 1055 + 260 E
= 1315
A possible route is:
d The degrees of B and G are odd; the rest are even.
A2B2C2G2D2C2G2E2D2E2F2G
We must repeat the shortest path from B to G.
2 B 2 F 2 A.
By inspection this is BDHG, length 183.
We add these arcs to the diagram. 3 a The odd nodes are B, D, G and I.
The minimum path lengths for each pairing are:
A B
BD + GI = 22 + 30 = 52
BG + DI = 37 + 42 = 79
E BI + DG = 32 + 18 = 50
C The arcs to be traversed twice are BI and DG.
D
Adding BI and DG to the diagram gives:
F A
I
B
G H E
H
A possible route is:
A2B2E2F2D2B2D2A2G2H2F2H
2 D 2 H 2 G 2 C 2 A. C
length of route = weight of network + BDHG G
= 995 + 183 D
= 1178
2 a Odd degrees at B, D, E and F.
Considering all possible pairings and their weights.
BD + EF = 130 + 85 = 215 ← least weight F
BE + DF = 110 + 178 = 288 A possible route is
BF + DE = 125 + 93 = 218 A2B2C2D2B2I2E2B2I2G2D2F2
We need to repeat arcs BD and EF. G 2 E 2 D 2 G 2 H 2 I 2 A.
The length of the shortest route
b Minimum time required = 326 + 50 = 376 ms
= weight of network + 215
= 908 + 215 4 a Odd degrees at B, D, E and F.
= 1123 Considering all possible pairings and their weight
Adding BD and EF to the diagram gives: BD + EF = 250 + 200 = 450 ← least weight
A B C BE + DF = 350 + 380 = 730
BF + DE = 300 + 180 = 480
We need to repeat arcs BD and EF.
Adding these to the diagram gives:
A B
F E D F C
A possible route is:
A 2 B 2 C 2 D 2 B 2 E 2 D 2 B 2 F 2 E 2 F 2 A.
b Odd degrees at C, D, E and G
E D
Considering all possible pairings and their weights
CD + EG = 130 + 75 = 205 A possible route is:
CE + DG = 157 + 92 = 249 A 2 B 2 C 2 D 2 B 2 D 2 E 2 F 2 B 2 E 2 F 2 A.
CG + DE = 82 + 120 = 202 ← least weight length = 1910 + 450 = 2360 m.
We need to repeat arcs CG and DE.
b We will still have two odd valencies. c Using the answer to part b, the minimum pairing is
We need to select the pair that gives the least path. found by using the path found in part a. The pipes
From part a our six choices are to be traversed twice are PQ, WV, UT and TS.
BD (250), EF (200), BE (350), DF (380), BF (300) and Length of route = 853 + 48 + 35 + 22 + 31 = 989 m
DE (180).
The shortest is DE (180) so we choose to repeat this.
Mixed exercise 4
It is the other two vertices (B and F) that will be our
1 a Eulerian − all nodes even
start and finish.
b Neither − more than 2 odd nodes
For example, start at B, finish at F
length of route = 1910 + 180 = 2090 m 2 e.g.
5 a Each arc must be traversed twice, whereas in the
standard problem each arc need only be visited once.
This has the same effect as doubling up all the edges Any not connected graph with 6 even nodes
The length of the route = 2 × weight of network 3 a x=3
= 2 × 89 = 178 km b The orders of the vertices are 29, 21, 17 and 3
b Odd nodes are C, D, E, G. The graph is neither Eulerian not semi-Eulerian
Considering all possible pairings. since it has more than 2 odd vertices.
CD + EG = 13 + 5 = 18 4 a
CE + DG = 15 + 3 = 18 Vertex A B C D E F G H I J
CG + DE = 10 + 7 = 17 ← least weight
We need to repeat arcs CG and DE. Degree 2 2 2 5 4 3 2 3 3 4
Length of route = 89 + 17 = 106 km b DF + HI = 19 + 36 = 55
c As EG can be omitted the valencies of E and G DH + FI = 22 + 27 = 49 ← least weight
become even, therefore the only odd nodes are C DI + HF = 46 + 41 = 87
and D. Shortest route from C to D is 13. Repeat DH and FI
Length of route = 84 + 13 = 97 km Add these to the network to get
F
Exercise 4C
1 There are 6 odd nodes B, C, D, E, G and H.
B and G remain as odd nodes. B I
The minimum path lengths for the pairings are:
CD + EH = 3 + 14 = 17
CE + DH = 4 + 13 = 17 D
CH + DE = 10 + 1 = 11 ← least weight
A H
The edges that must be traversed twice are CH and DE.
Length of route = 96 + 11 = 107 km
2 a There are 6 odd nodes B, C, D, E, F and G. G J
Starting at C so always remains odd
Case (i): Finishing at E
The pairings are: C
BD + FG = 21 + 7 = 28 E
BF + DG = 16 + 19 = 35
A possible route is
BG + DF = 9 + 12 = 21 ← least weight
A−B−F−I−J−G−E−J−H−D−F−I−H−D
Case (ii): Finishing at G
− C − E − D − A.
The pairings are:
c Length = 725 + 49 = 774
BD + EF = 21 + 8 = 29
BE + DF = 24 + 12 = 36 5 a The odd vertices are Q, R, T and V.
BF + DE = 16 + 11 = 27 QR + TV = 104 + 189 = 293
The edges that must be traversed twice are BG QT + RV = 171 + 115 = 286
and DF. QV + RT = 163 + 123 = 286
b The length of the route is 106 + 21 = 127 km The postman can either repeat QT and RV or QV
c Case (i): Finishing at E FG = 7 and RT.
Case (ii): Finishing at G EF = 8 b The total length of the route is 1890 + 286 = 2176 m
Total length of minimum route is c Only QV now needs to be repeated.
106 + 7 + BD = 127 + __ 12 BD Total length = 1890 − 123 + 163 = 1930 m
D = 127 − 113 = 14 ⇒ BD = 28
__12 B The route is now 246 m shorter.
3 a AG, GB, CD 6 a 15 m. The route is GFD.
b 630 + 2220 = 2850 m b The odd vertices are G, B, C and D.
c 570 + 2160 = 2730 m GB + CD = 16 + 3 = 19 ← least weight
GC + BD = 18 + 10 = 28
4 a PQWVRUTS, 286 m
GD + BC = 15 + 7 = 22
b Since the path represents the shortest route from
GA, AB and CD should be traversed twice.
P to S, passing through every other vertex along
Total length = 118 + 19 = 137 m
the way, the shortest route between any pair of
c x + 10 = 19, so x = 9
vertices must be contained within it. In particular,
the shortest route between any pair of odd vertices
must be contained within it.
291
7 a Vertex A
A B C D E F G H I C
B
Degree 2 3 4 3 4 2 6 3 3
Odd valencies at B, D, H and I. D
I
b Considering all possible complete
pairings and their weight E
BD + HI = 7.2 + 3.4 = 10.6
BH + DI = 7.6 + 4 = 11.6
BI + DH = 5.6 + 4.3 = 9.9 ← least weight H
CHAPTER 5 b A B C D E
Prior knowledge 5 A − 5 12 7 9
1 a B 5 − 7 2 4
A B C D E F G
C 12 7 − 5 7
A − 22 − − 15 − 8
B 22 − 18 − − − 21 D 7 2 5 − 2
C − 18 − 30 − 11 − E 9 4 7 2 −
D − − 30 − 19 − − AC − the shortest route is ABDC length 12
E 15 − − 19 − 15 − AE − the shortest route is ABDE length 9
BC − the shortest route is BDC length 7
F − − 11 − 15 − 25
BE − the shortest route is BDE length 4
G 8 21 − − − 25 − CE − the shortest route is CDE length 7
b i Using the matrix form of Prim’s algorithm: c A B C D E F
1 6 5 7 3 4 2
A − 10 18 13 15 18
A B C D E F G
B 10 − 8 3 5 8
A − 22 − − 15 − 8
C 18 8 − 5 3 10
B 22 − 18 − − − 21
D 13 3 5 − 2 5
C − 18 − 30 − 11 −
D − − 30 − 19 − − E 15 5 3 2 − 7
E 15 − − 19 − 15 − F 18 8 10 5 7 −
F − − 11 − 15 − 25 AC − the shortest route is ABDEC length 18
G 8 21 − − − 25 − AF − the shortest route is ABDF length 18
BC − the shortest route is BDEC length 8
B BE − the shortest route is BDE length 5
A
8 BF − the shortest route is BDF length 8
CD − the shortest route is CED length 5
G 18 CF − the shortest route is CEDF length 10
15
EF − the shortest route is EDF length 7
15
F d A B C D E F G
11 C
E
19 D A − 10 9 10 17 20 20
B 10 − 3 20 11 10 20
ii Using Kruskal’s algorithm:
8 AG C 9 3 − 19 8 13 23
11 CF D 10 20 19 − 27 20 10
15 AE and EF
18 BC E 17 11 8 27 − 8 18
19 DE F 20 10 13 20 8 − 10
B G 20 20 23 10 18 10 −
A
8 AC − the shortest route is ABF length 20
AG − the shortest route is ADG length 20
G 18
15 BE − the shortest route is BCE length 11
CF − the shortest rotue is CBF length 13
15
F CG − the shortest route is CBFG length 23
11
E C DE − the shortest route is DACE length 27
19
D 2a In the classical problem, each vertex must be visited
exactly once. In the practical problem, each vertex
Exercise 5A must be visited at least once.
1 a b i ABECEDEBA (20)
A B C D E ii ABCDEA (26)
A − 7 10 9 5
3 a PQRTSUQP (39)
B 7 − 3 11 12 b Consider removing the arcs RS and TU, since they
C 10 3 − 8 12 have the greatest weight. Also disregard PQ for the
D 9 11 8 − 4 moment − it must be included (twice) in order to
access P. All vertices are then even which makes
E 5 12 12 4 − the remaining network Eulerian. The minimum
AC − the shortest route is ABC length 10 length route is then made up of the length of the
AD − the shortest route is AED length 9 Eulerian circuit plus 2 × PQ. This will be the same
BD − the shortest route is BCD length 11 regardless of the starting point.
BE − the shortest route is BAE length 12 c Every route must visit Q twice.
293
Z b A3E5D7B17C13 A = 45
Initial upper bound = 230 c AEDBDCA (BC is not on the original network)
d 0.85 × (___
) = 11.75 seconds
b For example use VS 12 3
c Route SWYXZVS length 190 5
295
b BD, {
}, BC, reject CD, DE; length 18 km
b 4 c 5 AC
8 a A Hamiltonian cycle is a cycle that includes every DF
vertex. A B
b ABDCFGEA
c A B BG(I), BF, BC, AF, EF 3 4
BG(I), BF, BC, AF(O),
F C
D EF(O) 3 2
BG(I), BF(I), BC, D
E
AF(O), EF(O) 6
C E
BG(I), BF(I), BC(I),
c DB, DF, BC, CA, DE
G F AF(O), EF(O)
12 a In Prim’s algorithm, the starting point can be any
B Graph is planar. node, whereas Kruskal’s algorithm starts from the
A arc of least weight.
D In Prim’s algorithm, each new node and arc is
added to the existing tree as it builds, whereas in
applying Kruskal’s algorithm, the arcs are selected
E C according to their weight and may not be connected
until the end.
G F b i GH, GI, HF, FD, DA, AB, AC, DE
ii GH, AB, AC, AD, reject BD, DF, GI, reject BC, FH,
reject DG, DE
d B BG(I), BF, BC, AF,
c weight is 76
A
EF, ED 13 a Route: S − A − C − G − T, length: 82
D ED and EF cross so
C 6 54
graph is non-planar. 20
E 54
A 3 34 16
C 11
34
34 D 5 45 26 G 9 70
G F
S 1 0 46 45 76 71 70 12
9 a GC, FD, GF, reject CD, ED, reject EF, BC, AG, reject AB.
0 24 33 T 10 82
b A 54 G 30 F 25 D 35 E E 4 43 84 82
22 43
20 50 B 2 22 25
21 18
C B 22 H 8 66
34 F 7 56 68 66
cost = (20 + 25 + 30 + 35 + 50 + 54) × £1000 10
56
= £214 000
297
21 P 200 Q 24 a A B C D E F
75 A 0 20 30 32 12 15
165 110
U 126 95 R 136 B 20 0 10 25 32 16
V 223 S C 30 10 0 15 35 19
338 645
147 D 32 25 15 0 20 34
T
E 12 32 35 20 0 16
Total length = 2260 m
Odd nodes P, Q, S, T, U, V F 15 16 19 34 16 0
T and P remain odd.
QS + UV = 246 + 126 = 372 ← least weight b 101 km tour AEFBCDA
QU + SV = 275 + 223 = 498 c In the original network AD is not a direct path.
QV + SU = 205 + 349 = 554 The tour becomes AEFBCDEA
QS and UV gives the shortest pairing. d e.g. BCDEAFB
}
a Roads to be traversed twice: QR, RS, UV CBFAEDC
b Shortest route is 2260 + 372 = 2632 m DCBFAED length 88
22 Odd valencies are at A, B, C, D, F, G EAFBCDE
Route starts at A and finishes at G so these can remain FAEDCBF
odd. 25 a i 714
Remaining odd vertices are B, C, D, F: ii 552 (ACBDEC )
BC + DF = 0.8 + 1.7 = 2.5 b 472
BD + CF = 1.3 + 2.3 = 3.6 c 472 , solution < 552
BF + CD = 1.5 + 0.7 = 2.2 ← least weight 26 a 45
Repeat BF and CD b i AEFCDBA − length 49
a length = 9.5 + 2.2 = 11.7 km ii Choose a tour that does not use AB
b A−B−C−A−G−B−D−C−D−E−F−B−F− e.g. DB (6), BC (10), CF (8), FE(7), EA(7)
G (14 letters in route) Complete with AD(8), DBCFEAD
c Repeating AC and BF = 2.1 Total length 46
Minimum distance = 11.6 km
27 a Order of arcs: AB, BC, CF, FD, FE
The engineer is correct. His new route is 0.1 km
shorter. A 85 B 38 C 73 F 84 D
23 a In the practical T.S.P. each vertex must be visited at
least once. 92
In the classical T.S.P. each vertex must be visited E
exactly once.
DC b i 744
b AB, DF, DE, (reject EF ) {
} , EH or
{BE }
FG ii e.g. AD saves 105 giving 639
AC or AE saves 180 giving 564
AF saves 96 giving 648
B 18 E DE saves 66 giving 678
c 498
10 14 28 a Order of arcs: AC, AD, DF, CE, EB
8
either or D F D A C E B
9 H
A (not both) F 48 54 53 58 38
18 b i 502
13 13 ii Finding a shortcut to below 360, e.g. FB leaves 351
c M.S.T. is DF, CE, EB, FB length 244
C
The 2 shortest arcs are AC (53) and AD (54) giving
G
a total of 351
c 170 km d The optimal solution is 351 and is
d e.g. when CD is part of tree A−C−E−B−F−D−A
Use GH (saving 26) and BD (saving 19) giving a new
e A C
U.B. of 125 km
Tour ABDEHGFDCA E
e.g. when BE is part of tree
Use CG (saving 40) giving a new U.B. of 130 km
Tour ABEHEDFGCA
D B
F
29 a Order of arcs: AB, AF, FG, EG, DG, CG For the three lines connecting the new points,
B if one is the original colour then a set of three
vertices is made with the original colour. If none
55
are the original colour then the three vertices
C make a set of three themselves.
A
76
65 75 63
D A A
F G
55
E iii
b 778 km
c e.g. AC as a shortcut gives ABCGDGEGFA with
length 632 km
d B 82 C
55 85
2 a G
D 70 + 2x 40 + 5x
A 165 + 5x, 265 + 2x
B 8 195 A 5 125
65 65
200 195 125
F E
60 50
e 470 km 70 30
f Route ABCDEGFA, length 482 km
C 7 135
F 6 130 E 4 95
Challenge 30 140 135 40
130 95
1 a Let G be any finite simple graph with more than
one vertex and with number of vertices = n > 2.
The maximal degree of any vertex in G is < n − 1. 90 95 70
130 140
Also, if our graph G is not connected, then the
maximal degree is < n − 1. I 2 50 D 3 80
Case 1: Assume that G is connected. We cannot 50 80
have a vertex of degree 0 in G, so the set of vertex H 1 0
50 80
degrees is a subset of S = {1, 2, … , n − 1}. Since the
graph G has n vertices and there are n − 1 possible 0
degree options, there must be two vertices of the Via A H−E−A−G length 165 + 5x
same degree in G. Via B H−E−C−B−G length 265 + 2x
Case 2: Assume that G is not connected. G has no
b 165 + 5x = 265 + 2x ⇒ x = 33 __13
vertex of degree n − 1, so the set of vertex degrees
is a subset of S9 = {0, 1, 2, … , n − 2}. Again we have So range is 0 < x < 33 __13
n vertices and n − 1 possible degree options, so 3 a 9 __12 x − 26
there must be two vertices of the same degree in G. b The only vertices of odd order are B and C, we have
b i Possible sets are: to repeat the shortest path between B and C.
Blue: ABD, ACD If x > 9 the shortest path is BC (direct)
Red: BCF, DEF Weight of network + BC = 100
( 9 2 x − 26) + x = 100 ⇒ x = 12
ii For K6 any vertex will have a valency of 5, an __
1
edge to each of the other points.
If x , 9 the shortest path is BAC of length 2x − 9
A (9 __12 x − 26) + 2x − 9 = 100 ⇒ x = 11 __
17
23
≮ 9
so inconsistent.
c x = 12
With 5 lines there must be at least three of one 4 a Minimum spanning tree = 751
colour so there are four points connected by the Initial upper bound = 2 × 751 = 1502
same colour. Taking shortcut AH saves 120 + 131 − 144 = 107
Tour length = 1395
Tour route: ABACAEHFGDGFHA
A
b Delete G and use Prim’s algorithm starting at A
RMST = 672
Lower bound by deleting G = 672 + 144 + 155 = 971
Route is not a tour, so does not give an optimal
solution.
299
CHAPTER 6
Prior knowledge 6
1 y . 2, x + y < 7, y < x + 1
2 y
5
4
3
2
1
O 1 2 3 4 5 6 x
Exercise 6A
1 Number of boxes of gold assortment = x Number of boxes of silver assortment = y
Objective: maximise P = 80x + 60y
Constraints
• time to make chocolate, 30x + 20y < 300 × 60 which simplifies to 3x + 2y < 1800
All units now in minutes.
• time to wrap and pack 12x + 15y < 200 × 60 which simplifies to 4x + 5y < 4000
• ‘At least twice as many silver as gold’ 2x < y
• non-negativity x, y > 0
In summary: maximise P = 80x + 60y
subject to
3x + 2y < 1800
4x + 5y < 4000
2x < y
x, y > 0
2 Number of type A = x Number of type B = y
Objective: minimise C = 6x + 10y
Constraints
• Display must be at least 30 m long x + 1.5y > 30 which simplifies to 2x + 3y > 60
• ‘At least twice as many x as y’ 2y < x
• At least six type B y > 6
• non-negativity x, y > 0
In summary: minimise C = 6x + 10y
subject to:
2x + 3y > 60
2y < x
y>6
x, y > 0
3 Number of games of Cludopoly = x Number of games of Trivscrab = y
Objective: maximise P = 1.5x + 2.5y
Constraints
• First machine: 5x + 8y < 10 × 60 which simplifies to 5x + 8y < 600
All units now in minutes.
• Second machine: 8x + 4y < 10 × 60 which simplifies to 2x + y < 150
• ‘At most 3 times as many x as y’ 3y > x
• non-negativity x, y > 0
In summary: maximise P = 1.5x + 2.5y
subject to:
5x + 8y < 600
2x + y < 150
3y > x
x, y > 0
4 Number of type 1 bookcases = x Number of type 2 bookcases = y
Objective: maximise S = 40x + 60y
Constraints
• budget 150x + 250y < 3000 which simplifies to 3x + 5y < 60
• floor space 15x + 12y < 240 which simplifies to 5x + 4y < 80
• ‘At most __
13 of all bookcases to be type 2’ y < __
13 (x + y) which simplifies to 2y < x
• At least 8 type 1 x > 8
• non-negativity x, y > 0
Exercise 6B
1 a y
y=x
6
y=5
5
R
4
3
2x + 3y = 18
2
1
O 1 2 3 4 5 6 7 8 9 10 x
301
b y 3 y
x=3
8
2x = y
7 700
2x = 3y R
6
600
5
4
500
3
3x + 4y = 24
2 R y=1 400
1
x = 200
O 1 2 3 4 5 6 7 8 9 10 x 300
c y
200
20 x + y = 400
2x = y
18
100 y = 80
16
14
12 O 100 200 300 400 500 x
y = 10
10 4 Let x represent the number of type A and y represent
the number of type B.
8
R y 2y
6 x > 200, __
< x < ___
, x + y < 3000, y > 0
x + y = 20 9 3
4 y
y
2 =x
9
5x + 6y = 60 2800
2y
O 2 4 6 8 10 12 14 16 18 20 x x=
2400 3
d y
2000
8
y = 2x – 3
7 1600 R
R x + y = 3000
6
1200
5
4 800
y=3
3
400
2
x = 200
1
y = 6 – 2x O x
400 800 1200 1600 2000 2400 2800
O 1 2 3 4 5 6 7 8 x 5 a y < __
x
+ 10 y > __
x
x > 0
2 4
2 c b y
28 40
f + c = 28 x
24 y= +10
2
20 30 3x + 4y = 120
16
12 20
x
y=
8 4
R f + 2c = 36 R
4 10
2f + 3c = 60
O 4 8 12 16 20 24 28 32 36 f x + y = 20
O 10 20 30 40 50 x
Exercise 6C
1 a Need intersection of 4x + y = 1400 and 3x + 2y = 1200 Objective line passes through (200, 0) and (0, 400).
(320, 120) m = 760
b (0, 400) N = 1600 Objective line passes through (400, 0) and (100, 0).
2 a (0, 90) E = 90
b Need intersection of 6y = x and 3x + 7y = 420
(100.8, 16.8) F = 168
c Need intersection of 9x + 10y = 900 and 3x + 7y = 420 Objective line passes through (80, 0) and (0, 60).
( 63 __
7
11 11 )
, 32 __
8
G = 321 __
9
11
d Same intersection as in b (100.8, 16.8) H = 201.6 Objective line passes through (120, 0) and (0, 20).
3 a Need intersection of 3x + y = 60 and 5y = 3x
( 16 _23 , 10 )
J = 56 _23
b Need intersection of y = 4x and 9x + 5y = 450
( 15 __
15
29 29 )
, 62 __
2
K = 77 __
17
29
c Need intersection of 3x + y = 60 and y = 4x Objective line passes through (10, 0) and (0, 60).
(
8 _47 , 34 _27
) L = 85 _75
d Need intersection of 9x + 5y = 450 and 5y = 3x Objective line passes through (40, 0) and (0, 80).
(37.5, 22.5) m = 97.5
4 a C b A c B d D e C f A g B h D i C j D
5 y
x = 50 y = 3x Objective line passes through (0, 350) and (300, 0).
500 Maximum point is (200, 100). Pmax = 2000
450
400
2x + y = 500
350
300
250 7x + 6y = 2100
200
150
100 R x + 2y = 500
50 x + y = 300
6 y
Objective line passes through (0, 15) and (20, 0).
30 y = 2x
Intersection of 2x + 3y = 60 5x + 4y = 100
(8 _47 , 14 _27 ) value = 8285 _57
25
R 2y = x
20
15
10
5 2x + 3y = 60
O 5 10 15 20 25 30 35 40 x
5x + 4y = 100
303
7 a 9 a
y
y y = 10x x = 120
450
160
2x + y = 160 400
140
350 (33 13 , 333 13 )
120
300
100 R
A (40, 80) 250
80 2y – x = 100
200 R
60 x + y = 120 (120 , 160)
5
150 (5 19 , 52 12
19 )
40 (120, 110)
B (90, 30) 100
20 x + 3y = 180 50 x + 2y
2x + y = 400
O 20 40 60 80 100 120 140 160 180 200 x O
20 40 60 80 100 120 140 160 180 200 x
C2 = x + y C1 = 2x + 3y z = 5x + y
(objective for d) (objective for c) b i (120, 160) z = 760
C = 3x + 2y
(
5 __ , 52 __ 19 )
z = 78 __
5
ii 19 12 18
19
(objective for b)
c Optimal point ( 33 __ 13 ) optimal value of
13 , 333 __
b x + 2y = 700
Vertices C = 3x + 2y
(0, 160) 320 Challenge
a x=1
(40, 80) 280 y
(90, 30) 330 10
(180, 0) 540 8
x2 + y = 10
so minimum is (40, 80) value of C = 280 6
c (90, 30) C1 = 270
d C2 is parallel to x + y =120 so all points from A to B 4 R
are optimal points. 5y – 4x = 0
2
8 a y
y = 5x O x
70 1 2 3
8 4x + 3y = 24
4x + y = 60
Q = 6x + y 6
4
b i (13 __ 23 ) P = 33 __
13 , 6 __ 13 R
3x + 4y = 24
2
(34 37 , 17 37 ) Q = 221 37
ii __ 2 __ 1 __
13
O 2 4 6 8 10 x x + 5y = 10
3x + 2y
2
Solving 3x + 16y = 2400
3x + 5y = 1500
O 2 4 6 8 10 12 14 16 18 x simultaneously gives ( 363 __ 7
11 , 81 __ 9
11 )
5x + 6y = 60 Taking integer point
120 Points P = 5x + 3y
2y = x (10, 0) 50
100
(10, 30) 140
80
R
(12, 34) 162
60
Obj
40 (30, 0) 150
5x
ve
5x + 4y = 800
+2
305
3 y 5 a 5x + 8y < 600
900 2x + y < 150
y = 2x 3y > x
800 x, y > 0
700 b, c y
600 160
500 R 140 2x + y = 150
400
120
300
4x + 5y = 4000 100
200
Ob + 3
jec y
4x
100 80
tiv
e
O 60 6
200 400 600 800 1000 x (54 11 , 40 10
11 )
3x + 2y = 1800 40 R x = 3y
O 4 8 12 16 20 x
Objective line 5x + 4y = 80
40x + 60y
Using Method 1 from Example 13 shows you that 2 a 0.08x + 0.08y < 6.4 so x + y < 80
the optimal integer solution is (11, 5) giving 740 m b cost: 6x + 4.8y < 420 5x + 4y < 350
of shelving. c Display 30x < 2 × 20y 3x < 4y
Using Method 2 gives you the following solution: d y
Intersection of 3x + 5y = 60
5x + 4y = 80 giving ( 12 __ 13 )
90
4
13
, 4 __
8
5x + 4y = 350
80
Points 3x + 5y < 60 5x + 4y < 80 40x + 60y
70 3x = 4y
(12, 4) ✓ ✓ 720
(12, 5) ✗ ✓ 60
(13, 4) ✓ ✗ 50
(13, 5) ✗ ✗ R
40
Maximum value is 720 at (12, 4).
30 Objective
In this instance, the solution produced by Method 2 30x + 20y
is actually incorrect, but it requires a very particular 20
set of circumstances to create this discrepancy. It x + y = 80
is generally safe to assume that a solution found 10
using Method 2 will be correct, but do check your
graph to see whether there could be an alternative O 10 20 30 40 50 60 70 80 90 x
optimal integer solution.
e Maximum integer solution is 1950 at (43, 33) so the
Mixed exercise 6 librarian should buy 43 CD storage units and 33
1 a flour: 200x + 200y < 2800 so x + y < 14 DVD storage units.
fruit: 125x + 50y < 1000 so 5x + 2y < 40 3 a i Total number of people
b Cooking time 50x + 30y < 480 so 5x + 3y < 48 54x + 24y > 432 so 9x + 4y > 72
c y ii number of adults x + y < 12
iii number of large coaches x < 7
20
5x + 2y = 40 b y
18 x=7
18 9x + 4y = 72
16
16
14
12 14
10 12
Ob
5x + 3y = 48
3.5
jec
8
10
tive y
x+
6
x + y = 14 8
1.5
line
4
R 6
2
R x + y = 12
4
O 2 4 6 8 10 12 14 16 18 20 x
2
d P = 3.5x + 1.5y
e Maximum integer solution is £28.50 at (6, 5) so
Mr Baker should bake 6 cakes and 5 fruit loaves.
O 2 4 6 8 10 12 x
f Pmax = £28.50 Objective
84(4x + 3y)
307
For Q3 d Basic
b P + 8z + _ 45 r + _ 35 s = 11 x y z r s t Value
variable
x − 5z + _ 35 r − _ 45 s = 2 __
r 3 8
0 0 1 __14 − __78 31
y + 5z − _ 15 r + _ 35 s = 1
z __54 0 1 0 __12 − __14 46
15z − r + 2s + t = 1
y __
18 1 0 0 − __14 __3 1
c P = 11 − 8z − _ 45 r − _ 35 s, so increasing z, r or s would 8
decrease P. P __
21
0 0 0 3 __7 756
2 2
For Q4
This is an optimal solution. Examining the profit
b P + __
11
+ __
x 4 + __
12 x 12 s + u = ___
211
2 2 2 equation, increasing x, s, or t would reduce profit, so
4x2 – 3x4 + r – 2s + u = 33 this solution is optimal.
– __14 x2 + x3 + __ 4 + __
54 x 34 s – __ = __
12 u 57
4
P = 756 − __
21 x − 3s − __
72 t
2
__
11 – __
x 4 – __
34 x 54 s + t + __ = ___
12 u 109
4 2 4 e x = 0, y = 1, z = 46
x + x __
3
+ x __
1 __
1
– s + u __
1
= __ 77
1 4 2 4 4 4 2 4 Challenge
c P = ___
211
2
– __
11
– __
x
2 2
4 – __
12 x 12 s – u, so increasing x2, x4, s or k > __
85
u would decrease P.
For Q5
b P – 5x – 12y – 2t = –336
Exercise 7D
__
1 __ __
1 a Max P = 30 when x = 15, y = 0
−2 x
+ 32 y
+r– 32 t = 420
b Min C = −2 when x = __ 32
5
, y = __
14
5
, z = 0
__32 x
– __ + s – __
72 y 32 t = 84 c Max P = 24 when x = 0, y = 0, z = 12
__
1
16
+ __
x 3
16 + z + __
y 1
16 t = __
21
2
2 Applying the first stage of the two-stage simplex
c P = –366 + 5x + 12y + 2t, so increasing x, y or t method produces the following tableau after one
would decrease P. iteration.
For Q6 x1 x2 s1 s2 a1 Value
b P – 6x – 4z – r = –2
x2 __
5 1 __1 0 0 __
25
2x + y + __
12 z + __
12 r = 1 6 6 2
–6x – 2r + s = 4 a1 – __1
3
0 – __2
3
–1 1 2
–3x + __
52 z – __
32 r + t = 1 I __
1 0 __2 1 0 –2
3 3
c P = –2 + 6x + 4z + r, so increasing x, z or r would
increase P. There are no negative values in the bottom row, so the
maximum value of I is –2 ≠ 0 and there is no feasible
8 a x = 0, y = 0, z = __
32 solution.
b 3x + 4y + r + P = 3 3 a i Surplus variables represent the amount by
9 a P − x + 2y − 2z = 0 which the actual quantity exceeds the minimum
b possible value of that quantity.
x y z r s t Value ii Artificial variables are added to > constraints so
__ __ that s > 0 and a basic feasible solution can be
r 2 1
2
1 1
2
0 0 1 R1 ÷ 2 obtained.
__ b There are no negative values in the bottom row of
s −1 3 0 − __12 1 0 7 R2 − R1
2 the tableau so it is optimal, and I = 0, so there is a
t −4 __
5 0 − __3 0 1 1 R3 − 3R1 basic feasible solution.
2 2 c (Initial tableau interpreted from question)
p 3 3 0 1 0 0 2 R4 + 2R1 Basic
x y z s1 s2 s3 Value
c P = 2 when x = 0, y = 0, z = 1, r = 0, s = 7, t = 1 variable
s1 0 0 2 1 0 1 2
Exercise 7C x 1 0 __
1 0 __
−1
__
−3
__
29
2 2 2 2
1 a P = 39 when x = 13, y = 0
b P = 148 when x = 0, y = 9, z = 5 y 0 1 __
−1
2
0 __12 −1 __
11
2
2 a 2x + 3y + z < 80 P 0 0 0 0 −1 −2 13
4x + 2y + 3z < 140
3x + 4y + 2x < 96 (1st iteration)
b x > 0, y > 0, z > 0
Basic
c The most negative value in the objective row is −6, x y z s1 s2 s3 Value
variable
so the pivot is in the z column. The smallest positive
θ value is 46, which is in the s row. So the pivot s3 0 0 2 1 0 1 2
value is 2 in row s, column z __ __
x 1 0 7
2
3
2
__
−1
2
0 __
35
2
309
(2nd iteration) d
Basic Basic
x y z s1 s2 s3 Value x y z s1 s2 a1 Value
variable variable
s3 0 0 2 1 0 1 2 s1 0 __23 __13 1 __13 __
−1
3
12
x 1 1 5 __
52 0 0 25 x 1 __1
3
__2
3
0 __
−1
3
__
1
3
8
s2 0 2 3 2 1 0 15 P 0 −4 3 0 −1 (1 + M) 24
P 0 2 7 4 0 0 32 Basic
x y z s1 s2 a1 Value
P = 32 when x = 25, s2 = 15, s3 = 2, y = z = s1 = 0 variable
y 0 1 __12 __32 __12 __
−1
2
18
Exercise 7E x 1 0 __1 __
−1
__
−1
__1 2
2 2 2 2
1 a a1 ≠ 0
b The pivot is the 2 in the z column. The most P 0 0 5 6 1 M−1 96
negative value in the P row is in the z column and x = 2, y = 18, z = s1 = s2 = a1 = 0
the smallest θ value is given by __
62 .
c In the next iteration, a1 remains as a basic variable Mixed exercise 7
≠ 0 so this cannot represent a feasible solution. 1 a There are no negative numbers in the profit row.
d
b P + _ 32 x + _ 34 r = 840
x y z s1 s2 a1 Value Row operation so P = 840 − _ 32 x − _ 34 r
z __12 __12 1 __12 0 0 3 R1 ÷ 2 Increasing x or r would decrease P.
c i Maximum profit = £840
s2 __32 − __72 0 − __12 −1 1 2 R2 − R1
ii Optimum number of A = 0, B = 56 and C = 75
P 0 3(1 + M) 0 1 + M −M 0 6 − 9M R3 + R1(2 + 2M ) 2 a Maximise P = 14x + 20y + 30z
subject to: 5x + 8y + 10z + r = 25 000
2 a x + 3y + z + s1 = 100 5x + 6y + 15z + s = 36 000
3x − y + s2 = 52 where r and s are slack variables x, y, z, r, s > 0
x − s3 + a1 = 20 b b.v. x y z r s Value
b x y z s1 s2 s3 a1 Value
r 1 _23 4 0 1 − _23 1000
s1 1 3 1 1 0 0 0 100
z _1
3
_
2
5
1 0 __
1
15
2400
s2 3 −1 0 0 1 0 0 52
P −4 −8 0 0 2 72 000
a1 1 0 0 0 0 −1 1 20
P −(4 + M ) −2 1 0 0 M 0 −20M Row
b.v. x y z r s Value
c M is an arbitrarily large number. operation
d The pivot is the 3 in the x column. y __
5
1 0 _
1 − _16 250 R1 ÷ 4
12 4
3 a The constraints include a mixture of < and > signs.
b 3x − y + s1 = 110 z _
1 0 1 − __
1
__
2 2300 R2 − _ 25 R1
6 10 15
x + 2y − s2 + a1 = 45
c Minimise C = 4x + 3y P − _23 0 0 2 _23 74 000 R3 + 8R1
Maximise D = −4x − 3y − Ma1
D = −4x − 3y − M(45 − x − 2y + s2) Row
D + x(4 − M ) + y(3 − 2M ) + Ms2 = −45M b.v. x y z r s Value
operation
x y s1 s2 a1 Value x 1 2 _25 0 _
3
5
− _25 600 R1 ÷ __ 5
12
s1 3 −1 1 0 0 110 z 0 − _25 1 − _15 _51 2200 R2 − _ 16 R1
a1 1 2 0 −1 1 45 P 0 1 _53 0 2 _52 _
2 74 400 R3 + _ 23 R1
5
D (4 − M ) (3 − 2M ) 0 M 0 −45M
c i x = 600 y = 0 z = 2200
4 a x + y + z + s1 = 20 ii Profit is £744
3x + y + 2z − s2 + a1 = 24 iii The solution is optimal since there are no
b P = 3x + 5y − z − Ma1 negative numbers in the profit row.
a1 = 24 − 3x − y − 2z + s2 3 a _15 (x + y + z) > y ⇒ −x + 4y − z < 0
P − (3 + 3M)x − (5 + M)y − (2M − 1)z + Ms2 = −24M 60x + 100y + 160z < 2000 ⇒ 3x + 5y + 8z < 100
c x > 0 y > 0 z > 0
Basic b S = 2x + 4y + 6z
x y z s1 s2 a1 Value c There are three variables.
variable
d Writing inequalities as equations:
s1 1 1 1 1 0 0 20 –x + 4y – z + r = 0
a1 3 1 2 0 −1 1 24 3x + 5y + 8z + t = 100
S – 2x – 4y – 6z = 0
P −(3 + 3M) −(5 + M) −(2M − 1) 0 M 0 −24M
Enter coefficients to get initial tableau.
__ P 0 __
11
− __5 __7 0 56 R3 + 14R1
z 17
37
0 1 − __
5
37
__
4
37
10 __
30
37
R2 − _ 58 R1 2 2 2
S __
8
0 0 __
2 __
28
75 __
25
R3 + _ 14 R1 d From a zero stock situation we increase the number
37 37 37 37
of lions to 4. We are increasing the profit from 0 to
g There are no negative numbers in the objective row. £56.
h 0 small, 2 medium and 11 large tables (seating 74) 7 a 3x + 2y + s1 = 15
at a cost of £1960 2x + 5y + s1 = 20
4 a 0.05x + 0.08y < 20 ⇒ 5x + 8y < 2000 y − s3 + a1 = 2
__15 x
+ __ 2
15 < 48 ⇒ 3x + 2y < 720
y b Maximise I = −a1 = y − s3 − 2
b c
b.v. x y r s Value x y s s 1 2 s3 a1 Value
r 5 8 1 0 2000 s1 3 2 1 0 0 0 15
s 3 2 0 1 720 s2 2 5 0 1 0 0 20
P −1.5 −1.75 0 0 0 a1 0 1 0 0 −1 1 2
P 6 0 −8 6 0 600 R3 + 24R1 P −1 0 0 0 −3 6
8 a The x column contains the most negative value in
Row the P row.
b.v. x y z r s Value
operation The θ values are __ 70 = 70, ___
180 = 180, ___
150 = 75
1 1 2
y __15 1 0 __25 − _15 15 R1 ÷ __12 R2 The pivot is 1 in the x column and the a1 row.
b
z __
11
10
0 1 − __
3
10
__25 20 R2 − __52
Row
P __
74
0 0 __
18
__
16
760 R3 + 8R2 x y z s1 s2 s3 a1 Value
5 5 5 operation
311
3 D
1 3
A H
C G
0 4 6 7 8
I K L
B E J
2 5
F
4 b 1st dummy.
Activity Depends on
S depends on P only.
A — T depends on P and Q.
B A 2nd dummy.
So that S and R don’t share a start and end event.
C A
5 C
D B 1 3
A F
E C
Dummy
F E Dummy
0 4 6
G C G
H D, F B D
2 H
I G
J G E 5
K I
L J Exercise 8C
1 x is the largest of 7 + 5 = 12, 5 + 8 = 13 and 9 + 5 = 14.
Exercise 8B x = 14
1 Activity Depends on 2 w = 11, x = 16,
y = 11, z = 9
A — D(2)
9 11
B — 9 11
C A B(6)
Dummy G(5)
D A
9
E C A(3) 12
0 3
F B, C, D E(1)
0 3 H(4)
16
G B, C, D
C(4) 7 16
H E, F 11 F(4)
313
4 a 2 a a = 10 b = 19 x = 19 − 10 = 9
Activity Depends on
Total float = 3 = 15 − y − a
A — y = 15 − 3 − 10
B — y=2
b Minimum value of c = 10 + 2 = 12
C — c Maximum value of total float of R = 19 − 4 − 12 = 3
D A 3 a x = 3, y = 10, z = 17
E B b A, D, I and L
c Total float is 5 days
F C
G D
H D Exercise 8F
1
I E, F
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
J E, F
K G A C F H J
L H, I
B
M J
b 16 D
G(9)
17
4 D(3) 7 E
5 8 K(4)
A(4) H(3)
G
0 B(3) 3 14 L(7) 21
0 3 E(8) I(3) 14 21 I
11
C(6) 11
6 M(3)
F(2)
9 J(4)
15
18
c Critical path: B – E – I – L − length 21 days
Exercise 8E
1 Activity Total float
A 0
B 10 − 3 − 0 = 7
C 15 − 8 − 6 = 1
D 0
E 14 − 4 − 3 = 7
F 20 − 5 − 14 = 1
G 0
H 22 − 7 − 7 = 7
I 28 − 8 − 19 = 1
J 22 − 2 − 19 = 1
K 29 − 1 − 27 = 1
L 0
B E H M O
Exercise 8G
1 a A, E b G, H c F, H
2 a C, D b E, G
3 a 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
A C F H
315
d
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
B F H K M
A
C
D
E
G
I
J
L
e Yes, activity I can start on day 22 and the project can still be completed on time.
Exercise 8H
1 a 4
Workers
3
2
1
O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Days
b 3 workers
2 a 6
5 C F
Workers
4 C C C C C C C C F F F F F
3 C C C C C C C H H F F F F I I
2 B B B E E E E H H H H H H G G G G G G G G G
1 A A A A A A D D D D D D D G G G G G G G G G
O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Days
b 5 workers
3 a
6
5 H H H H
Workers
4 D D G G G G
3 C C G G G G I I I I
2 B B B B B C C D D D D F F F F F F F F F F F
1 A A A A A A A E E E E F F F F F F F F F F F
O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Days
5 workers are needed.
b Delay starting Activity H until day 16, project does not need to be extended.
4 a 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
A D I O P
B
C
E
F
G
J
K
M
L
Q
H
N
b
Workers 6 M
5 G G G J M N N
4 C C C C C F F F J K H H H H H H N N N N N N
3 B B B B B E E E E K L L L L L I I I I I I I I N N N N P P P P P P P P P
2 A A A A A A A A A D D D D D D I I I I I I I I O O O O O P P P P P P P P P
1 A A A A A A A A A D D D D D D I I I I I I I I O O O O O P P P P P P P P P
O 1 2 3 4 5 6 7 8 9 1011 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
c Total float on activity N is only 1 day, so delaying it by 2 days would cause the project to be delayed.
d 49 hours
Exercise 8I
1 a __
64
22
= 2.9… so, lower bound = 3
b 2 hours is less than the total float for activity B (3 hours).
c Activities J and H
d 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
A D F J
B E I
C G
A C F I J
b 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
A C F I J
B E D G K
317
3 The minimum time to complete the project using two workers is 25 days, using the following schedule diagram.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
A C F I J
B E D G H
Mixed exercise 8
1 a Activity D depends on activities A and C, whereas activity E depends only on activity A.
This shows that a dummy is required.
Activity J depends on activities G and I, whereas activity H depends only on activity G.
This shows that a second dummy is required.
b E G H
1 4 5 8
A
0 F Dummy K L
Dummy
B
2 3 6 7 9
C D I J
2 a C E
1 3 4
A Dummy
F
Dummy
0 5
B
D
2
d 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54
A C G I M
H K
e Day 15: C
Day 25: G, H, E, F
4 a J depends on H alone, but L depends on H and I
b 8 F(5) 13
I(3)
13 29
A(8) D(7) 22
L(6)
32
0 B(9) 20 H(2) 22 38
0 20 22 38
J(9)
31 M(7)
C(9) E(11)
9 20 31
9 G(8) 20 K(11)
c Total float on D = 20 − 7 − 8 = 5
Total float on E = 20 − 11 − 9 = 0
Total float on F = 29 − 5 − 8 = 16
d H J
C E M
K
e __
95
38
= 2.5 so 3 workers
f For example 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
C E H J M
B G K
A D F I L
B B
F E D J H
A C D H K M L
D G E K I
E G
319
5 a D(11)
10
10
E(4) 14
14
(9) 11
12 F(2)
14
14
11 G(1)
12
A E H K
B F I
C G J
D
L
6 a 28 days
6 D(7) 13 H(3) 21
11 18 21
A(6) E(4) I(7)
0 8 F(9) 21 28
0 B(8) 12 21 J (6) 28
G(11)
C(10) K(12)
10 10
10 16
b 3 workers
c 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
C G I
A
B
D
E
F
K
H
J
d 7
6
5 K K
Workers
4 E E E E K K K K
3 B B B B B B B B F F F F F F F F K K
2 A A A A A A D D D D D D D H H H F K K K K J J J J J J
1 C C C C C C C C C C G G G G G G G G G G G I I I I I I I
O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Days
e 7
6
5
Workers
4 E E E E K K K K
3 B B B B B B B B F F F F F F F F K K K K
2 A A A A A A D D D D D D D H H H F K K K K J J J J J J
1 C C C C C C C C C C G G G G G G G G G G G I I I I I I I
O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Days
7 a
3
D(8)
A(3) 4 12
E(6) H(2)
12
0 B(6) 6 14 K(3) 17
0 6 F(4) 14 17
10 I(3) J(1) 15 L(2)
C(5) 5 11 15
10 G(1)
b B − E − H − K and B − E − H − J − L
c 15
14
13 C C C
12 C C C G I
11 C C C D D G I
10 C C C D D G I I
9 C C C C C G F F F F I I
8 A A A C C G F F F F I I I
7 A A A C C G D D D D D I I
6 A A A C C D D D D D D I I L L
5 A A A C C D E E E E E E I J L L
4 B B B B B B E E E E E E I J L L
3 B B B B B B E E E E E E H H J L L
2 B B B B B B E E E E E E H H K K K
1 B B B B B B E E E E E E H H K K K
O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
321
d 9
8 A A A F H H
7 A A A D D D D D F F F F H H
6 A A A D D D D D D D D G F F F H H L L
5 A A A D D D C C C C C G E E E E E E I I I J L L
4 B B B B B B C C C C C G E E E E E E I I I J L L
3 B B B B B B C C C C C G E E E E E E I I I J L L
2 B B B B B B C C C C C G E E E E E E I I I K K K
1 B B B B B B C C C C C G E E E E E E I I I K K K
O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Challenge
a A, D, F critical. Total floats are B: 2, C: 8, E: 8
b i Reduce F by 3 days and D by 1 day, total cost £650.
ii Reduce F by 3 days, D by 4 days and B by two days. Total cost £1450.
c 27 days. Activity E has already been reduced by 2 days, and critical path is now ACE. No further reduction possible on
critical path so no further reduction in total project time possible.
d P = 100yB + 200yD + 400yE + 150yF
e x1 > 12
x2 + yB > 25
x3 − x1+ yD > 15
x4 − x1 > 8
x5 − x4 + yE > 9
x5 − x3 + yF > 10
x3 − x2 > 0
yB < 8
yD < 10
yE < 2
yF < 3
x5 < 28
x1, x2, x3, x4, x5, yB, yD, yE, yF > 0
Review exercise 2
1 a Chemical A: 5x + y > 10
Chemical B: 2x + 2y > 12, which simplifies to x + y > 6
Chemical C: __12 x + 2y > 6, which simplifies to x + 4y > 12
x > 0, y > 0
b y
10
5x + y = 10
8
R
6
4 x+y=6
2 x + 4y = 12
O 2 4 6 8 10 12 14 x
Objective line
2x + 3y
c T = 2x + 3y
d (4, 2) T = 14
2 a Maximise P = 300x + 500y
b Finishing 3.5x + 4y < 56 ⇒ 7x + 8y < 112 (o.e.)
Packaging 2x + 4y < 40 ⇒ x + 2y < 20 (o.e.)
c y
14
12 7x + 8y = 112
2x + 3y = 33
10
6
Ob
jec x + 2y = 20
4 tiv
el
ine
2 R
O 2 4 6 8 10 12 14 16 18 20 x
400
300
R
200
Ob
jec
tiv x + y = 500
el
100 in
e
x + y = 200
O 100 200 300 400 500 x
c Visible use of objective line method − objective line drawn or vertex testing
Vertex testing
(40, 160) → 7600
(80, 120) → 7200
(100, 400) → 19 000
(200, 300) → 18 000
Intersection of y = 4x and x + y = 500
Maximum profit of £190 at (100, 400), so ‘Decide’ should make 100 Badge 1 and 400 Badge 2.
323
4 a y
15
y + 3x = 15 y = 2x
10
R
5
2y = 7
b x + y = 12
c
O 5 10 15 x
b Visible use of objective line method − objective line drawn or vertex testing.
Minimum cost is £25 __16 at (3 __56 , 3 __12 ) so Becky should make 3 __56 kg of bird feeder food and 3 __12 kg of bird table food.
c Visible use of objective line method − objective line drawn, or vertex testing.
Maximum profit is £32 at (8, 4) so Becky should make 8 kg of bird feeder food and 4 kg of bird table food.
5 a Objective: maximise P = 0.4x + 0.2y (P = 40x + 20y)
subject to:
x < 6.5
y<8
x + y < 12
y < 4x
x, y > 0
b Visible use of objective line method − objective line drawn [e.g. from (2, 0) to (0, 4)] or all 5 points tested.
vertex testing
[(0, 0) → 0; (2, 8) → 2.4; (4, 8) → 3.2; (6.5, 5.5) → 3.7; (6.5, 0) → 2.6]
Optimal point is (6.5, 5.5) ⇒ 6500 type X and 5500 type Y
c P = 0.4(6500) + 0.2(5500) = £3700
6 a Maximise P = 50x + 80y + 60z
subject to x + y + 2z < 30
x + 2y + z < 40
3x + 2y + z < 50
where x, y, z > 0
c The solution found after one iteration has a slack of 10 units of black per day.
d i b.v. x y z r s t Value
z __
1 0 1 __23 − __13 0 6 __23 R1 ÷ __
32
3
c There is some slack (7 __34 ) on s, so do not increase blending; therefore increase processing and packing which are
both at their limit at present.
8 a x + 2y + 4z < 24
b i x + 2y + 4z + s = 24
ii s(>0) is the slack time on the machine in hours.
c 1 euro
d Profit = 31 euros y = 7 z = 2.5 x = r = s = 0
e Cannot make __12 a lamp.
f e.g. (0, 10, 0) or (0, 6, 3) or (1, 7, 2) checks in both inequalities
9 a 2.5x + 10y + 15z < 300 ⇒ x + 4y + 6z < 120
10x + 20y + 50z < 1000 ⇒ x + 2y + 5z < 100
b P = 10x + 20y + 28z
c b.v. x y z r s Value
r 1 4 6 1 0 120
s 1 2 5 0 1 100
P −10 −20 −28 0 0 0
d First iteration
Row
b.v. x y z r s Value
operation
y __
1 1 __32 __14 0 30 R1 ÷ 4
4
s __1
2 0 2 – __1
2 1 40 R2 – 2R1
P –5 0 2 5 0 600 R3 + 20R1
Second iteration
Row
b.v. x y z r s Value
operation
__
1 __12 – __12
y 0 1 2 10 R1 – __
12 R
2
x 1 0 4 –1 2 80 2R2
P 0 0 22 0 10 1000 R3 + 5R2
e This tableau is optimal as there are no negative numbers in the profit line.
f small 80, medium 10, large 0, profit £1000
10 a The constraints include a mixture of < and > variables.
b x + y + 2z + s1 = 10
x + 3y + z + s2 = 15
2x + y + z − s3 + a1 = 12
c The final row represents the new objectives function needed for the first stage of the two-stage simplex method.
d b.v. x y z s1 s2 s3 a1 Value
s1 0 0.5 1.5 1 0 0.5 −0.5 4
s2 0 2.5 0.5 0 1 0.5 −0.5 9
x 1 0.5 0.5 0 0 −0.5 0.5 6
P 0 −1.5 −2.5 0 0 −0.5 0.5 6
I 0 0 0 0 0 0 1 0
e There are no negative values in the bottom row, so the optimal value of I is 0 when a1 = 0.
f There is a negative value in the bottom row.
g b.v. x y z s1 s2 s3 Value
z 0 0 1 __5
7
− __1
7
__2
7
__
11
7
y 0 1 0 − __1
7
__3
7
__1
7
__
23
7
P 0 0 0 __
11
7
__27 __37 ___
104
7
325
11 a x + 2y + 3z + s1 = 18
3x + y + z − s2 + a1 = 6
2x + 5y + z − s3 + a2 = 20
b New objective is maximise I = −(a1 + a2)
−a1 = 3x + y + z − s2 − 6
−a2 = 2x + 5y + z − s3 − 20
In terms of non-basic variables, the new objective is maximise I = 5x + 6y + 2z − s2 − s3 − 26
c
b.v. x y z s1 s2 s3 a1 a2 Value
s1 1 2 3 1 0 0 0 0 18
a1 3 1 1 0 −1 0 1 0 6
a2 2 5 1 0 0 −1 0 1 20
P −2 1 −1 0 0 0 0 0 0
I −5 −6 −2 0 1 1 0 0 −26
b.v. x y z s1 s2 s3 a1 a2 Value
s1 __1
5 0 __
13
5 1 0 __2
5 0 − __2
5 10
a1 __
5
13
0 __45 0 −1 __15 1 − __15 2
y __25 1 __15 0 0 − __15 0 __15 4
P − __
12
5 0 − __6
5 0 0 __1
5 0 − __1
5 −4
I − __
13
5
0 − __45 0 1 − __15 0 __65 −2
b.v. x y z s1 s2 s3 a1 a2 Value
s1 0 0 __
33
13
1 __
1
13
__
5
13
− __
1
13
− __
5
13
___
128
13
__ 4
13 − __5
__
13 1
__
13 5
− __1
__
10
x 1 0 0 13 13 13
__ 1
13 __
2
13 __
3
− 13 __
2
− 13 __ 3
13 __
48
y 0 1 0 13
P 0 0 − __ 6
13
0 − __
12
13
__ 5
13 __ 12
13
− __5
13
− __
28
13
I 0 0 0 0 0 0 1 1 0
d The most negative value in the P row is in the x-column so, in the first iteration, x enters the basic variables.
e
b.v. x y z s1 s2 s3 a1 Value
s1 0 2 1 1 0 3 −3 18
s2 0 3 2 0 1 5 −5 50
x 1 0 0 0 0 −1 1 2
P 0 −3 −4 0 0 −1 (1 + M) 2
b.v. x y z s1 s2 s3 a1 Value
z 0 2 1 1 0 3 −3 18
s2 0 −1 0 −2 1 −1 1 14
x 1 0 0 0 0 −1 1 2
P 0 5 0 4 0 11 (M − 11) 74
All entries in the P row are non-negative so the tableau represents the optimal solution.
x = 2, y = 0, z = 18, s1 = 0, s2 = 14, s3 = 0, a1 = 0
13 a 4x + 3y + 2z + s1 = 36
x + 4z + s2 = 52
x + y − s3 + a1 = 10
b Maximise P = −2x + 3y − z − Ma1
= −2x + 3y − z − M(10 − x − y + s3)
= x(M − 2) + y(M + 3) − z − 10M − Ms3
Rearranging gives
P − (M − 2)x − (M + 3)y + z + Ms3 = −10M
c b.v. x y z s1 s2 s3 a1 Value
s1 4 3 2 1 0 0 0 36
s2 1 0 4 0 1 0 0 52
a1 1 1 0 0 0 −1 1 10
P −(M − 2) −(M + 3) 1 0 0 M 0 −10M
d b.v. x y z s1 s2 s3 a1 Value
s1 1 0 2 1 0 3 0 6
s2 1 0 4 0 1 0 0 52
y 1 1 0 0 0 −1 1 10
P 5 0 1 0 0 −3 0 30
b.v. x y z s1 s2 s3 a1 Value
s3 __1
3 0 __2
3
__1
3 0 1 0 2
s2 1 0 4 0 1 0 0 52
y __43 1 __23 __13 0 0 1 12
P 6 0 3 1 0 0 0 36
Maximum value of P = 36
Minimum value of C = −36
This occurs when x = 0, y = 12, z = 0, s1 = 0, s2 = 52, s3 = 2
14 E
1 4
A
J
F I
B K L
0 2 5 6 7
G
D
C H
3
15 a E 4 J
1
A I 6
D
L 7
C K
0 H
3 M
5
F
B
G
2
b For example I and J depend only on E. H depends on C, D, E and F.
327
16 a H
3 6
B
E G
A C J
0 1 2 5 8
F I
D L
4 7
K
b D will only be critical if it lies on the longest path
Path A to G Length
A−B−E−G 14
A−C−F−G 15
A − C − D == E − G 13 + x
So we need 13 + x to be the longest, or equal longest
13 + x > 15
x>2
17 a
18
5
20
A(5) J(3)
D(8) G(7)
0 B(10) 10 E(10) 27 35
1 2 6 7
0 10 27 L(8) 35
F(9) H(4)
19
3 K(5)
19 M(4)
C(11)
I(3)
22
4
22
c i Total float on N = 22 − 14 − 3 = 5
ii Total float on H = 16 − 5 − 3 = 8
19 a For example, it shows dependence but it is not an activity. G depends on A and C only but H and I depend on
A, C and D.
b G(5)
11 16
11 18 K(7)
25
A(9)
C(8) 25
L(8)
0 3 11 H(5) 17
0 B(3) 3 D(7) 11 17
I(1)
E(4)
J(5)
7 12
7 F(5) 12
c C I so B, C, E, F, I, J and L
B J L
E F
d Total float on A = 11 − 0 − 9 = 2
Total float on D = 11 − 3 − 7 = 1
Total float on G = 18 − 11 − 5 = 2
Total float on H = 17 − 11 − 5 = 1
Total float on K = 25 − 16 − 7 = 2
e 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
B C I J L
E F
20 a Critical activities are B, F, J, K and N, length of critical path is 25 hours, I is not critical.
b Total float on A = 5 − 0 − 3 = 2
Total float on C = 9 − 0 − 6 = 3
Total float on D = 11 − 3 − 3 = 5
Total float on E = 9 − 3 − 4 = 2
Total float on G = 9 − 4 − 3 = 2
Total float on H = 16 − 7 − 7 = 2
Total float on I = 16 − 9 − 5 = 2
Total float on L = 22 − 11 − 4 = 7
Total float on M = 22 − 16 − 2 = 4
Total float on P = 25 − 18 − 3 = 4
329
c 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
B F J K N
A
C
D
E
G
H
I
L
M
P
d F, E and G
21 a y
7
6
H
5
Workers
4
3 D
B G
2
C G F
1
A E I
O 2 4 6 8 10 12 14 16 x
Days
b 16 days, 7 workers
c Delay the start of H until time 13
d 3 days
22 a
9
E(3) 9
3 16
D(4) I(4)
3 F(2) 16
A(3) 7 13
K(3)
7 H(1) 13
0 C(1) N(2)
J(2)
0 M(2)
B(2) 4 7 18
7 11 18
G(3) L(3)
b 18 days
c ADFIKN
d y
4
H
Workers
3
E J
2
B C G L M
1
A D F I K N
O
2 4 6 8 10 12 14 16 18 x
Days
e 4 workers
f e.g. delay the start times of: E to time 4
G to time 7
H to time 12
J to time 10
L to time 13
M to time 16
23 a 12 C(23) 35 F(10) 68
12 35 68
A(12) K(19)
J(6)
0 35 H(18) 74 L(13) 87
0 35 74 87
D(14) I(20)
G(15)
B(17) M(13)
17 50
18 E(32) 50
b A, C, E, H, J, K and L
c Total float = 35 − 17 − 14 = 4
d Either 226 ÷ 87 = 2.6 (1 d.p.) so at least 3 workers needed
or 69 hours into the project activities J, K, I and M must be happening so at least 4 workers will be needed.
e 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90
1 A C G H K
2 B E I J L
3 D F M
0 5 9 21
0 A(5) 5 B(4) 10 G(8) 21
A C F H
B E
e For example
0 5 10 15 20 25 30
A C D F H
B G E
331
Challenge
1 a y
7
6 x=8
4
x + 4y = 24
3 x–y=0
R
2
O 1 2 3 4 5 6 7 8 9x
Optimal values x = y = __
24
5
b x = 4, y = 4 ⇒ P = 24
x = 5, y = 4 ⇒ P = 25
c x = 7, y = 4 ⇒ P = 27
d If the gradient of the objective line is similar to the gradient of a constraint that runs through the optimal vertex, then
the optimal integer solution may not lie close to the optimal vertex
2 Number of variables . 2 so must use simplex method not a graphical method.
y = 12, x = z = 0
C = −36
This is an estimate only because the time taken is not directly proportional to n2. This is used as an approximation.
2 a
C 6 17
27 22 17 4
16 G 7 21
9 3 21 21
8
B 3 11
7 D 4 13 14
11 F 5 14
16 13 15 14 2 I 9 30
35 30
11 16
5 6 10
7
H 8 23
A 1 0 E 2 8 24 23
16
8 8
Quickest route: AEFCGHI Time required: 30 minutes
b New quickest route: AEHI (or AEFHI) Time required: 31 minutes
3 Maximise 24x + 32y
Subject to: 2x + 3y < 100
8x + 11y > 240
5x + 12y < 320
x > 0, y > 0
4 a Odd nodes A, E, F, G
Pairings: AE + FG = 9 + 11 = 20
AF + EG = 5 + 16 = 21
AG + EF = 6 + 4 = 10
The sections that need to be traversed twice are AG and EF.
Total time required = 144 + 10 = 154 minutes
b FG = 12, Route via A =11, this is shorter so repeat FA and AG
c 158 − 144 −11 = 3
5 a Activity Immediately preceding
activities
A –
B –
C –
D A
E C
F E
G F
H B, C
I D, G, H
J E
D(5)
2 7
A(4) I(5)
H(8)
G(2)
1 4 6 8
B(3)
F(4)
C(5) J(9)
3 5
E(6)
b The dotted lines represent a dummy activity showing that activity H depends on activities B and C whereas activity E
depends on activity C only.
333
c D(5) 17
4
12 17
A(4) H(8) I(5)
G(2) 22
0 5 15
9 15 22
0 B(3)
F(4)
C(5) J(9)
5 11
E(6)
5 11
D C
G E
F
AB(I), AG, BF, BG, CD, CF
AB(I), AG(I), BF, BG, CD, CF
AB(I), AG(I), BF(I), BG(I), CD(O), CF
AB(I), AG(I), BF(I), BG(I), CD(O), CF(I)
The graph is planar.
H
A B
D C
G E
2 a
42 31 36 18 27 33 41 47 12 24 16
42 36 41 47 33 31 18 27 12 24 16
42 47 41 36 33 31 18 27 24 16 12
47
42 41 36 33 31 27 18 24 16 12
47
42 41 36 33 31 27 24 18 16 12
47
42 41 36 33 31 27 24 18 16 12
All of the numbers have now been selected as pivots, so the list is in order.
b 18
33 31 27 24 12
47 42 41 36 16
5 reels are required.
5000 log 5000
c 0.034 × ______________
= 0.27 seconds
800 log 800
This is only an estimate because the time taken is only approximately proportional to n log n
335
K(2)
15
23
b y
5
4
Workers
H J
3
E H K
2
B C G L
1
A D F I M
O
2 4 6 8 10 12 14 16 18 20 22 23 x
Days
So 4 workers are required.
c Delay the start of activity H by 2 days and the start of activity J by 2 days.
7 a The purpose of the first stage is to provide a basic feasible solution as a starting point for the second stage.
b b.v. x y z s1 s2 s3 a1 Value
s1 2 1 1 1 0 0 0 50
s2 1 3 1 0 1 0 0 60
a1 1 0 0 0 0 −1 1 10
P −1 −2 −1 0 0 0 0 0
I −1 0 0 0 0 1 0 −10
c I = 0 when a1 = 0, s1 = 30, s2 = 50, s3 = 0, x = 10, y = 0, z = 0
d b.v. x y z s1 s2 s3 Value
s1 0 1 1 1 0 2 30
s2 0 3 1 0 1 1 50
x 1 0 0 0 0 −1 10
P 0 −2 −1 0 0 −1 10
The pivot is the 3 in the y column.
e P = 50 when x = 10, y = 10, z = 20
Index
activity networks 223–4, 226–8, 230–1, degree, of vertex 34, 86–7, 89–92, 94–6 late event times 230–1, 232–3
236, 238–9, 244 dependence tables see precedence tables linear order 23
critical activities 232–4, 236, 238 digraphs 36 linear programming 138–70, 171–220
see also critical path analysis Dijkstra’s algorithm 66–71 formulating problems 139–43, 172–4
adjacency matrices 41 directed edges (arcs) 36, 70–1 graphs 145–70
algorithms 1–28, 52–84 distance matrices 41–2, 60–3, 104 optimal point location 149–58
bin-packing 16–19 distance tables 73–7 solutions with integer values 162–5,
bubble sort 10–12, 21–2, 23 dummy activities 226–8 196–7
Dijkstra’s 66–71 see also simplex algorithm; simplex
Egyptian multiplication 4 early event times 230–1, 232–3 tableaux
flow charts 6–8 edge set 34 lists, sorting 10–12
Floyd’s 73–7 edges (arcs) loops 35
Kruskal’s 53–6, 107 graphs 30, 32 lower bounds
nearest neighbour 118–20 minimum spanning trees 53–6, 57–8, bin-packing 16, 17, 19
order 21–3 60–3 critical path analysis 251
passes of 10 Egyptian multiplication algorithm 4 travelling salesman problem 103, 114–17
planarity 43–6 equations, linear programming 174
Prim’s 57–8, 60–3, 107, 118 Eulerian circuits 86 matrices 41–2, 60–3, 104
quick sort 13–14 Eulerian graphs 86–7 maximum points 152
route inspection 89–98 Euler’s handshaking lemma 36 minimum connectors see minimum
run times 21–3 even degree 34, 86–7, 89–92, 94–6 spanning trees
Russian peasant’s 4 event times 230–1, 232–3 minimum points 152
simplex see simplex algorithm events 223 minimum spanning trees (MST) 53–6,
in words 2–4 57–8, 60–3
arbitrarily large number 205, 207 feasible regions 139, 145–7, 149–58, lower bounds 114–17
arcs 163–5, 176 RMST 114–16
activities on 223 feasible solutions 139 upper bounds 107–12
see also edges final vertex label 66 modelling, with graphs 26–8
artificial variables 199–203, 205, 207–11 first-fit bin-packing algorithm 16, 17 modulus function 5
first-fit decreasing bin-packing MST see minimum spanning trees
backward pass (scan) 230 algorithm 16, 18, 19
basic feasible solution 183, 186, 199 float of activity 236, 238 nearest neighbour algorithm 118–20
basic variables 183, 199, 211 flow charts 6–8 networks 29–51
Big-M method 205–11 Floyd’s algorithm 73–7 matrix representation 41–2
bin-packing algorithms 16–19 forward pass (scan) 230 with more than four nodes 94–6
bubble sort algorithms 10–12, 21–2, 23 full-bin packing algorithm 16, 18–19 route inspection algorithm 89–98
undirected 105
Chinese postman algorithm see route Gantt (cascade) charts 238–40, 242, 249 weights 89–92
inspection algorithm graphs 29–51 nodes
columns, Prim’s algorithm 60–3 complete 39 events as 223, 230
complete graphs 39 connected 35, 86–7 see also vertices
constraints, linear programming 139–70, Eulerian 86–7 non-basic variables 199, 205, 208, 210
172–4, 188 isomorphic 39
contraction 50 linear programming 145–70 objective function 139–40, 149, 156, 173
critical path analysis 221–58 matrix representation 41–2 maximising 140, 149, 173, 186, 197
critical activities 232–4, 236, 238 modelling with 26–8 minimising 140, 149, 173, 186
critical path definition 232 planar 43–6 objective line method 149–58
dummy activities 226–8 semi-Eulerian 86–7 odd degree 34, 86–7, 90–2, 94–6
early event times 230–1, 232–3 simple 35 optimal integer solutions 162–5
float of activity 236, 238 spanning trees 38 optimal point location 149–58
Gantt charts 238–40, 242, 249 theory 34–6 optimal solutions 16, 17, 19, 139, 186
late event times 230–1, 232–3 trees 38 order
project modelling 222–4 of algorithm 21–3
resource histograms 242–6 Hamiltonian cycles 35, 44, 46, 103, of vertex see degree
scheduling diagrams 249–52 114–17
see also activity networks paths 34, 35
cycles inequalities, linear programming 139, 174 pivot column 183, 188, 191, 201
graphs 35 initial upper bounds 108–12 pivot row 181, 188, 191, 193, 201
minimum spanning trees 53–6 instruction box 6 planar graphs 43–6
isomorphic graphs 39 planarity algorithm 43–6
decision box 6 precedence tables 222–4, 226–7
decision variables 139–40, 172–3 Kruskal’s algorithm 53–6, 107 Prim’s algorithm 57–8, 60–3, 107, 118
337337
quadratic order 22, 23 problems requiring integer solutions upper bounds, travelling salesman
quick sort algorithms 13–14 196–7 problem 103, 107–12, 118–20
reducing number 191
residual minimum spanning trees (RMST) sink nodes 223, 230 valency see degree
114–16 size of problem 21 vertex set 34
resource histograms 242–6 slack variables 174, 176–7, 188, 199–203, vertex testing method 156–8
resource levelling 242, 244 208 vertices (nodes)
route inspection algorithm 89–98 sorted lists 10 degree 34, 86–7, 89–92, 94–6
route tables 73–7 source nodes 223, 230 graphs 30, 34, 35
rows, Prim’s algorithm 60–3 spanning trees 38 minimum spanning trees 53–6, 57–8,
ruler method 149–58 see also minimum spanning trees 60–3
run times, of algorithm 21–3 start/end box 6 shortest path algorithms 66–71, 73–7
Russian peasant’s algorithm 4 subgraphs 34
surplus variables 199, 208 walks 34, 35, 103
scheduling 249–52 weighted graphs see networks
semi-Eulerian graphs 86–7 table of least distances 104–5 weights
shortcuts 107, 109–12, 118 tours 103 arcs 230
shortest path trace tables 3, 7 minimum spanning trees 53–6, 57–8,
Dijkstra’s algorithm 66–71 trails 35 108
Floyd’s algorithm 73–7 travelling salesman problem 102–27 networks 89–92
route inspection algorithm 89–98 classical problems 103–5, 114 worker activity assignment 242–6,
simple graphs 35 practical problems 103–5 249–52
simplex algorithm 171–220 trees working lists 10
Big-M method 205–11 graphs 38
two-stage method 199–203 minimum spanning 53–6, 57–8, 60–3
simplex tableaux 176, 178, 181, 182–94 triangle inequality 103
338338
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further
Mathematics.
Pure Mathematics Year 1/AS Statistics and Mechanics Year 1/AS Pure Mathematics Year 2 Pearson Edexcel A level Mathematics
Series Editor: Harry Smith Series Editor: Harry Smith
Series Editor: Harry Smith
Statistics and Mechanics Year 2
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Series Editor: Harry Smith
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level
Mathematics. Mathematics.
Mathematics. Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level
Pearson Edexcel A level Mathematics Pure Mathematics Year 2
This book can be used alongside the Year 1 book to cover all the content needed for the Pearson Edexcel Mathematics.
Pearson Edexcel AS and A level Mathematics Pure Mathematics Year 1/AS
This book covers all the content needed for the Pearson Edexcel AS level Pure Mathematics exam. It can
Edexcel AS and A level Mathematics Statistics and Mechanics Year 1/AS
This book covers all the content needed for the Pearson Edexcel AS level Statistics and Mechanics exam.
also be used alongside the Year 2 book to cover all the content needed for the Pearson Edexcel A level A level Pure Mathematics exams.
It can also be used alongside the Year 2 book to cover all the content needed for the Pearson Edexcel A This book can be used alongside the Year 1 book to cover all the content needed for the Pearson Edexcel Pearson Edexcel A level Mathematics Statistics and Mechanics Year 2
line digital
Pure Mathematics exams. level Statistics and Mechanics exam. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling A level Statistics and Mechanics exam.
• Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling as well as supporting the new calculators. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling
• Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling
as well as supporting the new calculators. as well as supporting the large data set and new calculators. • FREE additional online content to support your independent learning, including full worked solutions as well as supporting the large data set and new calculators.
• FREE additional online content to support your independent learning, including full worked solutions for every question in the book (SolutionBank), GeoGebra interactives and Casio calculator tutorials. • FREE additional online content to support your independent learning, including full worked solutions
• FREE additional online content to support your independent learning, including full worked solutions
on
for every question in the book (SolutionBank), GeoGebra interactives and Casio calculator tutorials. for every question in the book (SolutionBank), GeoGebra interactives and Casio calculator tutorials. • Includes access to an online digital edition (valid for 3 years once activated). for every question in the book (SolutionBank), GeoGebra interactives and Casio calculator tutorials.
• Includes access to an online digital edition (valid for 3 years once activated). • Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of • Includes access to an online digital edition (valid for 3 years once activated).
• Includes access to an online digital edition (valid for 3 years once activated).
• Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of mixed and review exercises. • Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of
• Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of
mixed and review exercises. mixed and review exercises.
mixed and review exercises.
Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books
Pearson Edexcel AS and A level Mathematics books
Year 1/AS Year 2 Year 1/AS Year 2
Year 1/AS Year 2 Year 1/AS Year 2
ed
n
line digital line digital
on line digital on
on line digital
on
ed
ed
n
n
ludes a
ludes a
ludes a
ed
it
it
ed
ludes a
n
ion
ion
itio
ludes a
it
ion
n
inc
inc
it
inc
inc
Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books
Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books
Compulsory Options Compulsory Options
ion
Compulsory Options Compulsory Options
Pearson Edexcel AS and A level Mathematics Pearson Edexcel AS and A level Mathematics Pearson Edexcel A level Mathematics Pearson Edexcel A level Mathematics
Pure Mathematics Statistics and Mechanics Pure Mathematics Statistics and Mechanics
inc
For more information visit: www.pearsonschools.co.uk/edalevelmaths2017 For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
For more information visit: www.pearsonschools.co.uk/edalevelmaths2017 For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
www.pearsonschools.co.uk www.pearsonschools.co.uk
www.pearsonschools.co.uk
[email protected] www.pearsonschools.co.uk [email protected]
[email protected]
[email protected]
1 1 2 2
CVR_MATH_SB_AL_0274_CVR.indd 1 1/18/19 10:05 AM CVR_MATH_SB_AL_2020_CVR.indd 1 1/22/19 11:56 AM
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further
Mathematics. Mathematics. Mathematics. Mathematics. Mathematics.
Pearson Edexcel AS and A level Further Mathematics Further Mechanics 1
This book covers all the content needed for the optional Pearson Edexcel AS and A level Further
Pearson Edexcel AS and A level Further Mathematics Core Pure Maths Book 1/AS
This book covers all the content needed for the compulsory Pearson Edexcel AS level Core Pure
Pearson Edexcel AS and A level Further Mathematics Further Statistics 1
This book covers all the content needed for the optional Pearson Edexcel AS and A level Further
Pearson Edexcel AS and A level Further Mathematics Further Pure Mathematics 1
Pearson Edexcel AS and A level Further Mathematics Decision Mathematics 1
This book can be used alongside the Year 1 book to cover all the content needed for the Pearson Edexcel This book covers all the content needed for the optional Pearson Edexcel AS and A level Further Pure
Mathematics exam. It can also be used alongside Book 2 to cover all the content needed for the Statistics 1 exams. Mechanics 1 exams. AS and A level Further Mathematics exams. Mathematics 1 exams.
compulsory Pearson Edexcel A level Core Pure Mathematics exams. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling.
• Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling.
• Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions
• FREE additional online content to support your independent learning, including full worked solutions for every question in the book (SolutionBank) and GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives.
for every question in the book (SolutionBank) and GeoGebra interactives. • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated).
• Includes access to an online digital edition (valid for 3 years once activated). • Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers, and plenty of
• Includes worked examples with guidance, lots of exam-style questions, a practice paper, and plenty of mixed and review exercises. mixed and review exercises. mixed and review exercises. mixed and review exercises.
mixed and review exercises.
Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books
Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2
line digital line digital line digital line digital line digital
on on on on on
ed
ed
ed
ed
ed
n
n
ludes a
ludes a
ludes a
ludes a
ludes a
it
itio
itio
it
it
ion
ion
ion
n
inc
inc
inc
inc
inc
Decision Mathematics 1
Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books
Compulsory Options Compulsory Options Compulsory Options Compulsory Options Compulsory Options
Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics
Core Pure Mathematics Further Statistics 1 Further Mechanics 1 Decision Mathematics 1 Further Pure Mathematics 1
1 1 1 1 1
CVR_MATH_SB_AL_0397_FCVR.indd 1 CVR_MATH_SB_AL_0434_CVR.indd 1 1/18/19 9:41 AM 1/17/19 1:29 PM
CVR_MATH_SB_AL_0359_FCVR.indd 1 CVR_MATH_SB_AL_0380_FCVR.indd 1 1/22/19 10:38 AM 1/18/19 9:30 AM
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further
Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further
Mathematics. Mathematics. Mathematics. Mathematics. Mathematics.
This book covers all the content needed for the optional Pearson Edexcel AS and A level Further Statistics 2
Pearson Edexcel AS and A level Further Mathematics Further Mechanics 2
Pearson Edexcel AS and A level Further Mathematics Further Statistics 2
Pearson Edexcel A level Further Mathematics Core Pure Maths Book 2
This book covers all the content needed for the optional Pearson Edexcel AS and A level Further
Pearson Edexcel AS and A level Further Mathematics Further Pure Mathematics 2
This book can be used alongside Book 1 to cover all the content needed for the compulsory Pearson This book covers all the content needed for the optional Pearson Edexcel AS and A level Further Pure
Pearson Edexcel AS and A level Further Mathematics Decision Mathematics 2
This book covers all the content needed for the optional Pearson Edexcel AS and A level Decision
Edexcel A level Core Pure Mathematics exams. exams. Mechanics 2 exams. Mathematics 2 exams. Mathematics 2 exams.
• Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling. • Fully updated to match the 2017 specifications, with more of a focus on problem-solving and modelling.
• FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions for • FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions • FREE additional online content to support your independent learning, including full worked solutions
for every question in the book (SolutionBank) and GeoGebra interactives. every question in the book (SolutionBank), GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives. for every question in the book (SolutionBank) and GeoGebra interactives.
• Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated). • Includes access to an online digital edition (valid for 3 years once activated).
• Includes worked examples with guidance, lots of exam-style questions, practice papers, and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers, and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers and plenty of • Includes worked examples with guidance, lots of exam-style questions, practice papers, and plenty of
mixed and review exercises. mixed and review exercises. mixed and review exercises. mixed and review exercises. mixed and review exercises.
Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books Pearson Edexcel AS and A level Mathematics books
Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2 Year 1/AS Year 2
line digital line digital line digital line digital line digital
on on on on on
ed
ed
ed
ed
ed
n
n
ludes a
ludes a
ludes a
ludes a
ludes a
itio
it
it
itio
it
ion
ion
ion
n
n
inc
inc
inc
inc
inc
Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books Pearson Edexcel AS and A level Further Mathematics books
Compulsory Options Compulsory Options Compulsory Options Compulsory Options Compulsory Options
Pearson Edexcel A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics Pearson Edexcel AS and A level Further Mathematics
D1
Core Pure Mathematics Further Statistics 2 Further Mechanics 2 Decision Mathematics 2 Further Pure Mathematics 2
www.pearsonschools.co.uk
[email protected]
Book 2 For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
www.pearsonschools.co.uk
[email protected]
FS2
For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
www.pearsonschools.co.uk
[email protected]
FM2
For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
www.pearsonschools.co.uk
[email protected]
D2 For more information visit: www.pearsonschools.co.uk/edalevelmaths2017
www.pearsonschools.co.uk
[email protected]
FP2
2 2 2 2 2
CVR_MATH_SB_AL_3343_FCVR.indd 1 1/17/19 1:49 PM CVR_MATH_SB_AL_3305_FCVR.indd 1 CVR_MATH_SB_AL_0465_CVR.indd 1 1/17/19 1:34 PM 1/17/19 1:30 PM
CVR_MATH_SB_AL_3381_FCVR.indd 1 CVR_MATH_SB_AL_ 3329_FCVR.indd 1 1/17/19 12:54 PM 1/17/19 12:53 PM
www.pearsonschools.co.uk
[email protected]
1
CVR_MATH_SB_AL_0397_FCVR.indd 1 1/22/19 1:55 PM