0% found this document useful (0 votes)
274 views346 pages

Decision

This document discusses textbooks for Pearson Edexcel AS and A level Further Mathematics. It describes how this book, along with the Year 1 book, covers all the content needed for the Pearson Edexcel AS and A level Further Mathematics exams. It provides free additional online resources including full worked solutions and interactive content. The book includes worked examples, exam-style questions, practice papers, and mixed exercises.

Uploaded by

Daanyal Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
274 views346 pages

Decision

This document discusses textbooks for Pearson Edexcel AS and A level Further Mathematics. It describes how this book, along with the Year 1 book, covers all the content needed for the Pearson Edexcel AS and A level Further Mathematics exams. It provides free additional online resources including full worked solutions and interactive content. The book includes worked examples, exam-style questions, practice papers, and mixed exercises.

Uploaded by

Daanyal Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 346

11 - 19 PROGRESSION

Pearson Edexcel AS and A level Further Mathematics


Decision Mathematics 1
Series Editor: Harry Smith

Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further
Mathematics.

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
AS and A level Further Mathematics exams.
• 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
for every question in the book (SolutionBank) and GeoGebra interactives.
• 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
mixed and review exercises.

Pearson Edexcel AS and A level Mathematics books


Year 1/AS Year 2
11 - 19 PROGRESSION
11 - 19 PROGRESSION
11 - 19 PROGRESSION
Pearson Edexcel AS and A level Mathematics Pearson Edexcel AS and A level Mathematics Pearson Edexcel A level Mathematics 11 - 19 PROGRESSION

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.

Pearson Edexcel A level Mathematics Statistics and Mechanics Year 2


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

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

CVR_MATH_SB_AL_0298_CVR.indd 1 1/17/19 11:43 AM

Pearson Edexcel AS and A level Further Mathematics books


Compulsory Options
Pearson Edexcel AS and A level Further Mathematics
11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION
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 Book 1/AS Further Statistics 1 Further Mechanics 1 Decision Mathematics 1 Further Pure Mathematics 1
Series Editor: Harry Smith Series Editor: Harry Smith Series Editor: Harry Smith Series Editor: Harry Smith Series Editor: Harry Smith

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

Book 1/AS FS1 FM1 D1 FP1


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 For more information visit: www.pearsonschools.co.uk/edalevelmaths2017

www.pearsonschools.co.uk www.pearsonschools.co.uk www.pearsonschools.co.uk www.pearsonschools.co.uk www.pearsonschools.co.uk


[email protected] [email protected] [email protected] [email protected]
[email protected]

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

11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION


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
Core Pure Mathematics Book 2 Further Statistics 2 Further Mechanics 2 Decision Mathematics 2 Further Pure Mathematics 2
Series Editor: Harry Smith Series Editor: Harry Smith Series Editor: Harry Smith Series Editor: Harry Smith
Series Editor: Harry Smith

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

For more information visit: www.pearsonschools.co.uk/edalevelmaths2017

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

For more information visit: www.pearsonschools.co.uk/edalevelmaths2017

www.pearsonschools.co.uk
[email protected]

1
CVR_MATH_SB_AL_0397_FCVR.indd 1 1/22/19 1:55 PM
11 – 19 PROGRESSION

Pearson Edexcel AS and A level Further Mathematics

Decision Mathematics 1

D1
Series Editor: Harry Smith
Authors: Susie Jameson, Peter Sherran, Keith Pledger, Harry Smith

F01_EDD1_SB_ASAL_83299_Title.indd 1 1/22/19 4:09 PM


Published by Pearson Education Limited, 80 Strand, London WC2R 0RL.
www.pearsonschoolsandfecolleges.co.uk
Copies of official specifications for all Pearson qualifications may be found on the website:
qualifications.pearson.com
Text © Pearson Education Limited 2017
Edited by Tech-Set Ltd, Gateshead
Typeset by Tech-Set Ltd, Gateshead
Original illustrations © Pearson Education Limited 2017
Cover illustration Marcus@kja-artists
The rights of Susie Jameson, Peter Sherran, Keith Pledger, Harry Smith to be identified as authors
of this work have been asserted by them in accordance with the Copyright, Designs and Patents
Act 1988.
First published 2017
20 19 18 17
10 9 8 7 6 5 4 3 2 1
British Library Cataloguing in Publication Data
A catalogue record for this book is available from the British Library
ISBN 978 1292 18329 9 (Print)
ISBN 978 1292 20714 8 (PDF)
Copyright notice
All rights reserved. No part of this publication may be reproduced in any form or by any means
(including photocopying or storing it in any medium by electronic means and whether or not
transiently or incidentally to some other use of this publication) without the written permission
of the copyright owner, except in accordance with the provisions of the Copyright, Designs and
Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency,
Barnards Inn 86 Fetter Lane, London EC4A 1EN (www.cla.co.uk). Applications for the copyright
owner’s written permission should be addressed to the publisher.
Printed in the UK by Bell and Bain Ltd, Glasgow
Acknowledgements
The authors and publisher would like to thank the following for their kind permission to
reproduce their photographs:
(Key: b-bottom; c-centre; l-left; r-right; t-top)
123RF: Igor Sokolov 138, 259l; Alamy Stock Photo: Silicon Valley Stock 001, 128l, Alex Segre 052,
128c, Stephen Shepherd 102, 128r, Robert Stainforth 221, 259r, Jada Images 171, 259c; Getty
Images: Ilbusca 029, 032, 128cl; Science Photo Library: Peter Menzel 085, 128cr
All other images © Pearson Education

A note from the publisher


In order to ensure that this resource offers high-quality support for the associated Pearson
qualification, it has been through a review process by the awarding body. This process confirms
that this resource fully covers the teaching and learning content of the specification or part
of a specification at which it is aimed. It also confirms that it demonstrates an appropriate
balance between the development of subject skills, knowledge and understanding, in addition
to preparation for assessment.
Endorsement does not cover any guidance on assessment activities or processes (e.g. practice
questions or advice on how to answer assessment questions), included in the resource nor does
it prescribe any particular approach to the teaching or delivery of a related course.
While the publishers have made every attempt to ensure that advice on the qualification
and its assessment is accurate, the official specification and associated assessment guidance
materials are the only authoritative source of information and should always be referred to for
definitive guidance.
Pearson examiners have not contributed to any sections in this resource relevant to
examination papers for which they have responsibility.
Examiners will not use endorsed resources as a source of material for any assessment set by
Pearson.
Endorsement of a resource does not mean that the resource is required to achieve this Pearson
qualification, nor does it mean that it is the only suitable material available to support the
qualification, and any resource lists produced by the awarding body shall include this and
other appropriate resources.

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

F01_EDD1_SB_ASAL_83299_PRE_i-vi.indd 2 19/01/19 7:41 PM


Contents

Contents ● = A level only

Overarching themes iv ● 5.3 Using a minimum spanning tree


Extra online content vi method to find a lower bound 114
● 5.4 Using the nearest neighbour algorithm
1 Algorithms1 to find an upper bound 118
1.1 Using and understanding algorithms  2 Mixed exercise 5 123
1.2 Flow charts 6
1.3 Bubble sort 10 Review exercise 1128
1.4 Quick sort 13
6 Linear programming138
1.5 Bin-packing algorithms 16
6.1 Linear programming problems 139
1.6 Order of an algorithm 21
6.2 Graphical methods 145
Mixed exercise 1 25
6.3 Locating the optimal point 149
2 Graphs and networks29 6.4 Solutions with integer values 162
2.1 Modelling with graphs 30 Mixed exercise 6 167
2.2 Graph theory 34
●7 The simplex algorithm171
2.3 Special types of graph 38
● 7.1 Formulating linear programming
2.4 Representing graphs and networks
problems172
using matrices 41
● 7.2 The simplex method 176
● 2.5 The planarity algorithm 43
● 7.3 Problems requiring integer solutions 196
Mixed exercise 2 48
● 7.4 Two-stage simplex method 199
3 Algorithms on graphs52 ● 7.5 The Big-M method 205
3.1 Kruskal’s algorithm 53 Mixed exercise 7 213
3.2 Prim’s algorithm 57
3.3 Applying Prim’s algorithm to a distance 8 Critical path analysis221
matrix60 8.1 Modelling a project 222
3.4 Using Dijkstra’s algorithm to find the 8.2 Dummy activities 226
shortest path 66 8.3 Early and late event times 230
● 3.5 Floyd’s algorithm 73 8.4 Critical activities 232
Mixed exercise 3 79 8.5 The float of an activity 236
8.6 Gantt charts 238
4 Route inspection85
● 8.7 Resource histograms 242
4.1 Eulerian graphs 86
● 8.8 Scheduling diagrams 249
4.2 Using the route inspection algorithm 89
Mixed exercise 8 253
● 4.3 Networks with more than four odd
nodes94 Review exercise 2259
Mixed exercise 4 98
Exam-style practice: AS269
●5 The travelling salesman problem102
● Exam-style practice: A level271
● 5.1 The classical and practical travelling
salesman problems 103 Answers275
● 5.2 Using a minimum spanning tree
method to find an upper bound 107 Index337

iii

F01_EDD1_SB_ASAL_83299_PRE_i-vi.indd 3 19/01/19 7:41 PM


Overarching themes

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

• Hundreds of problem-solving questions, fully integrated specify the problem

into the main exercises


• Problem-solving boxes provide tips and strategies interpret results
collect information
• Structured and unstructured questions to build confidence
• Challenge boxes provide extra stretch process and
represent information
3. Mathematical modelling
• Dedicated modelling sections in relevant topics provide plenty of practice where you need it
• Examples and exercises include qualitative questions that allow you to interpret answers in the
context of the model
• Dedicated chapter in Statistics & Mechanics Year 1/AS explains the principles of modelling in
mechanics

Finding your way around the book Access an online


digital edition using
the code at the
front of the book.

Each chapter starts with


a list of objectives
The real world applications
of the maths you are about
to learn are highlighted at
the start of the chapter with
links to relevant questions in
the chapter

The Prior knowledge check


helps make sure you are
ready to start the chapter

iv

F01_EDD1_SB_ASAL_83299_PRE_i-vi.indd 4 19/01/19 7:41 PM


Overarching themes

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

Each section begins


with explanation
and key learning
points
Step-by-step Challenge Each chapter Problem-solving boxes
Exam-style questions
worked examples boxes give you ends with a provide hints, tips and
are flagged with E
focus on the key a chance to Mixed exercise strategies, and Watch
Problem-solving types of questions tackle some and a Summary out boxes highlight
questions are flagged you’ll need to more difficult of key points areas where students
with P tackle questions often lose marks in
their exams
Every few chapters a Review exercise
helps you consolidate your learning
with lots of exam-style questions

AS and A level practice papers


at the back of the book help you
prepare for the real thing.

F01_EDD1_SB_ASAL_83299_PRE_i-vi.indd 5 19/01/19 7:41 PM


Extra online content

Extra online content


Whenever you see an Online box, it means that there is extra online content available to support you.

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
=

SolutionBank provides a full worked solution for


x2 − x1 1.5 − 2.5 0.8 − 0.51
=
=2 0.6 − 0.7
Gradient of tangent at x = 3 is = − 0.859 (3 s.f.)
y2 − y1 3 −1
= =4

every question in the book. x2 − x1 d As the points move closer to A, the


3 − 2.5
gradient tends to − 0.75.
x-coordinate −1 0 1 2 3
Estimate for 3 a i Gradient= 16 − 9= 7= 7
gradient of −4 −2 0 2 4 4−3 1
curve
12.25 − 9 3.25
b The gradient of the curve at the point ii Gradient
= = = 6.5
3.5 − 3 0.5

Online Full worked solutions are


where x = p is 2p − 2.

c Gradient of tangent at x = 1.5 is 9.61 − 9 0.61


iii Gradient
= = = 6.1
y2 − y1 (−1.7) − 0.3 3.1 − 3 0.1
=
x2 − x1 0.5 − 2.5

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

2 a Substituting x = 0.6 into =


y 1 − x2 : ( 3 + h )2 − 9
v Gradient =
y = 1 − 0.6 2 = 0.64 = 0.8 , therefore the (3 + h) − 3
point A (0.6, 0.8) lies on the curve. 6h + h 2

Download all the solutions as a PDF or


=
b Gradient of tangent at x = 0.6 is h
y2 − y1 1.1 − 0.8 h (6 + h)
= =
h

quickly find the solution you need online


x2 − x1 0.2 − 0.6
=6+h
= − 0.75

© Pearson Education Ltd 2017. Copying permitted for purchasing


institution only. This material is not copyright free.
1

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

Access all the extra online content for free at:

www.pearsonschools.co.uk/d1maths
You can also access the extra online content by scanning this QR code:

vi

F01_EDD1_SB_ASAL_83299_PRE_i-vi.indd 6 19/01/19 7:42 PM


Algorithms
Objectives
After completing this chapter you should be able to:
1
● Use and understand an algorithm given in words  → pages 2–5

● Understand how flow charts can be used to describe


algorithms  → pages 6–10

● Carry out a bubble sort → pages 10–13

● Carry out a quick sort  → pages 13–16

● Carry out the three bin-packing algorithms and understand


their strengths and weaknesses  → pages 16–21

● Determine the order of an algorithm  → pages 21–24

Prior knowledge check


1 Here is a function machine.
Input ×4 +3 Output

Find:
a the output when the input is 11
b the input when the output is 99.

2 Two variables, x and y, are such that


Efficient sorting algorithms such as the y varies in direct proportion to x2.
quick sort allow software, controlling When x = 5, y = 75.
self-drive cars, to prioritise input Work out the value of y when x = 10.
information and react quickly and safely.   ← GCSE Mathematics

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 1 19/01/19 8:02 PM


Chapter 1

1.1 Using and understanding algorithms


■ An algorithm is a finite sequence of step-by-step instructions carried out to solve a problem.
Algorithms can be given in words or in flow charts.
You need to be able to understand and use an algorithm given in words.
You have been using algorithms since you started school. Some examples of mathematical algorithms
that you will be familiar with are:
● how to add several two-digit numbers
● how to multiply two two-digit numbers
● how to add, subtract, multiply or divide fractions.
It can be quite challenging to write a sequence of instructions for someone else to follow accurately.
Here are some more examples:

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

The ‘happy’ algorithm is:


• write down any integer
• square its digits and find the sum of the squares
• continue with this number
• repeat until either the answer is 1 (in which case the number is ‘happy’) or until you get trapped
in a cycle (in which case the number is ‘unhappy’)
Show that:
Watch out You will need to be able to
a 70 is happy b 4 is unhappy
understand, describe and implement specific
algorithms in your exam. You do not need to
a 72 + 02 = 49 b 42 = 16 learn any of the algorithms in this section.
42 + 92 = 97 12 + 62 = 37
92 + 72 = 130 32 + 72 = 58
12 + 32 + 02 = 10 52 + 82 = 89
12 + 02 = 1 82 + 92 = 145
so 70 is happy 12 + 42 + 52 = 42
42 + 22 = 20
22 + 02 = 4 As soon as the sum of the squares matches a
42 = 16 previous result, all of the steps in-between will be
so 4 is unhappy repeated, creating a cycle.

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 2 19/01/19 8:02 PM


Algorithms

Example 2

a Implement this algorithm.

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.

b Describe the numbers that are generated by this algorithm.

A trace table is used to record the values of each


a Use a trace table.
variable as the algorithm is run.
Instruction n A B C Print
step
1 1 1 1
2 1, 1
3 2
You may be asked to complete a printed trace
4 2
table in your exam. Just obey each instruction, in
5 2 1 2
order.
6 Go to step 3
3 3
4 3
5 3 2 3
6 Go to step 3
3 5
4 5
5 4 3 5
6 Go to step 3
3 8
4 8
5 5 5 8
6 Continue to step 7
7 Stop

b This algorithm produces the first few


numbers in the Fibonnacci sequence. You may be asked what the algorithm does.

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 3 19/01/19 8:02 PM


Chapter 1

Example 3

This algorithm multiplies the two numbers A and B.

1 Make a table with two columns.


Write A in the top row of the left-hand column and B in the top row of the right-hand column.
2 In the next row of the table write:
• in the left-hand column, the number that This famous algorithm is sometimes
is half of A, ignoring remainders called ‘the Russian peasant’s algorithm’
• in the right-hand column, the number that or ‘the Egyptian multiplication algorithm’.
is double B
3 Repeat step 2 until you reach the row which has a 1 in the left-hand column.
4 Delete all rows where the number in the left-hand column is even.
5 Find the sum of the non-deleted numbers in the right-hand column.
This is the product AB.

Implement this algorithm when:


a A = 29 and B = 34 b A = 66 and B = 56.

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

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 4 19/01/19 8:02 PM


Algorithms

Exercise 1A
1 Use the algorithm in Example 3 to evaluate:
a 244 × 125 b 125 × 244 c 256 × 123

2 The box below describes an algorithm.


a c
1 Write the input numbers in the form __
​​   ​​ and __
​​   ​​
b d
2 Let e = ad.
3 Let f = bc.
e
4 Print ‘Answer is ​​ _ ​​   ’
f

a Implement this algorithm with the input numbers 2 ​​ _4 ​​ and 1 ​​ _3 ​​
1 1

b What does this algorithm do?

3 The box below describes an algorithm.

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.

a Implement the algorithm.


b Describe the numbers produced by the algorithm.

P 4 The box below describes an algorithm.


Hint This algorithm requires
1 Input A, r. 5 Let r = s.
you to use the modulus
A
2 Let C = __
​​  r ​​ to 3 decimal places. 6 Go to 2. function. If x ≠ y, |x − y|
is the positive difference
3 If |r − C  | < 10−2 go to 7. 7 Print r. between x and y.
For example |3.2 − 7| = 3.8.
4 Let s = _​​  2 ​​  (r + C  ) to 3 decimal places.
1
8 Stop.

a Use a trace table to implement the algorithm above when:


i A = 253 and r = 12   ii A = 79 and r = 10   iii A = 4275 and r = 50
b What does the algorithm produce?

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 5 19/01/19 8:02 PM


Chapter 1

1.2 Flow charts


You need to be able to implement an algorithm given as a flow chart.
■ In a flow chart, the shape of each box tells you about its function.

Start/End Instruction Decision

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

n is acting as a counter. It ensures that the


Box 3 Let n = n + 1 algorithm stops after this loop has been
completed 10 times.

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 Implement this algorithm using a trace table.


b Alter box 4 to read ‘Let E = 3n’ and implement the algorithm again.
How does this alter the algorithm?

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 6 19/01/19 8:02 PM


Algorithms

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

Print ‘roots are’ x1 ‘and’ x2

Stop

Demonstrate this algorithm for these equations:


a 6x2 − 5x − 11 = 0 b x2 − 6x + 9 = 0 c 4x2 + 3x + 8 = 0

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 7 19/01/19 8:02 PM


Chapter 1

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

n A T T < A? n < 5? Box 2 n=n+1


Box 1 1 10
Box 2 2 Let T = un
Box 3
Box 3 15
Box 4 No
No Is
Box 6 Yes Box 4
T < A?
Box 2 3
Yes
Box 3 9
Box 4 Yes Box 5 Let A = T

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.

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 8 19/01/19 8:02 PM


Algorithms

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

2 a Apply the flow chart in Example 6 to the following sets of data.


i u1 = 28, u2 = 26, u3 = 23, u4 = 25, u5 = 21
ii u1 = 11, u2 = 8, u3 = 9, u4 = 8, u5 = 5
Is
b If box 4 is altered to T > A? , how will this affect the output?

c Which box would need to be altered if the algorithm had to be applied to a list of 8 numbers?

3 The flow chart describes an algorithm that  Start


can be used to find the roots of the equation
2x3 + x2 − 15 = 0.
Input a
a Use a = 2 to find a root of the equation.
b Use a = 20 to find a root of the equation.
3
Comment on your answer. Let b = 15 – a2 to 4 d.p.
2

Links This flow_______


chart implements the iterative
Is

3 15 − xn
2 Yes
formula xn+1 = ​​ ​ _______
 ​ ​​ | a – b | < 0.001? Print b Stop
2
 ← Pure Year 2, Section 10.2
No
Let a = b

E/P 4 The flow chart on the right  Start


describes how to apply Euclid’s
algorithm to two non-zero integers,
a and b. Input a, b a > b

a Apply Euclid’s algorithm to:


i 507 and 52  (2 marks) Let P = integer part of a ÷ b

ii 884 and 85  (2 marks)


iii 4845 and 3795  (2 marks) Let q = Pb

b Explain what Euclid’s algorithm


does.  (2 marks) Let r = a – q

Is Yes
r = 0? Print b Stop

No
Let a = b, b = r

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 9 19/01/19 8:02 PM


Chapter 1

E/P 5 The flow chart describes an algorithm.  Start


a Copy and complete this table, using the flow
chart with A = 18 and B = 7.
Input A and B
A B A < B? Output
Yes
Is A < B? Print A

(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)

1.3 Bubble sort


A common data processing task is to sort an unordered list into alphabetical or numerical order.
■ Unordered lists can be sorted using a bubble sort or a quick sort.
Lists can be sorted into ascending or descending order.
■ In a bubble sort, you compare adjacent items in a list:
• If they are in order, leave them.
• If they are not in order, swap them.
• The list is in order when a pass is completed without any swaps.
As the bubble sort develops, it is helpful to consider the original list as being divided into a working
list, where comparisons are made, and a sorted list containing the items that are in their final
positions. To start with, all items are in the working list.

This is the bubble sort algorithm:

1 Start at the beginning of the working list and move


from left to right comparing adjacent items.
a If they are in order, leave them.
b If they are not in order, swap them.
2 When you get to the end of the working list, the Notation Each time you get to the
last item will be in its final position. This item is end of the working list you complete one
then no longer in the working list. pass of the algorithm. The length of the
working list reduces by 1 with each pass.
3 If you have made some swaps in the last pass,
repeat step 1.
4 When a pass is completed without any swaps, every
item is in its final position and the list is in order. Note The elements in the list ‘bubble’
to the end of the list in the same way as
You need to learn the bubble sort algorithm. bubbles in a fizzy drink rise to the top.
This is how the algorithm got its name.

10

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 10 19/01/19 8:02 PM


Algorithms

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.

a Starting at the beginning of the list, compare


the first two letters. If they are in alphabetical
order, leave them in position, if not then swap
them. Continue through the list, to the end,
comparing every pair of letters in the same way.
b A L G O R I T H M
A L G O R I T H M
A G L O R I T H M
A G L O R I T H M
A G L O R I T H M
A G L O I R T H M
A G L O I R T H M
A G L O I R H T M
At the end of the first pass, the last letter is
A G L O I R H M T
guaranteed to be in its correct place.
c A G L I O H M R T

11

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 11 19/01/19 8:02 PM


Chapter 1

Example 9

Use a bubble sort to arrange these numbers into descending order.


39  57  72  39  17  24  48

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

P 3 A list of n items is to be written in ascending order using the bubble sort.


a State the minimum number of passes needed.
b Describe the circumstances in which this number of passes would be sufficient.
c State the maximum number of passes needed.
d Describe the circumstances in which this number of passes would be needed.

12

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 12 19/01/19 8:02 PM


Algorithms

E 4 Here is a list of exam scores:


63  48  57  55  32  48  72  49  61  39
The scores are to be put in order, highest first, using a bubble sort.
a Describe how to carry out the first pass.  (2 marks)
b Apply a bubble sort to put the scores in the required order. Only show the state of
the list at the end of each pass.  (4 marks)

1.4 Quick sort


The quick sort algorithm can be used to arrange a list into alphabetical or numerical order. In many
circumstances, it is quicker to implement than the bubble sort algorithm.
■ 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. Note If an item is equal to the
• The other sub-list contains items greater than the pivot. pivot it can go in either sub-list.
• You then select further pivots from within each sub-list and repeat the process.

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

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 13 19/01/19 8:02 PM


Chapter 1

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

37 20 17 26 44 41 27 28 50 17 There are 10 items in the list so we choose


the number to the right of the middle.
This is the 6th number from the left.
44 50 41 37 20 17 26 27 28 17 Numbers greater than the pivot are to
the left of the pivot, those smaller than
the pivot are to the right, keeping the
50 44 41 37 27 28 26 20 17 17
numbers in order. Numbers equal to the
pivot may go either side, but must be
50 44 41 37 28 27 26 20 17 17 dealt with consistently.

50 44 41 37 28 27 26 20 17 17 Two pivots are chosen, one for each


sub-list.

50 44 41 37 28 27 26 20 17 17 Now three pivots are selected.

Watch out We now choose the next two pivots,


Colour is used here to make
even if the sub-list is in order.
the method clear, but colours should not
be used in your exam.
The final pivots are chosen to give the
list in order.

14

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 14 19/01/19 8:02 PM


Algorithms

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

2 Use quick sort to arrange the list


22  17  25  30  11  18  20  14  7  29
into:
a ascending order b descending order

3 Sort the letters below into alphabetical order using:


a a bubble sort b a quick sort
N  H  R  K  S  C  J  E  M  P  L

4 The list shows the test results of a group of students.


Alex 33 Hugo  9
Alison 56 Janelle 89
Amy 93 Josh 37
Annie 51 Lucy 57
Dom 77 Myles 19
Greg 91 Sam 29
Harry 49 Sophie 77
Produce a list of students, in descending order of their marks, using:
a a bubble sort b a quick sort

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)

E 6 The table shows a list of nine names of students in a dance class.


Hassler Sauver Finch Giannini Mellor Clopton Miranti Worth Argi
H S F G Me C Mi W A
a Explain how to carry out the first pass of a quick sort algorithm to order the list
alphabetically.  (2 marks)
b Carry out the first two passes of a quick sort on this list, writing down the pivots
used in each pass.  (3 marks)

15

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 15 19/01/19 8:02 PM


Chapter 1

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?

1.5 Bin-packing algorithms


Bin packing refers to a whole class of problems.
The easiest is to imagine stacking boxes of fixed width a and length b, but varying heights, into bins
of width a and length b, using the minimum number of bins.

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

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 16 19/01/19 8:02 PM


Algorithms

Example 12

Nine boxes of fixed cross-section have heights, in metres, as follows.


0.3 0.7 0.8 0.8 1.0 1.1 1.1 1.2 1.5
They are to be packed into bins with the same fixed cross-section and height 2 m.
Determine the lower bound for the number of bins needed.

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.

With small amounts of data it is often possible to ‘spot’ an optimal answer.


The algorithms you will learn in this chapter will not necessarily find an optimal solution, but can be
implemented quickly.
■ The first-fit algorithm works by considering items in the order they are given.
First-fit algorithm

1 Take the items in the order given.


2 Place each item in the first available bin that can take it. Start from bin 1 each time.

Advantage: It is quick to implement. Online See the operation of the


Disadvantage: It is not likely to lead to a good solution.
first-fit algorithm using GeoGebra.

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

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 17 19/01/19 8:02 PM


Chapter 1

■ The first-fit decreasing algorithm requires the items to be in descending order before
applying the algorithm.
First-fit decreasing algorithm

1 Sort the items so that they are in descending order.


2 Apply the first-fit algorithm to the reordered list.

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.

Advantage: You usually get a good solution.


Disadvantage: It is difficult to do, especially when the numbers are plentiful and awkward.

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

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 18 19/01/19 8:02 PM


Algorithms

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

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 19 19/01/19 8:02 PM


Chapter 1

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

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 20 19/01/19 8:02 PM


Algorithms

The lengths are arranged in ascending order of size.


a Obtain a lower bound for the number of rolls of carpet needed.  (2 marks)
b Use the first-fit decreasing bin-packing algorithm to determine the number of rolls needed.
State the length of carpet that is wasted using this method.  (3 marks)
c Give one disadvantage of the first-fit decreasing bin-packing algorithm.  (1 mark)
d Use a full-bin method to obtain an optimal solution, and state the total length of wasted
carpet using this method.  (4 marks)

E/P 5 Eight computer programs need to be copied onto 40 MB discs.


The size of each program is given below.
Program A B C D E F G H
Size (MB) 8 16 17 21 22 24 25 25

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)

1.6 Order of an algorithm


The order of an algorithm, sometimes called the complexity Note The size of a sorting problem,
of the algorithm, tells you how changes in the size of a for example, would be given by the
problem affect the approximate time taken for its completion. number of items to be sorted.
This is sometimes called the run time of the algorithm.
■ The order of an algorithm can be described as a Watch out The exact run time will
function of its size. If an algorithm has order f(n), depend on the exact input data for
then increasing the size of the problem from n the algorithm. However, you can use
to m will increase the run time of the algorithm proportion to calculate estimated
f(m)
by a factor of approximately ​​ _____ ​​ run times of algorithms.
f(n)

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

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 21 19/01/19 8:02 PM


Chapter 1

The total number of comparisons would then be:

1 + 2 + 3 + … + (n – 4) + (n − 3) + (n − 2) + (n − 1) Links This is the sum of the first (n – 1) natural


= _​​  1 ​​   (n − 1)n = ​​ _1 ​​  n2 − _​​  1 ​​  n
2 2 2
numbers. ← Core Pure Book 1, Section 3.1

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

An algorithm is defined by this flow diagram, where n > 2 and n is an integer.


Start

Input n

Let a = 2

Is n Yes
a=a+1 divisible A Stop
by a?

Yes Is No
a < n? B Stop

a Describe what the algorithm does.


b Suggest suitable output text for boxes A and B.
c Determine the order of the algorithm.

a The algorithm tests whether or not n is prime.


b Box A: n is not prime.
Box B: n is prime.
c Let the size of the algorithm be n.
At each step the algorithm tests whether n is Problem-solving
divisible by a. The maximum number of steps will not
If n is prime, the answer at this step will never __be always be needed. If n is even, then the
‘yes’ so the algorithm will continue until a > ​​√ n ​​. algorithm will only require one step. In
The maximum number of __steps needed is given general you should consider the worst case
by the integer part of ​​√ n ​​. __ scenario when determining the order of an
So the algorithm has order √​​ n ​​. algorithm.

22

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 22 19/01/19 8:02 PM


Algorithms

Some common orders you need to recognise:


● Linear order (n)
● Quadratic order (n2)
● Cubic order (n3)
You can use these simplified rules for linear, quadratic, and cubic order algorithms:
■ If the size of a problem is increased by some factor k then:
• an algorithm of linear order will take approximately k times as long to complete
• an algorithm of quadratic order will take approximately k2 times as long to complete
• an algorithm of cubic order will take approximately k3 times as long to complete.

Example 18

A given list-searching algorithm has linear order.


To search a list with 500 values, the algorithm takes approximately 0.036 seconds.
Estimate the time taken by this algorithm to search a list containing 1250 values.

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

The bubble sort algorithm has quadratic order.


a Given that it takes a computer 0.2 seconds to sort a list of 1600 numbers using the bubble sort,
estimate the time needed to sort a list of 480 000 numbers.
b Comment on the suitability of the bubble sort algorithm for sorting large data sets.

480 000 The size of the problem has increased by a factor


a ​​  _________
 ​​ = 300
1600 of 300.
0.2 × 300² = 18 000
It would take approximately 18 000 seconds The algorithm has quadratic order, so the time
taken will increase by a factor of 3002 = 90 000.
or 5 hours to sort 480 000 numbers.
b The length of time needed for bubble
The quick sort algorithm has, on average, order
sort increases quickly as n increases. This n log n. This means that increasing the size of
means the bubble sort algorithm is not the problem from 1600 to 480 000 would result
suitable for large data sets. in an increase in runtime by a factor of
480 000 × log 480 000
__________________
  
​​      ​​ ≈ 532. This is a lot less
1600 × log 1600
than the increase of a factor of 3002 = 90 000 for
a quadratic order algorithm.

23

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 23 19/01/19 8:02 PM


Chapter 1

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)

P 4 A student applies a bubble sort followed by a first-fit bin-packing algorithm.


The student states that because both algorithms have order n2, the complete process must have
order n4.
Explain why the student is incorrect, and state the correct order of the combined process.

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.

1 Add each student rating for an employer to that


employer’s rating for the student, to create a score for
each employer-student pair.
2 List the scores for all possible pairs, and order them
using bubble sort.
3 Take the highest score in the list and match the student
and employer for work experience. Then delete all other
pairings containing either that student or that employer.
4 Repeat step 3 until all students have been paired with
employers.

Determine the order of this algorithm, justifying your answer.  (3 marks)

24

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 24 19/01/19 8:02 PM


Algorithms

Mixed exercise 1

E 1 Use the bubble-sort algorithm to sort, in ascending order, the list


27  15  2  38  16  1
giving the state of the list at each stage.  (4 marks)

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

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 25 19/01/19 8:02 PM


Chapter 1

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

c If Box 4 in the flow chart is altered to


‘Is M > Temp?’
state what the algorithm achieves now.  (1 mark)

26

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 26 19/01/19 8:02 PM


Algorithms

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)

E/P 9 Here are the names of eight students in an A level group:


Maggie, Vivien, Cath, Alana, Daisy, Beth, Kandis, Sara
a Use a quick sort to put the names in alphabetical order. Show the result of each pass
and identify the pivots.  (5 marks)
The quick sort algorithm has order n log n.
A computer program can sort a list of 100 names in 0.3 seconds using a quick sort.
b Estimate the time needed for this computer program to apply a quick sort to a list of
1000 names.  (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

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 27 19/01/19 8:02 PM


Chapter 1

Summary of key points


1 An algorithm is a finite sequence of step-by-step instructions carried out to solve a problem.

2 In a flow chart, the shape of each box tells you about its function.

3 Unordered lists can be sorted using a bubble sort or a quick sort.

4 In a bubble sort, you compare adjacent items in a list:


• If they are in order, leave them.
• If they are not in order, swap them.
• The list is in order when a pass is completed without any swaps.

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:

Type of algorithm Advantage Disadvantage


First-fit Quick to implement Not likely to lead to a good solution
First-fit decreasing Usually a good solution May not get an optimal solution
Easy to implement
Full-bin Usually a good solution Difficult to do, especially when the
numbers are plentiful or awkward

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)

9 If the size of a problem is increased by some factor k then:


• an algorithm of linear order will take approximately k times as long to complete
• an algorithm of quadratic order will take approximately k2 times as long to complete
• an algorithm of cubic order will take approximately k3 times as long to complete.

28

M01_EDD1_SB_ASAL_83299_U01_001-028.indd 28 19/01/19 8:02 PM


Graphs and networks
Objectives
After completing this chapter you should be able to:
2
● Know how graphs and networks can be used to create mathematical
models → pages 30–33
● Be familiar with basic terminology used in graph theory
 → pages 34–38
● Know some special types of graph  → pages 38–40
● Understand how graphs and networks can be represented
using matrices  → pages 41–43
● Use the planarity algorithm to determine whether or not a
given graph is planar → pages 43–47

Prior knowledge check


1 In the diagram, triangle ABC has
sides of lengths a, b and c.
A
b c

C B
a

Explain why a < b + c


 ← GCSE Mathematics

2 The diagram shows two houses which


must each be connected to gas (G   ),
water (W ) and electricity (E   ) supplies.

In decision maths, a graph or network


refers to a set of points joined by edges
(line segments). This graph models the G W E
London Underground network. The lines
show which stations are connected but Show how this can be done without
their lengths do not represent distances any of the connecting lines crossing
in real life. → Exercise 2A Q3 each other.

29

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 29 21/01/19 5:51 PM


Chapter 2

2.1 Modelling with graphs


You need to know how graphs and networks can be used to create mathematical models. In decision
maths, the word graph has a very specific meaning.
■ A graph consists of points (called vertices or nodes) which are connected by lines (edges or
arcs).
■ 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.
Notation
● A vertex is a point on a graph. Vertices are sometimes called nodes.
● An edge is a line segment joining vertices. Edges are sometimes called arcs.

Example 1

This graph shows the routes flown by an airline. Addis Ababa


Douala
a Explain why this is a graph.
Kigali
b Describe what is represented by Kinshasa
i the vertices Liberville Bujumbura
ii the edges.
c Describe two possible flight routes from Nairobi
Johannesburg to Liberville. Brazzaville

a It has vertices connected by edges.


Johannesburg
b i Cities served by the airline
ii Flight routes connecting cities The graph shows only which cities are connected
c Johannesburg to Douala to Liberville by a flight route. There is no scale and the graph
Johannesburg to Kinshasa to Liberville is not weighted, so it does not show any distances
or the correct geographical position of the cities.

Example 2

This network shows the lengths of pipes running A 150 E


between water standpipes on a camp site. The lengths 30 80 60
60 100
on the edges are given in metres. main B F
50 90
supply D
a Write down the length of the pipe connecting
80
standpipe B to standpipe D. 100
b Write a list of the standpipes that are directly C
connected to standpipe E.

This is an example of a weighted network.


a 50 m
b A, B, F

30

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 30 21/01/19 5:51 PM


Graphs and networks

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.

The minimum time required is 12 minutes along


the route ABED.

Exercise 2A
1 This graph represents the friendships within a group of students.
Alex
Fred Harriet
Becky

Chris

Govinda
Dhevan Esme

a State what is represented by each


i vertex
ii arc
b List all of Chris’s friends within the group.
c State two new friendships that could be created to ensure that every pair of friends has at least
one mutual friend.

31

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 31 21/01/19 5:51 PM


Chapter 2

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

Maths Physics Chemistry Biology Art English

b Which subjects are studied by the most students?

P 3 The diagram shows part of the London Underground map.

a Work out a possible route from Marylebone to Victoria


i that requires a minimum number of changes
ii that passes through a minimum number of stations.

32

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 32 21/01/19 5:51 PM


Graphs and networks

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 33 21/01/19 5:51 PM


Chapter 2

2.2 Graph theory


You need to be familiar with some basic terminology used to describe graphs in decision maths.
There are two different types of notation used to describe graphs, as follows:
B
A and B are
nodes or vertices.
C C is a node or a vertex.
A

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

■ If the degree of a vertex is even, you say it Notation


has even degree, so J, K and M have
● A subgraph is a part of the original graph.
even degree. Similarly vertices L and N ● The degree of a vertex is sometimes called
have odd degree. the valency or order.
■ A walk is a route through a graph along ● Even degree means that a vertex has an even
edges from one vertex to the next. number of incident edges. Odd degree means
the vertex has an odd number of incident
■ A path is a walk in which no vertex is edges.
visited more than once.

34

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 34 21/01/19 5:51 PM


Graphs and networks

■ 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

In the graph below, an example of:


● a walk is RSUWVU It is ok to include a vertex or an edge more than once on a walk.
● a path is RSUVW
● a trail is RUSVUW
● a cycle is RSUR It is not necessary to include every vertex in a cycle.
● a Hamiltonian cycle is RSUVWTR.
S
V

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.

■ A loop is an edge that starts and finishes at the same vertex.


A
This contains a loop from C to C.

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 35 21/01/19 5:51 PM


Chapter 2

■ 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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 36 21/01/19 5:51 PM


Graphs and networks

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.

2 Which of the graphs below are not simple?


a A D b F G
K

C J

I H
B E
c P d U V

T Q
W

X
Z
S R

3 In question 2, which graphs are not connected?

4 For the graph on the right, state: A


B
a four paths from F to D
b a cycle passing through F and D C
F
c the degree of each vertex.
D
Use the graph to: E

d draw a subgraph Notation A lemma is a mathematical fact used


e confirm the handshaking lemma. as a stepping stone to more important results.

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 37 21/01/19 5:51 PM


Chapter 2

7 Copy the diagram and complete a digraph 2 16


for the relationship ‘is a factor of’.

4 8

E 8 a Explain what is meant by a Hamiltonian cycle. (2 marks) P

b For this graph, list all of the Hamiltonian cycles


that start from the vertex P. (4 marks) T Q
c Explain what is meant by a subgraph. (2 marks)
d Draw a subgraph of this graph with 4 vertices. (1 mark)

S R

2.3 Special types of graph


You need to know about the following special types of graph.
■ A tree is a connected graph with no cycles.
B R
C S
A

D
T
E U W
F G V

A tree This is not a tree.


It contains cycle RTUSR.

■ 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

possible spanning trees are:


B D B D
  or  
A F A F

C E C E

There are many other possible spanning trees.

38

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 38 21/01/19 5:51 PM


Graphs and networks

■ A complete graph is a graph in which every vertex is directly connected by a single edge to
each of the other vertices.

Notation The complete graph


with n vertices is written as K n .

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 39 21/01/19 5:51 PM


Chapter 2

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

E 5 a Define the terms:


i tree (1 mark)
ii spanning tree. (1 mark)
b Explain why it is not possible to construct a spanning tree for this graph. (1 mark)

E/P 6 a Draw K4. (2 marks)


b State the degree of each vertex in the graph Kn. (1 mark)
c Find the total number of edges in the graph K20. (2 marks)

Challenge Hint Not counting isomorphic graphs, there


Draw all possible connected graphs with three edges. are 11 such graphs.

40

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 40 21/01/19 5:51 PM


Graphs and networks

2.4 Representing graphs and networks using matrices


You can use an adjacency matrix to represent a graph or network. The adjacency matrix provides
information about the connections between the vertices in a graph.
■ Each entry in an adjacency matrix describes the number of arcs joining the corresponding
vertices.

B
Example 6 E

Use an adjacency matrix to represent this graph. A


F
C

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.

The matrix associated with a weighted graph is called a distance matrix.


■ In a distance matrix, the entries represent the weight of each arc, not the number of arcs.

Example 7

Use a distance matrix to represent this network. B 23


17 E
A 19 16
15
A B C D E D
18 20
A — 17 18 — — C
B 17 — 15 19 23
C 18 15 — 20 — Watch out You should be able to write down
D — 19 20 — 16 the distance matrix given the network and draw
the network given the distance matrix.
E — 23 — 16 —

If the network has directed edges the distance


Notice that the matrix is symmetrical about the matrix will not be symmetrical.
leading diagonal (top left to bottom right). This
will be the case for any non-directed network.

41

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 41 21/01/19 5:51 PM


Chapter 2

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

S 4 — — 9 — 10 Watch out This matrix is not symmetrical about


11 — — 8 — — the leading diagonal.
T
U — 9 8 — 6 — This indicates a direct link of weight 6 from U to V.
V — — — 7 — —
This indicates a direct link of weight 7 from V to U.
W — 10 — — 9 —
This shows a direct link of weight 9 from W to V.

Exercise 2D
1
D
B G

C F

A
E

Use an adjacency matrix to represent the graph above.

2 Draw a graph corresponding to each adjacency matrix.


a A B C D E b A B C D
A 0 1 0 1 0 A 0 1 0 1
B 1 0 1 1 1 B 1 0 0 1
C 0 1 0 2 0 C 0 0 2 1
D 1 1 2 0 1 D 1 1 1 0
E 0 1 0 1 0

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 42 21/01/19 5:51 PM


Graphs and networks

3 Draw the network corresponding to each distance matrix.


a A B C D E b A B C D E F
A — 21 — 20 23 A — — — — 15 8
B 21 — 17 23 — B — — 9 13 17 11
C — 17 — 18 41 C — 9 — 8 — —
D 20 23 18 — 22 D — 13 8 — 10 —
E 23 — 41 22 — E 15 17 — 10 — —
F 8 11 — — — —

4 Use a distance matrix to represent the directed network below.


B 11 E
14 9
13 7
A 10 F
D 10
11 12
C

E 5 a Draw a graph to represent this adjacency matrix.


A B C D E
A 0 2 0 0 1
B 2 0 1 0 1 Watch out This is an adjacency matrix, not a
distance matrix.
C 0 1 0 1 1
D 0 0 1 0 1
E 1 1 1 1 0 (3 marks)
b For this graph, a spanning tree may be drawn such that one vertex connects to every edge.
Which vertex is this? (1 mark)
c Draw the spanning tree referred to in part b. (2 marks)

2.5 The planarity algorithm


A
You need to be able to determine whether a graph is planar.
■ A planar graph is one that can be drawn in a plane such that no two edges meet except at a
vertex.
Both of these graphs have edges crossing, so it
appears that neither is planar. However, K4 can
be drawn with no edges crossing.
K4 K5

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 43 21/01/19 5:51 PM


Chapter 2

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:

1 Identify a Hamiltonian cycle.


2 Draw a polygon with vertices labelled to match Try to draw a regular polygon as this
the ones in the Hamiltonian cycle. makes things clearer.
3 Draw edges inside the polygon to match
the edges of the original graph not already This is a list of all the edges in the
represented by the polygon itself. original graph that are not part of the
4 Make a list of all edges inside the polygon, in Hamiltonian cycle. You will attempt
any order. to show how the graph can be drawn
in a planar way by choosing edges to
5 Choose any unlabelled edge in your list and draw inside (‘I’) and outside (‘O’) the
label it ‘I’. If all edges are now labelled then the Hamiltonian cycle.
graph is planar.
6 Look at any unlabelled edges that cross the
edge(s) just labelled:
● If there are none, then go back to step 5

● If any of these edges cross each other, then

the graph is non-planar.


● If none of these edges cross each other, give
If the last set of edges were labelled ‘I’,
them the opposite label to the edge(s) just then the ‘opposite label’ would be ‘O’, and
labelled. vice versa.
● If all edges are now labelled, the graph is

planar. Otherwise, go back to the start of


step 6.

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 44 21/01/19 5:51 PM


Graphs and networks

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

Count to check: there are 7 edges inside the


Step 4: AE, AF, BH, BE, DH, FC, GH
polygon so there should be 7 edges in your list.

Step 5: AE(I), AF, BH, BE, DH, FC, GH


Choose any edge to start and label it ‘I’.
Step 6: Edge just labelled ‘I’: AE
Unlabelled edges that cross AE: BH and Edges BH and DH cross AE and are unlabelled.
DH They don’t cross each other, so label them ‘O’. The
AE(I), AF, BH(O), BE, DH(O), FC, GH graph still contains unlabelled edges, so go back
to the start of step 6.
Step 6: Edges just labelled ‘O’: BH and DH
Unlabelled edges that cross BH or DH: Consider all the edges that cross any of those
AF and BE just labelled. AE also crosses, but it is labelled
AE(I), AF(I), BH(O), BE(I), DH(O), FC, GH already, so you don’t need to include it. AF and
BE do not cross each other, so label them ‘I’, and
Step 6: Edges just labelled ‘I’: AF and BE go back to the start of step 6.
Unlabelled edges that cross AF or BE: none
BH, BE and DH all cross the edges just labelled,
Step 5: but they are already labelled. Go back to step 5.
AE(I), AF(I), BH(O), BE(I), DH(O), FC(I), GH
Choose either of the unlabelled edges and label
Step 6: Edge just labelled ‘I’: FC it ‘I’.
Unlabelled edges that cross FC: GH
AE(I), AF(I), BH(O), BE(I), DH(O), FC(I), GH(O)
All edges are labelled so the graph is planar:

Watch out You can demonstrate the completed


A B algorithm by giving each edge inside the
Hamiltonian cycle with its label, but the safest
H D way to check your answer and show that the
graph is planar is to draw an isomorphic graph in
a planar way. Draw any edges labelled ‘I’ inside
C E
the Hamiltonian cycle, and any edges labelled ‘O’
outside the Hamiltonian cycle.
G F

45

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 45 21/01/19 5:51 PM


Chapter 2

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.

Component Connected to In the table, each connection is only represented


A B, D, E, F once. For example, the connection from A to B is
B C, D, E, F shown, but not the connection from B to A.
C D, E
D E, F
E F
Using the Hamiltonian cycle ABCDEFA, apply the planarity algorithm to determine whether the
connections can be made without any wires crossing.

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 46 21/01/19 5:51 PM


Graphs and networks

A 2 a Define what is meant by a planar graph. (2 marks)


E A E

B F

C G

D H

b Starting at A, find a Hamiltonian cycle for the graph shown. (1 mark)


c Use the planarity algorithm to determine whether or not the graph is planar.
You must make your working clear and justify your answer. (4 marks)

E/P 3 Electronic components P, Q, R, S, T and U are attached to a circuit board.


The table shows the connections to be made with wires between the components.
Each connection is shown only once.

Component Connects directly to


P Q, R, S, T, U
Q R, U
R T, U
S T, U
T U
a Draw a graph to represent the connections between the components. (2 marks)
b Determine whether or not the connections can be made without crossing any wires. (4 marks)
A new connection is required between R and S.
c Apply the planarity algorithm a second time to determine whether the addition of this
connection will affect your answer to part b.  (4 marks)

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 47 21/01/19 5:51 PM


Chapter 2

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.

2 Which of these graphs are isomorphic?


a b c d e

f g h i

3 a Draw a graph with eight vertices, all of degree 1.


b Draw a graph with eight vertices, all of degree 2, so that the graph is:
i connected and simple   ii not connected and simple   iii not connected and not simple.

4 a Describe the difference between a distance matrix and an adjacency matrix.


b Use a distance matrix to represent the network below.
B 50
F
20 15 30
18 25
A 20
C
16 10
E
23
D

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 48 21/01/19 5:51 PM


Graphs and networks

E 7 The diagram shows a graph.


A

E B

D C

a Write down the valency of vertex A. (1 mark)


b Identify:
i a path from B to D (1 mark)
ii a cycle. (1 mark)
c Sketch:
i a spanning tree for this graph (1 mark)
ii a complete subgraph of this graph. (2 marks)

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)

A 9 A Hamiltonian cycle for this graph begins AGB…


E A E

B F

C G

D H

a Complete the Hamiltonian cycle. (2 marks)


b Use the planarity algorithm to determine whether the graph is planar. (4 marks)

E/P 10 A B

F
C

E
D

a Write down a Hamiltonian cycle starting from A. (2 marks)


b Show that this graph is planar by using the planarity algorithm. (4 marks)
Arc AB is added to the graph.
c Use the planarity algorithm to show that the new graph is non-planar. (4 marks)

49

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 49 21/01/19 5:51 PM


Chapter 2

Challenge
A The diagram shows a connected planar graph. The finite regions
of the graph are shaded in different colours.

Let V denote the number of vertices, E denote the number of


edges, and R denote the number of finite regions in a connected,
planar graph.
a For the graph above, verify that V + R – E = 1.
b Draw a graph with one vertex and four edges, and verify that
V + R – E = 1.
c Explain why the relationship V + R – E = 1 holds for any graph
with one vertex.
A contraction of an edge in a graph glues together adjacent
vertices, creating a graph with one fewer vertex. This diagram
shows the above graph with one edge contracted.

d Given that G is a planar connected graph, and that G’ is the


graph formed by contracting one edge of G, show that if the
relationship V + R – E = 1 holds for G’, then it must hold for G.
e Using your results from parts c and d, show that the Links In part e, use proof by
relationship V + R – E = 1 holds for all planar connected induction.
graphs.  ← Core Pure Book 1, Chapter 8

Summary of key points


1 A graph consists of points (called vertices or nodes) which are connected by lines (edges or
arcs).

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 50 21/01/19 5:51 PM


Graphs and networks

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.

7 A path is a walk in which no vertex is visited more than once.

8 A trail is a walk in which no edge is visited more than once.

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.

10 A Hamiltonian cycle is a cycle that includes every vertex.

11 Two vertices are connected if there is a path between them. A graph is connected if all its
vertices are connected.

12 A loop is an edge that starts and finishes at the same vertex.

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.

16 A tree is a connected graph with no cycles.

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

M02_EDD1_SB_ASAL_83299_U02_029-051.indd 51 21/01/19 5:51 PM


3 Algorithms on
graphs
Objectives
After completing this chapter you should be able to:
● Use Kruskal’s algorithm to find a minimum spanning tree
 → pages 53–57
● Use Prim’s algorithm on a network to find a minimum
spanning tree  → pages 57–59
● Apply Prim’s algorithm to a distance matrix → pages 60–65
● Use Dijkstra’s algorithm to find the shortest path between
two vertices in a network  → pages 66–73
● Use Floyd’s algorithm  → pages 73–79

Prior knowledge check


The diagram shows a weighted network.
A
12
B
9 15 7
4
3 11 C
G
F 14
2 5 9

E 16 D Map apps model roads as arcs


on a graph, and add weightings
a State the order of vertex C.
depending on traffic conditions.
b Draw a distance matrix for this network. By finding the shortest path
c Find a spanning tree with total weight less than on the graph, the website can
40. State clearly which arcs are included in your compute the quickest route to a
spanning tree and its total weight.  ← Chapter 2 destination.  → Exercise 3D Q7

52

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 52 21/01/19 4:20 PM


Algorithms on graphs

3.1 Kruskal’s algorithm


You can use Kruskal’s algorithm to find a minimum spanning tree. This can tell you the shortest,
cheapest or fastest way of linking all the nodes in a network.
Notation An MST is
■ A minimum spanning tree (MST) is a spanning tree such that sometimes called a
the total length of its arcs (edges) is as small as possible. minimum connector.
■ Kruskal’s algorithm can be used to find a minimum spanning tree:

1 Sort all the arcs (edges) into ascending order of weight.


2 Select the arc of least weight to start the tree.
3 Consider the next arc of least weight. Online Explore
• If it would form a cycle with the arcs already selected, reject it. Kruskal's algorithm
• If it does not form a cycle, add it to the tree. using GeoGebra.
If there is a choice of equal arcs, consider each in turn.
4 Repeat step 3 until all vertices are connected.

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 53 21/01/19 4:20 PM


Chapter 3

Add BC. Watch out The spanning tree does not


D necessarily remain connected as it grows, but the
4 8 finished spanning tree must be connected.
E C
6 6
5
5
B
7
A
Reject AD (it would make the cycle AEDA).
Add BD.
D
4 8
E C
6 6 All the vertices are now connected so you can stop.
5
5
7 B
A
If you continued to work through the list of arcs,
All vertices are connected so this is a each would be rejected because they would make
minimum spanning tree. cycles.
Its weight is 5 + 4 + 6 + 5 = 20

Example 2

Use Kruskal’s algorithm and show that there are  A 8 D


four minimum spanning trees for this network.
13
State their weight. 10 10
12 F
C
12 11
8
E
B 14

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 54 21/01/19 4:20 PM


Algorithms on graphs

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

Reject CD (it forms a cycle ACDA).


Add EF. 8
A D Notice that, when using Kruskal’s algorithm, the
10 C chosen arcs seem to jump around the network.
8 F Remember Kruskal’s algorithm seems chaotic.
11
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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 55 21/01/19 4:20 PM


Chapter 3

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

E/P 2 a State what is meant by:


i a tree  (1 mark)
ii a minimum spanning tree.  (1 mark)
b Use Kruskal’s algorithm to find a minimum spanning tree for this network.  (3 marks)
X
S 18 17
18
U 18 Y
22 17
20
W 15
19
T 16 18
23 V Z

c Draw the minimum spanning tree found in part b.  (1 mark)


d State, giving a reason, whether this minimum spanning tree is unique.  (1 mark)

56

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 56 21/01/19 4:20 PM


Algorithms on graphs

P 3 Draw a network in which:


a the three shortest edges form part of the minimum connector (MST)
b not all of the three shortest edges form part of the minimum connector.

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)

3.2 Prim’s algorithm


■ Prim’s algorithm can be used to find a minimum spanning tree:

1 Choose any vertex to start the tree. Note Prim’s algorithm


considers vertices,
2 • Select an arc of least weight that joins a vertex already in the
whereas Kruskal’s
tree to a vertex not yet in the tree. algorithm considers
• If there is a choice of arcs of equal weight, choose any of them. edges.
3 Repeat step 2 until all the vertices are connected.

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 57 21/01/19 4:20 PM


Chapter 3

Choose to start the tree at A.


Add the arc of least weight, AF, to the tree.
B F
8 The arcs to consider are those linking A to another
vertex: AF(8), AB(9), AD(9), AE(11) and AC(12).
A
C Add the one of least weight, AF, to the tree.

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

Add AB to the tree.


B F
9 8 The arcs linking A, F, D and C to the remaining
vertices (B and E  ) are AB(9), AE(11), FE(12),
A
C FB(15), DE(14), CB(10). The one of least weight
is AB.
8 9
E
D
Add AE to the tree.
B F The arcs linking A, F, D, C and B to the remaining
9 8
vertex, E, are AE(11), FE(12), DE(14). The one of
A least weight is AE.
C
11
8 9
E
D Hint Notice that with Prim’s algorithm the tree
Arcs added in this order: AF, AD, DC, AB, AE. always grows in a connected fashion. The arcs
do not jump around as they sometimes do in
Kruskal’s algorithm.

58

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 58 21/01/19 4:20 PM


Algorithms on graphs

Exercise 3B
1 Repeat Question 1 in Exercise 3A using Prim’s algorithm. Start at vertex A each time.

2 Describe two differences between Prim’s algorithm and Kruskal’s algorithm.

3 The network shows the distances,  H


E 5.2 C
3.1
in kilometres, between eight weather D
1.8 3.7
monitoring stations. The eight stations 2.5 2.4
A 3.5
need to be linked together with 4.6 E
underground cables. 2.3 B
G 3.4 2.8
a Use Prim’s algorithm, starting at A, 8.7
to find a minimum spanning tree. F
You must make your order of arc selection clear.  (3 marks)
b Given that cable costs £850 per kilometre to lay, find the minimum cost of linking these weather
stations.  (1 mark)

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 59 21/01/19 4:20 PM


Chapter 3

3.3 Applying Prim’s algorithm to a distance matrix


Networks (especially large ones) are often described using distance matrices. This is a convenient way
to input a large network into a computer. You can apply Prim’s algorithm directly to a distance matrix,
which makes it more convenient for computer applications.
■ The distance matrix form of Prim’s algorithm is:

1 Choose any vertex to start the tree.


2 Delete the row in the matrix for the chosen vertex.
3 Number the column in the matrix for the chosen vertex.
4 Put a ring round the lowest undeleted entry in the numbered
columns. (If there is an equal choice, choose randomly.)
5 The ringed entry becomes the next arc to be added to the tree.
6 Repeat steps 2, 3, 4 and 5 until all rows have been deleted.

Example 4

Apply Prim’s algorithm to the distance matrix A B C D E


to find a minimum spanning tree.
Start at A. A – 27 12 23 74
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 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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 60 21/01/19 4:20 PM


Algorithms on graphs

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 61 21/01/19 4:21 PM


Chapter 3

Example 5

Here is the distance matrix used in Example 4.


A B C D E
a Work out the number of comparisons A – 27 12 23 74
required to complete Prim’s algorithm.
B 27 – 47 15 71
b Work out the number of comparisons
required for an n × n distance matrix. C 12 47 – 28 87
c State the order of this implementation D 23 15 28 – 75
of Prim’s algorithm in terms of the number E 74 71 87 75 –
of vertices, n.

a Once the 1st vertex has been selected,


you need to choose the least of 5 − 1 = 4
values in a single column.
1

A B C D E
A – 27 12 23 74 The three comparisons are:
B 27 – 47 15 71 1. Compare the values in rows B and C, and
C 12 47 – 28 87 select the smallest.
D 23 15 28 – 75 2. Compare this to the value in row D, and select
E 74 71 87 75 – the smallest.
This requires 4 − 1 = 3 comparisons. 3. Compare this to the value in row E and select
Once the 2nd vertex has been selected, the smallest.
there are 2 columns to consider. In general, you can choose the smallest of n
different numbers by making n − 1 comparisons.
1 2
↓ ↓
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
E 74 71 87 75 –
The number of values in each column
is 5 − 2 = 3 so there are a further
3 × 2 − 1 = 5 comparisons to make.
Once the 3rd vertex has been selected,
there are 3 columns to consider.
The number of values in each column
is 5 − 3 = 2 so there are a further
2 × 3 − 1 = 5 comparisons to make.
Once the 4th vertex has been selected,
there are 4 columns to consider.

62

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 62 21/01/19 4:21 PM


Algorithms on graphs

The number of values in each column is


5 − 4 = 1 so there are a further This corresponds roughly to the number of steps
1 × 4 − 1 = 3 comparisons to make. a computer program would have to carry out in
The total number of comparisons is order to execute Prim’s algorithm on this distance
matrix.
3 + 5 + 5 + 3 = 16
b Starting with an n × n matrix, the row Problem-solving
corresponding to the starting vertex is
An n × n distance matrix corresponds to a network
crossed out, leaving n − 1 values in the
with n vertices. By considering the number of
corresponding column. The smallest of
comparisons needed in an n × n distance matrix,
these is to be found. This requires you can determine the order of Prim’s algorithm
(n − 1) − 1 comparisons. when applied to a network with n vertices.
At each stage, the number of columns
included increases by 1 and the number of
After the rth vertex has been selected you will
values remaining in each of those columns need to find the least of (n − r) × r values, which
reduces by 1. requires (n − r) × r − 1 comparisons.
The total number of comparisons required
to complete the algorithm is given by n n
Use ​​∑​​  1​ = n​, ​​∑​​  r​ = _​  12 ​  n(n + 1)​and ​
((n − 1) × 1 − 1) + ((n − 2) × 2 − 1) + ((n − 3) n
r=1 r=1

× 3 − 1) + … + ((n − (n − 1)) × (n − 1) − 1) ​∑ ​r​  ​​  ​= _​  16 ​  n(n + 1)(2n + 1)​


2​
r=1  
n−1
 ← Core Pure Book 1, Chapter 3
= ​∑​(​(n − r) × r − 1)
r=1
n−1 n−1 n−1
= n ​​  ∑​​r​​ − ​​  ∑​​r2​​ − ​​  ∑​​1​​ As a check, when n = 5, this gives
r=1 r=1 r=1
96
​5​​  3​− 7 × 5 + 6 ___
____________
= n​​(__
​  21 ​  (n − 1) n)​​ − __
​​  61 ​​  (n − 1) n(2n − 1) − (n − 1) ​​   
6
 ​ = ​   ​ = 16​
6
which is the result found in part a.
3n2(n − 1) − n(n − 1)(2n − 1) − 6(n − 1)
= ​​  ___________________________________
        ​​
6
​n​​  3​ − 7n + 6 When determining the order of an algorithm, you
= ____________
  
​​   ​​ only need to consider the highest power of n. As n
6
gets large, the n3 term will have the largest effect
c The order of Prim’s algorithm is n3.
on the runtime of the algorithm.

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 63 21/01/19 4:21 PM


Chapter 3

2* The table shows the distance, in miles, between five cities. It is intended to link these
five cities by a transit system.

Birmingham Nottingham Lincoln Stoke Manchester


Birmingham – 164 100 49 88
Nottingham 164 – 37 56 74
Lincoln 100 37 – 90 86
Stoke 49 56 90 – 44
Manchester 88 74 86 44 –
Use Prim’s algorithm, starting at Birmingham, to find the minimum total length of a
transit system linking all five cities. You must list the arcs in order of selection and state
the weight of your tree.

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 64 21/01/19 4:21 PM


Algorithms on graphs

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 65 21/01/19 4:21 PM


Chapter 3

3.4 Using Dijkstra’s algorithm to find the shortest path


You can use Dijkstra’s algorithm to find the shortest path between two vertices in a network. This could
be useful for finding the cheapest, shortest or quickest transportation route between two locations.
■ Dijkstra’s algorithm can be used to find the shortest path Note Dijkstra is pronounced
from S to T through a network: ‘Dike-Stra’.

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.

Online Explore Dijkstra's algorithm using


GeoGebra.

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 66 21/01/19 4:21 PM


Algorithms on graphs

The network becomes


A
4
5 D Give vertex S a final label of 0.
4 Indicate that this is the first vertex to
S 1 0 6 B 3 receive its final label by completing
8 the top boxes at S like this:
T S 1 0
2 2

C 12

Give working values to A, B and C


A since they are directly connected
5 4 to S.
5 D
4
S 1 0 6 B 3
6 8
T
2 2

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 67 21/01/19 4:21 PM


Chapter 3

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 The smallest working value is the 8


5 4 at D. This becomes D’s final label.
5 D 5 8 D becomes the 5th vertex to be
4 8 completed. The only working value to
S 1 0 6 B 3 4 3 add is the 11 at T.
6 4 8
T
2 2
14 12 11
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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 68 21/01/19 4:21 PM


Algorithms on graphs

The length of the shortest route from S to T is 11.


To find the shortest route, start at T and trace back
looking at final values and arc lengths.
Check the arcs into T.
11 − 2 ≠ 12 so CT is not on the route
11 − 4 ≠ 8 so BT is not on the route
11 − 8 = 3 so DT is on the route
To get to T in 11 you must have come from D. Continue
working back from D.
The working is Watch out Unless you are asked
11 − 8 = 3 DT to explain how you obtained your
8−4=4 BD final route, you do not need to
4−2=2 CB show all of this working. You can
2−0=2 SC identify the shortest route from
So the shortest route is your fully labelled diagram by
SCBDT, length 11 inspection.

■ 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

Use Dijkstra’s algorithm in this network to  B 15 E


find the length of the shortest route:
8 7 8
a from A to H 6
18 D 9 8
b from A to G. A H
G
List the routes you use. 6
8 8 9

C 12 F

a The final diagram looks like this. It shows all


the working needed to make the method clear. The lowest working values
at B and at C are both 8, so
B 3 8 15 E 6 21 either can be chosen first.
8 23 21
8 7 6 8

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 69 21/01/19 4:21 PM


Chapter 3

The length of the shortest route from A to H is 29.


There are two shortest routes: either 29 − 21 = 8 EH
21 − 15 = 6 DE
ABDEH and ACFH.
15 − 8 = 7 BD
b From the diagram, the length of the shortest route from
8− 0= 8 AB
A to G is 24.
Problem-solving or 29 − 20 = 9 FH
The route is ABDG.
20 − 8 = 12 CF
G already has a final value, so you do
8 − 0 = 8 AC
not need to implement the algorithm
again. Just work backwards from G
to A.

■ 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

a The final diagram looks like this:


Check that your method can be
B 3 4 4 D 4 5 11 G 7 15 understood from the diagram.
5 4 5 16 15
3 9 1 2
2
C 2 2 F 6 14 5 H 8 17
5 1
2 14 19 17
2 8 2
5 7
A 1 0 E 5 6 I 9 19
5 7 6 14 20 19

Examiners check the order in which the Problem-solving


numbers appear in the list of working values. Notice that 5 does not appear as a working value
It is important to put them in the order given for vertex E since it is not possible to traverse
by the algorithm. directly from A to E.

70

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 70 21/01/19 4:21 PM


Algorithms on graphs

The two quickest routes are


ACDFGHI and ACDEFGHI Watch out In this question you
since since are told to explain how you found
19 − 17 = 2 HI 19 − 17 = 2 HI the route from your diagram, so you
17 − 15 = 2 GH 17 − 15 = 2 GH need to show these calculations.
15 − 14 = 1 FG 15 − 14 = 1 FG
14 − 5 = 9 DF 14 − 6 = 8 EF
5− 2=3 CD 6− 5=1 DE
2− 0=2 AC 5− 2=3 CD
2 − 0 = 2 AC
Both are of length 19 minutes.
b Removing HI from the network would leave a final value of 20 at I. Start at I and find the route of
length 20.
20 − 6 = 14 EI
6−5=1 DE
5−2=3 CD
2−0=2 AC
So the quickest route from A to I, avoiding HI, is ACDEI, of length 20 minutes.

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 71 21/01/19 4:21 PM


Chapter 3

3* Use Dijkstra’s algorithm to find the        A


6 B
12
shortest route, and its length, from 18 9 C
A to F in this directed network. 10
14 2
E 27
D 13
16
F
22
8
G

E/P 4* The network represents the lengths, in B


metres, of all the roads in a building site.
331 275
A crane is needed for one day at T. There are E 291
379 G
two cranes available on-site, one at S1, and C
S1
the other at S2. 890 438
207 118
One of these two cranes will be moved to T. 784
T
In order to minimise the cost it is decided
852
to move the crane that is closest to T. Use S2 642 F
219
Dijkstra’s algorithm to determine which 293 D
309
crane should be moved. A
 (7 marks)
Problem-solving
It is possible to solve this problem with only one
application of Dijkstra’s algorithm. Think carefully
about the starting point.

E/P 5* a Use Dijkstra’s algorithm to find the shortest  D 37 G


route from A to H. Indicate how you 29
A 22
obtained your shortest route from your 55 25 19
F 30
labelled diagram. (6 marks) C 48
30 38
b Find the shortest route from 22
24 26 H
A to H via G. (2 marks)
B 18
c Find the shortest route from 51
E
A to H, not using CE. (2 marks)

E 6* Use Dijkstra’s algorithm to find the shortest  A


route from S to T in this directed network.
State the length of your route. (6 marks) 7 2 6
B
3
4 C 3
T
S 9
1
4
7

72

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 72 21/01/19 4:21 PM


Algorithms on graphs

E/P 7* A navigation app uses real-time data to determine A F


driving times, between different locations. 13 3
8 D 13
The diagram shows a network of driving times, 3
7
2
5
in minutes, along roads joining ten locations. 12 G 9
S T
a Use Dijkstra’s algorithm to find the B 1
14
quickest route from S to T, and state 13 5 5
E
the total driving time for this route. 11 2
(6 marks) C H
A driver is following this quickest route. Due to traffic congestion, the travel time
between H and T increases from 5 minutes to 13 minutes.
b State how this will affect the quickest route if this information is discovered:
i before the start of the journey
ii when the driver reaches point H.  (4 marks)
Dijkstra’s algorithm has quadratic order.
c If the app takes 0.026 seconds to apply Dijkstra’s algorithm to the above network, estimate the
time it would take the app to compute the quickest route on a network with roads connecting
40 different locations.  (2 marks)
d Explain why your answer to part c is only an estimate.  (1 mark)

3.5 Floyd’s algorithm


A
You can use Floyd’s algorithm to find the shortest path Note Unlike Dijkstra’s algorithm, Floyd’s
between every pair of vertices in a network. The algorithm algorithm will tell you the shortest
produces two tables. The first shows the minimum distance between any pair of vertices in
distance between each pair of vertices and the second the network.
can be used to find the corresponding route.
■ Floyd’s algorithm can be used to find the shortest path between every pair of vertices in a
network:

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 73 21/01/19 4:21 PM


Chapter 3

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.

Distance table Route table Watch out You compare Z


A B C D A B C D with the sum of the shaded
values in the same row and
A – Y A A B C D
column. You are always
B X – Z B A B [A] D comparing an unshaded value
C – C A B C D with the sum of two shaded
D – D A B C D 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

a Use Floyd’s algorithm to produce a table of shortest distances.


D
You should give the distance table and route table for each iteration.
b Find the route of minimum length from C to D.

74

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 74 21/01/19 4:21 PM


Algorithms on graphs

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.

The four letters in the matching


positions in the route table are
changed to the letter A.

The second row and column of the


Second iteration: previous table are now copied into a
A B C D A B C D blank table and these values are shaded.
The two remaining ∞ symbols are
A – 4 7 [13] A A B C [B]
replaced with 4 + 9 = 13 and
B 4 – 11 9 B A B A D
11 + 9 = 20. The letters in the
C 7 11 – [20] C A A C [B] corresponding positions in the route
D 1 5 8 – D A A A D table are changed to the letter B.
No other value in an unshaded
position needs to be changed from
the previous table.

In a new distance table, the third row


and the third column are now shaded.
The values in those positions are
Third iteration:
copied from the previous table.
A B C D A B C D In each unshaded position, the value
A – 4 7 13 A A B C B in the previous table is smaller than
B 4 – 11 9 B A B A D the sum of the shaded values, so
C 7 11 – 20 C A A C B no changes are made in the third
iteration. It follows that no changes
D 1 5 8 – D A A A D
are made to the route table.

75

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 75 21/01/19 4:21 PM


Chapter 3

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)

Online Explore Floyd's algorithm using


GeoGebra.

Example 10

8 departure gates in an airport, which are linked by a system F


2 2
of travellators and escalators, are modelled using the directed E
1 G
network shown. The weight of each edge represents the travel 1 5
H
3 B
time, in minutes, from one gate to another. 2 4

7 iterations of Floyd’s algorithm are applied to the network, 3 1


A C
resulting in the following distance and route tables. 1 2
D
Distance table Route table
A B C D E F G H A B C D E F G H
A – 2 5 7 3 11 9 4 A A B B C 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 ∞ ∞ ∞ ∞ – ∞ ∞ 1 E A B C D E F G H
F 7 1 4 6 2 – 8 3 F D B B C E F C E
G 9 3 6 8 4 2 – 5 G F F F F F F G F
H 2 4 7 1 5 7 5 – H D D D D D G G H

76

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 76 21/01/19 4:21 PM


Algorithms on graphs

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.

b The distance table shows the minimum travel


times between gates, so the minimum travel Looking at row D and column F, the entry in
this position is G, so the quickest route goes
time from gate D to gate F is 12 minutes.
via gate G.
Using the route table,
D→G→F
Watch out You need to check the quickest
D→C→G→F
route from D to G, and from G to F. The route
D→B→C→G→F
from D to G must detour via C. No detour is
D→A→B→C→G→F
required on the route from G to F.

Every stage in this route is now direct, so this is


Sarah’s quickest route from gate D to
the quickest route from D to F.
gate F is DABCGF.

77

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 77 21/01/19 4:21 PM


Chapter 3

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

3* This network shows the times needed in minutes to transport  J 6 K


materials between storage points on a building site. Use Floyd’s
11
algorithm to determine the shortest time needed to transport
4 9
materials between all possible pairs of storage points.
8

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)

E 5* a Explain the difference between the output of Floyd’s B


algorithm and the output of Dijkstra’s algorithm. (1 mark) 7
A
10 2
b This network shows the direct distances in miles by road
4 C 5
between seven towns. 11 8
F
i Show the initial distance table for the network. 6 3 4
ii Show the distance and route tables after one iteration of 7
D
Floyd’s algorithm.  (6 marks) G 6
9
E

78

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 78 21/01/19 4:21 PM


Algorithms on graphs

A 6* Jared and Amy are planning a school trip to a theme park.  B 22 C

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

Answer templates for questions marked * are available at www.pearsonschools.co.uk/d1maths


E 1 The network represents a theme park  Kiddizone 800 Scaryzone
with seven zones. The number on each
362 234 444
arc shows a distance in metres. 300 694
340 378 538
Tramways are to be built to link the Entrance Coolzone Quickzone
Highzone
seven zones and the entrance.
423
945 740
a Find a minimum connector using:
i Kruskal’s algorithm (4 marks) Wetzone
836
Darkzone
ii Prim’s algorithm, starting at the
entrance.  (4 marks)
You must make your order of arc selection clear.
b Draw your tree and state its weight.  (2 marks)

E/P 2 The network represents eight observation  L 8.7 M 5.3


N
points in a wildlife reserve and the possible
paths connecting them. The number on 3.8 T 4.1 3.7 6.8
4.7
each arc is the distance, in kilometres, 6.6
9.2
along that path. It is decided to link the Q
9.5 6.6 P
observation points by paths but, in order to S
minimise the impact on the wildlife reserve, 8.4 7.5
the least total length of path is to be used. R

79

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 79 21/01/19 4:21 PM


Chapter 3

a Find a minimum spanning tree for the network using:


i Prim’s algorithm, starting at L (4 marks)
ii Kruskal’s algorithm. (4 marks)
In each case list the arcs in the order in which you consider them.
b Given that paths TQ and RP already exist, and so must form part of the tree, state which
algorithm, Prim’s or Kruskal’s, you would select to complete the spanning tree.
Give a reason for your answer. (2 marks)

E/P 3* The table shows the distances, in mm,  A B C D E F


between six nodes A to F in a network. A – 124 52 87 58 97
a Use Prim’s algorithm, starting at A, B 124 – 114 111 115 84
to solve the minimum connector C 52 114 – 67 103 98
problem for this table of distances. D 87 111 67 – 41 117
You must explain your method E 58 115 103 41 – 121
carefully and indicate clearly the F 97 84 98 117 121 –
order in which you selected the arcs.  (3 marks)
b Draw a sketch showing the minimum connector and find its length.  (2 marks)
A computer applies Prim’s algorithm to a network containing 80 vertices in 0.02 seconds.
c Given that Prim’s algorithm has order n3, estimate the time required for the computer to
apply the algorithm to a network containing 240 vertices.  (2 marks)
d Explain why your answer to part c is only an estimate.  (1 mark)

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 80 21/01/19 4:21 PM


Algorithms on graphs

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)

E/P 6 A company is to install power lines  C 3 F 7 H


to buildings on a large industrial 7
estate. The lines are to be laid 1 3 L
2 3
by the side of the roads on the 5 4
estate. The estate is shown here 2 5 6
A N
as a network. The buildings are D G I 6
designated A, B, C, ..., N and the 5
4 6 4
4
distances between them are given M
in hundreds of metres. The manager 3
wants to minimise the total length of B 5 E 7 J 3 K
power line to be used.
a Use Kruskal’s algorithm to obtain a minimum spanning tree for the network and hence
determine the minimum length of power line needed.  (4 marks)
Owing to a change of circumstances, the company modifies its plans for the estate.
The result is that the road from F to G now has a length of 700 metres.
b Determine the new minimum total length of power line.  (3 marks)

81

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 81 21/01/19 4:21 PM


Chapter 3

7* A weighted network is shown. The number  B 25 C


on each arc indicates the weight of that arc. 8
D 12
a Use Dijkstra’s algorithm to find a path of 7 14 9
E 24
least weight from A to K. 5
K
State clearly: A 8 10
9 9
i the order in which the vertices were F 10
labelled 10 G 11
5 I
ii how you determined the path of least
8 17
weight from your labelling.
H J
b List all alternative paths of least weight.
c Describe a practical problem that could be modelled by the network and solved using
Dijkstra’s algorithm.

E 8* The network above shows the distances,  A


105
in miles, between nine cities. D
149
157 F
Use Dijkstra’s algorithm to determine 79 101
195
the shortest route, and its length, 134 T
S 123
between cities S and T. You must B 122
83
indicate clearly the order in which G
the vertices are labelled and how you 102 117
E
used your labelled diagram to decide 85
C
which cities to include in the shortest route.  (5 marks)

P 9 a Find a minimum spanning tree for this network using:  B


i Prim’s algorithm 17
ii Kruskal’s algorithm. 20
26 C
b Compare the application of the two algorithms in
A
this case. State which is easier. 15 22
18
c Describe a condition under which Prim’s algorithm 23 25
19
may be quicker to apply than Kruskal’s algorithm.

E 21 D

A 10 The diagram represents part of a road network with distances  P

E shown in kilometres. The road from S to Q is a one-way road,


as indicated by the arrow. 16 12
R
a Use Floyd’s algorithm to find the table of least distances, 10 15
showing both the distance table and the route table after S 20 Q
each iteration.  (7 marks)
b Use the route table to determine the shortest route from R
to P, explaining your method clearly.  (2 marks)

82

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 82 21/01/19 4:21 PM


Algorithms on graphs

A 11 The diagram shows a network of roads between some  B 8 F

E/P towns. The weight shown on each edge represents the 5 6 4


distance in miles. The local council wants to designate a A
3 D 2 E
network of ‘snow emergency roads’ between the towns. 2
4
7 9 7

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 83 21/01/19 4:21 PM


Chapter 3

Summary of key points


1 A minimum spanning tree (MST) is a spanning tree such that the total length of its arcs
(edges) is as small as possible.
2 Kruskal’s algorithm can be used to find a minimum spanning tree.
• Sort the arcs into ascending order of weight and use the arc of least weight to start the tree.
Then add arcs in order of ascending weight, unless an arc would form a cycle, in which case
reject it.
3 Prim’s algorithm can be used to find a minimum spanning tree.
• Choose any vertex to start the tree. Then select an arc of least weight that joins a vertex
already in the tree to a vertex not yet in the tree. Repeat this until all vertices are connected.
4 Prim’s algorithm can be applied to a distance matrix.
• Choose any vertex to start the tree. Delete the row in the matrix for the chosen vertex and
number the column in the matrix for the chosen vertex. Ring the lowest undeleted entry in
the numbered columns, which becomes the next arc. Repeat this until all rows are deleted.
5 Dijkstra’s algorithm can be used to find the shortest path between two vertices in a network.
• Label the start vertex with final value 0.
• Record a working value at every vertex, Y, that is directly connected to the vertex that has
just received its final label, X:
final label at X + weight of arc XY
• Select the smallest working value. This is the final label for that vertex.
• Repeat until the destination vertex receives its final label.
• Find the shortest path by tracing back from destination to start. Include an arc AB on the
route if B is already on the route and
final label B − final label A = weight of arc AB
Each vertex is replaced by a box:

Vertex Order of labelling Final label


Working values

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

M03_EDD1_SB_ASAL_83299_U03_052-084.indd 84 21/01/19 4:21 PM


Route inspection
Objectives
After completing this unit you should be able to:
● Use the orders of nodes to determine whether a graph is Eulerian,
4
semi-Eulerian or neither → pages 86 – 89
● Use the route inspection (Chinese postman) algorithm to find the
shortest route in a network → pages 89 – 94
● Use the route inspection algorithm in networks with more than four
odd nodes → pages 94 – 98

Prior knowledge check

a Find the sum of the orders  A


of the nodes in this graph.
B
b State the rule connecting
the sum of the orders and C
the number of arcs.
Robots are used to inspect sewer
c Write down the number E D
systems. You could use the route
of odd nodes.
inspection algorithm to work out
how the robot could inspect every d Explain why the number of odd nodes on any graph
pipe covering the shortest possible must be even.
distance.  → Exercise 4C, Q4  ← Sections 2.1, 2.2

85

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 85 10/10/2017 15:54


Chapter 4

4.1 Eulerian graphs


You can determine whether a graph is Eulerian, Links The degree of a vertex is the number
semi-Eulerian, or neither, by considering the of arcs that are incident to it. Vertices with even
degrees of the vertices. degree are called even vertices, and those with
■ An Eulerian graph or network is one which odd degree are called odd vertices.
contains a trail that includes every edge  ← Section 2.2
and starts and finishes at the same vertex.
This trail is called an Eulerian circuit. Notation An Eulerian circuit is sometimes
Any connected graph whose vertices are called an Eulerian cycle. However, it is not a true
all even is Eulerian. cycle since, in general, vertices will be visited
more than once.
■ A semi-Eulerian graph or network is one
which contains a trail that includes every
edge but starts and finishes at different
Watch out The trail must start at one odd
vertices. Any connected graph with exactly
vertex and end at the other odd vertex.
two odd vertices is semi-Eulerian.

Eulerian and semi-Eulerian graphs can be drawn without removing your pen from the paper, and
without repeating any arcs.

Start
End

End
Start

Exactly two vertices have odd degree, so this


All vertices have even degree, so this graph is graph is semi-Eulerian. A trail covering every
Eulerian. An Eulerian cycle covering every edge edge exactly once must start at one odd vertex
exactly once can start and end at any vertex. and end at the other.

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 86 10/10/2017 15:54


Route inspection

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.

a The graph has an odd node. It cannot be


Eulerian since every node of an Eulerian
graph must have even order. For any graph, the hand-shaking lemma states
that:
b The number of odd nodes must be even,
Sum of orders of nodes = 2 × number of edges
so p must be odd. The graph will have
exactly two odd nodes so is semi-Eulerian. This means that the sum of the orders of the
nodes must be even, and there must be an even
c Sum of the orders of the nodes = number of odd vertices. ← Section 2.2
2 × number of edges.
4+6+3+p+2
Number of edges = ​​ _________________
    ​​ Watch out Eulerian and semi-Eulerian graphs
2
p + 15 must be connected. The graph shown has two
= ______
​​   ​​ vertices and no edges. It is not connected so it is
2
d A neither Eulerian nor semi-Eulerian.
B

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 87 10/10/2017 15:54


Chapter 4

2 a Show that each of the graphs below is Eulerian.


b In each case, find a route that starts and finishes at A and traverses each arc exactly once.
i E G ii A B
B D
C C E
H
A
F F G

3 a Show that each of these graphs is semi-Eulerian.


b In each case, find a route, starting and finishing at different vertices, that traverses each edge
exactly once.
i R S ii J
I
K
T U
M
H
V W
L

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)

5 Here is the adjacency matrix for a graph.  A B C D E


a State, with reasons, whether the graph is connected. A 0 1 1 0 0
b State, with reasons, whether the graph is Eulerian, B 1 0 1 0 0
semi-Eulerian or neither. C 1 1 0 0 0
c Draw the graph. D 0 0 0 0 1
E 0 0 0 1 0

P 6 Here is the adjacency matrix of a connected graph.  A B C D E

Determine whether the graph is Eulerian, semi-Eulerian A 0 1 0 0 1


or neither, giving reasons for your answer. B 1 0 0 1 0
C 0 0 0 1 1
D 0 1 1 0 2
E 1 0 1 2 0

88

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 88 10/10/2017 15:54


Route inspection

E/P 7 a Determine under what conditions Kn is Eulerian. (3 marks)


b Give an example of a complete, semi-Eulerian graph. (1 mark)

E/P 8 A student makes the following claim:

Any graph which contains a Hamiltonian cycle must be Eulerian.

Give a counter-example to show that this claim is incorrect. (2 marks)

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?

4.2 Using the route inspection algorithm


The route inspection algorithm or Chinese postman algorithm, can be used to find the shortest
route in a network that traverses every arc at least once and returns to its starting point.
You can solve this problem easily if the network is Eulerian.
■ If all the vertices in the network have even degree, then the length of the shortest route will
be equal to the total weight of the network.

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 89 10/10/2017 15:54


Chapter 4

A, B, C, D and E have degrees 2, 2, 2, 2 and 4 Any Eulerian cycle starting at A would


respectively. traverse each edge exactly once then return
All vertices are even so the network is Eulerian. to A, so the total length is equal to the total
Shortest route = 11 + 7 + 8 + 12 + 9 + 10 = 57 m weight of the network. A possible route is
ABECDEA.

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 90 10/10/2017 15:54


Route inspection

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.

1 Identify any vertices with odd degree


2 Consider all possible complete pairings of these vertices
3 Select the complete pairing that has the least sum
4 Add a repeat of the arcs indicated by this pairing to the network

Example 5

A route is needed that starts at A, traverses every arc in this  3 8 3


A B
network, and returns to A. Find a possible route and state its length. 5
4 6
7 E 6
4 7

D C
3 9 3

(Total weight of network is 52)

A, B, C and D have odd degree.


Consider all the possible pairings of the four odd
You can pair these four nodes in three ways:
nodes. The order is not important so there are
A with B and C with D three possible pairings.
A with C and B with D
A with D and B with C.
Watch out You must consider all three pairings
These give the following lengths.
of the four odd nodes.
AB + CD = 8 + 9 = 17
AC + BD = 12 + 10 = 22
AD + BC = 7 + 6 = 13 ← least sum Work out the shortest path between each pair.
Add AD and BC to the network. Add these together to find the total additional
A B length that would be needed with each pairing.
8

5 6 Pairing A with D and B with C gives the least


7 7 6 6
4 E 7 sum, so you need to traverse these arcs twice.
Redraw the network with these arcs duplicated.
D 9 C
A possible route is
ABCEBCDEADA
Total length = 52 + 13 = 65

91

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 91 10/10/2017 15:54


Chapter 4

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

(Total weight of network is 285)

92

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 92 10/10/2017 15:54


Route inspection

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

E 120 (Total weight of


network is 938)

E 3* The diagram represents a network of cables joining I 24 A


computer servers in a university. The number on 32 22
11 B
each arc represents the time, in milliseconds, taken 23 E
for a data packet to travel along each cable. H 17
30 16
An analyst wishes to test the network by sending 20 22
19 19
a data packet on the shortest possible route that 18
C
traverses every cable at least once, and which starts G 14
D
and finishes at server A.
16
a Work out which cables will need to be traversed 23
twice, making your working clear. (4 marks) (Total weight of
F
b State the total time taken for the data packet network is 326)
to complete this route.  (1 mark)
Watch out The shortest route between adjacent odd
vertices may not be the arc that directly links them.

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 93 10/10/2017 15:54


Chapter 4

a Use the route inspection algorithm to find a minimum route, starting


and finishing at entrance A. State the length of your route. (4 marks)
Given that it is now permitted to start and finish at two different entrances,
b find the start and finish points that would give the shortest route, and state the
length of the route. (4 marks)

E/P 5* The diagram represents a system of roads. A

The number on each arc gives the distance, in kilometres, of that 5


F
road.
4
The town council needs to renew the road markings. 8 9
7
Cherry will be renewing the kerbside markings and Mac will
E 5 G B
renew the centre road markings. 6
Cherry needs to travel along each road twice, once on each side of 10
7 3 10
the road.
a Explain how this differs from the standard route inspection 15
C
problem and find the length of Cherry’s route. (4 marks) D
(Total weight of
Mac must travel along each road once. network is 89)
b Use the route inspection algorithm to find a minimal route. You should state the roads he will
traverse twice and the length of his route. (4 marks)
Road EG is being resurfaced soon and it is decided not to renew its road markings until after the
resurfacing.
Given that EG may be omitted from his route,
c find the length of Mac’s minimal route. (3 marks)

4.3 Networks with more than four odd nodes


A
If the network has more than four odd nodes then additional information will be provided that will
restrict the number of pairings that will need to be considered. With four odd nodes, there are three
possible pairings. With six odd nodes there are 15 possible pairings. Beyond six odd nodes, the
number of possible pairings increases rapidly.

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 94 10/10/2017 15:54


Route inspection

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 95 10/10/2017 15:54


Chapter 4

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)

a The odd nodes are A, C, D, E, F, G.


Starting at A and finishing at G leaves C, Problem-solving
D, E, and F to be paired. The situations where the patrol car finishes at G
By inspection, the path lengths are: or D need to be considered separately.
CD + EF = 9 + 4 = 13
CE + DF = 15 + 10 = 25
CF + DE = 16 + 6 = 22
Starting at A and finishing at D, leaves
C, E, F and G to be paired. Compare all the possible pairings for either
CE + FG = 15 + 9 = 24 situation, before choosing the pairing that adds
CF + EG = 16 + 11 = 27 the least weight.
CG + EF = 6 + 4 = 10
The minimum distance to be added is 10.
So the shortest route has length
80 + 10 = 90 km.
b The patrol car finishes at station D, and
roads CG and EF must be traversed twice.

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 96 10/10/2017 15:54


Route inspection

A 2* The diagram shows a network of cross-country skiing trails  B


10 C
E/P at a resort. The number on each arc shows the length of each 15
trail in kilometres. 4
A 14
Each week, the trails are inspected by snowmobile. 9
H 7
The inspector wants to find a route of minimum length D
that starts at C and traverses each trail at least once, 4
11
before finishing at either E or G. 5 12
a Use a suitable algorithm to find the trails that must G E
be traversed twice.  (5 marks) 7 8
F
b State the length of the route. (1 mark)
(Total weight of
A new trail, BD, is added. The inspector is still required to start network is 106)
at C and end at either E or G. Given that the new trail increases
the total length of the inspector’s minimum route by half the length of BD,
c find the length of BD. (4 marks)

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 97 10/10/2017 15:54


Chapter 4

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 2 Draw a graph that satisfies the following conditions:


● The graph has exactly 6 nodes
● All nodes have even degree
● The graph is not Eulerian (2 marks)

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)

E 4* The network of paths in a garden is shown F


below. The numbers on the paths give their 72 27
lengths in metres. The gardener wishes B I
to inspect each of the paths to check for 19
broken paving slabs so that they can be 25
36
repaired before the garden is opened to 65 D 29
22
the public. The gardener has to walk along A
each of the paths at least once. 49
G H
38 81 J
a Write down the degree (valency) of each 75
of the ten vertices. (1 mark) 30
100
b Hence find a route of minimum length. C
57
You should clearly state, with reasons, E
which paths, if any, will be covered (Total weight of network is 725)
twice. (4 marks)
c State the total length of your shortest route. (1 mark)

98

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 98 10/10/2017 15:54


Route inspection

E/P 5* The network represents the roads on a housing P


development. The weight on each arc represents the 197
length of that road in metres. A postman parks his Q
253
van at P. He wants to traverse each road at least
163
once before returning to his van.
104
Given that the postman wants to find a route of 115 R
V 131
minimum total length, 171
123
a determine which roads must be traversed twice, 189
191
showing your working clearly (5 marks)
T 22 S
b state the total length of the postman’s route. 231
U
 (1 mark)
(Total weight of network is 1890)
On a particular day, there is no mail to deliver for
the road shown by arc RT.
c Explain what difference, if any, this makes to the total length of the postman’s route.  (3 marks)

E/P 6* The diagram shows the lengths of different tracks  B 7 C


in a miniature railway. The number on each track 12
gives its length in metres. 10 14 3
E
a Use Dijkstra’s algorithm to find the shortest path 9
5 D
from G to D. You should state the path and its A 10
length. (5 marks) 7
F
The tracks in the miniature railway are to be tested. 6 8 27
A route of minimum length is needed which traverses
each track at least once, starting and finishing at A.
G
b Use a suitable algorithm to determine the length of
(Total weight of network is 118)
a suitable route. You should show all your working,
stating which tracks must be traversed more than
once. (5 marks)
A new track CG of length x m is added to the network. After adding the new track, the length
of the minimum route traversing each track at least once and starting and finishing at A is
unchanged.
c Find the value of x. (3 marks)

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 99 10/10/2017 15:54


Chapter 4

c Obtain the total length of your shortest route. (1 mark)


There is a minor road BD (not shown) between B and D of length 6.4 km. It is not a major
road so it does not need gritting urgently.
d Decide whether or not it is sensible to include BD as a part of the main gritting
route, giving your reasons. (You may ignore the cost of the grit.) (3 marks)

E/P 8* The network opposite represents the streets in a village. The B 68 C


number on each arc represents the length of the street in metres.
70 40
The junctions have been labelled 50
A, B, C, D, E, F, G and H. A
85
D
An aerial photographer has taken photographs of the houses in 65
73
E 45
the village. A salesman visits each house to see if the occupants 120
would like to buy a photograph of their house. He needs to 80
150
travel along each street at least once. He parks his car at A 55
F
and starts and finishes there. He wishes to minimise the total
distance he has to walk. G 110
H
a Use a suitable algorithm to find a route that the (Total weight of network is 1011)
salesman could take, stating the total distance he
has to walk.  (5 marks)
A friend offers to drive the salesman to B at the start of the day and collect him from C later in
the day.
b Explaining your reasoning, carefully determine whether this would increase or decrease
the total distance the salesman has to walk.  (3 marks)

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

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 100 10/10/2017 15:54


Route inspection

A 10* The network represents a system of oil pipelines.  A 18 B


E/P The number on each arc represents the length of each pipeline
7 6
in miles. All of the pipelines are to be inspected each month 9
11
10 7
by aeroplane. The inspection route must start at B F G 16 H
and can finish at landing strips at either D or F. 12
25 5 C
20
a Determine which landing strip should be chosen in order 8
E 14
to minimise the length of the inspection route. (4 marks) D
b Find the length of the minimum inspection route. (1 mark) (Total weight of network is 168)
In one month, pipelines FG, GE and EF are out of operation, and do not need to be inspected.
c Determine how this affects the minimum length of the inspection route. (3 marks)

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)

Summary of key points


1 An Eulerian graph or network is one which contains a trail that includes every edge and starts
and finishes at the same vertex. This trail is called an Eulerian circuit. Any connected graph
whose vertices are all even is Eulerian.
2 A semi-Eulerian graph or network is one which contains a trail that includes every edge but
starts and finishes at different vertices. Any connected graph with exactly two odd vertices is
semi-Eulerian.
3 The route inspection algorithm can be used to find the shortest route in a network that
traverses every arc at least once and returns to its starting point.
• If all the vertices in the network have even degree, then the length of the shortest route will
be equal to the total weight of the network.
• 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.
• If the network has more than two odd vertices, then you need to consider all the possible
pairings of the odd vertices.
4 Here is the route inspection algorithm.
• Identify any vertices with odd degree
• Consider all possible complete pairings of these vertices
• Select the complete pairing that has the least sum
• Add a repeat of the arcs indicated by this pairing to the network

101

M04_EDD1_SB_ASAL_83299_U04_085-101.indd 101 10/10/2017 15:54


5 The travelling
salesman problem
Objectives
After completing this chapter you should be able to:
● Explain the differences between the classical and practical problems
 → pages 103–107
● Use a minimum spanning tree method to find an upper bound
 → pages 107–113
● Use a minimum spanning tree method to find a lower bound
 → pages 114–118
● Use the nearest neighbour algorithm to find an upper bound
 → pages 118–122

Prior knowledge check


1 The diagram represents a A 22 B
proposed road network linking
seven towns A – G. The weight 8 G 21
18
of each arc represents the cost 15 25
of building the corresponding 11
15 F C
If a band has a list of cities for a
road, in millions of pounds.
tour, they might want to work out
a Draw a distance table for E 30 the shortest possible route that
19
the network. D would allow them to visit each
b Find a minimum spanning tree using city. This problem is sometimes
i Prim’s algorithm called the travelling salesman
ii Kruskal’s algorithm. ← Chapter 3 problem.  → Exercise 5D, Q5

102

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 102 21/01/19 8:27 PM


The travelling salesman problem

5.1 The classical and practical travelling salesman problems


A
There are two variations of the travelling salesmen problem. Before investigating the difference
between the classical and practical travelling salesman problems, there is some essential
terminology you need to learn.
■ A walk in a network is a finite sequence of Links A tour could visit some vertices more
edges such that the end vertex of one edge than once. If a tour visits every vertex exactly
is the start vertex of the next. once then it is a Hamiltonian cycle.
■ A walk which visits every vertex, returning  ← Section 2.2
to its starting vertex, is called a tour.

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 103 21/01/19 8:27 PM


Chapter 5

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 104 21/01/19 8:27 PM


The travelling salesman problem

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.

SA – the shortest route is SFA length 8


SB – the shortest route is SCB length 7
SD – the shortest route is SCD length 14
SE – the shortest route is SFE length 19 You will only need to find tables of least
AC – the shortest route is ABC length 7 distances for undirected networks. This
BE – the shortest route is BAFE length 19 means that the finished table will be
BF – the shortest route is BAF length 5 symmetrical about its leading diagonal.
For example, the least distance from A to
DF – the shortest route is DCSF length 19
S is the same as the least distance from
Which gives the following table of least distances.
S to A.
S A B C D E F
S – 8 7 2 14 19 5
A 8 – 2 7 19 17 3
B 7 2 – 5 17 19 5
C 2 7 5 – 12 21 7
D 14 19 17 12 – 13 19
E 19 17 19 21 13 – 14
F 5 3 5 7 19 14 –

105

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 105 21/01/19 8:27 PM


Chapter 5

Exercise 5A
A Answer templates for questions marked * are available at www.pearsonschools.co.uk/d1maths

1* For each network, complete the table of least distances.


a A 7 B Table of least distances
5
20 A B C D E
E 11 3
4 A – 7 5
D 8 C B 7 – 3
C 3 – 8 12
D 8 – 4
E 5 12 4 –

b A Table of least distances


15 5 A B C D E
E 2 D 2 B A – 5 7
B 5 – 2
5 10
9 C – 5
D 7 2 5 – 2
C
E 2 –

c B Table of least distances

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 –

d B 10 F Table of least distances


10 3 18 A B C D E F G
E 8 10
9 A – 10 9 10 17
A
C 8
24 B 10 – 3 20 10 20
10 38
G C 9 3 – 19 8
10
D D 10 20 19 – 20 10
E 17 8 – 8 18
F 10 20 8 – 10
G 20 10 18 10 –

106

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 106 21/01/19 8:27 PM


The travelling salesman problem

A 2 a Describe the difference between the practical and the B 3 C


classical travelling salesman problems. 2
b For the network given on the right find, by inspection, 1 3 9
A
the solution of:
i the practical travelling salesman problem 8 D
4
ii the classical travelling salesman problem.
E
State the route used in each case, starting from A.

P 3 a Find, by inspection, the solution of the practical R 11 S


travelling salesman problem for this network, starting
from P. State the route used. 3 5

b Explain why the choice of start point does not affect P 7 Q


6
the minimum distance travelled. 8
3
c Explain why it isn’t possible to find a solution to the
classical travelling salesman problem for this network. 15
U T

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

Determine the order of this algorithm in terms of the number of vertices, n,


and comment on its usefulness for large values of n.

5.2 Using a minimum spanning tree method to find an upper bound


■ You can use a minimum spanning tree method to find an upper bound for the practical
travelling salesman problem by following these steps:

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 107 21/01/19 8:27 PM


Chapter 5

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

Minimum spanning tree Initial upper bound

This visits each vertex and returns to the starting vertex.


■ An initial upper bound is found by finding the weight of the minimum spanning tree for the
network and doubling it.

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

The weight of the minimum spanning tree


= 3 + 3 + 4 + 5 + 7 + 8 = 30

b The initial upper bound is 2 × 30 = 60.

108

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 108 21/01/19 8:27 PM


The travelling salesman problem

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 –

Order of arc inclusion: AB, BD, AC, DE

A 11 B

13 8
C D

14

The weight of the minimum spanning tree


= 11 + 8 + 13 + 14 = 46
The initial upper bound is 2 × 46 = 92.

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 109 21/01/19 8:27 PM


Chapter 5

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

Use CE(18) instead of repeating CA(13), AB(11), BD(8) and


DE(14), this saves 13 + 11 + 8 + 14 − 18 = 28
This gives the following route:
A 11 B

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 110 21/01/19 8:27 PM


The travelling salesman problem

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 –

Order of arc selection: AB, AC, AE, EH, HF, FG, GD


B 47
A E H F G D
120 131 70 144 155
C 84

b The initial upper bound is 2 × 751 = 1502 miles


B
A E H F G D

c Looking at the tree, likely shortcuts are AD and BC.


AD saves 120 + 131 + 70 + 144 + 155 − 382 = 238 miles
BC saves 47 + 84 − 121 = 10 miles
This leaves the following tour
Problem-solving
B 47
A 120 E 131 H 70 F 144 G 155 D You can check your
121
answer by comparing
C 84 your initial upper bound,
382 the savings from your
Tour ABCAEHFGDA short cuts, and your
Tour length = 47 + 121 + 84 + 120 + 131 + 70 + 144 + 155 + 382 improved upper bound:
1502 – 238 – 10 = 1254
= 1254 miles

111

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 111 21/01/19 8:27 PM


Chapter 5

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 112 21/01/19 8:27 PM


The travelling salesman problem

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 –

a Find a minimum spanning tree for the network. (4 marks)


b Hence find an initial upper bound for the length of the employee’s route. (1 mark)
c Use shortcuts to reduce the upper bound to a value below 65 miles. (3 marks)
d State the route given by your improved upper bound and state its length. (2 marks)

E 3 a Use Kruskal’s algorithm to find a minimum B 58 C


spanning tree for the network shown on the 51
right, and hence find an initial upper bound for 27 38 41
40 25 38
the travelling salesman problem. (5 marks) 26
b Use shortcuts to reduce the upper bound to 34
A D
below 240. (3 marks)
55 37
c State the route given by your improved upper 30 63
bound and state its length. (2 marks)
F 35 E
Hint Start with the edge of minimum
weight, BF ← Section 3.1

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 113 21/01/19 8:27 PM


Chapter 5

5.3 Using a minimum spanning tree method to find a lower bound


A ■ You can use a minimum spanning tree method
Note This algorithm only produces
to find a lower bound for the classical problem a lower bound for the classical
by following these steps. problem. If you are solving the
practical problem you need to
1 Remove each vertex in turn, together with its arcs. apply the algorithm to a table of
2 Find the residual minimum spanning tree (RMST) least distances.
and its length.
Notation
3 Add to the RMST the ‘cost’ of reconnecting the
The residual spanning tree is the
deleted vertex by the two shortest, distinct, arcs
minimum spanning tree for the
and note the totals. resulting network after removing a
4 The greatest of these totals is used for the lower vertex.
bound.
5 Make the lower bound as high as possible to Watch out This algorithm will not,
reduce the interval in which the optimal solution is in general, generate a Hamiltonian
cycle. As such, the lower bound
contained.
is generally not a solution to the
6 You have found an optimal solution if the lower original problem, as it would be
bound gives a Hamiltonian cycle, or if the lower necessary to repeat arcs to create a
bound has the same value as the upper bound. tour.

Example 7

A B C D E The table of least distances for a network is shown.


A – 11 13 19 31 a By deleting vertex A, find a lower bound to the
B 11 – 24 8 22 travelling salesman problem for this network.
C 13 24 – 32 18
b State whether this lower bound represents an optimal
D 19 8 32 – 14 solution. Give a reason for your answer.
E 31 22 18 14 –

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 –

Using Prim’s algorithm starting at B, the order of arc selection


is BD, DE and EC

114

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 114 21/01/19 8:27 PM


The travelling salesman problem

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

Lower bound = weight of RMST + weights of two least arcs from A


= 40 + 11 + 13
= 64

b The lower bound represents a Hamiltonian cycle, so it must be


an optimal solution.

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 B C D E F G H You found an upper bound


A – 47 84 382 120 172 299 144 for this network in Example 6
on page 110.
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 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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 115 21/01/19 8:27 PM


Chapter 5

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 –

Order of arc selection: AB, AC, AE, EH, HF and FD


The residual minimum spanning tree is:
B 47
A E H F D
120 131 70 220
C 84
Weight of RMST = 672 miles

116

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 116 21/01/19 8:27 PM


The travelling salesman problem

A Once again we do not get a


Two least arcs are GF (144) and GD (155)
B Hamiltonian cycle when we
47
A E H F D ‘reconnect’ G, so this lower
120 131 70 220 bound does not represent an
C 84 144 155 optimal solution.

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

E/P 2 A B C D E A council employee needs to service five sets of traffic


lights located at A, B, C, D and E.
A – 13 11 19 14 The table shows the least distances, in miles between
B 13 – 12 7 16 the lights. She will start and finish at A and
wishes to minimise her total travelling distance.
C 11 12 – 11 8
a By deleting vertices A then B find two lower
D 19 7 11 – 14 bounds for the employee’s route. (4 marks)
E 14 16 8 14 – b Select the better lower bound, giving a reason for
your answer. (1 mark)
B 58 C
E/P 3 The network shows the least distances, in km,
51
between 6 locations on an orienteering course. 27 38
40 25 41 38
a By deleting vertices A then B, find two lower bounds 26
for the travelling salesman problem. (4 marks) 34
A D
b Select the better lower bound, giving a reason
55 37
for your answer. (1 mark) 30 63
An upper bound for the solution is given as 190 km.
c Write down the smallest interval that you can be F 35 E
confident contains the optimal length
Hint This upper bound was found as a solution to Q3
of the route. (2 marks)
in Exercise 5B.

117

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 117 21/01/19 8:27 PM


Chapter 5

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)

5.4 Using the nearest neighbour algorithm to find an upper bound


The method given in section 5.2 for finding an upper bound can be hard to use for large networks. In
general, selecting shortcuts is difficult and time consuming when there are lots of vertices to consider.
■ There are other algorithms to help find an upper bound and one is the nearest neighbour
algorithm. The method is as follows.

Note You will usually be directed


1 Select each vertex in turn as a starting point.
to start with specific vertices.
2 Go to the nearest vertex which has not yet been visited. You will only have to check all
3 Repeat step 2 until all vertices have been visited and the vertices if you are specifically
then return directly to the start vertex. instructed to do so.
4 Once all vertices have been used as the starting vertex,
select the tour with the smallest length as the upper Watch out Do not confuse the
bound. nearest neighbour algorithm
with Prim’s algorithm. In Prim’s
The upper bound given by the nearest neighbour algorithm you look for the vertex
algorithm always represents a possible tour. nearest any of the vertices in
However, in general, it will not represent the optimal your growing tree. In the nearest
solution. neighbour algorithm, you look
for the vertex nearest to the last
vertex chosen.

118

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 118 21/01/19 8:27 PM


The travelling salesman problem

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 –

Nearest neighbour tour starting at A


A C E B D A
= 80
7 6 14 24 29 Watch out
This demonstrates
Start at A.
a drawback of the
Look down the A column. The smallest number is 7, AC. Delete row A.
nearest neighbour
Look down the C column (only). The smallest number is 6, CE. Delete row C.
algorithm. The
Look down the E column (only). The smallest number is 14, EB. Delete row E.
last two arcs were
Look down the B column (only). You have now visited each vertex but D, so
‘forced’ on you and
you must choose BD, 24.
both are long arcs.
You have now visited each vertex, so you return directly from D to A, 29.

Nearest neighbour tour starting at B


B A C E D B
= 66
8 7 6 21 24

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.

Nearest neighbour tour starting at C


C E A B D C
= 74
6 13 8 24 23

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 119 21/01/19 8:27 PM


Chapter 5

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.

a Nearest neighbour tour starting at A


A B C E H F G D A
= 1250 miles
47 121 200 131 70 144 155 382

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.

Nearest neighbour tour starting at B


B A C E H F G D B
= 1233 miles
47 84 200 131 70 144 155 402

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.

b The interval is now


971 miles , optimal solution < 1233 miles.
We replace the upper bound of 1237 miles with the better upper bound of 1233 miles, since it is
lower. This reduces the interval containing the optimal solution.

120

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 120 21/01/19 8:27 PM


The travelling salesman problem

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.

2 (This is the same problem as described in Exercise 5C question 4)


The table shows the time, 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.

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 Starting at Z, find a nearest neighbour route.


b Find two further nearest neighbour routes starting at X then V.
c Select the value that should be given as the upper bound. Give a reason for your answer.

E/P 3 The nearest neighbour algorithm of selecting a route from Problem-solving


a given vertex has quadratic order.
The application to a single vertex
A computer program finds all the possible nearest has quadratic order.
neighbour routes and selects the route of least weight.
With 12 towns, the computer program takes 0.27 seconds to complete the task.
Estimate the length of time the computer program will take to compute the least length of the
nearest neighbour route for a network of 20 towns. (3 marks)

121

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 121 21/01/19 8:27 PM


Chapter 5

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 122 21/01/19 8:27 PM


The travelling salesman problem

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.

E/P 2 The network on the right shows a number of


13
hostels in a national park and the possible paths A
7
joining them. The numbers on the edges give the B
4
lengths, in km, of the paths. 3
a Draw a complete table of least distances for 4
E
7 C
the network. (You may do this by inspection.
5
The application of an algorithm is not
required.)  (2 marks) 10

b Use the nearest neighbour algorithm on the D


complete network to obtain an upper bound
to the length of a tour in this network which
13
starts and finishes at A and visits each hostel
exactly once.  (3 marks)
c Interpret your result in part b in terms of the original network.  (2 marks)
A computer program takes 0.85 seconds to apply the nearest neighbour algorithm to the above
network. A different national park has 12 hostels joined by paths.
d Given that the nearest neighbour algorithm has cubic order, estimate the time needed for the
same computer program to apply the nearest neighbour algorithm to this network of paths
and hostels. (2 marks)
e Explain why your answer to part d is only an estimate. (1 mark)

123

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 123 21/01/19 8:27 PM


Chapter 5

A 3 The table of least distances below was formed from the A 2 B


E network, N, on the right.
3 13 5
S A B C D E F 8
5
S – 8 7 2 14 19 5 F C
S 2
A 8 – 2 7 19 17 3
B 7 2 – 5 17 19 5 14 15
12
C 2 7 5 – 12 21 7
D 14 19 17 12 – 13 19 E 13 D
E 19 17 19 21 13 – 14 Network N
F 5 3 5 7 19 14 –
The table shows the distances, in km, between the central sorting office at S and six post offices
A, B, C, D, E and F.
A postal worker will leave the sorting office, go to each post office to collect mail and return to
the sorting office. He wishes to minimise his route.
a Use Prim’s algorithm, starting at S, to obtain two minimum spanning trees. State the order in
which you select the arcs.  (4 marks)
b Hence find an initial upper bound for the postal worker’s route.  (1 mark)
c Starting from this upper bound, use shortcuts to reduce the upper bound to a value below
60  km. You must state the shortcuts you use.  (2 marks)
d Starting at C, and then at D, find two nearest neighbour routes stating their lengths.  (4 marks)
e Select the better upper bound from your answers to parts c and d. Give a reason for your
answer.  (1 mark)
f Interpret your answer to e in terms of the original network, N, of roads.  (1 mark)
g Using the table of least distances, and by deleting C, find a lower bound for the postal
worker’s route.  (3 marks)

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 124 21/01/19 8:27 PM


The travelling salesman problem

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 125 21/01/19 8:27 PM


Chapter 5

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

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 126 21/01/19 8:27 PM


The travelling salesman problem

Summary of key points


A 1 A walk in a network is a finite sequence of edges such that the end vertex of one edge is the
start vertex of the next.
A walk which visits every vertex, returning to its starting vertex, is called a tour.

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.

3 The triangle inequality states


the longest side of any triangle < the sum of the two shorter sides.
4 You can use a minimum spanning tree method to find an upper bound for the pratical
travelling salesman problem.
• Find the minimum spanning tree for the network (using Prim's algorithm or Krunkal's
algorithm).
• An initial upper bound for the practical travelling salesman problem is found by finding the
weight of the minimum spanning tree for the network and doubling it.
• You can improve the initial upper bound by looking for shortcuts. Aim to make the upper
bound as low as possible to reduce the interval in which the optimal solution is contained.
5 You can use a minimum spanning tree method to find a lower bound from a table of least
distances for the classical problem.
• Remove each vertex in turn, together with its arcs.
• Find the residual minimum spanning tree (RMST) and its length.
• Add to the RMST the ‘cost’ of reconnecting the deleted vertex by the two shortest, distinct,
arcs and note the totals.
• The greatest of these totals is used for the lower bound.
• Make the lower bound as high as possible to reduce the interval in which the optimal
solution is contained.
• You have found an optimal solution if the lower bound gives a Hamiltonian cycle, or the
lower bound has the same value as the upper bound.
6 You can use the nearest neighbour algorithm to find an upper bond.
• Select each vertex in turn as a starting point.
• Go to the nearest vertex which has not yet been visited.
• Repeat step 2 until all vertices have been visited and then return directly to the start vertex.
• Once all vertices have been used as the starting vertex, select the tour with the smallest
length as the upper bound.

127

M05A_EDD1_SB_ASAL_83299_U05_102-127.indd 127 21/01/19 8:27 PM


Review exercise

Answer templates for questions marked * are available on www.pearsonschools.co.uk/d1maths


1
E/P 1* An algorithm is described by the flow Planks can be purchased in one-metre
chart below. lengths.
Start a Calculate a lower bound for the
number of planks that will be needed
Read a, b
to make the cabinet.  (2)
b Use the first-fit bin packing algorithm
Let c = a ÷ b to 2 d.p. to determine how many planks are
needed.  (3)
Let d = largest integer ø c c Use the full-bin algorithm to determine
how many planks are needed.  (2)
Let e = db d Explain why it is not possible to make
the cabinet using fewer planks than the
Let f = a – e number found in part c.  (2)
← Section 1.5
Is Yes Write
Stop
f = 0? ‘answer is’ b E 3 55 80 25 84 25 34 17 75 3 5
No a The list of numbers above is to be
Let a = b sorted into descending order. Perform
a bubble sort to obtain the sorted list,
Let b = f giving the state of the list after each
complete pass.  (4)
The numbers in the list represent masses,
a Given that a = 645 and b = 255, draw in grams, of objects which are to be
a table to show the results obtained packed into bins that hold up to 100 g.
at each step when the algorithm is
b Determine the least number of bins
applied.  (6)
needed.  (1)
b Explain how your solution to part a
c Use the first-fit decreasing algorithm to
would be different if you had been
fit the objects into bins which hold up
given that a = 255 and b = 645.  (2)
to 100 g.  (2)
c State what the algorithm achieves.  (2)
← Sections 1.3, 1.5
← Sections 1.1, 1.2
E 4 45 56 37 79 46 18 90 81 51
E/P 2 Nine pieces of wood are required to build
a Using the quick sort algorithm,
a small cabinet. The lengths, in cm, of the
perform one complete iteration
pieces of wood are listed below.
towards sorting these numbers into
10 15 55 40 75 25 55 60 55 ascending order.  (3)

128

M05B_EDD1_SB_ASAL_83299_RE1_05B_128-137.indd 128 18/01/19 3:28 PM


Review exercise 1

b Using the bubble sort algorithm, c State the number of edges in a


perform one complete pass towards Hamiltonian cycle for the
sorting the original list into descending graph K5.  (1)
order.  (3) ← Section 2.3
Bubble sort is an algorithm of quadratic
order.
A 8 a Define a Hamiltonian cycle.  (1)
c A computer applies a bubble sort to a
E/P A Hamiltonian cycle for this graph begins
list of 500 numbers in 0.016 seconds.
AB…
Estimate the time required for the
computer to apply the bubble sort to a B
list of 3000 numbers.  (2)
C
← Sections 1.3, 1.4, 1.6
A
E/P 5 The following list gives the names of
some students who have represented D
Britain in the International Mathematics F
Olympiad.
G E
Roper (R), Palmer (P), Boase (B),
Young (Y), Thomas (T), Kenney (K), b Complete the Hamiltonian cycle.  (4)
Morris (M), Halliwell (H), Wicker (W), c Use the planarity algorithm to
Garesalingam (G). determine whether the graph is
a Use the quick sort algorithm to sort planar.  (2)
the names above into alphabetical A new edge DE is added to the graph.
order.  (4)
d Use the planarity algorithm to show
b A computer applies the quick sort that this new graph is not planar.  (3)
algorithm with order n log n. ← Sections 2.2, 2.4, 2.5
The computer takes 0.024 seconds
to sort 1200 names into alphabetical
order. Estimate the time the computer E 9 The diagram shows 7 locations A, B, C,
would need to order 2000 names.  (3) D, E, F and G which are to be connected
by pipelines. The arcs show the possible
← Sections 1.4, 1.6
routes. The number on each arc gives the
E/P 6 A simple graph has 6 vertices. cost, in thousands of pounds, of laying
that particular section.
a Explain why if the graph has two
vertices of order 5, it cannot have any E
vertices of order 1.  (2)
40
b Draw a simple graph with exactly 6
vertices with degrees 4, 4, 3, 3, 1 F 35
and 1.  (2) 30 25
← Section 2.2 54 G
A D

E 7 a Draw the graph K5.  (1) 20 32


70
b State the number of edges in a
C
minimum spanning tree for the 50
graph K5.  (1) B

129

M05B_EDD1_SB_ASAL_83299_RE1_05B_128-137.indd 129 18/01/19 3:28 PM


Review exercise 1

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

ii Draw your minimum spanning tree


E 12 a Describe two differences between
and find its total length.  (3)
Prim’s algorithm and Kruskal’s
iii State whether your minimum algorithm.  (2)
spanning tree is unique. Justify your
b Find a minimum spanning tree for the
answer.  (2)
network below using:
b A connected network N has seven i Prim’s algorithm, starting with
vertices. vertex G  (4)
i State the number of edges in a ii Kruskal’s algorithm.  (4)
minimum spanning tree for N.  (1)
In each case write down the order in
A minimum spanning tree for a which you made your selection of arcs.
connected network has n edges.
F
ii State the number of vertices in the 11
10 H
network.  (1)
9 D
← Section 2.4, 3.3 A 12 6
G
7 10 19
B 15
8 10
11 17

C 19 E 20 I

130

M05B_EDD1_SB_ASAL_83299_RE1_05B_128-137.indd 130 18/01/19 3:28 PM


Review exercise 1

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

a Use Dijkstra’s algorithm to find the


quickest route from A to L. Complete
all the boxes on the answer sheet and
explain clearly how you determined the
quickest route from your labelling.
b Show that there is another route which
also takes the minimum time.
← Section 3.4

131

M05B_EDD1_SB_ASAL_83299_RE1_05B_128-137.indd 131 18/01/19 3:28 PM


Review exercise 1

17 A The driver of a snowplough, based at F,


E is planning a route to enable her to clear
E/P 10
y all the roads of snow. The route should
8 5
D 8 be of minimum length. Each road can
S T
x B 3 10 be cleared by driving along it once. The
9
6 4 snowplough cannot cross the footbridge.
7
11 Showing all your working and using an
F
C appropriate algorithm,
a find the route the driver should follow,
A weighted network is shown above.
starting and ending at F, to clear all the
Given that the shortest path from S to T roads of snow. Give the length of this
is 17 and that x > 0, y > 0, route.  (6)
a i explain why A and C cannot lie on The local authority decides to build a road
the shortest path  (2) bridge over the river at B. The snowplough
ii find the value of x.  (1) will be able to cross the road bridge.
b Given that x = 12 and y > 0, find the b Reapply the algorithm to find the
possible range of values for the length minimum distance the snowplough will
of the shortest path.  (3) have to travel (ignore the length of
c Give an example of a practical the new bridge).  (4)
problem that could be solved by ← Section 4.2
drawing a network and finding the
shortest path through it.  (2) E/P 19 C

← Sections 4.1, 4.2 0.2


0.9
D
E/P 18 H 0.7

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

M05B_EDD1_SB_ASAL_83299_RE1_05B_128-137.indd 132 18/01/19 3:28 PM


Review exercise 1

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

M05B_EDD1_SB_ASAL_83299_RE1_05B_128-137.indd 133 18/01/19 3:28 PM


Review exercise 1

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

M05B_EDD1_SB_ASAL_83299_RE1_05B_128-137.indd 134 18/01/19 3:28 PM


Review exercise 1

A c Using your answers to parts a and b, A A B C D E F


state the smallest interval that Nassim
A – 85 110 175 108 100
could correctly write down.  (2)
B 85 – 38 175 160 93
← Sections 5.2, 5.3, 5.4
C 110 38 – 148 156 73
D 175 175 148 – 110 84
E 26 The diagram shows six towns A, B, C, D,
E 108 160 156 110 – 92
E and F and the roads joining them.
The number on each arc gives the length F 100 93 73 84 92 –
of that road in miles. a Starting from A, use Prim’s algorithm
A to find a minimum connector and draw
the minimum spanning tree. You must
10 12 make your method clear by stating the
7 8 12
order in which the arcs are selected. (6)
F B
12 b i Using your answer to part a obtain
8 16 6 an initial upper bound for the
17
7 10 solution of the travelling salesperson
D problem.  (1)
15 9
15 ii Use a short cut to reduce the upper
E C
bound to a value less than 680.  (2)
a By deleting vertex A, obtain a lower c Starting by deleting F, find a lower
bound for the solution to the travelling bound for the solution of the
salesman problem.  (4) travelling salesperson problem.  (4)
The nearest neighbour algorithm for ← Sections 3.3, 5.2, 5.3
finding a possible salesman tour is as
follows: E 28 The table shows the distances, in km,
Step 1: Let V be the current vertex. between six towns A, B, C, D, E and F.
Step 2: Find the nearest unvisited vertex A B C D E F
to the current vertex, move A – 113 53 54 87 68
directly to that vertex and call it B 113 – 87 123 38 100
the current vertex. C 53 87 – 106 58 103
Step 3: Repeat step 2 until all vertices D 54 123 106 – 140 48
have been visited and then return E 87 38 58 140 – 105
directly to the start vertex.
F 68 100 103 48 105 –
b i Use this algorithm to find a tour a Starting from A, use Prim’s algorithm
starting at vertex A. State clearly the to find a minimum connector and draw
tour and give its length.  (4) the minimum spanning tree. You must
ii Starting at an appropriate vertex, make your method clear by stating the
use the algorithm to find a tour of order in which the arcs are selected. (4)
shorter length.  (4) b i Hence form an initial upper bound
← Section 5.4 for the solution to the travelling
salesman problem.  (1)
E 27 The table shows the distances, in km, ii Use a short cut to reduce the upper
between six towns A, B, C, D, E and F. bound to a value below 360.  (2)

135

M05B_EDD1_SB_ASAL_83299_RE1_05B_128-137.indd 135 18/01/19 3:28 PM


Review exercise 1

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

M05B_EDD1_SB_ASAL_83299_RE1_05B_128-137.indd 136 18/01/19 3:28 PM


Review exercise 1

2* Peter wishes to minimise the time spent driving  G


from his home at H, to a campsite at G. The
network above shows a number of towns and 70 + 2x 40 + 5x
the time, in minutes, taken to drive between
B A
them. The volume of traffic on the roads into G
is variable, and so the length of time taken to 70 60 50 30
drive along these roads is expressed in terms C
F E
of x, where x > 0. 30 40
a Use Dijkstra’s algorithm to find two routes
from H to G (one via A and one via B) that 90 70
minimise the travelling time from H to G. 130
State the length of each route in terms of x. 140 95

b Find the range of values of x for which Peter I D


should follow the route via A.
 ← Section 3.4 50 80

3 The route inspection problem is solved for this  B x+1 D


network giving a route of length 100. x–5 x 1
2x
a Find an expression for the total weight of the
network. E
A x–4 C 2 x – 14
b Prove by contradiction that BA + AC > BC. x–1
x–3
c Find the value of x showing all your working.
 ← Section 4.2 F x G

4 The table shows the distances, in miles,  A B C D E F G H


between some cities. A politician has to visit
A – 47 84 382 120 172 299 144
each city, starting and finishing at A. She wishes
to minimise her total travelling distance. B 47 – 121 402 155 193 319 165
a Show that she will definitely be able to C 84 121 – 456 200 246 373 218
complete her trip in under 1400 miles, D 382 402 456 – 413 220 155 289
and state a suitable route. E 120 155 200 413 – 204 286 131
b Show that her total trip must be at least F 172 193 246 220 204 – 144 70
971 miles in length, fully justifying why your
G 299 319 373 155 286 144 – 160
answer represents a lower bound.
H 144 165 218 289 131 70 160 –
 ← Sections 5.1, 5.2, 5.3

137

M05B_EDD1_SB_ASAL_83299_RE1_05B_128-137.indd 137 18/01/19 3:28 PM


6 Linear programming
Objectives
After completing this chapter you should be able to:
● Formulate a problem as a linear programming problem
 → pages 139–145
● Illustrate a two-variable linear programming problem graphically
 → pages 145–148
● Locate the optimal point in a feasible region using the objective line
(ruler) method  → pages 148–155
● Use the vertex testing method to locate the optimal point
 → pages 156–162
● Determine solutions that need integer values → pages 162–166

Prior knowledge check


1 Use three inequalities y
7
to describe the
6
shaded region of
5
this graph.
4
← Pure Year 1, Chapter 3
3
2
1
Linear programming is a method
of solving problems involving
O 1 2 3 4 5 6 7 x inequalities and more than one
variable. It is widely used in
2 Represent these inequalities on the same set of axes.
finance, planning, control, design,
2x + 3y < 12, x . 1, x < 4, y . 2 manufacturing and resourcing, and
Shade the region that satisfies all four inequalities. can help to maximise profits or
 ← Pure Year 1, Chapter 3 minimise costs.  → Exercise 6A, Q1

138

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 138 24/01/19 2:45 PM


Linear programming

6.1 Linear programming problems


You need to be able to formulate a problem as a linear programming problem.
● The decision variables in a linear programming problem For example, the cost of one teddy
are the numbers of each of the things that can be varied. bear, the number of teddy bears
The variables, which are often called x, y, z, etc., will be the made, etc.
‘letters’ in the inequalities and objective function.
There are two parts: a word
● The objective is the aim of the problem. It may be to
‘maximise’ or ‘minimise’, and an
maximise profit or to minimise cost.
algebraic expression called the
● The constraints are the things that will prevent you objective function, which is usually
making, or using, an infinite number of each of the written as an equation in terms of
variables. Each constraint will give rise to one the decision variables, for example,
inequality. P = 3x + 2y, C = 4x + 7y + 3z
● If you find values for the decision variables that satisfy
Examples of constraints are the
each constraint you have a feasible solution.
quantity of raw materials available,
● In a graphical linear programming problem, the region that the time available, the fact that
contains all the feasible solutions is called the feasible you cannot have a negative
region. quantity, etc.
● The optimal solution is the feasible solution that meets
the objective. There might be more than one optimal
solution.

■ To formulate a problem as a linear programming problem:


1 Define the decision variables (x, y, z, etc.).
2 State the objective (maximise or minimise, together with an objective function).
3 Write the constraints as inequalities.

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 139 24/01/19 2:45 PM


Chapter 6

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.

A formal summary of the problem is


You cannot have negative values for f or c.
Let f be the number of fruit cakes made. (A negative cake is not possible!)
Let c be the number of chocolate cakes made.
maximise  P = 3.5f + 5c
subject to: f + 2c < 36 Note This is the formal template for
f + c < 28 presenting a linear programming
2f + 3c < 60 problem. It is a good idea to follow
f, c > 0 this model when formulating a linear
programming problem.

140

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 140 24/01/19 2:45 PM


Linear programming

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.

Summarise the information in a table.


Each desk top diary costs £6 and each
Type of diary Minimum order Cost
pocket diary costs £3. The company wants
Desk top 200 £6 to minimise the cost.
Pocket 80 £3
Also require: The company must order at least 200 desk
• twice as many pocket as desk top top diaries and at least 80 pocket diaries.
• total of at least 400.
Define the decision variables. This type of comparative constraint can be
Let x be the number of desk top diaries bought. tricky. It sometimes helps to see it as two
Let y be the number of pocket diaries bought. steps: first getting the algebra correct and
then getting the inequality correct.
State the objective.
minimise   C = 6x + 3y
Problem-solving
State the constraints.
To get the algebra correct, change the
minimum order: x > 200
statement to read ‘exactly twice as many
y > 80
pocket as desk top’. This tells you which
at least twice as many pocket as desk top: one needs to be doubled. The number of
2x < y pocket diaries (y) is double the number
a total of at least 400 diaries: of desk top (x). So we get 2x = y. To get
x + y > 400 the direction of the inequality you can
consider which one of these can be made
non-negativity: larger whilst still satisfying the given
Since we have already stated that x > 200 and y > 80, condition. Here the number of pocket
we do not need to state that x > 0 and y > 0. diaries can increase so 2x < y.
So the non-negativity constraint is already satisfied
by the previous constraints.
The total number of diaries is simply x + y.
Here is the summary.

Let x be the number of desk top diaries bought.


Let y be the number of pocket diaries bought.
minimise c = 6x + 3y
subject to: x > 200
y > 80
2x < y
x + y > 400

141

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 141 24/01/19 2:45 PM


Chapter 6

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.

Summarise the information.


Sugar Fruit Juice Maximum Cost
Syrup
% % % amount (,) per litre
A (x) 30 50 20 40  000 50p
B (y) 20 35 45 45  000 40p
Required in
, 25 > 40 < 35 60  000
final blend
Define the decision variables.
This has already been done in the question.
State the objective. Each litre of syrup A costs 50p and
minimise   C = 0.5x + 0.4y each litre of syrup B costs 40p. The
company wants to minimise its costs.
State the constraints. Note the strict inequality.
30% of syrup A is sugar. It must be below 25%.

sugar: 0.3x + 0.2y , 0.25 (x + y)

20% of syrup B is sugar. less than ... ... 25% of the


combined blend
must be sugar.
0.3x + 0.2y , 0.25x + 0.25y
This simplifies to x,y
0.05x , 0.05y
Each litre of syrup A contains 50% fruit.

fruit: 0.5x + 0.35y > 0.4 (x + y)


Each litre of syrup B at least ... ... 40% fruit in the
contains 35% fruit. combined blend.

142

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 142 24/01/19 2:45 PM


Linear programming

This simplifies to 2x > y 0.5x + 0.35y > 0.4x + 0.4y


0.1x > 0.05y
juice: 0.2x + 0.45y < 0.35 (x + y)
which simplifies to 2y < 3x
0.2x + 0.45y < 0.35x + 0.35y
amount required: x + y > 60  000 0.1y < 0.15x
x < 40  000 10y < 15x
y < 45  000
non-negativity: x, y > 0
x < 40  000
y < 45  000
Here is the summary
minimise C = 0.5x + 0.4y
subject to x,y
2x > y
3x > 2y
x + y > 60  000
x < 40  000
y < 45  000
x, y > 0

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 143 24/01/19 2:45 PM


Chapter 6

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

She wishes to maximise the total amount of shelving.


Letting x and y be the number of type 1 and type 2 bookcases bought respectively, formulate this
as a linear programming problem. (5 marks)

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 144 24/01/19 2:45 PM


Linear programming

Smoothie Oranges Raspberries Kiwi fruit Apples Profit


A 1 10 2 2 60p
_1 _1
B ​2​ 40 3 ​2 ​ 65p
C 2 15 1 2 55p
Total available 50 1000 100 60

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

combined, operating time.


The manufacturer needs to process 20  000 litres of milk and 6000 litres of yoghurt. He wishes to
distribute this between the 2 factories in such a way as to minimise operating costs. Formulate
this as a linear programming problem in x and y, defining your decision variables. (6 marks)

6.2 Graphical methods


You can illustrate a two-variable linear programming problem graphically. You use the x- and y-axes
to represent the two variables, and shade any areas of the graph that fail to satisfy any of the
inequalities in the linear programming problem.
■ The region of a graph that satisfies all the Watch out By convention, you leave
constraints of a linear programming problem is the feasible region unshaded, and
called the feasible region. shade all other regions of the graph.

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 145 24/01/19 2:45 PM


Chapter 6

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.

Draw the line x = y. Use a dotted


line as the inequality is strict.

O x
40 000 Testing (40 000, 0) puts it in the
region to reject since 40 000 is
not < 0.

2x > y y The line 2x = y passes through


2x = y (0, 0), (10  000, 20  000) and
(30 000, 60 000).
reject

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 146 24/01/19 2:45 PM


Linear programming

x + y > 60 000
y

The line x + y = 60 000 passes


through (0, 60 000) and (60 000, 0).

keep

reject

x + y = 60 000 Testing (0, 0) puts it in the region


to reject since 0 + 0 is not
O x > 60 000.
40 000
Combine all these on one diagram.
y
2x = y 3x = 2y
60 000 Label the feasible region R.
y=x
R
50 000

40 000

30 000 The inequalities 2x > y, x > 0


and x > 0 are not actually
20 000 necessary to define the feasible
x + y = 60 000 region.
10 000
The question only asked for the
O x feasible region, so you do not
0

need to consider the objective


00

00

00

00

00

00

00
10

20

30

40

50

60

70

function.

Online Explore graphical solutions to linear


programming problems using GeoGebra.

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 147 24/01/19 2:45 PM


Chapter 6

2 A linear programming problem is given as:


maximise P = 3.5f + 5c
subject to: f + 2c < 36
f + c < 28
2f + 3c < 60
f, c > 0
On a graph, represent the feasible region for this problem, and label it R.

3 A linear programming problem is given as:


minimise C = 6x + 3y
subject to x > 200
y > 80
2x < y
x + y > 400
On a graph, represent the feasible region for this problem, and label it R.

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 148 24/01/19 2:45 PM


Linear programming

6.3 Locating the optimal point


Every point in the feasible region satisfies all the constraints, so is a potential solution to the linear
programming problem.
■ To solve a linear programming problem, you need to find the point in the feasible region
which maximises or minimises the objective function.
There are two methods for finding the optimal solution. The first method is called the objective line
method or ruler method.

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 149 24/01/19 2:45 PM


Chapter 6

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.

16 The value of P increases as the parallel lines


move to the right, away from the origin.
14

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).

Online Explore how the optimal solution


can be found using the objective line method
with GeoGebra.

150

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 150 24/01/19 2:45 PM


Linear programming

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.

Watch out You should always make sure you give


your answer in the context of the original question.
Don't just state the coordinates of the optimal point.

151

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 151 24/01/19 2:45 PM


Chapter 6

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

a ruler and either a second ruler or a set square.


er

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 152 24/01/19 2:45 PM


Linear programming

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

An objective line of the form


2x

1
ab = ax + by always passes
+y

through (b, 0) and (0, a).


=2

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 153 24/01/19 2:45 PM


Chapter 6

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.

y Online Explore how the


optimal solution can be found
90 using the objective line method
with GeoGebra.
3x + y = 90
80

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

a The objective line has equation 3x + 2y = 60 and passes through (20, 0)


and (0, 30).
The first point in the feasible region as the objective line moves away from
the origin is A.
A lies at the intersection of
3x + y = 90
and x + y = 50
Solving simultaneously gives
x = 20, y = 30
which gives C = 3 × 20 + 2 × 30 = 120

154

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 154 24/01/19 2:45 PM


Linear programming

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 155 24/01/19 2:46 PM


Chapter 6

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 156 24/01/19 2:46 PM


Linear programming

The feasible region has 4 vertices, A, B, C and D. When using this


Vertex Coordinates Value of x + 3y method all the
vertices of the
A x = 7.5, y = 7.5 7.5 + 3 × 7.5 = 30
feasible region
B x = 13, y = 13 13 + 3 × 13 = 52 should be tested,
C x = 13, y = 5 13 + 3 × 5 = 28 even if they are
_ obviously not
D 2
x = 11​ 3 ​, y = 5 11​ _32 ​ + 3 × 5 = 26​ _23 ​
optimal.
The minimum value occurs at D (​​ 11​ _23 ​, 5)​​ and is 26​ _23 ​

Online Explore how the optimal solution


can be found using vertex testing with GeoGebra.
Example 10
A feasible region is defined by the following constraints
9x + 11y < 99
4x + y < 28
5x + 3y > 30
x + 2y > 8
y<x
Find the optimal point and optimal value given that the objective is:
a maximise x + y b minimise 3x + 4y

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 157 24/01/19 2:46 PM


Chapter 6

The feasible region has 5 vertices, A, B, C, D and E. Use simultaneous


Online
equations to find the coordinates of A, B, C, D and E.
Explore how the
Vertex Coordinates Value of x + y Value of 3x + 4y optimal solution
can be found
A x = 4​ __
19 __19
20 ​  , y = 4​ 20 ​ 4​ __
19 __19 __ 9
20 ​ + 4​ 20 ​ = 9​  10 ​ 3 × 4​ __
19 __19 __13
20 ​ + 4 × 4​ 20 ​ = 34​ 20 ​
using vertex
testing with
B x = 5​ __
34 __4
35 ​  , y = 4​  35 ​ 5​ __
34 __ 4 __ 3
35 ​ + 4​  35 ​ = 10​ 35 ​ 3 × 5​ __
34 __ 4 __13
35 ​ + 4 × 4​  35 ​ = 34​ 35 ​ GeoGebra.

C x = 6​ __67 ​  , y = ​ _47 ​ 6​ __67 ​ + ​ _47 ​ = 7​ _37 ​ 3 × 6​ __67 ​ + 4 × ​_74 ​ = 22​ __67 ​

D x = 5​ _71  ​  , y = 1​ _37 ​ 5​ _71  ​ + 1​ _73 ​ = 6​ _47 ​ 3 × 5​ _71  ​ + 4 × 1​ _37 ​ = 21​ _71  ​

E x = 3​ _34 ​  , y = 3​ _34 ​ 3​ _34 ​ + 3​ _34 ​ = 7​ _21  ​ 3 × 3​ _34 ​ + 4 × 3​ _34 ​ = 26​ _41  ​

a Maximum value of x + y is at B (​​ 5​ __


35 ​, 4​  35 ​)​​and has value of 10​ 35 ​
34 __
4 __ 3

b Minimum value of 3x + 4y is at D (​​ 5​ _71  ​, 1​ _37 ​)​​and has value of 21​ _71  ​

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

O 100 200 300 400 500 x

Find the optimal point and the optimal value, using:


a the objective line method, with the objective ‘maximise M = 2x + y’
b the objective line method, with the objective ‘maximise N = x + 4y’
c the vertex testing method, with the objective ‘maximise P = x + y’
d the vertex testing method, with the objective ‘maximise Q = 6x + y’

158

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 158 24/01/19 2:46 PM


Linear programming

2 The diagram shows a feasible region, R.


y
100
90
9x + 10y = 900
80
70
R
60
50
40
30 6y = x
20
10 3x + 7y = 420

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’

3 The diagram shows a feasible region, R.


y y = 4x
90
80
70
60
50
9x + 5y = 450
40
30 R 5y = 3x

20
10

O x
5
10
15
20
25
30
35
40
45
50

3x + y = 60

Find the optimal point and the optimal value, using:


a the vertex testing method, with the objective ‘minimise J = x + 4y’
b the vertex testing method, with the objective ‘maximise K = x + y’
c the objective line method, with the objective ‘minimise L = 6x + y’
d the objective line method, with the objective ‘maximise M = 2x + y’

159

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 159 24/01/19 2:46 PM


Chapter 6

4 The diagram shows a feasible region, R, which is defined by:


3x + y > 12
y < 2x
3y > x
6x + 5y < 120
y
y = 2x

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 160 24/01/19 2:46 PM


Linear programming

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).

E/P 7 A linear programming problem is given as


minimise C = 3x + 2y
subject to 2x + y > 160
x + y > 120
x + 3y > 180 and x > 0, y > 0

a Draw a graph to illustrate the feasible, R. (3 marks)


(Use the values 0 < x < 200 and 0 < y < 160 for your axes.)
b Use the vertex testing method, on the four vertices, to identify the optimal point and optimal
value. (2 marks)
Given that the objective changes to
minimise C1 = 2x + 3y,
c draw a suitable objective line and use it to identify the optimal point and optimal value. (2 marks)
Given that the objective changes to
minimise C2 = x + y,
d explain why there is more than one solution to the problem. (2 marks)

E 8 A feasible region, R, is defined by


y < 5x
14x + 9y < 630
2y > x
4x + y > 60
a Draw a graph to illustrate the feasible region, R.
(Use the values 0 < x < 45 and 0 < y < 70 for your axes.) (3 marks)
b Use the objective line method to determine the optimal point and the optimal value given the
objective
i minimise P = x + 3y (4 marks)
ii maximise Q = 6x + y. (4 marks)
In each case you must draw, and label, an objective line, and find exact values.

E 9 A feasible region, R, is defined by


y < 10x
x < 120
2y – x > 100
2x + y < 400

161

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 161 24/01/19 2:46 PM


Chapter 6

a Draw a graph to illustrate R. (3 marks)


Given that the objective function is z = 5x + y,
b determine the optimal value of z, if z is to be
i maximised (3 marks)
ii minimised. (3 marks)
c Determine the maximum value of x + 2y. Give your answer as an exact value. (3 marks)

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.

6.4 Solutions with integer values


There is an additional constraint in some problems – that the solution has integer values. For
example, questions 1, 2, 3 and 4 in Exercise 6A all require integer solutions, since it is not possible to
sell a fraction of a box of chocolates, etc. In such cases the optimal point in the feasible region may
not be an acceptable solution, so you have to find the optimal integer solution.
■ If a linear programming problem requires integer solutions, you need to consider points
with integer coordinates near the optimal vertex.

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 162 24/01/19 2:46 PM


Linear programming

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

and (5, 6).


(4, 6) (5, 6)

Online Explore how


(
4 16
31
, 5 19
31 ) the optimal solution
can be found using the objective
(4, 5) (5, 5) line method with GeoGebra.

163

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 163 24/01/19 2:46 PM


Chapter 6

(4, 5) obeys all the constraints, so it lies in the feasible region.


P = 4 + 2 × 5 = 14
(5, 5) obeys all the constraints, so it lies in the feasible region.
P = 5 + 2 × 5 = 15
(4, 6) does not obey 5y – 4x < 10,
since 5 × 6 – 4 × 4 = 14 and is not < 10, so is outside the
feasible region.
(5, 6) does not obey 3x + 4y < 36,
since 3 × 5 + 4 × 6 = 39 and is not < 36, so is outside the Looking at the graph may
feasible region. suggest which constraints may
be broken for each point, so
The optimal integer solution is (5, 5) and P = 15.
these can be checked first.

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

O 100 200 300 400 500x

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 164 24/01/19 2:46 PM


Linear programming

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.

Point 5x + 2y > 1000 3x + 5y > 1500 ln R? x + y


(105, 236) 997 Ö 1000 — No As one constraint has failed, you
(105, 237) 999 Ö 1000 — No do not need to check others.
(106, 236) 1002 > 1000 1498 Ö 1500 No
(106, 237) 1004 > 1000 1503 > 1500 Yes 343
You only need to evaluate the
The optimal integer solution lies at (106, 237) and has a value of objective function for points in
343. the feasible region.

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 2 The graph opposite is being used to solve a linear  x = 10


y
programming problem, subject to the following constraints: 60 y = 2x + 10
y < 2x + 10
y + 2x < 60 40
x > 10
20 y + 2x = 60
y>0 R
The feasible region is labelled R.
O x
Given that x and y must both be integers, use the vertex 10 20 30
testing method to maximise the objective function
P = 5x + 3y, and write down the corresponding values of x and y. (7 marks)

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 165 24/01/19 2:46 PM


Chapter 6

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

She wishes to maximise the total amount of shelving.


a Formulate the above information as a linear programming problem. (5 marks)
b Use a suitable method to solve the problem, fully justifying your answer. (5 marks)

166

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 166 24/01/19 2:46 PM


Linear programming

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 167 24/01/19 2:46 PM


Chapter 6

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

a Write down the inequalities that define the region R.


The objective function, P, is given by P = 3x + 2y.
b Find the value of x and the value of y that lead to the maximum value of P. Make your
method clear.

168

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 168 24/01/19 2:46 PM


Linear programming

c i Give an example of a practical linear programming problem in which it would be necessary


for the variables to have integer values.
ii Given that the solution must have integer values of x and y, find the values that lead to the
maximum value of P.

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.

Product Stage 1 Stage 2 Hand painting


2 ​​ _2 ​​
1
Plate 5 —
Mug 3 2 2

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

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 169 24/01/19 2:46 PM


Chapter 6

Summary of key points


1 To formulate a problem as a linear programming problem:
• Define the decision variable (x, y, z, etc.).
• State the objective (maximise or minimise, together with an algebraic expression called the
objective function).
• Write the constraints as inequalities.
2 The region of a graph that satisfies all the constraints of a linear programming problem is
called the feasible region.
3 To solve a linear programming problem, you need to find the point in the feasible region which
maximises or minimises the objective function.
4 • 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.
5 To find an optimal point using the vertex method:
• First find the coordinates of each vertex of the feasible region.
• Evaluate the objective function at each of these points.
• Select the vertex that gives the optimal value of the objective function.
6 If a linear programming problem requires integer solutions, you need to consider points with
integer coordinates near the optimal vertex.

170

M06_EDD1_SB_ASAL_83299_U06_138-170.indd 170 24/01/19 2:46 PM


The simplex
algorithm
Objectives
After completing this chapter you should be able to:
7
● Understand and use slack and surplus variables → pages 172–175, 199
● Solve maximising and minimising linear programming problems
using simplex tableaux → pages 176–196
● Use the simplex tableau method to solve linear programming
problems requiring integer solutions → pages 196–198
● Understand and use the two-stage simplex method for maximising
and minimising problems which may include < and > constraints
 → pages 199–204
● Understand and use the Big-M method for maximising and
minimising problems which may include < and > constraints
 → pages 205–212

Prior knowledge check


1 Find the coordinates of the point where
the line 2x + 3y = 11 crosses the line
x + 2y = 4. ← Pure Year 1, Chapter 5

2 Find the maximum value of P = 5x − 2y


given the constraints x < 6 and 3 < y < 8.
 ← Section 6.3
3 Here is a system of three simultaneous
equations:
2x + 3y − z = 5
3y + 2z = 0
The simplex method allows you to solve linear x − 4y = 5
programming problems with more than two a Use the first two equations to show
variables. Large online retailers use methods that 4x + 9y = 10.
like this to optimise their shipping and b Hence find the values of x, y and z.
distribution networks.  ← Pure Year 1, Chapter 3

171

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 171 21/01/19 6:48 PM


Chapter 7

7.1 Formulating linear programming problems


A
You need to be able to formulate real-life problems as linear programming problems. In the previous
chapter you did this with two-variable situations.
■ To formulate a linear programming problem:
• define your decision variables
• write down the objective
• write down the constraints.
In this chapter you will consider more complicated linear programming problems.

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.

Time per Total time It is clearer if you summarise the information in


A B C D
hectare available a table.
Sowing 3 4 3 5 70
Thinning 18 17 19 16 360
Picking 20 25 26 22 500
First define your decision variables.
Packing 24 27 28 23 550
Profit 67 63 71 75
With more than two variables you can use xA,
Let xA , xB , xC and xD, be the number of xB, xC, … or x1, x2, x3, … instead of letters of the
hectares planted of varieties A, B, C and D alphabet. x1, x2, x3, … is particularly useful when
respectively. there are a large number of variables.

172

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 172 21/01/19 6:48 PM


The simplex algorithm

A Next write down the objective. You need to state


Maximise P = 67xA + 63xB + 71xC + 75xD
‘maximise’ or ‘minimise’ and give the objective
Subject to:
function.
3xA + 4xB + 3xC + 5xD < 70
18xA + 17xB + 19xC + 16xD < 360
Finally write down the constraints.
20xA + 25xB + 26xC + 22xD < 500
24xA + 27xB + 28xC + 23xD < 550 Watch out Remember to include non-
xA , xB , xC , xD > 0
negativity constraints. It is impossible to plant a
xA , xB , xC , xD < 20 negative number of hectares of any variety.

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

The numbers of tablets taken cannot be negative.

173

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 173 21/01/19 6:48 PM


Chapter 7

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.

3xA + 4xB + 3xC + 5xD + r = 70


Watch out Notice that you alter the non-
18xA + 17xB + 19xC + 16xD + s = 360
negativity constraint too. In order to satisfy the
20xA + 25x B + 26xC + 22xD + t = 500
original inequalities, r, s, t and u must also be
24xA + 27xB + 28xC + 23xD + u = 550 non-negative. In general, slack variables cannot
xA , xB , xC , xD , r, s, t, u > 0 be negative.

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 174 21/01/19 6:48 PM


The simplex algorithm

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 175 21/01/19 6:48 PM


Chapter 7

7.2 The simplex method


A
In the previous chapter you found optimal solutions to linear programming problems by considering
the vertices of the feasible region. With a two-variable problem, the feasible region can be
represented as an area on a graph. With three variables, you would need to represent the feasible
region as a 3D polyhedron. As the number of variables increases, it becomes impossible to visualise
the problem graphically.
The simplex algorithm starts at one vertex, and moves between vertices in sequence, increasing the
objective function and one of the variables each time, until it reaches an optimal solution.

■ The simplex method allows you to:


• determine if a particular vertex, on the Hint You can think of the algorithm as being a
edge of the feasible region, is optimal, set of signposts on a treasure hunt. As you reach
each vertex the algorithm tells you if you have
• decide which adjacent vertex you should
reached the optimal solution and if not, which
move to in order to increase the value of
way you should go to get to the next signpost.
the objective function.
■ Slack variables are essential when using
the simplex algorithm.

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 176 21/01/19 6:48 PM


The simplex algorithm

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

Our initial set of equations is


5x + 7y + r = 70 (1)
10x + 3y + s = 60 (2) Note that the objective function has been
rewritten so that the right-hand side is equal to 0.
P − 3x − 2y = 0 (3)
The reason for this will become apparent as you
Start at O (0, 0). This is the vertex where move on to the simplex tableau.
x=y=0

Test the objective function, P = 3x + 2y, at


this point and get P = 0. This is not optimal.

177

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 177 21/01/19 6:48 PM


Chapter 7

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

First divide equation (2) by 10 to make the


coefficient of x one, getting equation (5).

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.

To eliminate the +5x in equation (1), subtract 5


copies of equation (5).

178

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 178 21/01/19 6:48 PM


The simplex algorithm

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)

Look at equation (6).


When y = s = 0, P = 18. So the current profit is 18.
Make P the subject of equation (6):

P = 18 + __11
​ 10  ​  y − __ 3
​ 10  ​  s

You can see that increasing y will increase the


profit, but increasing s will decrease the profit.
So you need to increase y but keep s = 0. This
means you will travel along the line s = 0 in the
direction that makes y increase. In this case travel
along s = 0 up and to the left.
Continue along the line s = 0 until you hit the next
vertex.
You have just left the vertex y = s = 0, so you will
hit either s = r = 0 or s = x = 0 next.
Put these values into the current set of equations:
​ _
11 _1
2 ​  y + r    − ​  2 ​  s = 40 (4)
x + ​ __
3
10 ​  y + ​ __
1
10 ​  s = 6 (5)
__
11 __
3
− ​ 10 ​  y
P + ​  10 ​  s = 18 (6)

When s = r = 0 equation (4) gives y = ​ __


80 _3
11 ​ = 7 ​  11 ​

When s = x = 0 equation (5) gives y = 20


You get to y = 7 ​ _
3
11 ​ before y = 20, so you get
to the vertex s = r = 0 and the value given by
equation (4). You know s and r at this vertex, so
eliminate y from your equations.
Divide equation (4) by _
​ 11
2 ​to reduce the coefficient
of y to one, getting equation (7).
y+_
​ 112 ​  r − _
​ 111  ​  s = ​ __
80 _ 11
11 ​ (7) = (4) ÷ ​  2 ​
x + ​ __
3
10 ​  y + __ 1
​ 10  ​  s = 6 (5)
__
11 __
3
− ​ 10 ​  y + ​  10 ​  s = 18 (6)
P

Eliminate the terms in y from the other two


equations.

179

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 179 21/01/19 6:48 PM


Chapter 7

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.

You can apply this method to a problem with 3 (non-slack) variables.

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

Introducing slack variables r and s, and forming equations


you get:
2x + 2y + r = 5 (1)
5x + 3y + 4z + s = 15 (2)
P − 10x − 12y − 8z = 0 (3)
Start at (0, 0, 0). At this point P = 0, which is clearly
not the maximum.
Rewrite equation (3) to make P the subject:
P = 10x + 12y + 8z
You can see that you can increase the profit by
increasing x or y or z. Increase one variable at a time.

180

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 180 21/01/19 6:48 PM


The simplex algorithm

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)

Rewriting equation (6) to make P the subject:

P = 30 − 2x + 8z − 6r You must not increase x or r


since these will decrease the
you see that you can still increase the profit by increasing z.
profit, so you need to keep x
Once again, keep the other variables in that equation zero, and and r zero and increase z.
determine which vertex you reach first.

(In this case (equation 4) will not give a value for z because
there is no z term! This speeds things up.)

From equation (5) when x = r = s = 0   z = __


​  15
8 ​

Divide equation (5) by 4 to reduce the coefficient of z to one


giving equation (7).

181

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 181 21/01/19 6:48 PM


Chapter 7

A
x + y    +  ​ _21  ​  r =_
​ 52 ​ (4)

​ _21  ​  x + z −  ​ __38 ​  r + _


​ 41  ​  s = __
​  15
8 ​ (7)   = (5) ÷ 4

P + 2x − 8z + 6r = 30 (6)

Eliminate z from the other equations using equation (7).

There is no z term in equation (4) so this remains unchanged.

To eliminate the −8z in equation (6), add 8 copies of equation (7).

x + y    +    ​ _21  ​  r =_
​ 52 ​ (4) (unchanged)

​ _21  ​  x + z −  ​ __38 ​  r + _


​ 41  ​  s = __
​ 15
8 ​ (7)

P + 6x    + 3r + 2s    = 45 (8) = (6) + 8(7)

Rewrite equation (8) to make P the subject:

P = 45 − 6x − 3r − 2s

This tells you that at the current vertex, where x = r = s = 0,


P = 45.

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

Solve the linear programming problem in Example 6 using simplex tableaux.


Maximise P = 3x + 2y
subject to: Notation The word tableau is French. The
plural of tableau is tableaux.
5x + 7y + r = 70
10x + 3y + s = 60
x, y, r, s > 0

182

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 182 21/01/19 6:48 PM


The simplex algorithm

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.

If x = y = 0 then r = 70 [from equation (1)] and


s = 60 [from equation (2)]
You read across the tableau, so this initial tableau tells you that r = 70, s = 60 and P = 0. All other variables
are zero, by definition, since they are not listed as basic variables.
Currently therefore
P=0 x = 0 y = 0 r = 70 s = 60
This is called the basic feasible solution − all the constraints are satisfied, but applying the simplex
method will lead to an improved solution. Notice that each column corresponding to a basic variable only
contains 0s and a single 1 in the row corresponding to that variable.

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.

Basic variable x y r s Value θ values


r 5 7 1 0 70 70 ÷ 5 = 14
s 10 3 0 1 60 60 ÷ 10 = 6
P −3 −2 0 0 0

183

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 183 21/01/19 6:48 PM


Chapter 7

A Note that the basic variable entry has also


Select the row containing the smallest (positive)
θ value. (This will become the pivot row.) been changed. You are leaving the starting
vertex where x = y = 0 and increasing x, so
In this case this is the second row.
x is no longer equal to zero.
Basic
x y r s Value θ values The basic variable changes to the variable in
variable the pivot column.
r 5 7 1 0 70 70 ÷ 5 = 14 We replace the s at the start of the pivot
s 10 3 0 1 60 60 ÷ 10 = 6 row by x, the variable at the top of the pivot
P −3 −2 0 0 0 column.
We divide this row by the pivot, (which is the value in So there have been changes to every cell in
the pivot row and pivot column), to create the pivot the pivot row.
row. Comparing this second tableau with the
second set of equations from Example 6,
In this case we divide all the elements in row 2 by 10.
you see that you are still matching the
Basic Row algebraic solution, but without having to
x y r s Value
variable operations write down all the algebra.
r 5 7 1 0 70 5x + 7y + r = 70 (1)
__ __
x 1 3
​​  10​​ 0 1
​​  10 ​​ 6 R2 ÷ 10 x + __ 3
​​  10 + __
​​  y 1
​​  10 ​​  s = 6 (5) = (2) ÷ 10
P −3 −2 0 0 0 P − 3x − 2y = 0 (3)

Use this pivot row to eliminate x from each of the


other rows. We are aiming to get just one number 1 and
make all other terms zero in the x column.
Basic Row
x y r s Value
variable operations
__
− ​​ __
11 1
r 0 ​​  2​​ 1 2​​
40 R1 − 5R2 New R1 = old R1 − 5 × new R2
__
3 __
1
x 1 ​​  10​​ 0 ​​  10​​ 6
__
11 __
3
P 0 − ​​ 10​​ 0 ​​  10​​ 18 R3 + 3R2 New R3 = old R3 + 3 × new R2

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 ​

In column r  :   1 − 5 × 0 = 1 In column s:   0 − 5 × ​ __


1 _1
10 ​ = − ​  2 ​

In the value column 70 − 5 × 6 = 40


Similarly R3 + 3R2 states that we took the row 3 entry and added three times the corresponding row 2 entry.
So the calculations we did for row 3 were:
In column x: −3 + 3 × 1 = 0 In column y: −2 + 3 × __ 3
​ 10  ​ = − ​ __
11
10 ​

In column r  : 0+3×0=0 In column s: 0 + 3 × __ 1


​ 10  ​ = __ 3
​ 10  ​
In the value column 0 + 3 × 6 = 18

184

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 184 21/01/19 6:48 PM


The simplex algorithm

A Compare this third tableau with the third set of equations


​ __
11 _1
2 ​  y + r −   ​ 2 ​  s = 40 (4)   = (1) − 5(5)
x + __
​  3  ​  y
10 + __
​  1  ​  s = 6
10 (5)
− ​ __
P 11
 ​  y 10 + __
​  3  ​  s = 18
10 (6)   = (3) + 3(5)

Now repeat the process again.


First we look for the most negative entry in the objective (bottom)
row. In this case it is the − ​​ __
11
10 ​​ in the y column. This gives the new
pivot column.

Basic variable x y r s Value


__
11 __1
r 0 ​​  2 ​​ 1 − ​​  2 ​​ 40
__
3 __
1
x 1 ​​  10 ​​ 0 ​​  10​​ 6
__
11 __
3
P 0 − ​​ 10 ​​ 0 ​​  10​​ 18

Second calculate the new θ values.

Basic variable x y r s Value θ values


__ __1
40 ÷ __ ___ __
11 80 3
r 0 ​​  2 ​​ 1 − ​​  2 ​​ 40 ​​  11
2 ​​ = ​​  11 ​​ = 7 ​​  11 ​​
__ __
6 ÷ ​​ __
3 1 3
x 1 ​​  10 ​​ 0 ​​  10​​ 6 10 ​​ = 20
__
P 0 − ​​ __
11
10 ​​
0 3
​​  10​​ 18

Third we select the smallest, positive θ value. This lies in the first
row, so this will become the next pivot row.

Basic variable x y r s Value θ values


__ __1
40 ÷ __ ___ __
11 80 3
r 0 ​​  2 ​​ 1 − ​​  2 ​​ 40 ​​  11
2 ​​ = ​​  11 ​​ = 7 ​​  11 ​​
__ __
6 ÷ ​​ __
3 1 3
x 1 ​​  10 ​​ 0 ​​  10​​ 6 10 ​​ = 20
__
P 0 − ​​ __
11
10 ​​
0 3
​​  10​​ 18

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.

Basic variable x y r s Value Row operations


__ __ ___
R1 ÷ __
2 1 80
y 0 1 ​​  11 ​​ − ​​  11 ​​ ​​  11 ​​ ​​  11
2 ​​
__
3 __
1
x 1 ​​  10 ​​ 0 ​​  10 ​​ 6
__
11 __
3
P 0 − ​​ 10 ​​ 0 ​​  10 ​​ 18

Here are the fourth set of equations determined in Example 6


y + __ 2
​​  11 ​​  r −   ​​ __
1 __ 80
11 ​​  s = ​​  11 ​​ (7)   = (4) ÷ ​​ __
11
2 ​​
x + __ 3
​ 10  ​  y + __ 1
​ 10  ​  s = 6 (5)
− ​ __
P 11
 ​  y 10 + __
​  3  ​  s = 18
10 (6)

185

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 185 21/01/19 6:48 PM


Chapter 7

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.

Basic variable x y r s Value Row operations


__
2 __
1 ___
80
y 0 1 ​​  11 ​​ − ​​  11 ​​ ​​  11 ​​
___ ___
x 1 0 − ​​ ___
3
55 ​​
7
​​  55 ​​ 42
​​  11 ​​ R2 − __ 3
​​  10 ​​  R1
__1 __1
P 0 0 ​​  5 ​​ ​​  5 ​​ 26 R3 + __ 11
​​ 10 ​​  R1

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 186 21/01/19 6:48 PM


The simplex algorithm

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

The smallest positive θ value is 2 in row 2, so this


becomes the pivot row.

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 187 21/01/19 6:48 PM


Chapter 7

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.

1 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.
2 Create the initial tableau.
Enter the coefficients of the variables in the appropriate column and row.
3 Look along the objective row for the most negative entry: this indicates the pivot column.
4 Calculate the θ values, for each of the constraint rows, where
θ = (the term in the value column) ÷ (the term in the pivot column)
5 Select the row with the smallest, positive θ value to become the pivot row.
6 The element in the pivot row and pivot column is the pivot.
7 Divide the row found in step 5 by the pivot, and change the basic variable at the start of
the row to the variable at the top of the pivot column. This is now the pivot row.
8 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.
9 Repeat steps 3 to 8 until there are no more negative numbers in the objective row.
10 The tableau is now optimal and the non-zero values can be read off using the basic
variable column and value column.

■ 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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 188 21/01/19 6:48 PM


The simplex algorithm

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.

a Introducing slack variables r and s, and forming equations:


2x + 2y + r = 5 (1)
5x + 3y + 4z + s = 15 (2)
P − 10x − 12y − 8z = 0 (3)
The steps refer to the
Step 1, Step 2
algorithm on page 188.
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

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 189 21/01/19 6:48 PM


Chapter 7

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 190 21/01/19 6:48 PM


The simplex algorithm

A There are no negatives in the


Basic
Value objective (bottom) row, so
variable
our tableau is optimal. Read
y 2 ​​ __
1
2 ​​ off the values of the basic
z 1 ​​ __
7
8 ​​ variables y, z and P from the
P 45 value column.

The optimal solution is The simplex tableau


P = 45, x = 0, y = 2​ _21  ​, z = 1 ​ __78 ​, r = 0, s = 0. algorithm is much quicker
than the algebraic simplex
b Objective function: method. Although the
10x + 12y + 8z = 0 + 30 + 15 = 45 = P ✓ algebra is there, it is hidden.
Constraints:
Check that your values of P,
2x + 2y = 0 + 5 = 5 < 5 ✓ x, y and z satisfy the original
5x + 3y + 4z = 0 + 7​​ __ __1
2 ​​ + 7​​  2 ​​ = 15 < 15 ✓
1
objective function, and
x, y, z > 0 ✓ check that each constraint is
satisfied.

Reducing the number of tableaux


In the above example you wrote each line of each tableau twice.
Watch out This is optional. In
Once you are more comfortable with the algorithm you may be
your exam sufficient tableaux
able to reduce the number of tableaux by combining all the row
will be provided for the full,
operations into one tableau. The important thing is to make sure
non-reduced solution.
that the pivot row is written down first. A complete solution to
the problem would look like this.

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

Basic Row The first row to be written in


x y z r s Value
variable operations this tableau is the pivot row,
__1
y 1 1 0 ​​  2 ​​ 0 2 ​​ __
1
2 ​​ R1 ÷ 2 row 2. The pivot row from the
s 2 0 4 __1
−1 ​​  2 ​​ 1 __1
7​​  2 ​​ R2 − 3R1 above tableau is then used to
work out the other rows.
P 2 0 −8 6 0 30 R3 + 12R1
New R1 = old R1 ÷ 2

191

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 191 21/01/19 6:48 PM


Chapter 7

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

The optimal solution is


P = 45, x = 0, y = 2​ _21  ​, z = 1 ​ __78 ​, r = 0, s = 0

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.

Note The most negative


a Basic
x y z r s t Value θ values entry in the objective row lies
variable
in the y column, so this is the
r 2 −3 2 1 0 0 4 − ​​ __
4
3 ​​ pivot column.
s 1 2 4 0 1 0 8 4 Use the smallest, positive θ
t 0 1 −1 0 0 1 6 6 value, so although − ​​ _43 ​​ is the
smallest, you can not use it as
P −3 −4 5 0 0 0 0
a pivot.
The smallest, positive θ value
is 4, so row 2 will become the
pivot row.
The pivot is the 2 in row
2 column y, and the basic
variable will change to y.

192

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 192 21/01/19 6:48 PM


The simplex algorithm

A Now divide row 2 by the


Basic Row
x y z r s t Value pivot, 2.
variable operations
r 2 −3 2 1 0 0 4 R1
y
__1
​​  2​​ 1 2 0 __1
​​  2 ​​ 0 4 Now eliminate y from the
R2 ÷ 2
other rows. Use the pivot row,
t 0 1 −1 0 0 1 6 R3 R2 in the tableau above.
P −3 −4 5 0 0 0 0 R4 To eliminate the −3 from row
1 you need to add 3 copies of
Basic Row row 2, so R1 + 3R2.
x y z r s t Value To eliminate the 1 from row
variable operations
__
7 __
3 3 you need to subtract row 2,
r ​​  2​​ 0 8 1 ​​  2​​ 0 16 R1 + 3R2 so R3 − R2.
__1 __1
y ​​  2​​ 1 2 0 ​​  2​​ 0 4 To eliminate the −4 from row
__1 __1 4 you need to add 4 copies of
t − ​​  2​​ 0 −3 0 − ​​  2​​ 1 2 R3 − R2
P 0 13 0 2 0 16 row 2, so R4 + 4R2.
−1 R4 + 4R2

Basic Row The only negative entry in


x y z r s t Value the objective row lies in the
variable operations
__ __ ___
x column, so this is the pivot
​​  7 ​​ = 4​​ __
7 3 32 4
r ​​  2​​ 0 8 1 ​​  2​​ 0 16 7 ​​ column.
__1 __1
y ​​  2​​ 1 2 0 ​​  2​​ 0 4 8 Use the smallest, positive θ
t __1
− ​​  2​​ 0 −3 0 __1
− ​​  2​​ 1 2 −4 value, so although −4 is the
smallest, you cannot use it as
P −1 0 13 0 2 0 16
a pivot.
The smallest, positive θ value
Basic is 4 ​​ _47 ​​, so row 1 will
x y z r s t Value θ values become the pivot row.
variable
__ __
​​ __ ___ The pivot is the _​​ 72 ​​in row 1
R1 ÷ __
16 2 3 32
x 1 0 ​​  7 ​​ ​​  7 ​​ 7​​ 0 ​​  7 ​​ ​​  72 ​​
__1 __1
column x.
y ​​  2​​ 1 2 0 ​​  2​​ 0 4
__1 __1
t − ​​  2​​ 0 −3 0 − ​​  2​​ 1 2 Now divide row 1 by the
P −1 0 13 0 2 0 16 pivot, _​​  72 ​​.

Basic Row Eliminate x from the other


x y z r s t Value
variable operations rows. Use the pivot row, R1.
x 1 0 __
16
​​  7​​ __
2
​​  7​​ __
3
​​  7​​ 0 ___
32
​​  7 ​​ To eliminate the _​ 12 ​ from
__ __1 __ __ row 2 you need to subtract _​ 21 ​
R2 − ​​ __
6 2 12 1
y 0 1 ​​  7​​ − ​​  7​​ ​​  7​​ 0 ​​  7 ​​ 2 ​​ R1 of row 1, so R2 − _​ 21 ​  R1.
__1
t 0 0 − ​​ __
13
7​​
​​  7​​ − ​​ __
2
7​​
1 ​​ ___
30
7 ​​ R3 + __
​​  21 ​​ R1 To eliminate the − ​ _12 ​from row
P 0 0 ___
107
​​  ​​ __
2
​​  7​​ __
17
​​  7​​ 0 ___
144
​​  ​​ R4 + R1 3 you need to add _​ 21 ​row 1, so
7 7
R3 + _​ 12 ​ R1.
There are no negatives in the objective row, so you have an To eliminate the −1 from row
optimal solution. 4 you need to add row 1, so
R4 + R1.

193

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 193 21/01/19 6:48 PM


Chapter 7

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 194 21/01/19 6:48 PM


The simplex algorithm

A 4 Maximise P = 4x1 − 3x2 + 2x3 + 3x4


P subject to
x1 + 4x2 + 3x3 + x4 + r = 95 Hint There are 4 decision variables and 4 slack
2x1 + x2 + 2x3 + 3x4 + s = 67 variables. Your initial tableau will need rows for r, s,
x1 + 3x2 + 2x3 + 2x4 + t = 75 t and u, and columns for x1, x2, x3, x4, r, s, t and u.
3x1 + 2x2 + x3 + 2x4 + u = 72
x1, x2, x3, x4, r, s, t, u > 0

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

P 7 For each question 1 to 6:


a verify, using the original equations and constraints, that your solution is feasible,
b write down the final set of equations given by your optimal tableau,
c use the profit equation, written in part b, to explain why your solution is optimal.

E 8 The following tableau was obtained as part of the solution of a maximising linear programming
problem.

Basic variable x y z r s t Value


z 2 _ 1
​​   ​​ 1 _ 1
​​   ​​ 0 0 _ 3
​​   ​​
2 2 2
_ 3
​​ __ ​​
​− ​ _ ​​
1 15
s −1 ​​   ​​
2
0 2
1 0 2
_ 5 _
​  ​ _2 ​​
3 3
t −4 ​​   ​​
2
0 − 0 1 ​​   ​​
2

P 3 4 0 1 0 0 3

a Write down the values of x, y and z as indicated by this tableau.  (2 marks)


b Write down the profit equation from the tableau.  (2 marks)

195

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 195 21/01/19 6:48 PM


Chapter 7

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)

7.3 Problems requiring integer solutions


You can use the simplex tableau method to solve linear programming problems requiring integer
solutions. You need to consider integer-valued points near your optimal solution.

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

In Example 8 we found the following solution


P = 26,   x = __
​ 42 _9 __
80 _3
11 ​ = 3 ​  11 ​,   y = ​  11 ​ = 7 ​  11 ​
Test points around this optimal solution.

Point 5x + 7y < 70 10x + 3y < 60 In feasible region? P = 3x + 2y


(3, 7) 15 + 49 < 70 30 + 21 < 60 Yes 9 + 14 = 23
(3, 8) 15 + 56 . 70 No
(4, 7) 20 + 49 < 70 40 + 21 . 60 No
(4, 8) 20 + 56 . 70 No
So our best integer solution is
P = 23, x = 3, y = 7

Problem-solving
For each point, you need to test whether the point
lies in the feasible region, and evaluate P.
 ← Section 6.4

196

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 196 21/01/19 6:48 PM


The simplex algorithm

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

In Example 10 we found the following solution

P = 45,   x = 0,   y = 2 ​​ __


1 __
7
2 ​​,   z = 1 ​​  8 ​​
Test points around this optimal solution.

Point 2x + 2y < 5 5x + 3y + 4z < 15 In feasible region? P = 10x + 12y + 8z


(0, 2, 1) 0+4,5 0 + 6 + 4 , 15 Yes 0 + 24 + 8 = 32
(0, 2, 2) 0+4,5 0 + 6 + 8 , 15 Yes 0 + 24 + 16 = 40
(0, 3, 1) 0+6.5 No
(0, 3, 2) 0+6.5 No
So our best integer solution is
P = 40, x = 0, y = 2, z = 2

■ 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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 197 21/01/19 6:48 PM


Chapter 7

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 198 21/01/19 6:48 PM


The simplex algorithm

7.4 Two-stage simplex method


A
The simplex method described above only works when all the constraints, other than the non-
negativity conditions, are < constraints. These can be converted into equations using slack variables.
The method relies on starting at the origin and using the slack variables as basic variables to give
a basic feasible solution. This solution is then improved upon by moving systematically to other
vertices of the feasible region until the optimum solution is found.
Problems that include > constraints have no obvious basic feasible solution since the origin is not in
the feasible region. These constraints also require different treatment to convert them into equations.
You could convert the inequality x + 3y > 10 into an equation by subtracting a variable, s. This would
give you:
x + 3y − s = 10, where s > 0
Here, s is referred to as a surplus variable. Notice that surplus variables are also subject to non-
negativity conditions and must be subtracted to produce the equation. Surplus variables may be used
to convert any > inequality into an equation. However, this doesn’t solve the problem of using the
simplex method with x and y as non-basic variables. This would require x = y = 0, giving −s = 10
which makes s negative. To avoid this problem, a new type of variable called an artificial variable is
introduced.
x + 3y − s + a = 10, where s, a > 0
This constraint can now be written in a simplex tableau using x, y and s as non-basic variables and a
as a basic variable with value 10.

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 199 21/01/19 6:48 PM


Chapter 7

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

Converting the inequalities into equations:


s1 is a slack variable, s2 and s3 are
x + y + 2z + s1 = 10
surplus variables and a1 and a2 are
2x − 3y + z − s2 + a1 = 5
artificial variables.
x + y − s3 + a2 = 8
In stage 1 you need to minimise a1 + a2
Let I = −(a1 + a 2 )
This is equivalent to maximising −(a1 + a2)
Substituting for a1 and a2 from the equations above
gives the new objective as
The artificial variables will always be
maximise I = −(13 − 3x + 2y − z + s2 + s3) basic variables in the initial tableau. I
rearranging should be expressed in terms of non-
I − 3x + 2y − z + s2 + s3 = −13 basic variables so that the tableau is in
the right form. The columns for a1 and
a2 should each only contain zeros and a
single 1.

200

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 200 21/01/19 6:48 PM


The simplex algorithm

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

The most negative number


Basic in the I row is −3, so the x
x y z s1 s2 s3 a1 a2 Value
variable column is the pivot column.
s1 1 1 2 1 0 0 0 0 10 Calculating the θ values,
__
3 __1 __1 __1 __
5
x 1 − ​​  2 ​​ ​​  2 ​​ 0 − ​​  2 ​​ 0 ​​  2 ​​ 0 ​​  2 ​​ the smallest is given by
a2 1 1 0 0 0 −1 0 1 8 5 ÷ 2 so the pivot is 2.
P −3 2 −1 0 0 0 0 0 0
I 2 0 1 1 0 0 x now replaces a1 as a
−3 −1 −13
basic variable. Each value
in the pivot row is divided
Basic Row by the pivot.
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 Row operations are now
__1 __1 __ carried out so that the
x 1 − ​​ __
3
2​​
​​  2​​ 0 − ​​ __
1
2​​
0 ​​  2​​ 0 5
​​  2​​ R2 ÷ 2 remaining cells in the x
__
5 __1 __1 __1 __
11
a2 0 ​​  2​​ − ​​  2​​ 0 ​​  2​​ −1 − ​​  2​​ 1 ​​  2​​ R3 − R2 column contain only 0s.
__
5 __1 __
3 __
3 __
15
P 0 − ​​  2​​ ​​  2​​ 0 − ​​  2​​ 0 ​​  2​​ 0 ​​  2​​ R4 + 3R2
__1 __
I 0 − ​​ __
5
2​​
​​  2​​ 0 − ​​ __
1
2​​
1 3
​​  2​​ 0 − ​​ __
11
2​​ R5 + 3R2

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 201 21/01/19 6:48 PM


Chapter 7

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

There are no negative values in the bottom row, so the optimal


solution has been found.
The maximum value of P is 30
This occurs when x = 10, s2 = 15, s3 = 2 and y = z = s1 = 0

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

Converting the inequalities to equations:


x + y + 2z + s1 = 8
2x − 3y + z − s2 + a1 = 5
x + y − s3 + a2 = 10

202

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 202 21/01/19 6:48 PM


The simplex algorithm

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 203 21/01/19 6:48 PM


Chapter 7

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)

E/P 3 a Define what is meant by:


i a surplus variable
ii an artificial variable. (2 marks)
The following tableau is obtained during the first stage of a two-stage simplex process to
maximise P:

Basic variable x y z s1 s2 s3 a1 a2 Value


s1 0 0 2 1 0 1 0 −1 2
x 1 0 _ 1
​​   ​​ 0 ​− ​ _ ​​
1
​− ​ _ ​​
3 _ 1
​​   ​​ _ 3
​​   ​​ ​​ __ ​​
29
2 2 2 2 2 2
y 0 1 ​− ​ _2 ​​
1
0 _ 1
​​   ​​ −1 ​− ​ _2 ​​
1
1 ​​ __
11
 ​​
2 2
P 0 0 0 0 −1 −2 1 1 13
I 0 0 0 0 0 0 1 1 0

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 204 21/01/19 6:48 PM


The simplex algorithm

7.5 The Big-M method


A
The first stage of the two-stage simplex method Hint Note that when the sum of the artificial
involves minimising the sum of the artificial variables is zero, each artificial variable must be
variables. If there is a feasible solution then this zero since none of them can be negative.
sum will be zero. The Big-M method involves a
different but equivalent approach which, again, leads to the sum of the artificial variables being zero.
In the Big-M method, M is used to represent an arbitrarily large number. This guarantees that a
term such as M − 100 will be positive and a term such as 75 − 0.5M will be negative. You can compare
terms involving M in order to select the pivot column.

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 205 21/01/19 6:48 PM


Chapter 7

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

There is a choice of pivot column, since −1 appears in the z column


and the s3 column.
Choosing the s3 column, the minimum positive θ value is given by
3 ÷ 1 so the pivot is the 1 in the s2 row.
s3 now becomes a basic variable in place of s2.
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 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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 206 21/01/19 6:48 PM


The simplex algorithm

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

There is only one negative value in the objective row now, so s2


becomes the pivot column and the ​​ _1
3 ​​ in the s 3 row becomes the
pivot.
Dividing the pivot row by ​​ _
1
3 ​​gives the new pivot row.
Using row operations to put the pivot column in the right form
gives the next tableau.

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 207 21/01/19 6:48 PM


Chapter 7

A ■ The Big-M method uses the following steps:


1 Introduce a slack variable for each constraint of the form <.
2 Introduce a surplus variable and an artificial variable for each constraint of the form >.
3 For each artificial variable a1, a2, a3 ... subtract M(a1 + a2 + a3 ...) from the objective
function, where M is an arbitrarily large number.
Hint In the Big-M method,
4 Eliminate the artificial variables from your objective
any artificial variables will
function so that the variables remaining in your objective always start as basic variables.
function are non-basic variables.
5 Formulate an initial tableau, and apply the simplex method in the normal way.

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

2x + y + z + s1 = 20 The inequalities are converted to


x − 2y − z + s2 = 7 equations exactly as in the previous
x − s 3 + a1 = 4 example.
x, y, z, s1, s2, s3, a1 > 0
The objective is to minimise P, but this is
−P = −x + y − z
equivalent to maximising −P.
Using Big-M, you can minimise P by maximising Q where
Q = − x + y − z − Ma1
Writing a1 in terms of non-basic variables gives
Q = − x + y − z − M(4 − x + s3)
Q = − x + y − z − 4M + Mx − Ms3
Rearranging gives
Q + x − y + z − Mx + Ms3 = −4M
This means your non-basic variables will
Q + (1 − M)x − y + z + Ms3 = −4M
be x, y, z and s3.
You can now write the initial tableau as
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
Q 1−M −1 1 0 0 M 0 −4M

208

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 208 21/01/19 6:48 PM


The simplex algorithm

A
The most negative value in the objective row is 1 − M so the x
column becomes the pivot column.

The smallest value of θ is given by 4 ÷ 1 so the 1 in the a1 row


becomes the pivot.
x now replaces a1 as a basic variable.
Using row operations to put the pivot column in the standard form
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
R4 −
Q 0 −1 1 0 0 1 M−1 −4
(1 − M)R3

The only negative value in the objective row is in the y column.


The least positive θ value is given by 12 ÷ 1 so the 1 in the s1 row
becomes the pivot.
y replaces s1 as a basic variable.
Using row operations to put the pivot column in the standard form
gives the next tableau.

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 209 21/01/19 6:48 PM


Chapter 7

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.

a Converting the inequalities into equations:


Problem-solving
x + y + 2z + s1 = 10
When there is more than one artificial
2x − 3y + z − s2 + a1 = 5
variable, you need to multiply M by the sum
x + y − s3 + a2 = 8
of all the artificial variables. Since you are
The objective function is now modified to trying to maximise P, and M is very large,
P = 3x − 2y + z − M(a1 + a2) this has the effect of minimising a1 + a2 just
as in the first stage of the simplex method.
a1 = 5 − 2x + 3y − z + s2
You need to rewrite a1 + a2 in terms of the
and
non-basic variables so that the tableau is in
a2 = 8 − x − y + s3
the standard form.
adding gives
a1 + a2 = 13 − 3x + 2y − z + s2 + s3
using this expression
P = 3x − 2y + z − M(13 − 3x + 2y − z + s2 + s3)
P = (3 + 3M)x − (2 + 2M)y + (1 + M)z − Ms2 − Ms3 − 13M
P = 3(1 + M)x − 2(1 + M)y + (1 + M)z − Ms2 − Ms3 − 13M
Rearranging:
Rearrange to give
P − 3(1 + M)x + 2(1 + M)y − (1 + M)z + Ms2 + Ms3 = −13M each coefficient in
The first tableau may now be written as: terms of M.

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 210 21/01/19 6:48 PM


The simplex algorithm

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

Using row operations to put column x in standard form gives:

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 211 21/01/19 6:48 PM


Chapter 7

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 212 21/01/19 6:48 PM


The simplex algorithm

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 213 21/01/19 6:48 PM


Chapter 7

A From your final tableau


c i write down the numbers of small, medium and large packets indicated.
ii write down the profit.
iii state whether this is an optimal solution, giving your reason.  (3 marks)

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 214 21/01/19 6:48 PM


The simplex algorithm

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 215 21/01/19 6:48 PM


Chapter 7

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 216 21/01/19 6:48 PM


The simplex algorithm

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

a State the value of the pivot, making your reasons clear.


b Complete the solution, justifying that it is optimal. You should clearly state your row
operations.

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 217 21/01/19 6:48 PM


Chapter 7

A The factory manager formulates this problem as:


Let x, y, z represent the numbers of pies A, B, C made respectively.
Maximise P = 100x + 80y + 60z
subject to: x + y + z < 800
z > 200
x, y, z > 0
a Explain why the basic simplex algorithm cannot be used to solve the linear programming
problem. (1 mark)
b Without working, state the optimal solution to this linear programming problem. (1 mark)
Based on available ingredients and on customer demand, the factory manager also implements
the following constraints
2x + 2y + z < 1200
4y + 5z > 1000
The Big-M method is to be used to solve this linear programming problem.
c Define what M represents in this context. You must use correct mathematical language in
your answer. (1 mark)
d Set up the initial tableau for this problem. Show your modified objective function and
clearly state the basic variables. (4 marks)
e State, with a reason, which value you would use as your first pivot, and explain how you
would carry out one iteration of the algorithm. You do not need to apply your method.
 (3 marks)

Challenge Hint You will need to think


A linear programming problem is given as follows: carefully about how you deal
Maximise P = 3x + 4y + 2z with the second constraint,
subject to: 2x + 4y < 10 which contains an equality.
x + 2y + z = 12
4y + 2z > 15
x, y, z > 0
Solve this linear programming problem using an appropriate method.

218

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 218 21/01/19 6:48 PM


The simplex algorithm

Summary of key points


A 1 To formulate a linear programming problem:
• define your decision variables
• write down the objective function
• write down the constraints.

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).

3 The simplex method allows you to:


• determine if a particular vertex, on the edge of the feasible region, is optimal
• decide which adjacent vertex you should move to in order to increase the value of the
objective function.

4 Slack variables are essential when using the simplex algorithm.

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

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 219 21/01/19 6:48 PM


Chapter 7

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.

11 The Big-M method uses the following steps:


• Introduce a slack variable for each constraint of the form <.
• Introduce a surplus variable and an artificial variable for each constraint of the form >.
• For each artificial variable a1, a2, a3 ... subtract M(a1 + a2 + a3 ...) from the objective
function, where M is an arbitrarily large number.
• Eliminate the artificial variables from your objective function so that the variables
remaining in your objective function are non-basic variables.
• Formulate an initial tableau, and apply the simplex method in the normal way.

220

M07_EDD1_SB_ASAL_83299_U07_171-220.indd 220 21/01/19 6:48 PM


Critical path analysis
Objectives
After completing this chapter you should be able to:
● Model a project by an activity network using a precedence table
 → pages 222–226
8
● Use dummy activities  → pages 226–229
● Identify and calculate early and late event times in activity networks
 → pages 230–232
● Identify critical activities  → pages 232–235
● Calculate the total float of an activity  → pages 236–237
● Calculate and use Gantt (cascade) charts  → pages 238–241
● Construct resource histograms  → pages 242–249
● Construct scheduling diagrams  → pages 249–253

Prior knowledge check


Find, by inspection, the length of the shortest
route from A to B in this directed network.
A B

The techniques of critical path analysis may 5 6 7


be applied to the management of complex F 8 3
tasks to improve overall efficiency. Recent C
9 8
applications in healthcare, for example, 7 4
have resulted in a reduction in the time that
patients spend in emergency departments. E 2 D

221

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 221 21/01/19 7:08 PM


Chapter 8

8.1 Modelling a project


Imagine that you have responsibility for the completion of a complex project. The total amount of
work to be done is divided into separate activities and some of these cannot be started until others
have been completed. You are expected to organise the activities efficiently in order to avoid any
unnecessary delay.
In order to plan the project effectively you would need Notation When one activity
to represent the activities in some way that makes any cannot proceed until another
dependencies clear. It would be helpful to make use of some activity is completed, it is
suitable notation and to apply a systematic approach. referred to as a dependency.

■ 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.

This process may be broken down into


separate activities.
Typically, these are labelled A, B, C, D, … for
ease of reference later.
A Build wooden frame
B Cut out fabric for cushions
C Stitch and fill cushions
D Attach springs to wooden frame
E Cover frame
F Complete assembly
G Inspect
H Wrap
The activities may now be written in a
precedence table.
Activity Depends on
A – E depends on D. The fact that E depends on A
B – (because D depends on A) is clear from the entry
C B above and is not shown again, i.e. only immediate
D A dependence is shown in the table.
E D
Both activities C and E must be completed
F C, E
before work on activity F may be started.
G F
H G

222

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 222 21/01/19 7:08 PM


Critical path analysis

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 223 21/01/19 7:08 PM


Chapter 8

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

B E Activity E is dependent on activity B.


2

1 Activity F is dependent on activities C


A
and E. It is now clear that we need to
C F
0 3 swap the positions of activities C and
D in the network to show this.
B E
2 Watch out It often isn’t easy to get
the layout of the network right first
D G time. It’s a good idea to draw the
1 4 5
A network in pencil and have a rubber to
F hand!
C
0 3
Finally, activity G depends on activities
B E D and F so their arcs need to meet at
2
a node. With practice, it gets easier to
anticipate how the network needs to
be set out and so there is less need for
adjustment.

224

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 224 21/01/19 7:08 PM


Critical path analysis

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.

2 The development of a commercial computer program is divided into activities A to J.


Activity A does not depend on any other activity.
Activities B, C and D all require that Activity A is completed before they can start.
Activities E and F depend on activity B.
Activity G cannot be started until activities C and E have been completed.
Activity H requires the completion of activity D, while activity I requires that both activities F
and G are completed first.
Activity J requires the completion of all activities before it may be started.
a Draw a precedence table to represent the development of the computer program.
b Use the precedence table to draw the corresponding activity network.

E 3 The precedence table for a project is shown below.


Draw the corresponding activity network.
Activity Depends on
A –
B –
C A
D A
E B
F B
G D
H D
I C, E
J F
K G, I, J
L H, K (3 marks)

225

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 225 21/01/19 7:08 PM


Chapter 8

E 4 Here is an activity network for a project.


D 5 H
2
B 9
F
A 7 K
0 1 4
I L
E
C
3
G 6 8
J

Draw a precedence table to represent the project.  (3 marks)

8.2 Dummy activities


You need to understand the use of dummy activities.
The precedence table given below appears to be very simple and yet the corresponding activity
network cannot be completed using the methods described so far.

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 226 21/01/19 7:08 PM


Critical path analysis

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 227 21/01/19 7:08 PM


Chapter 8

■ 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

Draw a precedence table for the network.

E 2 A project is modelled by the activity network  3


C
shown opposite.
a Explain the significance of the dotted line from 1 E
A
events 2 to 4.  (2 marks) D

b Draw a precedence table for this network. 0 4


Dummy F
 (3 marks)
B
2 5
G

228

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 228 21/01/19 7:08 PM


Critical path analysis

E 3 Draw an activity network to represent the precedence table below.


Your network should contain exactly one dummy.

Activity Must be preceded by


A –
B –
C –
D A
E C
F A, B, E
G C
H D (3 marks)

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)

b Explain the purpose of each dummy.  (2 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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 229 21/01/19 7:08 PM


Chapter 8

8.3 Early and late event times


Activities within a project typically take different lengths of time to complete.
■ 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.
The activity network opposite was used in Exercise 8B
3
question 2 but now each activity has a figure in C(4)
brackets representing its duration in hours.
1 E(2)
Activity A takes 2 hours to complete. A(2)
D(3)
0 4
The dummy takes 0 hours to complete. Dummy(0) F(4)
B(7)
2 5
G(1)

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 230 21/01/19 7:08 PM


Critical path analysis

Example 5
The diagram shows part of an activity network.
Calculate the value of x.
2

D(5) The largest of:


2+5=7
7 x 7 + 3 = 10
C(3) 9+0=9

9 The dotted line indicates a dummy. This has a


weight of 0.

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 231 21/01/19 7:08 PM


Chapter 8

E 2 The activity network for a project is given below.


9 D(2) w
z 11
B(6) Watch out Activities A, C and E can
Dummy G(5)
9 be completed in 8 hours, but there is a
A(3) 12 dummy showing that you cannot start
0 3
E(1) activity H until activity B has been
0 3 H(4) x completed.
C(4) 7 x
y F(4)

The time in hours needed to complete each activity is shown in brackets.


Early and late times are shown at each vertex.
Calculate the values of w, x, y and z.(8 marks)

E 3* The activity network for a project is given below.


F(4)
C(9)
I(5)
Dummy
A(8)
D(7)
G(5) J(5)
0
H(8)
0
B(6)
K(5)
E(5)

The time in days needed to complete each activity is shown in brackets.


Calculate the early and late times at each vertex. (5 marks)

8.4 Critical activities


You need to be able to identify critical activities.
■ 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 Watch out It is possible for a project
called a critical path. A critical path is the to have more than one critical path, in
which case the total project time is the
longest path contained in the network.
same on each one.
■ At each node (vertex) on a critical path the early
event time is equal to the late event time.

232

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 232 21/01/19 7:08 PM


Critical path analysis

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

The critical activities are A, D, G, and L. Check: 6 + 7 + 9 + 7 = 29.


Adding the durations of the critical activities
gives the total duration for the project, as Problem-solving
shown by the early and late event times at Notice that at each vertex on the critical path,
the sink node. the early and late event times are equal. These
indicate the critical events. Elsewhere, there is a
difference between the two values.

■ An activity connecting two critical events isn’t necessarily a critical activity.

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

The critical activities are E and G. F is not a


critical activity even though it connects two
critical events. Any increase in the duration of Watch out In your exam, you may need to find
activity E or activity G will increase the total more than one critical path and to identify all of
time for the project, whereas the duration of the critical activities.
activity F may be increased by up to 3 hours
and have no effect on the total time.

233

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 233 21/01/19 7:08 PM


Chapter 8

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

There are two critical paths: A B D G and


A B H.
The critical activities are those that
The critical activities are A, B, D, G and H.
lie on either critical path.

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

a Identify the critical activities. (2 marks)


b Name an activity that links two critical events but is not critical.
Explain your reasoning. (3 marks)

234

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 234 21/01/19 7:08 PM


Critical path analysis

E/P 3* The activity network for a project is shown below.


Activity times are given in days and are shown C(4)
in brackets. H(5)
a Copy and complete the activity network A(3)
D(2) Dummy
to show the early and late event
times. (4 marks)
E(3) F(4) I(3)
b Explain why G is not a critical B(7)
activity. (2 marks) G(1)
c Determine the critical activities and the
length of the critical path. (3 marks)

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)

a Complete the precedence table below.


Event Immediately preceding activity
A –
B –
C –
D
E
F
G
H
I
J
K
L
M (3 marks)
b Complete the diagram by calculating the early time and the late time for each event. (4 marks)
c Determine the critical activities and the length of the critical path. (2 marks)

235

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 235 21/01/19 7:08 PM


Chapter 8

8.5 The float of an activity


You can determine the total float of activities.
■ 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.

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 236 21/01/19 7:08 PM


Critical path analysis

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)

E 3 A project’s activity network is shown below.


y
C(4) 12 G(5)
6 3
A(6) 6 D(5) H(6) z K(4)
0 11 21
0 B(2) E(4) 11 I(7) L(3) 21
2 18
x F(12) J(3) 18
14
15

a Find the values of x, y and z. (2 marks)


b List the critical activities. (1 mark)
c Calculate the total float of activity E. (1 marks)

237

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 237 21/01/19 7:08 PM


Chapter 8

8.6 Gantt charts


You need to be able to construct and use Gantt (cascade) charts.
■ 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.

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.

The critical activities are shown as rectangles in a line at the top.

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

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Activity B has duration 3 hours, an earliest


start time of 4 hours and a latest finish
A C E F H time of 12 hours.

B Activity D has duration 2 hours, an earliest


start time of 7 hours and a latest finish
D time of 14 hours.

G Activity G has duration 3 hours, an earliest


start time of 9 hours and a latest finish
time of 16 hours.

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 238 21/01/19 7:08 PM


Critical path analysis

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)

E 2 An activity network for a project is shown below.

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

a Calculate the values of w, x, y and z. (4 marks)


b List the critical activities. (2 marks)
c Calculate the total float for activities G and N. (2 marks)
d Draw a Gantt chart to represent the project. (4 marks)

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 239 21/01/19 7:08 PM


Chapter 8

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

H The green line


indicates the
I position of
midday on day 10.

a The activities that must be happening Problem-solving


at midday on day 10 are C, D and E. Activity F may be happening at
b The activity that may be happening at midday on day 10 midday on day 10, but the total
is F, because its duration is 10 days and it has to finish float of 5 days shows that the start
could be delayed until day 14.
at the end of day 23.

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 240 21/01/19 7:08 PM


Critical path analysis

The first spot check takes place at 12 noon on day 8.


a Determine which activities must be happening at this time.  (2 marks)
The second spot check takes place at 12 noon on day 15.
b List all the activities which may be happening at this time.  (2 marks)

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

Use your chart to determine:


b which activities may be happening at midday on day 5, (2 marks)
c which activities must be happening at midday on day 7. (2 marks)

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

a Find the values of x, y and z. (2 marks)


b Identify the critical path. (1 mark)
c Calculate the total float on activities A and C. (1 mark)
d Draw a Gantt chart for the project. (4 marks)
The foreman checks on how well the project is progressing. He makes a check on Day 21 and
notices that Activity I has not yet started.
e Can the project still be completed on time? Explain your answer. (1 mark)

241

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 241 21/01/19 7:09 PM


Chapter 8

8.7 Resource histograms


A
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. Workers follows these rules:
■ No worker can carry out more than one Watch out In many cases each activity will only
activity simultaneously.
require one worker, but you may also need to
■ Once a worker, or workers, have started an consider situations where more than worker is
activity, they must complete it. needed for certain activities.
■ Once a worker, or workers, have finished an
activity, they immediately become available to start another activity.

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 242 21/01/19 7:09 PM


Critical path analysis

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.

From end of day To end of day Activities Number of


Combine the information given
workers in the Gantt (cascade) chart
0 3 A, B 3 with the information about the
3 7 A, D, E 5 number of workers required for
7 9 C, D, E 4 each activity. Work out how many
9 11 C, E, G 4 workers are needed on each
day of the project. This is the
11 13 F, E, G 4
information that will be shown
13 14 F, G 3 on the resource histogram.
14 18 F 1
18 26 H 1

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.

Watch out Make sure there are no gaps in your


resource histogram.

243

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 243 21/01/19 7:09 PM


Chapter 8

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 244 21/01/19 7:09 PM


Critical path analysis

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

3 these activities only


B B B
2 requires 1 worker.
B B B
1
A A A A A A E E E E E E E H H H H H H H H
0 Next write in any
0 2 4 6 8 10 12 14 16 18 20 21
other activities that
Days
can start at time 0.
In this case, activity
B starts at time
0. It requires two
4 workers so allocate
G G G G G G G G
Workers

3 two rows in the


B B B G G G G G G G G resource histogram.
2
B B B F F F F F F F F F
1
A A A A A A E E E E E E E H H H H H H H H Activity B finishes
0
0 2 4 6 8 10 12 14 16 18 20 21 at day 3. You can
Days now start activities
F and G.

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 245 21/01/19 7:09 PM


Chapter 8

A The only activity


6 left to include is D.
C C C C C
5 The earliest it can
C C C C C
Workers

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 246 21/01/19 7:09 PM


Critical path analysis

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

a draw a resource histogram (4 marks)


b state the number of workers required to complete the project. (1 mark)

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 247 21/01/19 7:09 PM


Chapter 8

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)

E/P 4 The activity network opposite 21


shows the activities involved in 22 N(6)
assembling a particular vehicle
9 H(6) 28
on a factory production line.
9 D(6) 28
The times shown are in hours
I(8) O(5)
and the latest start times and A(9) 15 23 P(9)
earliest finish times are shown 15 23
at the vertices. 0 B(5) 5 E(4) 37
0 11 F(3) M(1) 37

8 J(1) 9
C(5) 30 31 Q(1)

5 G(3) 14
K(1)
27 36

10 L(4)
32

a Draw a Gantt (cascade) chart for this network. (4 marks)


The number of workers required for each activity is shown in the table.
Number of workers
1 2 3
required
Activity B, C, E, F, G, H, L, Q A, D, K, J, M, N, O I, P
b Draw a resource histogram for this project, assuming that each activity starts at the
earliest possible time. State the number of workers needed in this instance. (4 marks)

248

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 248 21/01/19 7:09 PM


Critical path analysis

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)

8.8 Scheduling diagrams


The process of assigning workers to activities is Note When constructing scheduling diagrams,
known as scheduling. You need to be able to you can assume that each activity requires only
construct a scheduling diagram to show which one worker.
workers should be assigned to which activity.
■ 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.

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 249 21/01/19 7:09 PM


Chapter 8

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

One worker is needed to complete the critical activities.

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

Worker 2 starts with activity B and, on completion, starts


activity D. A third worker is needed to start activity E on time.

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

Delay activity F as late as possible, so it may be started by worker 2 on completion of activity D.

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

All of the activities have now been assigned and so the


scheduling diagram is complete. By starting activity H as soon
as possible and activity I on
Shading is used to indicate any periods of inactivity for each worker. completion of activity H, both
activities may be completed by
worker 3.

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 250 21/01/19 7:09 PM


Critical path analysis

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

The sum of all of the activity times is 67 days.

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)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Worker 1 starts activity


A and worker 2 starts
Worker 1 A C activity B.
Worker 2 finishes first
Worker 2 B E and starts activity E.
Worker 1 starts activity C
(17 , 21).

251

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 251 21/01/19 7:09 PM


Chapter 8

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 Worker 2 starts


activity D and worker
Worker 2 B E D 1 starts activity F.

Continuing in the same way produces the following scheduling 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 26 27 28 29 30 31 32 33 34

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

a Given that the total


duration of all of the C

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 252 21/01/19 7:09 PM


Critical path analysis

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)

a Draw a Gantt chart to represent the project. (4 marks)


b Schedule the project to be completed by the minimum number of workers in the
critical time. State the number of workers required. (4 marks)

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 –

E 1 The precedence table for activities involved in B –


producing a computer game is shown opposite. C B
An activity on arc network is to be drawn to D A, C
model this production process. E A
a Explain why it is necessary to use at least two F E
dummies when drawing the activity network. G E
 (2 marks) H G
b Draw the activity network using exactly two I D, F
dummies. (4 marks) J G, I
K G, I
L H, K

253

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 253 21/01/19 7:09 PM


Chapter 8

E 2 a Draw the activity network described in this Immediately preceding


precedence table, using activity on arc and Activity
activities
exactly two dummies. (3 marks)
A –
b Explain why each of the two dummies is
B –
necessary. (2 marks)
C A
D B
E B, C
F B, C
E/P 3 An engineering project is modelled by I(16)
5 7
the activity network shown on the right.
2 G(8)
The activities are represented by the A(10) C(11) M(9)
J(10)
arcs. The number in brackets on each
arc gives the time, in days, to complete 1 4 K(21) 9
D(5) H(12)
the activity. Each activity requires E(15)
B(14) 6
one worker. The project is to be 3
L(6) N(12)
completed in the shortest time.
F(20) 8
a Calculate the early time and late time for each event.  (3 marks)
b State the critical activities. (2 marks)
c Find the total float of activities D and F. You must show your working. (2 marks)
d Draw a cascade (Gantt) chart for this project. (4 marks)
The chief engineer visits the project on day 15 and day 25 to check the progress of the work.
Given that the project is on schedule,
e which activities must be happening on each of these two days? (1 mark)
A 4 A project is modelled by the F(5)
2 5
E/P activity network shown on I(3)
the right. The activities are A(8) D(7) 8
represented by the arcs. The L(6)
number in brackets on each H(2)
4 6 10
arc gives the time, in hours, to 1
B(9) J(9)
complete the activity. The numbers M(7)
C(9) E(11)
in circles are the event numbers. 9
Each activity requires one worker. 3
K(11)
G(8) 7

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 254 21/01/19 7:09 PM


Critical path analysis

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

a Calculate the missing early and late times. (2 marks)


b Explain what is meant by a critical path. (1 mark)
c List the two critical paths for this network. (2 marks)
The sum of all the activity times is 110 days and each activity requires just one worker.
The project must be completed in the minimum time.
d 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)
e List the activities that must be happening on day 20. (2 marks)
f Comment on your answer to part e with regard to the lower bound you found in part d.
 (2 marks)
g Schedule the activities, using the minimum number of workers, so that the project is
completed in 30 days. (3 marks)

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 255 21/01/19 7:09 PM


Chapter 8

A c Draw a Gantt (cascade) chart to represent the project. (4 marks)


d Assuming that each activity only requires one worker, draw a resource histogram. (3 marks)
e Use resource levelling to show that the project can be completed with 4 workers
without extending the total time needed. (2 marks)
E/P 7* A group of workers are involved in a building project. The number in brackets on each arc
represents the time, in days, to complete the activity.

D(8)
A(3)
E(6) H(2)
B(6) K(3)
F(4)

I(3) J(1) L(2)


C(5)
G(1)

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 256 21/01/19 7:09 PM


Critical path analysis

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

Summary of key points


1 A precedence table, or dependence table, is a table that shows which activities must be
completed before others are started.
2 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 first node, which is called the source node.
• Sometimes the source 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.
3 A dummy activity has no time or cost. Its sole purpose is to show dependencies between
activities.

257

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 257 21/01/19 7:09 PM


Chapter 8

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

M08A_EDD1_SB_ASAL_83299_U08_221-258.indd 258 21/01/19 7:09 PM


Review exercise

Answer templates for questions marked * are available on www.pearsonschools.co.uk/d1maths


2
E/P 1 Two fertilisers are available, a liquid X and The times available each week for cutting,
a powder Y. A bottle of X contains finishing and packaging are 66, 56 and 40
5 units of chemical A, 2 units of chemical hours respectively.
B and _​​  2 ​​unit of chemical C. A packet of
1
The company wishes to maximise its profit.
Y contains 1 unit of A, 2 units of B and 2
Let x be the number of Oxford, and y
units of C. A professional gardener makes
be the number of York suites made each
her own fertiliser. She requires at least 10
week.
units of A, at least 12 units of B and at
least 6 units of C. a Write down the objective function. (1)
b In addition to
She buys x bottles of X and y packets of Y.
2x + 3y < 33,
a Write down the inequalities which model
this situation. (4) x > 0,
y > 0,
b Draw a graph to illustrate the feasible
region, R. (2) find two further inequalities to model
the company’s situation. (2)
A bottle of X costs £2 and a packet of Y
costs £3. c Illustrate all the inequalities, indicating
clearly the feasible region. (2)
c Write down an expression, in terms of x
d Explain how you would locate the
and y, for the total cost £T. (1)
optimal point. (1)
d Using your graph, obtain the values of x
e Determine the number of Oxford and
and y that give the minimum value of T.
York suites that should be made each
Make your method clear and calculate
week and the maximum profit gained.(2)
the minimum value of T. (2)
It is noticed that when the optimal solution
← Sections 6.1, 6.2, 6.3, 6.4
is adopted, the time needed for one of the
E 2 A company produces two types of self- three stages of the process is less than that
assembly wooden bedroom suites, the available.
‘Oxford’ and the ‘York’. After the pieces
f Identify this stage and state by how
of wood have been cut and finished, all the
many hours the time may be reduced.(2)
materials have to be packaged. The table
← Sections 6.1, 6.2, 6.3, 6.4
below shows the time, in hours, needed to
complete each stage of the process and the E/P 3 The Young Enterprise Company ‘Decide’,
profit made, in pounds, on each type of suite. is going to produce badges to sell to
Oxford York decision maths students. It will produce
Cutting 4 6 two types of badge.
Finishing 3.5 4 Badge 1 reads ‘I made the decision to do
Packaging 2 4 maths’ and Badge 2 reads ‘Maths is the
Profit (£) 300 500 right decision’.

259

M08B_EDD1_SB_ASAL_83299_RE2_08B_259-268.indd 259 18/01/19 5:36 PM


Review exercise 2

‘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

4 Becky’s bird food company makes two 6


E
types of bird food. One type is for bird
feeders and the other for bird tables. Let 4 R

x kg represent the quantity of food for


bird feeders made each day, and y kg 2
represent the quantity of food for bird
tables made each day. Due to restrictions 0
0 2 4 6 8 10 12 x
in the production process, and known 6.5
demand, the following constraints apply:
The feasible region, R, is indicated.
x + y < 12
x = the number (in thousands) of type X
y , 2x
batteries produced each day,
2y > 7
y = the number (in thousands) of type Y
y + 3x > 15 batteries produced each day.
a Show these constraints on a diagram The profit of each type X battery is 40p
and label the feasible region R. (3) and on each type Y battery is 20p.
The objective is to minimise C = 2x + 5y. The company wishes to maximise its daily
b Solve this problem, making your profit.
method clear. Give, as fractions, the a Write this as a linear programming
value of C and the amount of each type problem, in terms of x and y, stating
of food that should be produced. (4)

260

M08B_EDD1_SB_ASAL_83299_RE2_08B_259-268.indd 260 18/01/19 5:36 PM


Review exercise 2

the objective function and all the A Basic


constraints. (4) x y z r s t Value
variable
_1
1​​ _2 ​​ –​​ _2 ​​
1
b Find the optimal number of batteries r ​​  2 ​​ 0 1 1
0 10
of each type to be made each day. y ​​ _2 ​​
1
1 ​​ _2 ​​
1
0 ​​ _2 ​​
1
0 20
Your answers must be a whole number
of batteries and you must show your t 2 0 0 0 –1 1 10
working clearly. (4) P –10 0 –20 0 40 0 1600
c Find the daily profit, in £, made by c Explain the practical meaning of the
EXYCEL. (1) value 10 in the top row. (1)
← Sections 6.1, 6.2, 6.3, 6.4
d i Perform one further complete
A 6 Flatland UK Ltd makes three types of iteration of the simplex algorithm.(3)
carpet, the Lincoln, the Norfolk and the ii State whether your answer to part
E
Suffolk. The carpets all require units of d i is optimal. Give a reason for your
black, green and red wool. answer.
iii Interpret your current tableau, giving
For each roll of carpet, the Lincoln requires
the value of each variable. (1)
1 unit of black, 1 of green and 3 of red, the
← Sections 7.1, 7.2
Norfolk requires 1 unit of black, 2 of green
and 2 of red, and the Suffolk requires 2 E/P 7 T42 Co. Ltd produces three different
units of black, 1 of green and 1 of red. blends of tea, Morning, Afternoon and
There are up to 30 units of black, 40 units Evening. The teas must be processed,
of green and 50 units of red available blended and then packed for distribution.
each day. Profits of £50, £80 and £60 are The table below shows the time taken, in
made on each roll of Lincoln, Norfolk hours, for each stage of the production of
and Suffolk respectively. Flatland UK Ltd a tonne of tea. It also shows the profit, in
wishes to maximise its profit. hundreds of pounds, on each tonne.
Let the number of rolls of the Lincoln, Profit
Norfolk and Suffolk made daily be x, y Processing Blending Packing
(£100)
and z respectively. Morning
3 1 2 4
a Formulate the above situation as a linear blend
programming problem, listing clearly Afternoon
2 3 4 5
the constraints as inequalities in their blend
simplest form, and stating the objective Evening
4 2 3 3
function. (4) blend

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

M08B_EDD1_SB_ASAL_83299_RE2_08B_259-268.indd 261 18/01/19 5:36 PM


Review exercise 2

A An initial simplex tableau for the above A ii Explain what s means in practical
situation is terms. (1)

Basic Another constraint and the objective


x y z r s t Value function give the following simplex
variable
r 3 2 4 1 0 0 35 tableau. The profit P is stated in euros.
s 1 3 2 0 1 0 20 Basic
x y z r s Value
t 2 4 3 0 0 1 24 variable
P –4 –5 –3 0 0 0 0 r 3 5 6 1 0 50
s 1 2 4 0 1 24
b Solve this linear programming problem
using the simplex algorithm. Take the P –1 –3 –4 0 0 0
most negative number in the profit row c Write down the profit on each small
to indicate the pivot column at each lamp. (1)
stage. (5)
d Use the simplex algorithm to solve this
T42 Co. Ltd wishes to increase its profit linear programming problem. (5)
further and is prepared to increase the
e Explain why the solution to part d is not
time available for processing or blending or
practical. (1)
packing or any two of these three.
f Find a practical solution which gives
c Use your answer to part b to advise the
a profit of 30 euros. Verify that it is
company as to which stage(s) should be
feasible. (3)
allocated increased time. (2)
← Sections 7.1, 7.2, 7.3
← Sections 7.1, 7.2

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

M08B_EDD1_SB_ASAL_83299_RE2_08B_259-268.indd 262 18/01/19 5:36 PM


Review exercise 2

A The carpenter wishes to maximise his A b Rewrite the constraints as equations


profit. The simplex algorithm is to be used using the notation given in the tableau.
to solve this problem.  (2)
c Write down the initial tableau using r c Explain the purpose of the final row
and s as slack variables. (2) of the tableau and show how it was
d Use two iterations of the simplex derived. (3)
algorithm to obtain the following d Choose a suitable pivot and carry out
tableau. In the first iteration you should one iteration. (4)
increase y. (3) e Explain what your answer to part d
Basic shows. (1)
x y z r s Value
variable In the second stage of the two-stage
_1 _1 _1
y 0 1 ​​  2 ​​ ​​  2 ​​ − ​​  2 ​​ 10 simplex method, the following tableau is
x 1 0 4 −1 2 80 produced.
P 0 0 22 0 10 1000 Basic
x y z s1 s2 s3 Value
variable
e Give a reason why this tableau is _1 _2 _1
​​ _3 ​​
8
z 0 ​​  3 ​​ 1 ​​  3 ​​ 0 ​​  3 ​​
optimal. (1)
_7
​− ​ _3 ​​ ​​ _3 ​​ __
1 1 23
s2 0 ​​  3 ​​ 0 1 ​​  3 ​​
f Write down the number of each type of
_1 _1 _2 __
14
chest that should be made to maximise x 1 ​​  3 ​​ 0 ​− ​  3 ​​ 0 ​− ​  3 ​​ ​​  3 ​​
the profit. State the maximum profit. (2) P 0 ​− ​ _3 ​​
2
0 ​​ _3 ​​
5
0 ​​ _3 ​​
1 __
38
​​  3 ​​
← Sections 7.1, 7.2, 7.3
f Explain how you know that the
E/P 10 A linear programming problem is defined solution represented by the tableau is
by the following conditions. not optimal. (1)
Maximise P = x + 2y + 3z g Carry out one more iteration and
subject to: interpret the result. (4)
← Section 7.4
x + y + 2z < 10
x + 3y + z < 15 E 11 Here is a linear programming problem
2x + y + z > 12 that is to be solved using the two-stage
x, y, z > 0 simplex method.
a Explain why this problem cannot Maximise P = 2x – y + z
be solved directly using the simplex subject to:
algorithm. (1) x + 2y + 3z < 18
The initial tableau for the two stage 3x + y + z > 6
simplex method is shown below.
2x + 5y + z > 20
Basic Value x, y, z > 0
x y z s1 s2 s3 a1
variable
a Express the constraints as equations
s1 1 1 2 1 0 0 0 10
using slack, surplus and artificial
s2 1 3 1 0 1 0 0 15
variables. (2)
a1 2 1 1 0 0 –1 1 12
b Write a new objective function for
P –1 –2 –3 0 0 0 0 0
the first stage in terms of non-basic
I –2 –1 –1 0 0 1 0 –12 variables. (2)

263

M08B_EDD1_SB_ASAL_83299_RE2_08B_259-268.indd 263 18/01/19 5:36 PM


Review exercise 2

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

M08B_EDD1_SB_ASAL_83299_RE2_08B_259-268.indd 264 18/01/19 5:36 PM


Review exercise 2

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)

D(x) 0 B(3) 3 F(2) y K(7) 14 22


x 3 z 19 N(3) 22
C(5) F(4)
G(2)
J(2) M(3)
C(5)
5 9
Find the range of values of x that will 7 H(3) 16
make D a critical activity. (2)
← Sections 8.2, 8.4 A trainee at a building company is
using critical path analysis to help
E/P 17* 5 plan a project. The diagram shows the
trainee’s activity network. Each activity
A(5) J(3)
D(8) is represented by an arc and the number
G(7) in brackets on each arc is the duration of
B(10) E(10) the activity, in hours.
1 2 6 7
L(8)
F(9) H(4) a Find the values of x, y and z. (2)
K(5)
C(11) M(4) b State the total length of the project and
3
I(3) list the critical activities. (2)

4 c Calculate the total float time on:


The diagram shows the activity network i activity N
used to model a building project. The ii activity H (2)
activities are represented by the edges. ← Sections 8.3, 8.4, 8.5

265

M08B_EDD1_SB_ASAL_83299_RE2_08B_259-268.indd 265 18/01/19 5:36 PM


Review exercise 2

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

M08B_EDD1_SB_ASAL_83299_RE2_08B_259-268.indd 266 18/01/19 5:36 PM


Review exercise 2

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

M08B_EDD1_SB_ASAL_83299_RE2_08B_259-268.indd 267 18/01/19 5:36 PM


Review exercise 2

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

2 A linear programming problem is expressed as:


Minimise C = 2x – 3y + z
subject to:
4x + 3y + 2z < 36
x + 4z < 52
x + y > 10
x, y, z > 0
Choose a suitable method to solve this problem, giving the optimal values of C, x, y and z.
← Section 7.5

268

M08B_EDD1_SB_ASAL_83299_RE2_08B_259-268.indd 268 18/01/19 5:36 PM


Exam-style practice
Further Mathematics
AS Level
Decision 1
Time: 50 minutes
You must have: Mathematical Formulae and Statistical Tables, Calculator

1 a Use the bubble sort to write these numbers in ascending order.


21 16 11 25 18 15 23 10
You should only show the state of the list at the end of each pass.(3)
b Show that the bubble sort algorithm has quadratic order.(3)
A computer takes 0.018 seconds to apply the bubble sort to a list of 50 numbers.
c Estimate how long it would take the computer to sort a list of 1000 numbers using the
bubble sort. Explain why your answer is only an estimate.(2)

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)

3 A magazine offers two advertising packages for its classified section:


Package A: picture area: 20 cm2, price: £40 including up to 25 words
Package B: picture area: 30 cm2, price: £55 including up to 60 words
In a particular issue, up to 1000 cm2 of picture space is available, and at most 1600 words can
be used in total.
The magazine needs to generate a minimum of £1200 of revenue from the advertising sales.
The profit made on each Package A sold is £24.
The profit made on each Package B sold is £32.

269269

M09A_EDD1_SB_ASAL_83299_PP1_269-270.indd 269 18/01/19 5:50 PM


Exam-style practice

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)

4* The diagram shows a network of tunnels that are to  A


16 B
be inspected. The number on each arc represents the
time required, in minutes, to inspect each tunnel. 5 6
8
The inspection route is to start and finish at B and 3 14
F 12
every tunnel must be traversed at least once. G H
The total time taken is to be minimised. 4 20 24 5 C

The total weight of the network is 144. 11


E
a Use an appropriate algorithm to determine which 16
D
tunnels need to be traversed twice and state the
total time required for the inspection.(5)
A new tunnel is added to the network, joining A directly to E. A manager states that after this
addition, only tunnel FG should be traversed twice to create a minimum inspection route.
b Explain why the manager is incorrect.(2)
Following the introduction of the new tunnel, the duration of the minimum inspection route is
found to have increased by 4 minutes.
c Find the length of the new tunnel.(2)

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

M09A_EDD1_SB_ASAL_83299_PP1_269-270.indd 270 18/01/19 5:50 PM


Exam-style practice
Further Mathematics
A Level
Decision 1
Time: 1 hour and 30 minutes
You must have: Mathematical Formulae and Statistical Tables, Calculator

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

M09B_EDD1_SB_ASAL_83299_PP2_271-274.indd 271 21/01/19 7:09 PM


Exam-style practice

3* a Explain what is meant when a network is described as semi-Eulerian.(1)


The diagram represents a road network that must be checked for damage after a storm.
The number on each arc is the length of the corresponding road in miles.
A
4
8 2 4 B
F 1
2 G
5
J 3
E 7 6 Total weight of network is 74
2 3 H
3 I 2
6 4
D C
10

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

b Name the arc that can only be traversed in one direction.(1)


c Use Floyd’s algorithm to produce a complete table of least distances. Show the distance and
route tables after each iteration.(7)
d Find the shortest distance from A to E and state the route used. (2)

272

M09B_EDD1_SB_ASAL_83299_PP2_271-274.indd 272 21/01/19 7:09 PM


Exam-style practice

5 Angie supplies two types of party-pack for children’s parties:


A mini-pack containing 12 sandwiches, 5 slices of cake, 5 orange drinks and 6 blackcurrant
drinks.
A mega-pack containing 30 sandwiches, 20 slices of cake, 5 orange drinks and 12 blackcurrant
drinks.
Angie can make at most 240 sandwiches.
The number of sandwiches she can make is at most double the number of slices of cake she can
make.
She wants to use at least 55 orange drinks and at least 96 blackcurrant drinks.
Assume that Angie makes x mini-packs and y mega-packs.
a Write and simplify 4 inequalities to represent the constraints, other than the non-negativity
constraints.(4)
b Represent the inequalities on a diagram and label the feasible region R.(4)
Angie makes a profit of £8 on each mini-pack and £21 on each mega-pack. She wants to
maximise her profit.
c Use vertex testing to work out how many of each pack she should make and state the
corresponding profit.(4)

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

M09B_EDD1_SB_ASAL_83299_PP2_271-274.indd 273 21/01/19 7:09 PM


Exam-style practice

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

M09B_EDD1_SB_ASAL_83299_PP2_271-274.indd 274 21/01/19 7:09 PM


Answers

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

244 125 125 244 256 123 5 8.95


122 250 62 488 128 246 6→2 8.827
61 500 31 976 64 492 3 0.123
30 1000 15 1952 32 984 4 8.889
15 2000 7 3904 16 1968 5 8.889
7 4000 3 7808 8 3936 6→2 8.887
3 8000 1 15  616 4 7872
3→7 0.002
1 16  000 Total 30  500 2 15  744
7 Print 8.889
Total 30  500 1 31  488
iii
Total 31  488
Step A r C r−C s Print r
2 a 1 ​ __ ​  9 ​  ​ __
a ​ = __ c  ​ = __
​  4 ​   a = 9, b = 4, c = 4, d = 3
b 4 d 3 1 4275 50
2 e = ad = 9 × 3 = 27
3 f = bc = 4 × 4 = 16 2 85.500

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

Roots are − ​ _13 ​ and _​ 52 ​

275

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 275 24/01/19 7:42 AM


Answers

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.

276 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 276 24/01/19 7:42 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 277 24/01/19 7:42 AM


Answers

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.

278 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 278 24/01/19 7:42 AM


Answers

4 a Any four of these 7 2 16


FABD FED
FACBD FECBD
FABCED FECABD
FACED
b e.g. F A C B D E F, D B A F E D
c Vertex A B C D E F
Degree 3 3 3 2 3 2
4 8
d Here are examples. (There are many others.) 8 a A Hamiltonian cycle is a cycle that includes every
i A ii F vertex.
b PQRSTP, PQSRTP, PTSRQP, PTRSQP
c A subgraph of some graph G is a graph whose
C
edges and vertices are all edges and vertices of G.
B d e.g.     or  
E

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

3 vertices all even, all of degree 2


c The sum of degrees = 2 × number of edges, so the ix
sum of degrees must be even. Any vertices of odd
degree must therefore ‘pair up’. So there must be
an even number of vertices of odd degree.

279

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 279 24/01/19 7:42 AM


Answers

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

b Each vertex will have a degree of n − 1


c 190

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

280 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 280 24/01/19 7:42 AM


Answers

c A B Similarly, taking AE or BF outside first, the


remaining edges cross inside and neither can be
taken outside without crossing the outside edge.
The conclusion is that the original graph is not
C planar.
3 a Q

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

2 a A planar graph is one that can be drawn in a plane G W E


such that no two edges meet except at a vertex. A Hamiltonian cycle is AWCEBGA. Redraw the graph
b e.g. AGBHCEDFA inside a hexagon:
c G A
A B
W G

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 281 24/01/19 7:42 AM


Answers

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

282 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 282 24/01/19 7:42 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 283 24/01/19 7:42 AM


Answers

b 2 In Prim’s algorithm, the starting point can be any node,


whereas Kruskal’s algorithm starts from the arc of
2 1 least weight.
In Prim’s algorithm, each new node and arc is added
2.5
to the existing tree as it builds, whereas in applying
Kruskal’s algorithm, the arcs are selected according to
5 6 7 their weight and may not be connected until the end.
3 a H C 3.1
D
1.8
8 2.4
The three shortest edges form a cycle. A E
4.6 B 3.4
2.8
4 a Cl 2.3
G F
0.8
1.4 Ce
M S Selection order: AH, AG, AB, BC, CD, BF, EF
1.9
2.3 1.6 b £17 340
2.8
4 a Q T 27 W
H
R
P 3.1 E 1.1 27 15 41
S 18
Sh P V 19 Y
Arcs were added in the order MCl (0.8), ShR (1.1), 31
29
ClS, CeR, CeH, SR, ME, PE 24
b 15 km
R U X
Exercise 3B b £231 000
c Replace WX with VX. This is the cheapest way to
1 A
link X to the spanning tree. The total cost is now
16 £231 000 + £28000 − £19000 = £240 000
14 C 5 a Prim’s algorithm identifies the next node to link to
B the existing tree. Linking a new node cannot form a
H 12 cycle.
18 12 b One minimum connector is shown below.
D E
B Order of
15 11 connection
G 4 D
F 10 J AB
8
weight: 98 A F 9 BC
10 8 CD
9 I
b C 8 K DE
A C
6 G L 7 DF
B E FG
4 7 8
6 GH
H HL
2 KL
5 D
Total weight = 87 IK
3 IJ
F
c The minimum connector is not unique; there are
G
three minimum connectors with total weight 87.
E

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

284 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 284 24/01/19 7:43 AM


Answers

2 Arcs in order c Shortest route A to H not using C E: A − D − F − E − H


BS (49) Length 95
SM (44) 6 Shortest route: S − B − C − T
SN (56) Length of shortest route: 10
NL (37) 7 a Quickest route is SCEHT. Shortest time = 31 min.
weight = 186 b i Route changes to SABDGT. New time = 32 min
3 a cost = €1014 ii The driver should change the route to HEGT to
b D save 1 minute. Total travel time 38 min.
c 0.026 × ​​​(___
​   ​)​​​  ​​= 0.026 × 16 = 0.416 seconds
2
35 H 40
A 42 10
48 d The time required is not directly proportional to the
53 52
F 47 square of the number of locations − this is just an
E approximation.
61 G
C Exercise 3E
B 1 a
c i It is cheaper to translate from E to H then from H Initial tables
to G at a cost of 48 + 52 = 100 euro rather than
159 euro per 1000 words. P Q R S P Q R S
ii A direct translation is likely to be more accurate P − 9 5 12 P P Q R S
then a translation via another language.
4 a order of arcs Q 9 − 3 7 Q P Q R S
XE (26)
R 5 3 − ` R P Q R S
EG (18)
EH (23) S 12 7 ` − S P Q R S
HA (25)
AF (20) 1st iteration
FB (16) P Q R S P Q R S
AD (22)
FC (24) P − 9 5 12 P P Q R S
CI (26) Q 9 − 3 7 Q P Q R S
C 26 I
E R 5 3 − 17 R P Q R P
26 23
X H S 12 7 17 − S P Q P S
24
18
25 20 B 2nd iteration
A F 16
G
22 P Q R S P Q R S
D
b 9 oil rigs and 1 depot make 10 nodes. P − 9 5 12 P P Q R S
24 oil rigs and 1 depot make 25 nodes. Q 9 − 3 7 Q P Q R S
Estimated time = 0.7 × (​​​ ___
​   ​)​​​  ​​= 10.9 seconds (1 d.p.)
3
25
10 R 5 3 − 10 R P Q R Q
c i Any distance less than 26 miles will change the S 12 7 10 − S P Q Q S
minimum connector as I will link directly to X.
ii Any distance of 26 miles or more will not change 3rd iteration
the minimum connector as the shortest way to
connect I to the rest of the tree will be to connect P Q R S P Q R S
to C.
P − 8 5 12 P P R R S
Exercise 3D
Q 8 − 3 7 Q R Q R S
1 a Shortest route: S − B − E − H − G − C − F − T
Length of shortest route: 20 R 5 3 − 10 R P Q R Q
b Shortest route: S − A − B − D − F − H − T
Length of shortest route: 15 S 12 7 10 − S P Q Q S
2 a A to Q A−F−E−I−N−P−Q Length 37
b A to L A−F−G−M−L Length 19 4th iteration (no change)
c M to A M−G−F−A Length 17
d P to A P−N−I−E−F−A Length 24 P Q R S P Q R S
3 Shortest route: A − B − E − C − G − F Length 38
4 Shortest route: S1 − B − C − F − E − G − T P − 8 5 12 P P R R S
Length of shortest route: 1660
Q 8 − 3 7 Q R Q R S
5 a 94 − 18 = 76 EH 76 − 24 = 52 CE
52 − 22 = 30 BC 30 − 30 = 0 AB R 5 3 − 10 R P Q R Q
Shortest route A to H: A − B − C − E − H
Length 94 S 12 7 10 -− S P Q Q S
b Shortest route A to H via G: A − D − G − H
Length 96

285

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 285 24/01/19 7:43 AM


Answers

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

(​  30 ​)​​​  ​= 0 . 44 sec​(2 d.p.)


3
E ` ` 3 6 − 7 9 100
c ​0 . 012 × ​​ ____
F 4 11 8 ` 7 − 6
G 11 18 21 ` 9 6 − Mixed exercise 3
1 a i Arcs are labelled with initial letters of the nodes.
CK add to tree
A B C D E F G SH add to tree
A A B C D E F G CE add to tree
EK reject
B A B C D E A A CH add to tree
C A B C D E F A HW add to tree
CS reject
D A B C D E F G HQ add to tree
E A B C D E F G QS reject
QD add to tree
F A A C D E F G KS reject
G A A A D E F G DW reject
EW reject

286 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 286 24/01/19 7:43 AM


Answers

ii EC Entrance 1 Entrance 2 Entrance 3


CK
1514 587
CH
488
HS 523
HW Office
HQ Entrance 4
QD b length 3112 m
b K S 5 a 29 27 30 19 9 26 17 18 8 12 24 20 14 14 22 26
234 300 8 29 27 30 19 9 26 17 18 12 24 20 14 14 22 26
378 538 8 9 17 12 14 14 18 29 27 30 19 26 24 20 22 26
340 Q
C H 8 9 12 17 14 14 18 19 24 20 22 26 29 27 30 26
E
423 740
8 9 12 14 17 14 18 19 20 24 22 26 29 27 26 30
8 9 12 14 14 17 18 19 20 22 24 26 26 27 29 30
weight: 2953 W D
EF CD EJ FJ GI CG DG BC FI HK EK CF JK AE AB AH
2 a i LT L M N
MT b, c
4.1 4.7 B 19 C
MQ
3.8 T 3.7 A
NQ 27 9
ST 6.8 E 8 F 17
Q D
QR 6.6 24 12 20
NP S 6.6 H
22 K G
14
P J I Total weight = 172
R
d e=v−1
ii MQ (3.7) add to tree 6 a weight = 45 so 4500 m needed
LT (3.8) add to tree
C 3 F H
MT (4.1) add to tree
NQ (4.7) add to tree 1
MN (5.3) reject A 3 3
L
{
ST (6.6) add to tree
QR (6.6) add to tree
4
2
D 6
I
5 4
N
NP (6.8) add to tree G
reject remaining arcs 4 4
b Start off the tree with QT and PR then apply M
Kruskal’s algorithm. Prim’s algorithm requires the 3
B E J 3 K
‘growing’ tree to be connected at all times. When
using Kruskal’s algorithm the tree can be built from b weight = 47 so 4700 m
non-connected sub-trees. 7 a Possible paths are A − H − G − E − I − K
and A − H − J − I− K
L
M and A − B − C − K
3.8 A, B, F, H, D, G, J, E, C, I, K
T ii 44 − 9 = 35 IK 44 − 9 = 35 IK
3.8 N
6.6 35 − 10 = 25 EI 35 − 17 = 18 JI
9.2 4.7 25 − 10 = 15 GE or 18 − 8 = 10 HJ
S 6.6 Q 15 − 5 = 10 HG 10 − 10 = 0 AH
R 10 − 10 = 0 AH
7.5 P or
44 − 12 = 32 CK
3 a C 32 − 25 = 7 BC
7−7=0 AB
52 b A − H − G − E − I − K and A − H − J − I − K
and A − B − C − K
84 97 58 41
c The arcs could be roads.
B F A E D The nodes could be junctions.
length Selection
332 mm order: AC, AE, ED, AF, FB The number on each arc could be distance in km.
b length 332 mm The network, together with Dijkstra’s algorithm,
could be used to find the shortest route from A to K.
c 0.02 ​×​ (​​​ ____  ​)​​​  ​​= 0.54 sec
3
240
​  8 Order of vertex labelling:
80
d The time required is not directly proportional to n3 S C B A E D G F T
but this is used as an approximation. Route: S − C − E − F − T
411 − 101 = 310 FT
4 a Arcs in order: Entrance 2−office; Entrance 2− 310 − 123 = 187 EF
Entrance 4; Entrance 4−Entrance 3; Office−Entrance 187 − 85 = 102 CE
1 102 − 102 = 0 SC

287

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 287 24/01/19 7:43 AM


Answers

9 a B requires a further (n − r − 1) comparisons. The number of


17 comparisons at each step is (n − 1) + (n − r − 1) = 2n − 2r − 1,
A so the total number of comparisons is:
n−1 n−1 n−1 n−1
C
19
15
Total weight = 72

​​ ​ (​​​ 2n − 2r − 1) = 2​​∑​ n
​​​ − 2​​∑​ r​​​ − ∑
​​ ​ 1
​​​
r=1 r=1 r=1 r=1
D = 2n(n − 1) − n(n − 1) − (n − 1)
E 21
= n2 − 2n + 1
b Students’ own answer Which has order n2.
c Prim’s algorithm may be quicker on a graph with a
large number of arcs, such as a complete network,
as Kruskal’s algorithm would require arcs to be CHAPTER 4
sorted by weight.
10 a Prior knowledge 4
1 a 16
1st iteration
b Sum of valencies = 2 × number of arcs
P Q R S P Q R S c 4
d From part b, the sum of the valencies must be even.
P − 12 ~ 16 P P Q R S

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.

288 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 288 24/01/19 7:43 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 289 24/01/19 7:43 AM


Answers

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.

290 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 290 24/01/19 7:43 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 291 24/01/19 7:43 AM


Answers

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

Shortest routes: BD is BED; BH is BEGH, DI is DGI;


BI is BEI, DH is DGH. F J

Repeat BE, EI and DG, GH.


G K
Adding these arcs to the network gives
B E A possible route is:
A2B2H2C2B2H2I2J2H2F2J2K2
F 2 B 2 D 2 F 2 D 2 E 2 F 2 G 2 E 2 A.
c Length of route = 249 + 28 = 277
D I
A d i We will still have to repeat the shortest path
G
between a pair of the odd nodes.
We will choose the pair that requires the shortest
path.
The shortest path of the six is BF (10).
C We will use D and H as the start and finish nodes.
F H ii 259
A possible route is: e Each edge, having two ends, contributes two to the
A2B2E2I2H2G2I2E2B2C2D2G2 sum of valencies for the network.
D 2 E 2 G 2 H 2 F 2 G 2 C 2 A. Therefore the sum = 2 × number of edges
c Length = 51.4 + 9.9 = 61.3  km The sum is even so any odd valencies must occur
d If BD is included B and D now have even valency. in pairs.
Only H and I have odd valency. 10 a Odd nodes are A, B, D, E, F and G
So the shortest path from H to I needs to be repeated. Starting at B so can leave as odd
Length of new route = 51.4 + BD + path from H to I Case (i): Land at D
= 51.4 + 6.4 + 3.4 AE + FG = 19 + 10 = 29
= 61.2  km AF + EG = 7 + 22 = 29
This is (slightly) shorter than the previous route so AG + EF = 6 + 12 = 18 ← least weight
choose to grit BD since it saves 0.1  km. Case (ii) Land at F
8 a Odd nodes are B, C, E and H AD + EG = 26 + 22 = 48
Consider possible pairings and weight AE + DG = 19 + 20 = 39
BC + EH = 68 + 150 = 218 AG + ED = 6 + 14 = 20
BE + CH = 95 + 73 = 168 ← least weight Better to use landing strip at D.
BH + CE = 141 + 85 = 226 b 168 + 18 = 186 miles
Repeat BD, DE and CH c Odd notes unchanged.
A possible route is: Case (i): Land at D
A − B − C − H − E − G − H − C − D − B − D − E − A − AE + FG = 40 + 13 = 53
F −E−D−A AF + EG = 7 + 34 = 41
Total length = 1011 + 168 = 1179 m AG + EF = 6 + 47 = 53
b If the salesman can start at B and end at C those Case (ii) Land at F
nodes can stay odd, therefore only route to be AD + EG = 26 + 34 = 60
travelled twice is EH at 150m. AE + DG = 40 + 20 = 60
Total length = 1011 + 150 = 1161 m AG + ED = 6 + 14 = 20 ← least weight
This would decrease the total distance the salesman Now better to land at F.
has to walk. 168 − (10 + 25 + 12) + 20 = 141 miles
9 a Route inspection algorithm: Challenge
Identify any vertices with odd valency. a Shortest time from A to B is 30 minutes.
Consider all possible complete pairings of these Route A − C − D − G − H − E − F − B
vertices. or A − C − D − G − F − B
Select the complete pairing that has the least sum. b 143 + AC + DG + HE + FB
Add a repeat of the arcs indicated by this pairing to = 143 + 2 + 5 + 4 + 8 = 162 minutes
the network.
b Odd vertices B, D, F, H
Considering all complete pairings
BD + FH = 14 + 15 = 29
BF + DH = 10 + 26 = 36
BH + DF = 12 + 16 = 28 ← least weight
Repeat BH and DF.
Adding these arcs to the network gives

292 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 292 24/01/19 7:43 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 293 24/01/19 7:43 AM


Answers

4 Students’ own answers, e.g. Exercise 5C


B 3 C 1 a 45
2 b The lower bound represents a tour so it must be
1 3 9 optimal.
A
B
8 D 10
4 E
E 7
8
Challenge
1 Since the network is complete, every vertex is accessible A C
9
from every other vertex. From any start vertex, there 11
must exist a route that visits every other vertex directly D
in turn. There must also exist a direct route back to the 2 a 50 (deleting A)    49 (deleting B)
start vertex. The solution is given by the route of this b Better lower bound is 50 since it is the highest.
type for which the total distance is a minimum. 3 a 183 (deleting A)    177 (deleting B)
(n − 1 )  ! b Better lower bound is 183 since it is the highest.
2 The number of distinct Hamiltonian cycles is ________
​​   ​​
2 c 183 , optimal value < 190
The order of the algorithm is (n − 1)!
4 a 170 (deleting S) 145 (deleting V )
The value of (n − 1)! grows rapidly as n increases
b Better lower bound is 170 because it is higher.
showing that the algorithm is no use for large n.
c 170 , optimal value < 190
Exercise 5B Exercise 5D
1 a
A 24 B Initial upper 1 a D7B12C8  E14  A19  D = 60
9 bound = 102 b E8C11A13B7D14E = 53 or E8C11D7B13A14E = 53
C c The better upper bound is 53 since this is lower.
10
2 a Z10X15Y40V55W30    S70  Z = 220
8 b X10Z15V40Y45W30   S55X = 195
D V15  Z10  X15Y45W30     S75V = 190
E c The better upper bound is 190 because it is lower.
b DE shortcut route length 79 3 Applied to n vertices the algorithm has cubic order.
0.27 × (​​ ___
​   ​)​​ = 1.25 seconds
c ABCDEA length 79 20 3
2 a A 11 C 11 D 7 B 12
4 a 1200 minutes
8 b U120    S150    R120V150T180W270U = 990
and
U120T150V120    R150    S240W270U = 1050
E c V120    R150    S120U120T180W300V = 990 and
b 74 V120    R150U120     S210T180W300V = 1080 and
c BE as shortcut or AB as shortcut (other answers V120    R150U120T180W240   S210V = 1020
possible) d The better upper bound is 990 because it is lower.
d i Using BE: ACEBDCA length 62 5 a Nearest neighbour route from B has length 648 + x
ii Using AB: ACECDBA length 58 Nearest neighbour route from A has length 639 + x
3 a C Total length = 1287 + 2x = 1419, ⇒ x = 66
b An upper bound for the optimal length = 639 + 66
= 705 miles
26
E 27 B 25 F 30
A Mixed exercise 5
1 a Either Kruskal’s: EF, DE, CD, BD, AC, EG
34 or Prim’s (e.g.): AC, CD, DE, EF, BD, EG
b 7004
A c e.g. use AB and DG
Initial upper bound = 284 Route ACDEFEGDBA length 6005
b Many possibilities, e.g. DE, EC, DF and EC 2 a A B C D E
c DE gives ACAFBEDA length 231
EC gives ADAFBECA length 217 A − 7 13 4 3
DF and EC gives ACEBFDA length 190 B 7 − 17 7 10
4 a S W Y 15 X
30 45 C 13 17 − 10 13
V
D 4 7 10 − 5
10
15
E 3 10 13 5 −

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

294 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 294 24/01/19 7:43 AM


Answers

e The time taken to complete the algorithm is not 6 a C 80 L 56 O 68 B 54 N


proportional to the cube of the number of hostels.
However, the calculation in part d is based on this
154
as an approximation.
3 a SC SF FA AB CD DE
E
B 2 A 3 F 5 S 2 C 12 D 13 E
Tree 1 Order: LO OB BN LC OE
SC CB BA AF CD DE b i 824 miles
E 13 D 12 C 5 B 2 A F ii Use NC as a shortcut
3 Route: LOEOBNCL length 653
Tree 2
c 573
2
7 a 110 + x = 140, so x = 30
b 151 miles
S 16 12 22 23 30 30 18
B2A2E2C2G2F2D2B
b 74 c 81 + 19 + 20 = 120 miles
c Tree 1: use BE as short cut d 120 < optimal length < 140
Route: SCDEBAFS length 56
Tree 2: use EF as short cut Challenge
Route: SCBAFEDCS length 53 For n vertices: The number of distance to compare from
d C2S5F3A2B17D13E21C = 63 some start vertex is
(n − 1) + (n − 2) + … + 2 + 1 = (​​ _____
2 )
D12C2S5F3A2B19E13D = 56 n−1
​   ​ ​n​
e The better upper bound is 53 since it is smaller
f Route SCBAFEDCS The process must be repeated for each vertex. This gives
g 44 (n −1)n 2
the total number of comparisons as ​​_____ . ​​Finally,
2
4 a In the classical problem each vertex must be visited select the tour of shortest length (n − 1 comparisons) to
exactly once before returning to the start.
(n − 1)n 2 (n − 1)(n 2 + 2)
In the practical problem each vertex must be visited give​​ _____​  + n − 1 = ​_____
​   ​​​ , which is cubic order.
2 2
at least once before returning to the start.
b R 29 T Review exercise 1
1 a
28 a b c d e f f = 0? answer is 15

V P Q 645 255 2.53 2 510 135 No


29 19
255 135 1.89 1 135 120 No
135 120 1.13 1 120 15 No
23 21 120 15 8 8 120 0 Yes
U S
b The first row would be
VP{ }
Order: PQ QU US QR ​ ​  TR ​  ​ 255  645  0.40  0  0  255  No
but the second row would then be the same as the
c Use VT and QS as shortcuts giving a length of 213 first row in the table above. So in effect this new
Route PQUSQRTVP first line would just be an additional row at the start
d P19Q23U21S51R29T37V29P = 209 of the solution.
e 186
c Finds the highest common factor of a and b.
f 186 , optimal value < 209
2 a Total length = 390 cm, so 4 planks are needed.
5 a A 42 D 45 E 38 C 58 F b 6 planks
c 5 planks
56 d There are 5 lengths over 50 cm, so none of these
B G can be paired together. Therefore minimum of
59 5 lengths are required.
Order: AD DE EC EB CF BG 3 a 80  55  84  25  34  25  75  17  5  3
b 596 80  84  55  34  25  75  25  17  5  3
c The minimum connector has been doubled and 84  80  55  34  75  25  25  17  5  3
each arc in it repeated 84  80  55  75  34  25  25  17  5  3
d Use AE and GF as shortcuts 84  80  75  55  34  25  25  17  5  3
Route: ADEBGFCEA length 427 b 403 ÷ 100 = 4.03 so 5 bins are needed.
e 352 km c Bin 1: 84 + 5 + 3
f The lower bound will give an optimal solution if it is Bin 2: 80 + 17
a tour. Bin 3: 75 + 25
If the minimum spanning tree has no ‘branches’ so Bin 4: 55 + 34
the two end vertices have valency 1, and all other Bin 5: 25
vertices have valency 2, then if the two least arcs
are incident on the two vertices of valency 1 an 4 a For example, 45 37 18 46 56 79 90 81 51
optimal solution cannot be found. b For example, 56 45 79 46 37 90 81 51 18
c 0.576 seconds (3 s.f.)

295

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 295 22/01/19 7:14 AM


Answers

5 a For example, 10 a i Method:


• Start at A and use this to start the tree.
R P B Y T K M H W G
• Choose the shortest edge that connects a
B H G K R P Y T M W vertex already in the tree to a vertex not yet in
the tree. Add it to the tree.
B G H R P M T Y W • Continue adding edges until all vertices are in
FB
{BC}
B G M P R W Y
the tree. AF, FC ​​ ​  or​​   ,​​ FD, EB
B G H K M P R T W Y
ii A 9 F 7 B 11 E   or
list in order
2000 × log 2000 3 8
b ​0.024 × _______________
​    ​=​0.043 seconds (3 d.p.)
1200 × log 1200
C D
6 a Since the graph is simple, there are no loops, so
each of the degree-5 vertices must be joined to each A 9 F 3 C 7 B 11 E
of the other vertices. This means that each of the 8
other vertices has degree at least 2.
D
b e.g.
iii The tree is not unique, there are 2 of them (see
above).
b i number of edges = 7 − 1 = 6
ii number of vertices = n 1 1
7 a 11 a A 7 B
11 4
7 3
F 8 2 C
3 9
5
6 D
E

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

296 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 296 24/01/19 7:43 AM


Answers

b For example  82 − 12 = 70 GT b 15 miles


70 − 16 = 54 CG c The final route table shows that the shortest route
54 − 20 = 34 AC from A to D is via C. The shortest route from C to D
34 − 34 = 0 SA is via B.
c Shortest route from S to H + HT S − B − F − H − T So, the shortest route from A to D is ACBD.
length: 84 16 x = CD + DA = 7 + 10 = 17
14 a A 1 0 B 3 4 C 7/8 10 D 12 6 y = AB + BC = 5 + 3 = 8
4 6 6
z = AB + BD = 5 + 6 = 11
0 4 10 16
17 a i Shortest path through A is 18 + y or 26 both of
1 2 8 4 which are greater than 17.
Shortest path through C is 23, which is greater
E 2 1 4 F 4 5 5 G 8/7 10 2 H 10/9 12
than 17. So shortest path cannot go through A
1 5 10 12 or C.
5 7 3 1 ii Shortest path must go through B.
S − B − D − T = 13 + x
I 5 6 2 J 6 8 4 K 9/10 12 1 L 11 13 13 1 x = 17
6 12 8 12 13 x=4
b If y = 0 shortest path is S − A − D − T = 18
For example If y = 5 shortest path is S − C − D − T = 23
13 − 1 = 12 HL or 13 − 1 = 12 KL so range is 18 to 23.
12 − 2 = 10 GH 12 − 4 = 8 JK c For example, a person seeking the quickest route
10 − 5 = 5 FG   8 − 2 = 6 IJ from home to work through a city. The arcs are the
5 − 4 = 1 EF   6 − 5 = 1 EI roads that may be chosen, the number the time,
1 − 1 = 0 AE   1 − 1 = 0 AE in minutes, to journey along that road. The nodes
Shortest path is {
​​ ​  }​ ​ ​​ length 13
A−E−F−G−H−L represent junctions.
A−E−I−J−K−L 18 a Odd vertices are B1, B2, E, G
b State the other path. B1 B2 + EG= 65 + 18 = 83
15 a Initial tables B1 E + B2 G= 41 + 42 = 83
B1 G + B2 E= 26 + 30 = 56 ← least weight
A B C D A B C D
Repeat B1D, DG, B2A, AE
A − 10 5 ∞ A A B C D Route: For example, F − A − E − A − B2 − A − C −
B 10 − 3 7 B A B C D E − F − G − D − H − G − D − B1 − D − F
C 5 3 − 11 C A B C D (All correct routes have 17 letters in their ‘word’)
length = 129 + 56 = 185 km
D 1 7 11 − D A B C D b Now only the route between E and G needs
First iteration repeating so repeat EF + FG = 18
length of new route = 129 + 18
A B C D A B C D
= 147 km
A − 10 5 ∞ A A B C D
19 a All arcs are to be traversed twice, this is, in effect,
B 10 − 3 7 B A B C D repeating each arc. So all valencies are even
C 5 3 − 11 C A B C D b E.g. A − B − D − G − F − G − D − C − E − A − E − C −
D 1 7 6 − D A B A D A−F−E−F−B−F−A−B−D−C−A
(all correct routes will have 23 letters in their name)
Second iteration length = 2 × 6 = 12 km.
A B C D A B C D 20 a
A − 10 5 17 A A B C B B 3 12 G 7 18
B 10 − 3 7 B A B C D 12(15) 3 3 18
12 E 5 15 5
C 5 3 − 10 C A B C B 5 15 9
D 1 7 6 − D A B A D 6
A 1 0 C 2 10 I 9 22
2
Third iteration 10 10 24 23 22
A B C D A B C D 12 F 6 17
4
15 22 18 17 2
A − 8 5 15 A A C C C
D 4 14 3 H 8 20
B 8 − 3 7 B C B C D 15 14 20
C 5 3 − 10 C A B C B Shortest route is A − B − E − F − H − I, length 22 km
D 1 7 6 − D A B A D b i Odd vertices are A and I (only), so we need to
Fourth iteration repeat the shortest route from A to I. This was
found in a.
A B C D A B C D So repeat AB, BE, EF, FH, HI.
A − 8 5 15 A A C C C ii For example A − B − C − A − D − C − E − H − I
B 8 − 3 7 B C B C D − H − E − F − I − G − F − E − B − F − B − A (20
letters in route)
C 5 3 − 10 C A B C B
iii 91 + 22 = 113 kmXX
D 1 7 6 − D A B A D

297

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 297 24/01/19 7:43 AM


Answers

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

298 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 298 24/01/19 7:43 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 299 24/01/19 7:43 AM


Answers

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

300 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 300 24/01/19 7:43 AM


Answers

In summary: maximise S = 40x + 60y


subject to:
3x + 5y < 60
5x + 4y < 80
2y < x
x>8
x, y > 0
5 Let x = number of kg of indoor feed and y = number of kg of outdoor feed
Objective: maximise P = 7x + 6y
Constraints
• Amount of A 10x + 20y < 5 × 1000 which simplifies to x + 2y < 500
• Amount of B 20x + 10y < 5 × 1000 which simplifies to 2x + y < 500 All units now in grams.
• Amount of C 20x + 20y < 6 × 1000 which simplifies to x + y < 300
• ‘At most 3 times as much y as x’ y < 3x
• At least 50 kg of x x > 50
• non-negativity y > 0 (x > 0 is unnecessary because of the previous constraint)
In summary: maximise P = 7x + 6y
subject to
x + 2y < 500
2x + y < 500
x + y < 300
y < 3x
x > 50
y>0
6 Number of A smoothies = x   Number of B smoothies = y   Number of C smoothies = z
Objective: maximise P = 60x + 65y + 55z
Constraints
• oranges x + _​ 12 ​   y + 2z < 50 which simplifies to 2x + y + 4z < 100
• raspberries 10x + 40y + 15z < 1000 which simplifies to 2x + 8y + 3z < 200
• kiwi fruit 2x + 3y + z < 100
• apples 2x + __
​​  12 ​​  y + 2z < 60 which simplifies to 4x + y + 4z < 120
• non-negativity x, y, z > 0
In summary: maximise P = 60x + 65y + 55z
subject to:
2x + y + 4z < 100
2x + 8y + 3z < 200
2x + 3y + z < 100
4x + y + 4z < 120
x, y, z > 0
7 Let number of hours of work for factory R = x   Let number of hours of work for factory S = y
Objective: minimise C = 300x + 400y
Constraints
• milk 1000x + 800y > 20 000 which simplifies to 5x + 4y > 100
• yoghurt 200x + 300y > 6000 which simplifies to 2x + 3y > 60
• ‘At least __
​​  13 ​​of total time for R’ x > __ ​​  13 ​​ (x + y) which simplifies to 2x > y
• ‘At least __
​​  13 ​​of total time for S’ y > __
​​  13 ​​ (x + y) which simplifies to 2y > x
• non-negativity x, y > 0
In summary: minimise C = 300x + 400y
subject to:
5x + 4y > 100
2x + 3y > 60
2x > y
2y > x
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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 301 24/01/19 7:43 AM


Answers

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

302 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 302 24/01/19 7:43 AM


Answers

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).

c Need intersection of x + 3y = 1200 and 3x + 2y = 1200


​( 171​ _37 ​, 342​ _67 ​  )​ P = 514​ _27 ​
d (350, 0) Q = 2100

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

O 50 100 150 200 250 300 350 400 450 500 x

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 303 24/01/19 7:43 AM


Answers

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

60 b Gradient of objective line = −3


(10 40 23
59 , 53 59 )
Max value of P occurs at the point where the objective
50 line is a tangent to the curve x2 + y = 10
14x + 9y = 630
40 dy
2
(6 , 33 ) 1 Gradient of curve is ___
​​   ​​ = −2x
3 3 dx
30 R −2x = −3 ⇒ x = 1.5, y = 10 − 1.52 = 7.75
2y = x
2 1
Max P = 3 × 1.5 + 7.75 = 12.25
20 (34 37 , 17 37 )
1 2
(13 3 , 6 3 ) Exercise 6D
10
P = x + 3y 1 a y
O 5 10 15 20 25 30 35 40 45 x 10

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

Maximum integer value


(5, 1) 3x + 2y = 17

304 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 304 24/01/19 7:43 AM


Answers

b y Test integer values nearby.

30 Points 2y > x 5x + 4y < 800 5x + 2y


28 (114, 57) ✓ ✓ 684
(114, 58) ✓ ✗ —
26
(115, 57) ✗ ✗ —
24 4x + y = 28 (115, 58) ✓ ✗ —
22
So optimal point is (114, 57)
20 Value 684
d y
18
y=x
300
16
250
14
200
12 R
3x + 5y = 1500
150 R
10
100
8
3x + 16y = 2400
50 Objective
6 2x + y
Ob
jec y
2x

4 O 100 200 300 400 500 600 700 800 x


tiv
+
e

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

Points 3x + 5y < 1500 3x + 16y > 2400


Minimum integer value (6, 5) 2x + y = 17
(363, 81) ✓ ✗
c (363, 82) ✓ ✓
y (364, 81) ✓ ✗
y = 4x
200 (364, 82) ✗ ✓

180 So optimal integer point is (363, 82)


Value 808
160
2 The table shows points in R on, or close to, a vertex
140 with integer coordinate.

120 Points P = 5x + 3y
2y = x (10, 0) 50
100
(10, 30) 140
80
R
(12, 34) 162
60
Obj

(13, 34) 167


ecti

40 (30, 0) 150
5x

ve

5x + 4y = 800
+2

20 Maximum value of P = 167 when x = 13, y = 34


y

O 20 40 60 80 100 120 140 160 180 200 x

Solving 2y = x and 5x + 4y = 800 simultaneously


gives (​ 114 __ ​  17 ​)​​
​  27 ​, 57 __

305

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 305 24/01/19 7:43 AM


Answers

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

Intersection of 4x + 5y = 4000 and 3x + 2y = 1800 20 5x + 8y = 600


gives (​ 142 __ ​  57 ​)​​
​  67 ​, 685 __
Testing nearby integer points O 20 40 60 80 100 120 140 x

Points 4x + 5y < 4000 3x + 2y < 1800 80x + 60y Objective


1.5x + 2y
(142, 685) ✓ ✓ 52 460
(142, 686) ✓ ✓ 52 520 Intersection of 5x + 8y = 600
2x + y = 150 giving (​ 54 __ 6
​  11 ​, 40 __ 11 )
​  10 ​ ​​
(143, 685) ✓ ✓ 52 540
(143, 686) ✗ ✗ ­— Points 5x + 8y < 600 2x + y < 150 1.5x + 2y

So maximum integer solution is 52 540 pennies at (54, 40) ✓ ✓ 161


(143, 685). (54, 41) ✓ ✓ 163
4 a 2x + 3y > 60 (55, 40) ✓ ✓ 162.5
2y < x
(55, 41) ✗ ✗ —
y>6
x, y > 0 So maximum value is 163 at (54, 41).
b, c
6a Let x be the number of type 1 bookcases purchased.
y Let y be the number of type 2 bookcases purchased.
22 Maximise: S = 40x + 60y
20 subject to:
18 3x + 5y < 60
x = 2y
16 5x + 4y < 80
14 2y < x
12 x>8
R x, y > 0
10
8 b y
y=6
6 x=8
4 20
2x + 3y = 60
2
16
O
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 x
Objective 2y = x
12
6x + 10y

Intersection of 2x + 3y = 60 and y = 6 (21, 6) 8


cost C = 6x + 10y
so minimum cost = 6 × 21 + 60
4 3x + 5y = 60
= £186 R

O 4 8 12 16 20 x

Objective line 5x + 4y = 80
40x + 60y

306 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 306 24/01/19 7:43 AM


Answers

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)

c minimise C = 336x + 252y


= 84(4x + 3y)
d Objective line passes through (0, 4) (3, 0)
e Minimum integer solution is 3108 at (7, 3) so the
headteacher should hire 7 large coaches and 3
small coaches for a cost of £3108.
4 a 4x + 5y < 47
y > 2x − 8
4y − x − 18 < 0
x, y > 0
b Solving simultaneous equations y = 2x − 8
4x + 5y = 47
6​​ __
3
14
,​​ 4​ _37 ​

307

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 307 24/01/19 7:43 AM


Answers

c i For example where x and y   ii (6, 4) Exercise 7A


• types of car to be hired 1 Let x1, x2 and x3 be the numbers of round, square and
• number of people etc rectangular boxes respectively.
5 a 2​  _12 x
​ + 3y < 300 [5x + 6y < 600] Maximise P = 12x1 + 10x2 + 11x3
5x + 2y < 400 subject to: 4x1 + 2x2 + 3x3 + r = 360
2y < 150 [ y < 75] 2x1 + 3x2 + 3x3 + s = 360
b Maximise P = 2x + 4y x1, x2, x3, r, s > 0
c y 2 Let xA, xB, xC and xD be the numbers of types A, B, C
and D backpacks made.
200
Maximise P = 8xA + 7xB + 6xC + 9xD
5x + 2y = 400 subject to: 2.5xA + 3xB + 2xC + 4xD + r = 1400
180
10xA + 12xB + 8xC + 15xD + s = 9000
160 5xA + 7xB + 4xC + 9xD + t = 4800
xA + xB + xC + xD + u = 500
140
xA, xB, xC, xD, r, s, t, u > 0
120 3 Let xA, xC and xS be the numbers of adults, children and
senior members.
100 Maximise P = 40xA + 10xC + 20xS
y = 75 subject to: xA + xC + xS + r = 100
80
−xA + xC − xS + s = 0
60 −2xA + xC + xS + t = 0
R xA, xC, xS, r, s, t > 0
40 4 Let xr, xf and xm be the numbers of batches of rock
Ob 2 12 x + 3y = 300
jec cakes, fairy cakes and muffins made.
20 tiv
e
Maximise N = 10xr + 18xf + 12xm
Subject to: 220xr + 100xf + 250xm + r = 3000
O 20 40 60 80 100 120 140 x 100xr + 100xf + 50xm + s = 2000
50xr + 100xf + 75xm + t = 1500
Maximum integer solution is P = 30 at (30, 75) so xr, xf, xm, r, s, t > 0
the company should make 30 plates and 75 mugs 5 Let xs, xm and xl be the numbers of small, medium and
for a profit of £360. large boxes.
d The optimal point is at the intersection of y = 75 Minimise C = 0.3xs + 0.5xm + 0.8xl
and 2​ _12 x
​ + 3y = 300. subject to: xs + 3xm + 7xl > 280
So the constraint 5x + 2y < 400 is not at its limit. 3xs + 8xm + 18xl > 600
At (30, 75) 5x + 2y = 300 so 100 minutes are unused. −xs + xm + xl < 0
−xm + 2xl < 0
Challenge xs, xm, xl > 0
a (60, 30, 35)
b (60, 30, 35) From solving x + y + 2z = 160, x − z = 25, Exercise 7B
y + 2z = 100
(40, 70, 15) From solving x − z = 25, y + 2z = 100, 1 P = 38 when x = 0 y = 3 z = 5 r = 0 s = 0
where z = 15 2 P = 260 when x = 0 y = 40 z = 10 r = 0 s = 0
(60, 70, 15) From solving x + y + 2z = 160, y + 2z = 100, 3 P = 11 when x = 2 y = 1 z = 0 r = 0 s = 0 t = 1
where z = 15 4 P = 105.5 when x1 = __ ​​  77 ,​​ x2 = 0, x3 = __
​​  57 ,​​ x4 = 0, r = 33,
4 4
(40, 90, 15) From solving x + y + 2z = 160, x − z = 25,
s = 0, t = ​​ ___
109
,
​​ u = 0
where z = 15 4

c 5 P = −336 when x = 0, y = 0, z = ​​ __ 21


,​​ r = 420, s = 84,
Vertex P 2
t = 0, u = 16
(60, 30, 35) 175 6 P = −2 when x = 0, y = 1, z = 0, r = 0, s = 4, t = 1
(40, 70, 15) 275 7 For Q1
(60, 70, 15) 315 b P + ​​  __83 x
​​ + r + _​  43 ​  s = 38

(40, 90, 15) 335 ​ _12 ​  x + y + _​ 12 ​  r = 3


​ _76 ​  x + z − _​ 12 ​  r + _​ 13 ​s = 5
Optimum value of P is 335 when x = 40, y = 90 and z = 15
c P = 38 − ​​  __83 x
​​ − r − _​ 34 ​  s
so increasing x, r or s would decrease P.
CHAPTER 7 For Q2
Prior knowledge 7 b P + _​ 12 ​  x + 2r + _​ 32 ​  s = 260
1 x = 10, y = −3 ​ _14 ​  x + y + _​ 12 ​  r − _​ 14 ​  s = 40
2 24
​ _14 ​  x + z + _​ 14 ​  s = 10
3 a 2x + 3y − z = 5 (1)
3y + 2z = 0 (2) c P = 260 − _​ 12 ​  x − 2r − _​ 32 ​  s, so increasing x, r or s would
(1) × 2: 4x + 6y − 2z = 10 (3) decrease P.
(2) + (3): 4x + 9y = 10 as required.
b x = 3 ​​ __25 ,​​ y = − ​​ __25 ​​ , z = __
​​  35 ​​

308 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 308 24/01/19 7:43 AM


Answers

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

y 0 1 ​​ __32 ​​ 1 ​​ __12 ​​ 0 ​​ __


2
15
​​
P 0 0 4 2 −1 0 17

309

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 309 24/01/19 7:43 AM


Answers

(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.

310 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 310 24/01/19 7:43 AM


Answers

e Pivot is 8 in initial tableau. Sanding 25x + 20y + 30z < 120


⇒ 5x + 4y + 6z < 24
Row
b.v. x y z r t Value b r and s are numbers which indicate the slack time.
operation
P − 14x − 12y − 13z = 0
y –​​_58 ​​ ​​  __
37
8
​​ 0 1 ​​  __18 ​​ ​​  __
25
2
​​ R1 + R2 4x + 5y + 3z + r = 16
5x + 4y + 6z + s = 24
z ​​  __3 ​​
8
​​  __5 ​​
8
1 0 ​​  __1 ​​
8
​​  __
2
25
​​ R2 ÷ 8 Use these equations to create the initial tableau.
S ​​  __1 ​​ –​​  __1 ​​ 0 0 ​​  __3 ​​ 75 R3 + 6R2 c
4 4 4
Row
f b.v. x y z r s Value
operation
Row x 1 ​​  __54 ​​ ​​  __34 ​​ ​​  __14 ​​ 0 4 R1 ÷ 4
b.v. x y z r t Value
operation
s 0 − ​​  __9 ​​ ​​  __9 ​​ − ​​  __5 ​​ 1 4 R2 − 5R1
y − ​ __
5
37
 ​ 1 0 __
​  8  ​
37
​ __
1
37
 ​ 2​ __
26
37
 ​ R1 ÷ 4​ _58 ​ 4 4 4

__ 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

c Optimal solution x = 125 ​ _57 ​  y = 171 ​ _37 ​ P −1 −3 0 0 0 0 0


Integer solutions needed, so point testing gives I 0 −1 0 0 1 0 −2
x = 126 y = 171 d
d The first point is A if y is increased first x y s1 s2 s3 a1 Value
The second point is C s1 3 0 1 0 2 −2 11
5 a 54x + 72y + 36z < 1800 ⇒ 3x + 4y + 2z < 100
60x + 36y + 48z < 1500 ⇒ 5x + 3y + 4z < 125 s2 2 0 0 1 5 −5 10
b P = 12x + 24y + 20z y 0 1 0 0 −1 1 2
c b.v. x y z r s Value P −1 0 0 0 −3 3 6
r 3 4 2 1 0 100 I 0 0 0 0 0 1 0
s 5 3 4 0 1 125 I = 0, a1 = 0 as required for the first stage. A basic
P −12 −24 −20 0 0 0 feasible solution for the second stage is P = 6 when
s1 = 11, s2 = 10, y = 2.
d
e x y s1 s2 s3 Value
Row
b.v. x y z r s Value
operation s1 3 0 1 0 2 11
y ​​  __34 ​​ 1 ​​  __12 ​​ ​​  __14 ​​ 0 25 R1 ÷ 4 s2 2 0 0 1 5 10
s ​​  __
11
​​ 0 ​​  __5 ​​ − ​​ _3 ​​ 1 50 R2 − 3R1 y 0 1 0 0 −1 2
4 2 4

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

e There are no negative numbers in the profit row. s1 0 0 1 1 2 −2 −2 10 R1 − 2R3


f Type A = 0 Type B = 15 Type C = 20 y 0 1 −1 0 1 −1 −1 110 R2 − R3
Profit = £760
6 a Maximise P = 14x + 12y + 13z x 1 0 0 0 0 1 1 70
subject to: P 0 0 1 0 M M + 6 2M + 1 300 R4 + R3
Carving 2x + 2.5y + 1.5z < 8 ⇒ 4x + 5y + 3z < 16

311

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 311 24/01/19 7:43 AM


Answers

P = 300 when x = 70, y = 110, z = 0, s1 = 10, CHAPTER 8


s2 = s3 = a1 = 0
Optimal since values in bottom row all positive. Prior knowledge 8
9 a Not feasible since a1 = 8 ≠ 0 1 Route: AC CE ED DB, length: 20
b The pivot is the first 2 in the x column. x column
has the most negative P row and 2 gives the Exercise 8A
smallest positive θ value. 1 One possible solution is
c
Activity Depends on
Row
x y z s1 s2 s3 a1 Value A —
operation
B A
s1 0 –​​ __12 ​​ ​​ __72 ​​ 1 –​​ __12 ​​ 0 0 ​​ __32 ​​ R1 – R2
C B
x 1 ​​ __3 ​​
2
​​ __1 ​​
2
0 ​​ __1 ​​
2
0 0 ​​ __5 ​​
2
R2 ÷ 2 D C
E D
a1 0 –4 –1 0 –1 –1 1 3 R3 – 2R2
F E
__
​  52 ​ + –​​ __7 ​​ ​​ __12 ​​ + __
​​  52 ​​ – R4 + (1 + G F
P 0 2 0 M 0
4M +M M 3M 2M)R2
Another possible solution is
10 a The basic simplex method can only be used if all
the non-negativity constraints are <. As z > 200 we Activity Depends on
have to use non-basic variables. A —
b x = 600, y = 0, z = 200
c M represents an arbitrarily large number B A
d P − 100x − (80 + 4M)y − (60 + 6M)z + Ms2 + Ms4 C ­—
= −1200M
D B, C
Basic
x y z s1 s2 s3 s4 a1 a2 Value E D
variable
F E
s1 1 1 1 1 0 0 0 0 0 800
G F
s3 2 2 1 0 0 1 0 0 0 1200 2 a Activity Depends on
a1 0 0 1 0 −1 0 0 1 0 200 A —
B A
a1 0 4 5 0 0 0 −1 0 1 1000
C A
−(80 −(60 D A
P −100 0 M 0 M 0 0 −1200M
+ 4M) + 6M)
E B
e The most negative value in the objective row is
F B
−(60 + 6M) in the z column
The smallest positive θ value for the z column is G C, E
200 in either the a1 or a2 row, so either the 1 or 5 H D
can be used as the pivot value
Divide all elements in the chosen pivot row by the I F, G
pivot value J H, I
Use the pivot row to eliminate the pivot’s variable
from all other rows, such that the pivot column now b F
only contains 1s and 0s 2 5
Repeat until there are no negative values in the B E
objective row A C G I
0 1 3
Challenge H J
D 6 7
P = 28.5 when x = __
​​  92 ​​ , y = __
​​  14 ​​ , z = 7 4

3 D
1 3
A H
C G
0 4 6 7 8
I K L
B E J
2 5
F

312 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 312 24/01/19 7:43 AM


Answers

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)

2 a The dummy shows that activity F depends on 3


17 F(4) 21
activities B and D, whereas activity G only depends C(9) 17 21
on activity B.
8 I(5)
b Activity Depends on 8 Dummy
A(8) 15 26
A — D(7)
B — 21 G(5) 26
J(5)
0
C A H(8)
0 31
D A B(6) 6 11 31
13 E(5) 18 K(5)
E C
F B, D
G B Exercise 8D
1 x = 3, y = 17, z = 17
3 D
1 4 2 a The critical activities are B, E, H, J and N.
A H b I, even though it connects too critical events the
Dummy
duration of I can be increased by up to 14 hours
F without affecting the total time.
0 3 5
B 3 a
7
E
C G C(4) 12 H(5)
2
3
4 a A(3) D(2) 17
R 8 Dummy
1 3 0 10 17
P 2nd dummy 0 E(3) 10
I(3)
S F(4) 14
1st B(7) 7
0 dummy 4 14
7 G(1)
Q T b 7 + 1 ≠ 14
2 c The critical path is B − E − F − I.

313

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 313 24/01/19 7:43 AM


Answers

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

314 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 314 24/01/19 7:43 AM


Answers

2 a w = 26   x = 29   y = 34   z = 26


b Critical activities: B, E, H, M, O
c Total float for G = 26 − 5 − 13 = 8
Total float for N = 39 − 5 − 29 = 5
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

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

B, D and E may be happening at midday on day 5.


b Only A must be happening at midday on day 7.
4 a x = 15, y = 25, z = 27
b B, F, H, K, M
c A max float 7
C max float 7

315

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 315 24/01/19 7:43 AM


Answers

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

316 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 316 24/01/19 7:43 AM


Answers

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

4 workers are needed to complete the project in 22 hours.


2 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

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

3 workers are needed to complete the project in the critical time.

317

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 317 24/01/19 7:43 AM


Answers

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

b Dummy 1 is needed to show dependency.


 E and F depend on C and B, but D depends on B only.
Dummy 2 is need so that each activity can be uniquely represented in terms of its event.
3 a
10 29 I(16) 45
10 29 45
A(10) C(11)
G(8) M(9)
0 21
J(10)
0 21 54
D(5) H(12) 54
B(14)
14 E(15) 33 K(21)
16 33 N(12)
L(6)
F(20) 39
42

b There are two critical paths:


A − C − G − I − M and A − C − H − K
The critical activities are A, C, G, H, I, K
c Total float on D is 21 − 5 − 14 = 2
Total float on F is 42 − 20 − 14 = 8

318 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 318 24/01/19 7:43 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 319 24/01/19 7:43 AM


Answers

5 a D(11)
10
10
E(4) 14
14

(9) 11
12 F(2)
14
14

11 G(1)
12

b The critical paths are: A − E − H − K and A − E − L


c A critical path is a continuous path from the source node to the sink node such that a delay in any activity results in
a corresponding delay in the whole project.
Sum of all of the activity times ____ 110
d ​​ _____________________________
   
     ​​ = ​​   ​​
critical time of the project 30
Lower bound for number of workers is 4.
e D, H, I, J, L
f The answers to part e show that at least 5 workers are needed on day 20 in order to complete the project in the
minimum time.
g 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

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

320 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 320 24/01/19 7:43 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 321 24/01/19 7:43 AM


Answers

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.)

322 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 322 24/01/19 7:43 AM


Answers

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

d For example, Point testing


• test all corner points in feasible region
• find profit at each and select point yielding maximum.
Profit line
• Draw profit lines.
• Select point on profit line furthest from the origin.
e Using a correct, complete method.
make 6 Oxford and 7 York, profit = £5300
f Finishing time required = 49 hours, so reduce finishing time by 7 hours.
3 a Objective: maximise P = 30x + 40y (or P = 0.3x + 0.4y)
subject to:
x + y > 200
x + y < 500
x > ​​ ___
20
100
​​ (x + y) ⇒ 4x > y
x < ​​ ___
40
100
​​ (x + y) ⇒ 3x < 2y
x, y > 0
b y
y = 4x
500
2y = 3x

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 323 24/01/19 7:43 AM


Answers

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

y ​​ __13 ​​ 1 0 ​− ​ __13 ​​ ​​ __23 ​​ 0 16 ​​ __23 ​​ R2 − ​​ __12 ​​   R1


t 2 0 0 0 −1 1 10 R3 − no change
P −3 ​​ __13 ​​ 0 0 13 ​​ __13 ​​ 33 ​​ __13 ​​ 0 1733 ​​ __13 ​​ R4 + 20R1

ii Not optimal as there is a negative value in the profit row.


iii x = 0 y = 16 ​​ __23 ​​  z = 6 ​​ __23 ​​
P = £1733.33 r = 0 s = 0 t = 10
7 a Objective: Maximise P = 4x + 5y + 3z
subject to 3x + 2y + 4z < 35
x + 3y + 2z < 20
2x + 4y + 3z < 24
where x, y, z > 0
b P = 47 ​​  __14 ​​ , x = 11 ​​  __12 ​​  y = ​​  __14 ​​ , z = 0, r = 0, s = 7 ​​  __34 ​​ , t = 0

324 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 324 24/01/19 7:43 AM


Answers

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

x 1 0 0 − ​​ __27 ​​ − ​​ __17 ​​ − ​​ __57 ​​ __


​​  25 ​​
7

P 0 0 0 ​​ __
11
7
​​ ​​ __27 ​​ ​​ __37 ​​ ___
​​  104 ​​
7

The maximum value of P is ___


​​  104 ​​ = 14 ​​ __67 ​​which occurs when x = __
​​  25 ​​ , y = __
​​  23 ​​ , z = __
​​  11 ​​ , s1 = s2 = s3 = 0
7 7 7 7

325

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 325 24/01/19 7:43 AM


Answers

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

d 1st iteration y enters the basic

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

2nd iteration x enters the basics

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

Basic feasible solution is x = __


​​  10
13
.​​ y = __
​​  48
13
,​​ z = 0, s1 = ___
​​  128
13
,​​ s2 = s3 = a1 = a2 = 0
12 a 3x + 2y + z + s1 = 24
5x + 3y + 2z + s2 = 60
x − s3 + a1 = 2
b P = x + 3y + 4z − Ma1
= x + 3y + 4z − M(2 − x + s3)
P = x(1 + M) + 3y + 4z − 2M − Ms3
P − (1 + M)x − 3y − 4z + Ms3 = −2M
c
b.v. x y z s1 s2 s3 a1 Value
s1 3 2 1 1 0 0 0 24
s2 5 3 2 0 1 0 0 60
a1 1 0 0 0 0 −1 1 2
P −(1 + M) −3 −4 0 0 M 0 −2M

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

326 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 326 24/01/19 7:43 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 327 24/01/19 7:43 AM


Answers

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

b Total float on A = 20 − 0 − 5 = 15 Total float on H = 27 − 19 − 4 = 4


Total float on B = 10 − 0 − 10 = 0 Total float on I = 22 − 19 − 3 = 0
Total float on C = 22 − 0 − 11 = 11 Total float on J = 35 − 18 − 3 = 14
Total float on D = 20 − 10 − 8 = 2 Total float on K = 27 − 22 − 5 = 0
Total float on E = 27 − 10 − 10 = 7 Total float on L = 35 − 27 − 8 = 0
Total float on F = 19 − 10 − 9 = 0 Total float on M = 35 − 22 − 4 = 9
Total float on G = 27 − 18 − 7 = 2
c Critical activities: B, F, I, K and L   length of critical path is 35 days
d New critical path is B, F, H, L   length of new critical path is 36 days
18 a x = 0
y=7 [latest out of (3 + 2) and (5 + 2)]
z=9 [earliest out of (13 − 4) and (19 − 7) and (16 − 2)]
b Length is 22
Critical activities: B, D, E and L

328 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 328 24/01/19 7:43 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 329 24/01/19 7:43 AM


Answers

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

330 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 330 24/01/19 7:43 AM


Answers

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

New shortest time is 89 hours.


24 a F(6)
12 18
12 18
C(7) H(3)
D(2) E(7)

0 5 9 21
0 A(5) 5 B(4) 10 G(8) 21

b Critical activities: A, C, F and H; length of critical path = 21


c Total float on B = 10 − 5 − 4 = 1 Total float on E = 21 − 12 − 7 = 2
Total float on D = 12 − 9 − 2 = 1 Total float on G = 21 − 9 − 8 = 4
d 0 5 10 15 20 25 30

A C F H

B E

e For example
0 5 10 15 20 25 30

A C D F H

B G E

Minimum time for 2 workers is 24 days.

331

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 331 24/01/19 7:43 AM


Answers

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

Exam-style practice (AS Level)


1 a 21  16  11  25  18  15  23  10
16  11  21  18  15  23  10  25
11  16  18  15  21  10  23  25
11  16  15  18  10  21  23  25
11  15  16  10  18  21  23  25
11  15  10  16  18  21  23  25
11  10  15  16  18  21  23  25
10  11  15  16  18  21  23  25
10  11  15  16  18  21  23  25
b For a list of n items:
The 1st pass requires (n − 1) comparisons.
The 2nd pass required (n − 2) comparison.
The process continues until the final pass, which requires 1 comparison.
The total number of comparisons is
1 + 2 + 3 + … + (n – 2) + (n − 1)
n
This is an AP with sum __ ​​   ​​ (n − 1)
2
Thus the bubble sort has quadratic order.
c 0.018 × (​​​ _____
50 )
2
1000
​   ​​​​  ​​= 7.2 seconds

This is an estimate only because the time taken is not directly proportional to n2. This is used as an approximation.

332 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 332 24/01/19 7:43 AM


Answers

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

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 333 24/01/19 7:44 AM


Answers

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 The critical path is CEFGI.


e Total float for activity D is 17 − 5 − 4 = 8 hours

Exam-style practice (A Level)


1 a Starting with AB means that H cannot be included without repeating either B or A.
b AHBCEFGDA
c H
A B

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

334 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 334 24/01/19 7:44 AM


Answers

3 a A network is semi-Eulerian if it has exactly two odd nodes.


b The odd nodes are A, B, C, D, E, F
Possible pairings:   AC + DF = 10 + 10 = 20
AD + CF = 11 + 9 = 20
AF + CD = 2 + 10 = 12
Minimum length = 72 + 12 = 84 miles
c AF, CD
d Possible pairings:   AB + DF = 4 + 10 = 14
AD + BF = 11 + 5 = 16
AF + BD = 2 + 13 = 15
The route is extended by 14 − 12 = 2 miles
4 a Dijkstra’s or Floyd’s Algorithm
b Arc CA
c 1st iteration (no change)
– 5 ∞ ∞ ∞ A B C D E
5 – 11 16 ∞ A B C D E
10 11 – 8 6 A B C D E
∞ 16 8 – 10 A B C D E
∞ ∞ 6 10 – A B C D E
2nd iteration
– 5 16 21 ∞ A B B B E
5 – 11 16 ∞ A B C D E
10 11 – 8 6 A B C D E
21 16 8 – 10 B B C D E
∞ ∞ 6 10 – A B C D E
3rd iteration
– 5 16 21 22 A B B B C
5 – 11 16 17 A B C D C
10 11 – 8 6 A B C D E
18 16 8 – 10 C B C D E
16 17 6 10 – C C C D E
4th iteration (no change)
– 5 16 21 22 A B B B C
5 – 11 16 17 A B C D C
10 11 – 8 6 A B C D E
18 16 8 – 10 C B C D E
16 17 6 10 – C C C D E
5th iteration (no change)
– 5 16 21 22 A B B B C
5 – 11 16 17 A B C D C
10 11 – 8 6 A B C D E
18 16 8 – 10 C B C D E
16 17 6 10 – C C C D E
d 22, ABCE
5 a 12x + 30y < 240, i.e. 2x + 5y < 40
x
12x + 30y < 2(5x + 20y), i.e. x < 5y or y > __
​​   ​​
5
5x + 5y > 55, i.e. x + y > 11
6x + 12y > 96, i.e. x + 2y > 16
b y
10 x + y = 11
8
6 y= x
R 5
4
2
2x + 5y = 40
O 2 4 6 8 10 12 14 16 18 20 x
x + 2y = 16

335

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 335 24/01/19 7:44 AM


Answers

(​​ ​  7 ​ , ​  7 ​)​​ ​​(___


​   ​ , ​ __ ​)​​
c 80 ___ 16 40 8
Vertex (6, 5) (5, 6) ___
3 3
Profit £153 £166 £139.43 £162.67

So Angie should make 5 mini-packs and 6 mega-packs


and the corresponding profit will be £166.
6 a 11
E(4)
11
6 I(5)
6 D(2) F(3)
A(6) 8 16
8 H(3) 16 M(7)
C(1)
0
J(1)
0 23
B(5) 7 13 23
8 G(6) 15 L(4)

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

336 Online Full worked solutions are available in SolutionBank.

Z01_EDD1_SB_ASAL_83299_ANS_275-336.indd 336 24/01/19 7:44 AM


Answers Index

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

Z02_EDD1_SB_ASAL_83299_IND_337-338.indd 337 10/10/2017 14:23


Index

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

Z02_EDD1_SB_ASAL_83299_IND_337-338.indd 338 10/10/2017 14:23


11 - 19 PROGRESSION
Pearson Edexcel AS and A level Further Mathematics
Decision Mathematics 1
Series Editor: Harry Smith

Pearson’s market-leading books are the most trusted resources for Pearson Edexcel AS and A level Further
Mathematics.

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
AS and A level Further Mathematics exams.
• 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
for every question in the book (SolutionBank) and GeoGebra interactives.
• 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
mixed and review exercises.

Pearson Edexcel AS and A level Mathematics books


Year 1/AS Year 2
11 - 19 PROGRESSION
11 - 19 PROGRESSION
11 - 19 PROGRESSION
Pearson Edexcel AS and A level Mathematics Pearson Edexcel AS and A level Mathematics Pearson Edexcel A level Mathematics 11 - 19 PROGRESSION

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

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

CVR_MATH_SB_AL_0298_CVR.indd 1 1/17/19 11:43 AM

Pearson Edexcel AS and A level Further Mathematics books


Compulsory Options
Pearson Edexcel AS and A level Further Mathematics
11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION
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 Book 1/AS Further Statistics 1 Further Mechanics 1 Decision Mathematics 1 Further Pure Mathematics 1
Series Editor: Harry Smith Series Editor: Harry Smith Series Editor: Harry Smith Series Editor: Harry Smith Series Editor: Harry Smith

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

Book 1/AS FS1 FM1 D1 FP1


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 For more information visit: www.pearsonschools.co.uk/edalevelmaths2017

www.pearsonschools.co.uk www.pearsonschools.co.uk www.pearsonschools.co.uk www.pearsonschools.co.uk www.pearsonschools.co.uk


[email protected] [email protected] [email protected] [email protected]
[email protected]

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

11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION 11 - 19 PROGRESSION


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
Core Pure Mathematics Book 2 Further Statistics 2 Further Mechanics 2 Decision Mathematics 2 Further Pure Mathematics 2
Series Editor: Harry Smith Series Editor: Harry Smith Series Editor: Harry Smith Series Editor: Harry Smith
Series Editor: Harry Smith

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

For more information visit: www.pearsonschools.co.uk/edalevelmaths2017

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

For more information visit: www.pearsonschools.co.uk/edalevelmaths2017

www.pearsonschools.co.uk
[email protected]

1
CVR_MATH_SB_AL_0397_FCVR.indd 1 1/22/19 1:55 PM

You might also like