Top Banner
Operational Research Module AS3021 COURSE NOTES Dr G Bowtell City University
262

Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Feb 03, 2018

Download

Documents

duongtram
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Operational Research

Module AS3021

COURSE NOTES

Dr G BowtellCity University

Page 2: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Contents

1 Initial Overview of Course 11.1 Introductory Ideas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 Linear Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.4 Network Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.5 Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2 Linear Programming - 2 variables 152.1 Two variable problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.2 Sensitivity Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.2.1 Changes in the Objective Function . . . . . . . . . . . . . . . . . . . . . . . . . 212.2.2 Reduced Cost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222.2.3 Change in Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

2.3 Solution by Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.4 Integer Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352.5 Worksheet 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382.6 Worksheet 1 - Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

3 Mathematics of Linear Programming - Geometric Approach 473.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.2 Euclidean Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.3 Lines and Planes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483.4 Convex Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513.5 Extreme Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.6 Supporting Hyperplane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.7 Optimal Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

4 Mathematics of Linear Programming - Algebraic Approach 584.1 Standardized Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584.2 Reduction to Standard Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594.3 Equivalent Optima . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604.4 Unrestricted variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

i

Page 3: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CONTENTS ii

4.5 RealChoc in Standard Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.6 Solution of Simultaneous Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

4.6.1 Unique Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644.6.2 Non-Unique Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644.6.3 Row Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644.6.4 Change of Basis Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654.6.5 Row Reduction and the Inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . 664.6.6 Basic Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

4.7 Extreme Points and Basic Feasible Solutions . . . . . . . . . . . . . . . . . . . . . . . . 694.8 Number of Basic Solutions - Extreme points . . . . . . . . . . . . . . . . . . . . . . . . 71

5 Linear Programming - Simplex 725.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725.2 Geometrically motivated Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725.3 Optimization in 3-Dimensions by Row Reduction . . . . . . . . . . . . . . . . . . . . . 745.4 Simplex Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785.5 Simplex Tableau - Dual Prices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835.6 Simplex Tableau - Feasible Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845.7 Simplex Tableau - Optimal Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855.8 Artificial Starting Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865.9 Problems with Simplex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

5.9.1 Degeneracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895.9.2 Non-Uniqueness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905.9.3 Unboundedness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905.9.4 Infeasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

6 Linear Programming - Dual Problem 936.1 The Diet Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 936.2 General Dual Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946.3 Dual Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

7 Networks and Graphs 1017.1 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1017.2 Minimal Spanning Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1037.3 Shortest Path Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

7.3.1 Dijkstra’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087.3.2 Floyd’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

7.4 Maximum Flow Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1177.5 Ford - Fulkerson Maximum Flow Algorithm . . . . . . . . . . . . . . . . . . . . . . . . 1217.6 Maximum Flow-Minimum Cut Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . 1267.7 Flow Problem Variations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

Page 4: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CONTENTS iii

8 Dynamic Programming 1308.1 Shortest Route Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1308.2 Generalization of Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . . . . 1348.3 Method of Solution for Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1368.4 Equipment Replacement Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1408.5 Knapsack Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

A Worksheets 148A.1 Worksheet 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148A.2 Worksheet 1 - Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150A.3 Worksheet 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156A.4 Worksheet 2 - Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157A.5 Worksheet 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161A.6 Worksheet 3 - Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162A.7 Worksheet 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165A.8 Worksheet 4 - Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166A.9 Worksheet 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172A.10 Worksheet 5 - Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174A.11 Worksheet 6 - Class Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

B Past Exam - May 2007 182B.1 Question Paper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182B.2 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190

C Past Exam - May 2006 200C.1 Question Paper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200C.2 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

D Specimen Exam Type Questions and Solutions 218D.1 Specimen Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

D.1.1 Minimal spanning tree problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 218D.1.2 Shortest distance problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219D.1.3 Maximum Flow - Minimum Cut - Ford-Fulkerson . . . . . . . . . . . . . . . . . 221D.1.4 Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222D.1.5 Linear Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

D.2 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

E Specimen Courseworks 243E.1 Coursework 1 - 2007 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243E.2 Solution to CW1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245E.3 Coursework 2 - 2007 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250E.4 Solution to CW2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250

Page 5: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

PREFACE iv

Preface

This course was first given by the author in January 2006 and is intended as an introduction to Oper-ational Research. The topics presented have been selected by the author and the present Professor ofOperational Research at City University as being some of the most important topics in the subject.However it should be noted that there are other topics that could arguably have been include if timehad allowed. The book by Taha[15] gives a much fuller introduction to this area of study.

The following text is the sum total of all handouts, examinations and notes generated from 2006onwards. The notes themselves have been written using the Bibliography and thus contain more ma-terial than that presented at the lectures. The assessment, both continuous and examination, is thenbased on the lectures. The notes should therefore be used in conjunction with the notes you take atthe lectures.

December 2007

Page 6: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Chapter 1

Initial Overview of Course

1.1 Introductory Ideas

The purpose of this chapter is to try and give the reader an idea of what is meant by OperationalResearch. Unfortunately there is no definitive statement that will satisfy everyone. Most generallyit may be envisaged as a branch of Mathematical Modelling or even a branch of Applied Mathemat-ics, though to some this would be a too broad a definition. Without question the subject involvesa mathematical or quantitative approach to the description and analysis of many diverse types ofproblem. The problems considered usually have an Economic, Financial or Managerial flavour andinvolve the setting up of a mathematical description from which various questions can be answered.More often than not the problem will involve optimizing some quantity relative to a set of variables,this then leads to the making of an appropriate decision. The quizzing of the model in order to makedecisions is one of the important features of operational research. Mathematically one is usually tryingto find the maximum or minimum value of a real function of many variables given a set of constraintsamongst the variables. For example we may wish to maximize xy, where x and y are non-negativevariables such that their sum is no greater than 1. This scenario is typical of a problem where thevariables represent some physical quantities, hence the non-negative restriction, and the resources arerestricted, hence the restriction on their sum.

The quizzing of the model can take on many forms and apart from delivering the optimum solutionto the problem it may including analysing the response of the optimizing criteria relative to changesin the parameter in the model or indeed changes in the model itself. For example in the above simpleproblem one might ask what is the effect of a 10% increase in the resources.

The course explores three essential methods of OR, namely Linear Programming, Dynamic Pro-gramming and Network Models. The following sections give a simple example of each in order totry and introduce the ideas and demonstrate the type of problem that may be solved using them.The course then develops these methods and expands the range of problem that can be considered.However before developing any of these methods the general idea of modelling a real life situation isconsidered.

1

Page 7: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 2

1.2 Modelling

The process of modelling a particular real life situation will vary from problem to problem, howeverthere are some steps that are common to all problems. As many attempts have been made to formalizethe process of mathematical modelling the following must not be taken as definitive, merely as areasonable way to proceed.

Identify the problem

• Carefully define the problem in words.

• Decide which aspects of the problem to investigate.

Construct the Model

• State any assumptions made.

• Choose variable and parameters for the model. The variables, or decision variables, areusually the quantities we wish to determine that optimize some given quantity that dependson them (objective criteria or function). Parameters are fixed values in the problem, suchas the total amount of a given resource. These may be varied and the problem re-solved inorder to investigate the sensitivity of the model.

• Write down mathematical relationships, including any constraints on the variables andparameters.

• Write down the mathematical problem to be solved in terms of the chosen variables andparameters.

Carry out the Mathematics

• Solve the equations and inequalities

• Draw Graphs

• Derive results

Interpret and Evaluate

• If relevant collect data to test the model

• Decide if the mathematical solution is reasonable

• Criticize the model and test its sensitivity with respect to changes.

Report

• If satisfied with the results write relevant report

• If not satisfied introduce revisions and repeat the process

In terms of practical OR the following problem doesn’t register on the scale, however it is worthy ofconsideration in order to illustrate the above approach to modelling.

Page 8: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 3

Example 1.1 A farmer wishes to fence off a corner of a field in order to graze a flock of sheep. Howshould he best do it?

This problem is now considered under the above heading, however it is stressed that they are notcarved in stone and a certain flexibility is allowed.

Identify the problemThe problem is deliberately vague and not well defined. This is quite often the case in real lifeand it is necessary to sharpen up the problem in order to deliver an answer. We will assumethat the farmer is going to use an electric fence to restrain his animals. Such a fence consistsof a single strand of wire supported by insulated posts. We are given that the fence is in thecorner of the field, it is therefore reasonable to assume that the original field is already enclosedby a sheep-proof fence. At this point the word best in the question is not clear. The followingtwo scenarios are possible:

(a) The farmer may only have a limited amount of fencing and posts and thus is interested inhow to erect his fence in order to maximize the size of the pen.

(b) Alternatively he may wish to fence off at least a given area and wishes to know how to doit in order to minimize the amount of fencing used.

The task is to investigate the problem and advise the farmer accordingly, indicating the size andshape of the pen and the amount of material used.

Construct the ModelTo construct the model we first have to make certain assumptions. If it turns out that theseassumptions lead to an unreasonable answer to the problem then they must be revised, perhapsin the light of more information. We will assume that:

• The corner of the field has straight edges running at right angle to each other.

• Since posts are more expensive than the wire between them we will assume that the enclosedarea is a rectangle. Thus it may be possible to enclose the area with as few as three posts.The relative cost of posts and wire or the availability of either may lead us to a later revisionto the model.

The symbols for the problem are chosen as follows:

• The variables for the problem are clearly the lengths of the two sides of the rectangle, itis these that we will be trying to find in order to provide a best solution. Thus let x bethe length of one side and y the length of the other, both measured in metres. It is alwaysimportant to specify the units.

• To discuss either of the two scenarios (a) or (b) above we need to introduce the area of thefield enclosed and the total length of the fence erected. Let A represent the area of the fieldmeasured in square metres and L the total length of the fence measured in metres.

Writing down the mathematics for the two scenarios is now straightforward:

Page 9: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 4

• A = xy, L = x + y, x > 0 and y > 0. (Hence A and L greater than zero).

• In scenario (a) the length of fence is limited, thus for a given value of L it is necessary tomaximize A = xy, subject to the constraints x + y ≤ L, x, y > 0.

• In scenario (b) the size of the field must be greater than some given value, thus for a givenvalue of A it is necessary to minimize L = x+y, subject to the constraints A ≤ xy x, y > 0.

The mathematical model is now created and the questions formulated in terms of the chosensymbols.

Carry out the MathematicsIn (a) where the length of fence is limited we could assume that all the fence was used in orderto create the largest fenced off area. (ie assume that x + y = L) Similarly in (b) to minimizethe length of fencing we could assume that we enclose the least acceptable area (ie assume thatA = xy). In general the validity of such assumptions will not be obvious from the question,thus it will be necessary to work with the constraints as inequalities or find some alternativeway round this complication. Rather than make these assumptions the following uses graphicalarguments to reach the solutions.

Scenario (a)Assuming that the amount of fence is given by L0 then the problem is to maximize A = xy

such that x + y ≤ L0, x, y > 0.

Since L0 is known it is possible to plot the graph of L0 = x + y. (Fig. 1.1). Thus on thediagram the values of x and y that satisfy x+y ≤ L0, x, y > 0 are either inside the triangleOAB or on the line segment AB. This set is referred to has the feasible region for theproblem.

Choose a value of A such that the curve y =A

xintersects the feasible region, as shown in

Fig. 1.1.

As A increases the curve y =A

xmoves away from the origin, hence there comes a point

where the curve lasts intersects the feasible region, shown as P in Fig. 1.1, and A takes itsmaximum value Amax.

To calculate the value of Amax and the coordinates of P is a standard procedure. It issimply necessary to find the value of A such that the line x + y = L0 is a tangent toy = A/x. By simple calculus:

y =A

x⇒ y′ = − A

x2= −1 since the gradient of x + y = L0 is− 1

At P :

x + y = x +A

x= L0 using

A

x2= 1 ⇒ x + x = L0 ⇒ x =

L0

2

Thus it follows that at P

y =L0

2and Amax =

L20

4

Page 10: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 5

A

B

y = Amaxx

O

P

y = Ax

x

y

/

y + x = L0

/

Figure 1.1: Feasible region inside the triangle OAB and on AB; P is the point of optimal solution

Scenario (b)Although the solution to this problem is similar to that in (a) the arguments are reversed.Here the minimum value of L = x+y is required subject to the constraints A0 ≤ xy, x, y >

0. (where A0 is the smallest acceptable size of field) In Fig. 1.2 the feasible region consistsof all points in the first quadrant that lie above the curve y = A0/x

Choose a value of L such that x + y = L intersects with the feasible region, as shown inFig. 1.2. As L decreases the line x + y = L moves towards the origin, hence there comesa point where the curve lasts intersects the feasible region, shown as P in Fig. 1.2, and L

takes its minimum value Lmin.Thus to locate P it is necessary to find the value of L such that the line x + y = L is atangent to the curve y = A0/x.Since the gradient of the straight line is −1 for all L, at P:

y =A0

x⇒ y′ = −A0

x2= −1 ⇒ A0

x= x

Thus

x + y = Lmin ⇒ x +A0

x= Lmin ⇒ x =

Lmin

2and y =

Lmin

2

Hence:

y =A0

x⇒ A0 =

L2min

4⇒ Lmin = 2

√A0

Interpret and EvaluateBased on the assumption that the fenced off area is a rectangle the solution is reasonable as itpredicts that the best shape is a square. This is to be expected as there is no bias towards eitherof the two boundaries that might affect the solution.

Page 11: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 6

P

x + y = Lx + y = Lmin

y = A0x

Feasible Region

x

y

+

Figure 1.2: Feasible region above the curve y = A0x ; P is the point of optimal solution

To investigate the sensitivity of the model in scenario (a) consider the effect on the area thatcan be enclosed due to a change in the length of fence available. Denoting the change in A as∆A and the change in L as ∆L then from A = L2

4 :

∆A =14

((L + ∆L)2 − L2

)=

14

(∆L2 + 2L∆L

)(1.1)

These changes are sometimes referred to as absolute changes or errors however a more meaningfulmeasure is to talk about relative changes. For example if the availability of fence is increased by10% what is the percentage change in the area of the enclosure. Mathematically a relationshipbetween ∆A/A and ∆L/L needs to be established.From Eq(1.1) and using 4A = L2:

∆A

A=

14A

(∆L2 + 2L∆

)=

1L2

(∆L2 + 2L∆L

)=

(∆L

L

)2

+ 2∆L

L(1.2)

For a relative change in L of 10%, ∆L/L = 0.1 thus from Eq(1.2) the relative change in A isgiven by ∆A/A = (0.1)2 +2×0.1 ≈ 0.2, ignoring small squared terms1. Hence a 10% increase inL gives approximately a 20% increase in the area enclosed. Clearly in general terms the relativechange in A is almost twice that of the relative change in L.

Similarly for scenario (b) where L = 2√

A the equation corresponding to Eq(1.1) is:

∆L = 2(√

A + ∆A−√

A) = 2√

A

{√1 +

∆A

A− 1

}

1In general if F is a function of {x1, x2 . . . xn} then for small changes in the variables ∆F ≈Pni=1

∂F∂xi

∆xi

Page 12: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 7

Calculating the relative changes and again ignoring small squared terms gives:

∆L

L=

∆L

2√

A=

{√1 +

∆A

A− 1

}≈ ∆A

2A

As expected the relative change in L is approximately half that of the relative change in A.

ReportBased on the data provided the farmer should fence off a square area in the corner of the field.If he only has L0 m of fence then he will be able to fence off an area of L2

0/4 m2. Alternativelyto fence off an area of A0 m2 he will require 2

√A0 m of fence.

The use of more posts may allow the farmer to increase the area enclosed by changing theshape of the boundary. (Although not investigated one would expect a more circular boundary toenclose a larger area for a given length of fence.) However more data on the cost of posts andthe return on grazing more animals would be required in order to decide if the additional costwas worthwhile.

1.3 Linear Programming

The following example gives an idea of the type of problem that will be considered in the later chapters.The main difference between this and the later problems is in the complexity. In general problemsinvolve many variables and many constraints, whereas this simple taster example has only two variablesand two constraints. (Not including the usual positive condition on the variables). Unfortunately thelarger problems bring with them many technical difficulties which can only be overcome by introducingmethods other than the simple graphical approach below. It is to be noted however that the graphicalapproach gives a good insight to both the general problem and its solution.

Example 1.2

HandMade Books Inc. wishes to know how many paperback and how many hardback copies of a giventitle to produce.

This problem is clearly far too vague and much more data is required before we can formulate theproblem. The following would be sufficient for a simple model.

HandMade Books Inc. wish to produce a given title in both paperback and hardback. The”guts” of the book is the same for each type, thus HandMade would only need to makea single order from the printers. However the minimum order from the printers is 500copies. The binding department can bind either type but only has at most 4000 mins. ofman power to allocate to the job. From experience they know that a paperback copy takes5 mins. to bind whereas a hardback takes 10 mins. After taking into account all the costs,including the extra material used in binding, the profit on each hardback is £12 and oneach paperback £4. Based on the assumption that all copies produced can be sold howmany of each type of book should HandMade produce in order to maximize their profit.

Page 13: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 8

Construct the Model

Variables

Since there are two types of book and the problem is to determine how many of each should beproduced let P denote the number of paperback and H denote the number of hardback.

Constraints

As usual the variables are non-negative thus P ≥ 0 and H ≥ 0.Since at least 500 copies must be ordered: P + H ≥ 500.A paperback takes 5 mins. to produce thus the total time involved in producing paperbacks is5P mins. Similarly the total time producing hardbacks is 10H mins. Thus since the maximumavailable time for binding is 4000 mins the following inequality must hold: 5P + 10H ≤ 4000

Objective Function

The problem requires the production levels that give maximum profit. Denoting the profit byQ, the data gives: Q = 4P + 12H.

Mathematical Problem

The mathematical problem to be solved can now be formulated as:

Maximize

Q = 4P + 12H

Subject to

P + H ≥ 5005P + 10H ≤ 4000

P, H ≥ 0

The term Linear in the title refers to the fact that both the objective function Q and the inequalitiesare simple linear combinations of the variables. In Ex(1.1) the product xy that appeared is not linearand thus this was not an example of a linear programming problem.

Solve the InequalitiesThe most direct way of visualizing this problem is to draw a graph as in Ex(1.1). As in Ex(1.1) thefeasible region for the problem is the set of all values of P and H that satisfy all the constraints.Graphically the constraints P ≥ 0 and H ≥ 0 restrict the problem to the positive quadrant. The con-straint P + H ≥ 500 is represented in Fig 1.3(a) as all the points on and above the line P + H = 500.Similarly the constraint 5P + 10H ≤ 4000 is represented in Fig. 1.3(b) as all the points on and belowthe line 5P + 10H = 500.

Since all the inequalities have to be satisfied simultaneously, combining these diagrams in the positive

Page 14: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 9

P

H

P + H = 500

P + H > 500

P

H

800

5P + 10H < 40005P + 10H = 4000

400

500

500

(a) (b)

¼ ¼

Figure 1.3: Consider both diagrams in the positive quadrant; In (a)the region P + H > 500 is abovethe line P + H = 500. In (b) the region 5P + 10H < 4000 is below the line 5P + 10H = 4000.

quadrant gives the feasible region for the problem. (see Fig. 1.4) In this diagram the objective functionhas been plotted with Q = 3600. As Q is increased the line moves away from the origin and the pointR moves up the line AC. Clearly as Q increase the point at which the objective function last overlapsthe feasible region is when R is at A. Thus the coordinates of A will give the maximum value of Q

consistent with the constraints.The coordinates of A are given by the solution of the two bounding lines P +H = 500 and 5P +10H =4000. Solving these simultaneously gives H = 300 and P = 200.

Interpret and EvaluateThe model predicts that HandMade Books should produce 300 hardback copies and 200 paperback.It is reasonable that the number of hardback should be greater than the number of paperback sincethe profit on the hardback version is three times that of the paperback but only takes twice as longto make. The assumption that all the copies can be sold to give the stated profits may not be correct,especially as hardbacks are usually more difficult to sell. Marketing may want to consider the effectof changing the prices of the books to generate different profits.

ReportUnder the given circumstances HandMade should produce 300 hardback and 200 paperback copies;this will yield a profit of £4400.

In later chapters the effect of making changes to a model is considered. In this problem one mightconsider the effect of changing the profit made per book, the amount of time available in fabricationor the printer’s minimum. The result of such changes would be reported to the client.

Page 15: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 10

800500

500

400

P + H = 500ª

5P + 10H = 4000

ª

P

H

feasible region

>

A

B C

..........................................................

R

3600 = 4P + 12H

ª

Figure 1.4: Shaded area ABC is the feasible region for the problem; Objective function with Q =3600 shown as dotted line.

1.4 Network Model

A network in its most general sense is just a collection of points and lines with some or all of the pointsbeing joined by lines. An alternative name for such an object is a graph, though this term is perhapsmore used by Mathematicians than Management Scientists. The use of such objects to representproblems is extremely wide, thus here in the introduction, a single simple example is considered.The example is chosen because of its intuitive link with the idea of a network; as will be seen in laterchapters the construction of a network is not always the obvious way to represent and solve a problem.

Example 1.3

A Cable company wishes to join together four regions. Denoting the centres as (1), (2), (3) and (4)then the following table gives the distances of possible routes between centres. Note that for somereason it is not possible to construct a link directly between centre (2) and centre (4).

from to dist km(1) (2) 10(1) (3) 70(1) (4) 40(2) (3) 30(3) (4) 50

Identify the problem and Construct the modelThe data from this table is now represented by the Network in Fig 1.5. If we assume that the cost of

Page 16: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 11

1

4

3

2

10

70

40 50

30

Figure 1.5:

constructing a link is proportional to the given distance between the centres then the problem is todecide on the overall picture that minimizes the sum of all the links between centres.

Carry out the MathematicsAn intuitive way to proceed is to randomly select one of the centres as a starting point and then con-struct a link to the nearest centre. The third link is then constructed by seeing which of the remainingtwo centres is closest to the two already linked. Finally the fourth centre is linked in along the shortedpath. Formally at the ith stage we have a set of centres that have already been linked, denote this byCi. Its complement, C ′

i, is therefore the set of all the centres that have still to be linked. The processcan be seen in Fig 1.6 where (1) is the first centre chosen.

Thus initially C1 = {1} and C ′1 = {2, 3, 4} and the process is as follows:

• (a) shows the links to (1) from the other centres. Clearly (2) is the closest (indicated in dots)Thus we form the first permanent link between (1) and (2). C2 = {1, 2} and C ′

2 = {3, 4}• (b) shows the links from the remaining centres to the two already linked. Clearly (3) is the

closest, again shown in dots. This link is made permanent. C3 = {1, 2, 3} and C ′3 = {4}

• The final link is made, the shortest link being from (4) to (1). C4 = {1, 2, 3, 4} and C ′1 = {}

The final network in Fig 1.6(d) indicates how the centres should be connected in order to minimizethe total distance; this can be seen to be 80km.

Interpret and EvaluateThe result appears to be reasonable, as a quick glance at the original data suggests that the 70kmroute from (1) to (3) is not sensible as the same link can be accomplished via (2) using at total link

Page 17: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 12

1

4

3

2

......................

C1 C ′1

40

70

10

(a) (b)

1

2

4

3........................

40

70

30

C2 C ′2

1

2

3

4.............................................

10

10 30

40

501

4

3

2

C4 C ′4

40

3010

(d)(c)

C3 C ′3

Figure 1.6: Dotted lines indicate the shortest link from C ′i to Ci. Vertical dashed lines separate Ci and C ′i.

distance of 40km.

Without further developing the theory of networks there is no guarantee that the above algorithmproduces the shortest path connecting all centres. Indeed it may be that starting from another centrea different configuration may result which may or may not have the same total distance of 80km.

ReportThe centres should be linked with (1) to (4), (1) to (2) and (2) to (3). This gives a total distance of80km.

Networks can be used to model many diverse situations and different algorithms developed to movethrough the network in a prescribe fashion in order to satisfy some given criteria. In the above prob-

Page 18: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 13

lem the task was to visit every centre in such a way as to minimize the distance travelled. In otherproblems the requirement may be to find a path through a given network from one point to anotherin such a way as to satisfy a given criteria, often related to maximizing profit or minimizing cost.

1.5 Dynamic Programming

Problems that can be split into n stages such that at each stage the same criteria is used to move to thenext are solved by a technique referred to as Dynamic Programming. The following example illustratesthe idea of splitting up a problem and how at each stage we use the same logic to move to the next.It is to be stressed that although this is a network problem, not all dynamical programming problemsinvolve a network and conversely not all network problems are solved using dynamical programming.

Example 1.4 The network in Fig. 1.7 represents a road network between six towns. The towns,which are labelled 1 to 6, will be referred to as nodes in the network. The task is to find the shortestroute from town 1 to town 6, that is to say from node(1) to node(6). At each stage the method

1

2

3

4

5

6

stage 0 stage 1 stage 2 stage 3

3

3

4

2

8

22

4

[1,3]

[1,2]

[1,0]

[2,6]

[3,4]

[2,7]

[3,10]

[4,8]

[5,9]

Figure 1.7: Distance between towns in km indicated by numerals next to respective links.

calculates the shortest distance from (1) to each town in the given stage. At each node(X) the notation[N,s] is introduced to indicate that the shortest distance from node(1) to node(X) is s, where N isthe node immediately before node X on the shortest route from node 1.

With reference to Fig 1.7 the label are attached as follows:

Stage 0:

Trivially node(1) is zero km from node(1) thus it is labelled as [1,0].

Page 19: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 1. INITIAL OVERVIEW OF COURSE 14

Stage 1:

Since there is only one link from node(1) to node(2) it can be seen from Fig.1.7 that the minimumdistance of node(2) from node(1) is 3; thus node(2) is labelled [1,3] Similarly the minimumdistance of node(3) from node(1) is 2 and thus node(3) is labelled [1,2].

Stage 2:

Node(4):

It is seen that node(4) can be reached in one of two ways, either via node(2) or via node(3). If theshortest route is via node(2) then the label on node(2) indicates a distance of 3km from node(1),thus since node(4) is 3km from node(2) the label [2,6] would be attached to node(4).(see Fig1.7)

Alternatively if the shortest route to node(4) is reached via node(3) then since the label onnode(3) indicates a distance of 2km from node(1) and since node(4) is 2km from node(3) thelabel [3,4] would be attached to node(4).

As each node is to have only a single label and it is the shortest route that is being sought,choose the label with the smallest value of s. In this case the label [3,4].

In Fig.1.7 the discarded label [2,6] is shown crossed out leaving the single label [3,4] attachedto node(4)

Node(5):

In a similar fashion there are two possible labels to consider for node(5). Again the label withthe smallest value of s, namely [2,7], is selected. See Fig 1.7.

Stage 3:

Node(6) can be reached via node(4) or node(5).

If the shortest route to node(6) is via node(4), then since the label on node(4) indicates a distanceof 4km from node(1) and since node(6) is 4km from node(4) the label [4,8] would be attachedto node(6).

Alternatively if the shortest route to node(6) is reached via node(5), the label on node(5) in-dicates a distance of 7km from node(1) and since node(6) is 2km from node(5) the label [5,9]would be attached to node(6).

Again the label with the smallest s, namely [8,4] is selected.

This final label on node(6) indicates that node(6) is 8km from node(1). Although not proved this isindeed the shortest path from node(1) to node(6).The labels carry the information of this shortest path from node(1) to node(6). Tracing back the pathfrom (6) we see that 6 ← 4 ← 3 ← 1. Thus the shortest route from (1) to (6) is first via (3) and thenvia (4).

The important point regarding this method is that it starts each stage with the same type of infor-mation and then applies the same rules to get to the next stage. The solution therefore consists of aset procedure that is repeated over and over again.

Page 20: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Chapter 2

Linear Programming - 2 variables

2.1 Two variable problem

This chapter discusses a two variable example which allows the consideration of many aspects of linearprogramming by making reference to a graphical representation.

Example 2.1

RealChoc produces two types of chocolate, milk and plain, which is then further processed into differentlines of confectionary by one of its subsidiaries. The following data give the contents of each type ofchocolate, the levels of ingredients available at the start of each production period and the associatedprofits.

Each types of chocolate is made from the same ingredients but mixed in different ratios.Milk chocolate consists of 10% cocoa solid, 20% vegetable fat, 30% sugar and 40% milksolids. Dark chocolate consists of 40% cocoa solid , 30% vegetable fat, 20% sugar and 10%milk solids. The amount of ingredients available at the start of a production period areas follows: 4 tonnes of cocoa solid, 3.5 tonnes of vegetable fat, 3.5 tonnes of sugar and 4tonnes of milk solid.

It is calculated that 25% more profit can be made from producing milk chocolate thanplain. (this last fact would involve knowing the relative costs of the raw materials, theproduction costs and the marketing strategy for the chocolate)

RealChoc needs to know the amounts of each type of chocolate to produce.

Identify the problemThis problem is well specified, it is simply necessary to find the amounts of the two different typesof chocolate that should be produced to maximize the profit, whilst at the same time considering thelimited availabilities of the various ingredients.

Construct the modelIn this type of problem it is sometimes helpful to extract the data and place it in a table, the objective

15

Page 21: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 16

function and the constraints are then easier to write down. Extracting the numerical data from theabove gives:

Ingredient Milk % Plain % Supply (tonnes)Milk Solid 40 10 4

Sugar 30 20 3.5Veg Fat 20 30 3.5Cocoa 10 40 4

Profit ratio 1.25 1

Table 2.1:

• The choice of decision variables is immediate, let x1 denote the amount of milk chocolateproduced and x2 the amount of plain chocolate produced; these are both measured in metrictonnes and subject to the constraints x1, x2 ≥ 0.

• The construction of an objective function that represents the profit is not straight forward asonly the relative profit of one type of chocolate over the other is given. Assuming the profit isproportional to the weight of chocolate produced, then denoting the total profit as z, it followsthat z ∝ 1.25x1 + x2. The simplest way to express this is to write z = 5x1 + 4x2. The unit ofprofit is then the amount of profit that can be made on 0.25 tonne (250 kg) of plain chocolateor equivalently 0.2 tonne (200 kg) of milk chocolate.

• The constraints are generated from the availability of supply of the ingredients. With RealChocproducing x1 of milk chocolate and x2 of plain then considering the ingredients in turn gives:

• Milk SolidsThe amount of milk solids available is 4 tonnes. The total amount of milk solids used isgiven by:

{40100x1 + 10

100x2

}, which gives the constraint 4x1 + x2 ≤ 40.

• SugarThe amount of sugar available is 3.5 tonnes. The total amount of sugar used is

{30100x1 + 20

100x2

},

which gives 3x1 + 2x2 ≤ 35.

• Vegetable fatThe amount of vegetable fat available is 3.5 tonnes. The total amount of vegetable fat usedis

{20100x1 + 30

100x2

}, which gives 2x1 + 3x2 ≤ 35.

• CocoaThe amount of Cocoa available is 4 tonnes. The total amount of cocoa used is

{10100x1 + 40

100x2

},

which gives x1 + 4x2 ≤ 40.

After simplification the mathematical problem is now seen to be:

Page 22: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 17

Maximize

z = 5x1 + 4x2

Subject to

4x1 + x2 ≤ 403x1 + 2x2 ≤ 352x1 + 3x2 ≤ 35x1 + 4x2 ≤ 40

x1, x2 ≥ 0

The above problem can be recast in terms of matrices, a notation which has the advantage of beingapplicable to problems in many variables with many constraints. With the notation:

A =

4 13 22 31 4

x =

(x1

x2

)b =

40353540

c =

(54

)0 =

(00

)

the problem becomes:

Maximize

z = cT x

Subject to

Ax ≤ b , x ≥ 0

Where the inequalities are interpreted to mean that the inequality holds for each element of the col-umn matrices involved and cT is the matrix transpose of c

Clearly the problem Ax ≤ b , x ≥ 0 has many solutions. Any such solution is said to be a fea-sible solution and the set of all solutions is called the feasible set or feasible region. The problem istherefore to find a feasible solution that maximizes z = cT x.

Carry out the mathematics

Since the problem has only two variables it can be represented graphically, with the two inequali-ties x1, x2 ≥ 0 restricting the problem to the positive quadrant.Graphically Ax = b represents four straight lines. As in Ex(1.2) replacing the equals sign in each ofthe equations with an inequality sign produces a region to one side or the other of each of the lines.In terms of the problem each line is associated with a resource and the points on a line represent

Page 23: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 18

production levels that correspond to the total consumption of that resource. For example all pointson the line 4x1 + x2 = 40 represent production levels that consume all the available milk solids. Thepoints satisfying 4x1 + x2 < 40 represent all the points below the line and correspond to productionlevels that do not consume all the milk solids.

In Fig. 2.1 the four lines defined by Ax = b are plotted in the positive quadrant. Since each of theinequalities in Ax < b is of the form m1x1 + m2x2 < b1, with m1, m2 and b1 positive, this defines aregion that consists of all points that lie below1 all four lines. Thus the feasible region is the boundaryand interior of the polygon OABCDEO.

x1

x2

A

B

C

D

E

4

4 8

8

12

12................................................................................................

40 = 5x1 + 4x2

x1 + 4x2 = 40 (cocoa)

= 2x1 + 3x2 = 35 (veg fat)

+3x1 + 2x2 = 35 (sugar)

+

4x1 + x2 = 40 (milk)

+

feasible region

O

(9,4)

(4,9)

10

10

(7,7)

Figure 2.1: Feasible region OABCDEO; Objective function z = 40 = 5x1 + 4x2 shown in dotted line

The problem is therefore to find the values of x1 and x2 in the feasible region such that

z = cT x = 5x1 + 4x2 is a maximum.

1To determine which side of the line m1x1 +m2x2 = b1 the points satisfying the inequality m1x1 +m2x2 < b1 lie firstconsider a point P on the line. Allow x1 to decrease, this moves the point P to the left. Thus if m1 > 0, m1x1 + m2x2

decreases and becomes less than b1. The inequality is still satisfied. Thus P has moved into the region m1x1+m2x2 < b1.The required region is therefore on this side of the line. The reverse argument applies if m1 < 0 with the movement ofP to the left now being out of the region and the required region being on the other side of the line.

Page 24: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 19

Select a sample value of z equal to 40, say, and plot this on the graph. In Fig. 2.1 the equation40 = 5x1 + 4x2 is drawn as a dotted line. It can be seen that this line intersects the feasible regionin an infinite number of points, each corresponding to possible production levels that produce a profitof 40. As the objective function z increases the dotted line moves parallel to itself and away from theorigin. It will eventually not intersect with the feasible region. Clearly the last point of intersection ofthe objective function with the feasible region corresponds to its maximum value consistent with theconstraints. Careful consideration of the diagram shows that this final point is at C. A more analyticalapproach would be to note that the gradient of the objective function lies between the gradients oftwo adjacent sides of the polygon passing through C, namely BC and CD.In detail:

gradient CD = −1.5 < gradient z = −1.25 < gradient BC = −23

Having graphically determined where the optimum solution lies it is now only a matter of calculatingthe coordinates of C and hence the corresponding value of z.The point C is at the intersection of the two lines:

3x1 + 2x2 = 35 and 2x1 + 3x2 = 35

Solving gives x1 = 7 and x2 = 7.Using these values in the objective function z = 5x1 + 4x2 gives z = 63.

Remarks

• In this example the solution (7, 7) was unique, however if the objective function had been parallelto either BC or CD the problem would have had multiple solutions; that is to say all the pointson BC or CD as appropriate. In either case C would still have been an optimal point.

• At the optimum point C the constraints for the vegetable fat and the sugar take on the equalitysign. ie C is the point of intersection of the two lines 3x1 + 2x2 = 35 and 2x1 + 3x2 = 35. Insuch a case the two constraints 3x1 + 2x2 ≤ 35 and 2x1 + 3x2 ≤ 35 are said to be binding.

• Using x1 = 7 and x2 = 7 a simple calculation shows that the amount of cocoa used at this pointis 35 tonnes, being 5 tonnes below the available amount. The system is therefore said to haveslack in it with respect to this constraint. Similarly the system is also slack with respect to theavailability of milk solid.

In problems where a constraint uses ≥ rather than ≤ and the constraint is not binding thesystem is said to be in surplus with respect to this constraint.

Interpret and Evaluate The solutions suggest that RealChoc should produce 7 tonnes of milkchocolate and 7 tonnes of plain chocolate. The values seem reasonable since to try and produce morewould not be possible as both the supplies of sugar and vegetable fat have been totally consumedat this level of production. However there will be a surplus of the other two ingredients and no ac-count has been taken of any loss in profit due to this surfeit. Hopefully excesses can be carried forwardto the next production period without extra cost or the levels of material ordered adjusted accordingly.

Page 25: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 20

The graph certainly indicates that the optimal level of production should be on the boundary ofthe feasible region at one of the vertices. In general if there were too many vertices to be able totell from a graph which was optimum then one could theoretically calculate the coordinates of allthe vertices. Doing this for A to E and then evaluating z it can be seen which pair of values gives amaximum. Carrying out this process yields the following results:

vertex coords z valueO (0,0) 0A (0,10) 40B (4,9) 56C (7,7) 63D (9,4) 61E (10,0) 50

Table 2.2: values of the objective function at each of the vertices of the feasible region in Fig. 2.1

As previously calculated the maximum value of z does indeed occur at C.

ReportRealChoc should produce 7 tonnes of milk chocolate and 7 tonnes of plain. At this production levelthe profit will be 63 times the profit that can be made on 200 kg of milk chocolate. RealChoc shouldbe aware that at this level of production all the available sugar and vegetable fat are consumed.

If it is possible to make small changes in the supply of raw materials or indeed in the amount ofprofit obtainable then the production scenario may change in a significant fashion. More analysis willbe required in order to advise RealChoc.

2.2 Sensitivity Analysis

Consider the general two dimensional maximization problem:

Maximizez = cT x subject to Ax ≤ b, x ≥ 0

where A is an n× 2 matrix, b an n× 1 column matrix, c =(

c1

c2

)and x =

(x1

x2

).

This section considers the change in z due to small changes in:

• c1 or c2.

• Any one of the components of b.

In this analysis only one parameter is considered to change at a time.

Page 26: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 21

2.2.1 Changes in the Objective Function

The objective function is given by z = c1x1+c2x2. A change in c1 or c2 will have the effect of changingthe gradient of the objective function. With reference to Fig. 2.1 and the detail in Fig. 2.2(a), for C

to remain the point of optimum solution the gradient of the objective function must lie between m2,the gradient of BC and m1 the gradient of CD.Symbolically

m1 ≤ −c1

c2≤ m2 (2.1)

First consider a small change δ in c2; for Ex(2.1) write z = 5x1 + (4 + δ)x2, δ ≥ −4. From Fig. 2.2(b)

...........................................................

C

B

..D

gradient − c1c2

¼

gradient m2

*

gradient m1

*

(a)

z = c1x1 + c2x2

2x1 + 3x2 = 35

gradient − 23

...........................................................

C

B

..D

gradient − 54+δ

¼

3x1 + 2x2 = 35

*

gradient − 32

*

(b)

z = 5x1 + (4 + δ)x2

Figure 2.2: (a) The objective function z = c1x1 + c2x2 must lie between BC and DC produced, thusm1 ≤ − c1

c2≤ m2 (b) In the example −3

2 ≤ − 54+δ ≤ −2

3

and Eq(2.1), for C to remain the optimal point the following inequality must be satisfied:

−32≤ − 5

4 + δ≤ −2

3⇒

23≤ 5

4 + δ⇒ δ ≤ 7

2and

54 + δ

≤ 32

⇒ −23≤ δ

Thus C will remain the optimal point provided:

−23≤ δ ≤ 7

2that is to say 3

13≤ c2 ≤ 7

12

(2.2)

Assuming it is possible to raise the profit coefficient of plain chocolate, then any value from 4 to 7.5will still have C(7, 7) as the optimal production point. With c2 at its maximum value of 7.5 the profitwill have risen to z = 5x1 + 7.5x2 = 5× 7 + 7.5× 7 = 87.5.On the other hand if the available profit on plain chocolate decreases then it can fall as far as 31

3

Page 27: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 22

before it is necessary to change the production levels. At its lowest point the profit is decreased toz = 5x1 + 31

3x2 = 35 + 2313 = 581

3 .

In a similar fashion we can determine the range of values of c1 that preserve C as the optimal point.Consider z = (5 + δ)x1 + 4x2. Thus:

m1 ≤ −c1

c2≤ m2 ⇒ −3

2≤ −5 + δ

4≤ −2

3⇒ −7

3≤ δ ≤ 1 ⇒ 2

23≤ c1 ≤ 6 (2.3)

This now means that the coefficient of x1 can vary in the range [223 , 6] with C(7, 7) remaining the

optimum point of production.

In both cases an interval was established such that the optimal point was the same for all valuesof the c-parameter in the interval. This leads to the following definition.

Definition - Range of OptimalityThe range of optimality of the coefficient ci in the objective function z = cT x corresponding to theoptimal solution x0 is an interval Ii such that x0 is the optimal solution for all ci ∈ Ii.That is to say provided ci stays in the interval the optimal solution remains unchanged.

Alternative names are optimal range, optimal interval, interval of optimality

In the above example: x0 = (7, 7), I1 = [223 , 6] and I2 = [31

3 , 712 ].

2.2.2 Reduced Cost

In some problems, particularly when there are more than two variables, it transpires that one ormore of the variables are zero in the optimal solution. That is to say it is not worthwhile producinga particular product or carrying out a particular activity. Clearly if it is required to produce sucha product, then one way of making it more worthwhile is to try and increase the amount of profitassociated with it, this amount is referred to as the reduced cost for the product.

Strictly speaking the term reduced cost refers to a minimization problem where the objective functionis the total cost of production. If at the optimal solution one of the variables is zero it means that itis too expensive to produce the associated product. Thus by reducing the associated cost coefficient itcan eventually become worthwhile producing the particular product.

In the present problem the optimum solutions are all non-zero, namely x1 = 7 and x2 = 7, thusthe problem of changing the profit of either commodity in order to trigger its production is not nec-essary. In such a case the reduced cost is said to be zero.(In this problem one might argue that the term increased profit would be more apt, however the termreduced cost is used for all problems.)

To illustrate the need for increasing the profit assume for this section that the objective function

Page 28: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 23

is given by z = 5x1 + x2. That is to say assume that the profit on plain chocolate has been reducedfrom 4 to 1, thus making it a lot less profitable. Redrawing Fig. 2.1 with the new objective function(see Fig. 2.3), that is to say set z = 42 = 5x1 + x2, it is clear that as z increase the last point atwhich the objective function intersects the feasible region is at E(10, 0). Thus only milk chocolate isproduced giving a profit of z = 5× 10 + 0 = 50.

Since x2 is zero at the optimal point consider increasing the profit coefficient c2 from 1 to (1+δ). This

x1

x2

42 = 5x1 + x2

j

A

B

C

D

E

4

4 8

8

12

12

ª

50 = 5x1 + x2

4x1 + x2 = 40

*feasible region

O

10

10

Figure 2.3: The new objective function z = 5x1 + x2 is shown with z = 42 and also translated to itsoptimal position at E where it last intersects the feasible region with z = 50; At this optimal pointx2 = 0.

causes the gradient of the objective function to become less negative and the line 50 = 5x1 +(1+ δ)x2

will rotate anti-clockwise about E. There will come a point when the value of δ is such that theobjective function and DE are coincident (namely when the gradient of the objective function is equalto the gradient of DE). At this point there are an infinite number of optimum solutions with x2 6= 0,namely any other point but E on DE. Any further increase in δ will cause D to becomes the nextunique optimum solution.

Since DE has gradient −4 and z = 5x1 + (1 + δ)x2 has gradient− 51+δ the objective function lies

along DE when:

− 51 + δ

= −4 ⇒ 1 + δ =54

⇒ δ = 0.25

Thus in this example it would be necessary to increase the possible profit on dark chocolate by 0.25in order to make it worthwhile producing any.

Definition - Reduced Cost

Page 29: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 24

Consider a linear programming problem where a variable is zero at an optimal point. Theleast absolute change necessary in the corresponding coefficient in the objective function,in order for this variable to not necessarily be zero in an optimal solution is called thereduced cost of the variable.

Non-zero variables are said to have zero reduced cost as it is not necessary to changethe corresponding coefficients of the objective function to make them non-zero.

As mentioned above in a minimization problem it is found that the change in the coefficientin the objective function is, as the name suggests, reduced in order to produce a non-zerovariable in the optimal solution.

2.2.3 Change in Resources

This section looks at the effect on the objective function due to a change in any one of the componentsof the righthand side of the constraints Ax ≤ b. Usually b represents levels of resource in a problem,hence the title of the section. The optimum point is the intersection of two lines; in the problem aboveC was the intersection of BC and DC. The task is to consider the effect of changes in the componentsof b in such a way that the optimum point remains the intersection of the same two lines. Graphicallychanging a component of b moves the associated line parallel to itself, hence the optimum point maymove. The situation is therefore different to that in Sec. 2.2.1 where the changes were made such thatnot only did C remain the intersection of the same two lines but the point itself remained unchanged.

....................................

..........................A

B

C

D

N

C′

B′

feasible region

D

A

BN

C

(a) (b)

feasible region

Figure 2.4: (a) Dashed line C ′B′ is the position of the line CB after increasing δ from zero. As δchanges C ′ moves along the line DC towards N . (b) δ increased sufficiently to force the line CBoutside the feasible region which is now bounded by AND

1. Variation in the amount of vegetable fatThe boundary for this constraint is given by the line 2x1 + 3x2 = 35, with BC being thatpart of the line in the feasible region. To model the change in the righthand side write this as

Page 30: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 25

2x1 + 3x2 = 35 + δ. As δ increase from zero the original line will move away from the origin,similarly as δ decreases from zero it will move towards the origin.

Consider initially an increase of δ from zero.

With reference to Fig. 2.4(a) the point C ′, which is the intersection of 2x1 + 3x2 = 35 + δ and3x1 + 2x2 = 35 will move along the line towards the point N (the point of intersection of AB

and DC produced). Once the line has passed N , Fig. 2.4(b), there are no points on the line thatlie in the feasible region. That is to say the point C, the intersection of the fat and sugar linesis outside the feasible region and is therefore no longer an optimal solution. Thus the largestvalue that δ can take is when the line 2x1 + 3x2 = 35 + δ passes through N . To calculate thisvalue and the effect of such a change on z proceed as follows:

Coordinates of N :

N is the point of intersection of the line AB, x1+4x2 = 40, and the line DC, 3x1+2x2 =35. Solving gives the coordinates of N as (6,17

2 ).

General coordinates of C

The coordinates of C are initially the solutions of:

2x1 + 2x2 = 353x1 + 2x2 = 35

⇒(

2 33 2

)(x1

x2

)=

(3535

)

Writing the matrix equation as Bx0 = d then the initial solution is given as x0 = B−1d

With the change in the right hand side the general coordinates of C are given bysolving:

2x1 + 3x2 = 35 + δ3x1 + 2x2 = 35

⇒(

2 33 2

)(x1

x2

)=

(35 + δ

35

)

Let ∆d =(

δ0

)and let the change in x0 due to the introduction of δ be denoted by

∆x. The matrix equation can now be written in the form;

B (x0 + ∆x) = d + ∆d ⇒ Bx0 + B∆x = d + ∆d

Using Bx0 = d this gives

B∆x = ∆d ⇒ ∆x = B−1∆d

Evaluating this numerically gives:

∆x =(

2 33 2

)−1 (δ0

)⇒ ∆x = −1

5

(2 −3−3 2

)(δ0

)=

−2δ

5

3δ5

(2.4)

Page 31: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 26

Thus the coordinates of C are given by

x = x0 + ∆x =

7

7

+

−2δ

5

3δ5

=

7− 2δ5

7 + 3δ5

(2.5)

Maximum value of δ

The maximum value of δ is when C and N coincide, thus using the coordinates of C

from Eq(2.5) and solving either:

7− 2δ

5= 6 or 7 +

5=

172

gives δ =52

(2.6)

Change in z

Denoting the initial optimal value of z as z0 (ie z0 = cT x0) and the change in z dueto ∆d as ∆z, the equation for the objective function becomes:

z0 + ∆z = cT (x0 + ∆x) ⇒ ∆z = cT ∆x (2.7)

Since the change in d is only in one component of d, let e stand for either(

10

)or

(01

)as appropriate and thus write ∆d = δe.

With this notation and using ∆x = B−1∆d:

∆z = cT ∆x = δcT B−1∆e ⇒ ∆z

δ= cT B−1e (2.8)

Thus for a change of δ in the availability of the fat supply the relative change in z isgiven by:

∆z

δ= (5, 4) B−1

(10

)= (5, 4)

( −25

35

)=

25

(2.9)

The relative change in z due to a change in any of the resources is an important pieceof information as it indicates which resource it is most profitable to try and increase.However if large changes in the resources are possible, greater than the maximum δ

calculate above, then C will no longer be the optimum point and the problem wouldneed to be resolved. With this in mind the following definition provides a useful toolwhen analysing which resource to increase to obtain the most advantageous change inz.

DefinitionThe dual price associated with a given constraint is the change in the objective

Page 32: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 27

function per unit change in the righthand side of the particular constraint. Alternativenames are shadow price and simplex multiplier. In the notation of the aboveexample this is given by ∆z

δ .

Maximum value of z

For the change in fat the maximum value of δ = 52 . (Eq(2.6)). Using Eq(2.9) this

give the maximum change in z as 25 × 5

2 = 1. Thus the maximum profit attainable byincreasing the amount of fat, but at the same time retaining C as the optimal point(that is to say all the sugar and fat supplies are used up) is 63+1=64.recall that with the original resources the maximum profit was 63

Any further increase in δ will not increase the profit as C will no longer be in thefeasible region and N will remain the optimum point. For all values of δ above thismaximum value the constraint on the vegetable fat no longer plays a role in theoptimization problem. Such a constraint is said to be redundantDefinitionA constraint is said to be redundant if the removal of the constraint does not affectthe feasible region.In the above problem and with reference to Fig. 2.2(b) all the other constraints nowlie below the constraint line for vegetable fat. Hence the removal of this constraintline does not affect the feasible region.

Consider now the effect of decreasing δ from zero.

The original line BC now moves towards the origin and as it does so it takes the feasible regionwith it (see Fig. 2.5).Eventually the point of intersection of BC with CD will fall outside the feasible region; shown

..............................

........

........

........

........

........

........

........

........

........

........

.....

AB

C

D

E

C′

B′

feasible region

Figure 2.5: Dotted line B′C ′ shows the vegetable fat constraint with δ reduced below zero by such anamount so as to cause the point of intersection of it with DC to lie outside the feasible region

as C ′ in Fig. 2.5. The smallest value of δ for which C is a part of the feasible region is when

Page 33: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 28

C and D coincide. (That is to say D now plays the role of N in the previous case of increasing δ.)

Coordinates of D

D lies on the intersection of CD and DE and as given in Table 2.2 has coordinatesD(9, 4)

Minimum value of δ

Using the expression for the coordinates of C obtained in Eq(2.5), and the coordinatesof D as (9, 4) the minimum value of δ is given by solving:

9 = 7− 2δ

5or 4 = 7 +

5⇒ δ = −5 (2.10)

Minimum value of z

Substituting for δ = −5 into Eq(2.9) gives ∆z = −2. Thus the minimum value of z isgiven as 63 + ∆z = 63− 2 = 61.

2. Variation in the amount of sugar

The other resource associated with the optimum point at C is the supply of sugar with bindingline CD (see Fig. 2.6).

As δ increases from zero the line CD moves parallel to itself in a direction away from theorigin. C, its point of intersection with BC moves along the line BC towards N . Fig. 2.6 showsthe line CD, denoted as the dashed line C ′D′, drawn for a value of δ large enough to cause C,now denoted C ′, to pass N . Thus we deduce that the maximum value of δ such that C remainsin the feasible region and hence remains the optimal point is when the line CD passes throughN .

As δ decreases from zero the line CD moves in a direction towards the origin and C nowmoves towards B. For this case Fig. 2.6 shows the line CD, denoted as the dashed line C ′′D′′,drawn for a value of δ negative enough to cause C, now denoted C ′′, to pass B. Thus we deducethat the minimum value of δ such that C remains in the feasible region is when the line CD

passes through B.

Coordinates of N (Fig 2.6)

These are at the intersection of BC and ED, thus solving the corresponding equations2x1 + 3x2 = 35 and 4x1 + x2 = 40 gives N(17

2 , 6).

Coordinates of C

To find the general coordinates of C the only difference between this case and the one

Page 34: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 29

...................................

............................

............

............

...........

C

D

E

A

B

C′

D′

N

C′′

D′′

........................

δ > 0

δ < 0

Figure 2.6: Dotted line C ′D′ shows the sugar constraint with δ increased from zero by such an amountso as to cause the point of intersection of it with BC to lie outside the feasible region. Similarly C ′′

is the point of intersection outside the feasible region with δ reduced below zero. For C to remain inthe feasible region δ is maximum at N and minimum at B

above is that ∆d is now given by(

)and Eq(2.4) becomes:

∆x =(

2 33 2

)−1 (0δ

)⇒ ∆x = −1

5

(2 −3−3 2

)(0δ

)=

3δ5

−2δ5

(2.11)Thus using Eq(2.5) the general coordinates of C are given by:

x = x0 + ∆x =

7

7

+

3δ5

−2δ5

=

7 + 3δ5

7− 2δ5

(2.12)

Maximum and Minimum values of δ

Using the coordinates of N and Eq(2.12) the maximum value of δ is given by δmax = 52

and using the coordinates of B(4, 9) the minimum value of δ is given as δmin = −5

Dual price

Page 35: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 30

Using Eq(2.8) the dual price ∆zδ is calculated by setting e =

(01

):

∆z

δ= cT B−1e = (5, 4)

35

−25

=

75

(2.13)

Maximum and Minimum values of z

With the intersection of BC and CD still giving the optimum point the maximum andminimum values of z that are attainable by varying the amount of sugar are givenusing the dual price and the extreme values of δ calculated above.

The maximum value of z is given by:

zmax = z0 + δmax × dual price = 63 +52× 7

5= 66.5

Similarly zmin is given by:

zmin = 63− 5× 75

= 56

3. Variation in the amount of cocoa

In Fig. 2.1 the line AB represents the boundary line for cocoa. Introducing δ to represent thevariation the equation becomes x1 + 4x2 = 40 + δ. As δ increases from zero this line, shown asA′B′ in Fig. 2.7(a), moves away from the origin and as A′ passes the point N (the intersectionof CB produced and the x2-axis) the constraint becomes redundant. Clearly for all values ofδ ≥ 0 the point C remains fixed as the point of optimal solution. Thus any amount of increasein the supply of cocoa will not affect the production strategy.

Decreasing δ from zero moves the line AB toward the origin. C will remain the optimal solutionuntil this line passes below C, cutting C out of the feasible region; shown as A′′B′′ in Fig. 2.7(a).Thus the minimal amount of cocoa that must be available in order to maintain the optimalsolution at C is when δ is sufficiently negative for the line AB to pass through C.

Using the coordinates of C(7, 7) and the equation x1 + 4x2 = 40 + δ gives:

7 + 4× 7 = 40 + δ ⇒ δ = −5

Thus the minimum amount of cocoa required for the original optimal strategy to be maintainedis (40− 5) = 35 tonne

Note that trivially the dual price for cocoa is zero since there is no change in z as the amountof cocoa is changed. (provided of course C remains the optimal point.)

4. Variation in the amount of milk

Variation of the milk supply by δ is represented by the line 4x1+x2 = 40+δ. For increasing δ thisis shown as D′E′ in Fig. 2.7(b). As δ continues to increase this constraint becomes redundant

Page 36: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 31

as E′ passes M (the point of intersection of CD produced and the x1-axis). Thus for all valuesof δ ≥ 0 C remains optimal.

Decreasing δ from zero moves the line DE towards the origin and eventually C no longer lies inthe feasible region; shown as D′′E′′ in Fig. 2.7(b). Thus the minimum value of δ consistent withC being the optimal solution is when D′′E′′ passes through C. Using the coordinates of C(7, 7)and the equation of D′′E′′, 4x1 + x2 = 40 + δ gives δ = −5 and the minimum supply of milkconsistent with the original production strategy to be 35 tonnes.

Again the dual price is zero.

......

......

......

......

......

A

B

C

D

E

A′B′

N

A′′

B′′ ...........................

A B

C

D D′

M

E′

EE′′

D′′

δ > 0

δ > 0

δ < 0

δ < 0

(a) (b)

x1 x1

x2x2

Á

Figure 2.7: Dashed lines are variation of cocoa line AB in (a) and variation of milk line DE in (b)

2.3 Solution by Excel

Excel can be used to solve an n-variable linear programming problem using the add-in programmeSolver. This process is illustrated below for the RealChoc problem where n, of course, is only equal totwo. As the Solver program is an Excel add-in it is only available if it has been installed and activated.It is available on all the University computers but may need activating as follows.

To activate SolverClick on Tools, Add-Ins and check the Solver Add-in

Recall that the inequalities and objective function for the RealChoc problem are given by:

Page 37: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 32

Maximize

z = 5x1 + 4x2

Subject to

4x1 + x2 ≤ 403x1 + 2x2 ≤ 352x1 + 3x2 ≤ 35x1 + 4x2 ≤ 40

x1, x2 ≥ 0

Entering the Problem into the Worksheet

For the purpose of using the spreadsheet the problem is split into three sections; objective func-tion, the variables and the constraints.

With reference to Table: 2.3:

• The values of the objective function coefficients c1 and c2 are entered into cells D5 and E5. Thevariables, x1 and x2 are stored in D9 and E9 and in this problem set initially equal to 1.

• The objective function is entered into C5 as =SUMPRODUCT(D5:E5, D9:E9)

• The first parameters associated with the first constraint 4x1 + x2 ≤ 40, that is to say the x1

and x2 coefficients (1 and 4) and the 40 from the righthand side of the inequality are enteredinto cells D14, E14 and C14 respectively. The value of 4x1 + x2 is now entered into cell B14 as=SUMPRODUCT($D$9:$E$9, D14:E14)

• This last process is repeated for the other three inequalities.

To Run Solver

• Invoke Solver using: Tools Solver

This invokes a Solver dialogue box which is completed as follows:

• Solver is very versatile and will solve many types of problem. To solve a Linear ProgrammingProblem with non-negative variables make the following changes:

Click the Options button and check the Assume Linear Model and Assume Non-Negative but-tons. All other options should be ok by default. Click OK to close box.

• Set Target Cell K8 the objective function z

• Check the max radio button. since the problem is maximize

• Set by Changing D9:E9 the x1 and x2 cells

Page 38: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 33

• To Add items to the Subject to Constraints box click the Add button, this will give an inputbox. Complete the first box as B14 <= C14 OK.

• Repeat to add the other three constraints

• Solver can now be run by clicking Solve.

• After completion, almost instantaneous for this problem, the dialogue box will say if the processhad been successful. Check the Keep Solver Solution radio button, Click on the reports Answerand Sensitivity. Click OK.

• The Optimal solution will be placed in the Worksheet, plus two more sheets will be generated,one for each of the reports; shown below in Table 2.3

Answer Report (Table 2.3)

Target and Adjustable Cells

The first two tables are self-explanatory in as much as they give the optimal solution,values of z, x1 and x2, and the original values of these variables at the start of the iterativeprocess.

Constraints

The third table tells us which constraints are binding and which are slack and by howmuch. As we saw in Sec. 2.2.1 and in Fig. 2.1 the point C is at the optimal solution andis the intersection of the bounding lines for sugar and fat. Thus both these constraints arebinding with zero slack, as seen in the table.

The amount of cocoa used for the optimum production (7, 7) is given by 7 + 4 × 7 = 35which falls short of the total available amount of 40 by 5. The constraint is therefore notbinding. This is given in the last line of the Constraints table. A similar remark appliesto the consumption of milk which is also shown in this table.

Page 39: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 34

A B C D E F G H I J

1

2 Constraints of the form Ax<=>b Objective function z=cTx

3

4 z c1 c2 c3 c4 c5 c6 c7

5 63 5 4

6

7

8 x1 x2 x3 x4 x5 x6 x7

9 7 7

10

11 row Value of

12 i (Ax)i a1 a2 a3 a4 a5 a6 a7

13 Milk

14 35 40 4 1

15 Sugar

16 35 35 3 2

17 Fat

18 35 35 2 3

19 Cocoa

20 35 40 1 4

21 Cnstr 5

22 0

23 Cnstr 6

24 0

25 Cnstr 7

26 0

27 Cnstr 8

28 0

6

7

8

Objective

Function

2

3

4

5

Variables

bi

columns of A

1

Target Cell (Max)

Cell Name Original Value Final Value

$C$5 Function z 9 63

Adjustable Cells

Cell Name Original Value Final Value

$D$9 x1 1 7$E$9 x2 1 7

Constraints

Cell Name Cell Value Formula Status Slack

$B$14 Milk 35 $B$14<=$C$14 Not Binding 5

$B$16 Sugar 35 $B$16<=$C$16 Binding 0

$B$18 Fat 35 $B$18<=$C$18 Binding 0$B$20 Cocoa 35 $B$20<=$C$20 Not Binding 5

Adjustable Cells

Final Reduced Objective Allowable Allowable

Cell Name Value Cost Coefficient Increase Decrease

$D$9 x1 7 0 5 1 2.3333333$E$9 x2 7 0 4 3.5 0.6666667

Constraints

Final Shadow Constraint Allowable Allowable

Cell Name Value Price R.H. Side Increase Decrease

$B$14 Milk 35 0 40 1E+30 5

$B$16 Sugar 35 1.4 35 2.5 5

$B$18 Fat 35 0.4 35 2.5 5$B$20 Cocoa 35 0 40 1E+30 5

Answer Report

Sensitivity Report

Table 2.3: Extract from Excel Worksheet for Ex(2.1) at optimal point; Reports generated by Solver

Sensitivity Report (Table 2.3)

Adjustable Cells

In this table, since the variables are non-zero the reduced costs are shown to be zero. i.e.no increase in the c-coefficients is necessary to make any of the variables non-zero; as theyare already non-zero. With reference to Eq(2.3) the allowable change δ in c1 was in theinterval [−7

3 , 1]. Similarly from Eq(2.2)) the amount variation of c2 is given by the interval[−2

3 , 72 ]. These values can be seen in the last two columns of the table.

Constraints

Page 40: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 35

In the second table in this section the shadow (dual) prices for the non-binding constraintsmilk and cocoa are zero; this is to be expected since having more of these ingredientsavailable when not all are being used will make no change to the problem. The shadow(dual) prices for sugar and fat are as calculated in Eq(2.13) and Eq(2.9) having the values1.4 and 0.4; as shown in the table.

In Sec. 2.2.3 items 1 and 2 it was shown that the maximum increase in sugar or fat, withoutchanging the position of the optimum solution, is 2.5. These figures can be seen in thetable.

In items 3 and 4 of Sec. 2.2.3 it was shown that any increase in the amount of milk or cocoacan be made without changing in the position of the optimum solution. This is indicatedin the table by the 1E+30 entries.

On the other hand it was shown that it was not possible to reduce the amount of any ofthe ingredients by more than 5 without changing the position of the optimum solution.These figures are shown in the last column of the table.

2.4 Integer Solutions

In general the solution of a linear programming problem will not be in terms of integers, as was thecase in the RealChoc problem above. For the RealChoc problem it would have not been a problem ifthe optimal solution had been at a non-integer point, as the variables simply represented the weights ofthe different types of chocolate. However it is easy to imagine a problem where only integer solutionsmake any physical sense.

The problem below is that of a construction company building two types of house. For such a problemit is clearly not feasible to build a fraction of a house. Thus the values of the decision variables in thesolution of the linear programming problem designed to optimize the return must be integers. Taha[15] remarks that there is no really good and reliable software for solving integer linear programmingproblems. This is certainly the case as the number of variables increases, however for a small numberof variables Solver does quite a good job. The following problem is only in two variables thus it ispossible to use graphs to obtain integer solutions to the problem. In order to illustrate the use of Solverfor the solution of the integer linear programming problem, the Solver solution of this problem is alsoshown. However it must be borne in mind that whatever algorithm Solver is using the additionalcomplexity encountered in order to find integer solutions will increase with the number of variables.

Example 2.2A construction company is about to build on a site which is split into 95 plots. Each plot can accom-modate either one executive house or three small affordable homes. The government and local planingauthority stipulate that at least 25% of the homes built must be affordable. The builder however isaware that there is a certain snob factor associated with the executive homes and that if he buildsa site with more than 50% affordable homes then he will have difficulty selling the executive homes.The project carries with it a fixed cost of £1500k which covers the cost of the land, marketing, legal

Page 41: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 36

etc. Additionally each executive home cost him £340k to build and each affordable home £50k. Thesales prices of the two types of home are £500k for an executive home and £70k for an affordable home.

The problem is how many houses of each type should the builder construct in order to maximizehis profit.

Construct ModelLet A stand for the number of affordable homes and E the number of executive homes; clearly thesedecision variables must be non-negative integers. The constraints on the variables are therefore:

• A ≥ 0 and E ≥ 0, A and E integer.

• The site can accommodate 95 plots, thus since each plot can take either one executive home orthree affordable homes the constraint is:

E +A

3≤ 95 ⇒ 3E + A ≤ 285

• Since at least 25% of the total number of homes is to be affordable:

14(E + A) ≤ A ⇒ E ≤ 3A

• The number of affordable homes must must not exceed 50% of the total:

A ≤ 12(A + E) ⇒ A ≤ E

The profit z, in thousands of pounds, is given by:

z = revenue − cost = 500E + 70A− 340E − 50A− 1500 ⇒ z = 160E + 20A− 1500

SolutionInitially the restriction that the variables should be integral is relaxed, thus plotting the equations3E + A = 285, E = 3A and E = A the feasible region is given by the shaded area in Fig.2.8(a).

The optimal points occur at either P or Q which have coordinates P (71.5, 71.25) and Q(28.5, 85.5).

Evaluating z at each of the two points gives z = 11, 325 and z = 12, 750 respectively, thus in therelaxed problem Q is the optimal point.

The temptation at this stage is to just round the coordinates of Q and hopefully obtain the opti-mal integral solution. In this case there are four possible values that can be obtained from rounding.However it must be remembered that the optimal solution for the original problem must:

Page 42: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 37

A

E

3E + A = 285

E = A

E = 3A

P

Q

O

z = 160E + 20A− 1500Q(28.5, 85.5)

(28,86) (29,86) (30,86)

(28,85) (29,85) (30,85)

O

P...........

........

(a) (b)

Figure 2.8: (a) Feaseible region for the relaxed problem shown shaded. (b) The point Q is showntogether with the four nearest point with integer coordinates. Additionally two points with A = 30 arealso shown. The objective function is shown in its optimal position for the relaxed problem, ie passingthrough Q

• Be in the feasible region, which means any point with integer coordinates that lies in the shadedregion.

• Maximizes z

From Fig2.8(b) it is clear that of the four possible results from rounding (ie the four points with integercoordinates surrounding Q), only (29, 85) lies inside the feasible region. At this point z = 12, 680. Tosee if this is indeed the maximum value of z the objective function z = 160E + 20A− 1500 is shownon the diagram passing through the relaxed optimal point at Q. As z is decreased it is clear that thefirst point in the feasible region with integer coordinates that it passes through is (30, 85), which givesz = 12, 700. thus it is this point that is optimal and not the one found by rounding.

ReportTo maximize his profit the builder should build 30 affordable homes and 85 executive homes. Thiswill yield a profit of £12,700k.

RemarksThe above example shows that rounding alone may not yield an optimal solution, indeed it may noteven yield a feasible solution. It will be seen later that the relaxed problem, where the variables arereal, can be solved efficiently using the Simplex method. However any method that deals with integersolutions is going to be fairly complex, this is clear from the fact that such a method has to searchmany more points than those on the boundary of the feasible region for the relaxed problem. As thenumber of variables increases this problem becomes more and more difficult. One way out of thisproblem is to be satisfied by a solution that is obtained by rounding a solution found by an efficient

Page 43: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 38

and reliable algorithm for the relaxed problem. Provided the point selected lies inside the feasibleregion and bearing in mind that the optimum solution can be no better than the optimum solutionobtained for the relaxed problem this may be an acceptable compromise.

2.5 Worksheet 1

1. Inequalities

Graphically display the feasible region defined by the following inequalities:

2x1 + 2x2 ≤ 8 3x1 + 2x2 ≤ 12 x1 + 0.5x2 ≤ 3 x1 ≥ 0, x2 ≥ 0

Maximize z = 3x1 + 2x2 on the feasible region. Which, if any, of the first three inequalities maybe removed without affecting the optimum solution?

2. Inequalities

Consider the following linear programming model:

Maximize the objective function z = 3x1 + 3x2 subject to the constraints:

2x1 + 4x2 ≤ 12 6x1 + 4x2 ≤ 24 x1 ≥ 0, x2 ≥ 0

(a) Find the optimal solution using graphical means.

(b) If the objective function is changed to z = 2x1 + 6x2 what will the optimum solution be.

3. Workload Balancing

The company Snap produces photo printers for both the professional and consumer markets.The Snap consumer division recently introduced two photo printers that provide colour printsrivaling those produced by a professional processing lab. The P100 model can produce a 100mm× 150mm borderless print in 40 seconds. The more sophisticated and faster P150 can evenproduce a 300mm× 500mm print. Financial projections show profit contributions of £42 foreach P100 and £87 for each P150.

The printers are assembled, tested and packaged at Snap’s plant located in New Barnet. Thisplant is highly automated and uses two manufacturing lines to produce the printers. Line 1performs the assemble operation with times of 3 mins per P100 printer and 6 mins per P150printer. Line 2 performs both the testing and packaging operations. Times are 4 mins per P100printer and 2 mins per P150 printer. The shorter time for the P150 is a result of its faster printspeed. Both manufacturing lines are in operation for one 8-hour shift per day.

The problem

Perform an analysis for Snap by consider the following points.

(a) Obtain the best number of units of each type to produce in order to maximize the totalcontribution to profit in an 8 hour shift. What reasons might management have for notimplementing your recommendation?

Page 44: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 39

(b) Suppose that management also states that the number of P100 printers produced shouldbe at least as great as the number of P150 produced? Again assuming that the objectiveis to maximize the total contribution to profit in an 8 hour shift, how many units of eachprinter should be produced?

(c) Does the solution you have in (b) balance the total time spent on Line 1 with that on Line2? Why should this be of concern to management?

(d) Management requested an expansion of the model in (b) that would produce a betterbalance between the total time on Line 1 and that on Line 2. They want to limit thedifference between the time spent on the two lines in the 8-hour shift to be no more than30mins. If the objective is still to maximize the total profit how many units of each printershould be produced? What effect does this work-load balance have on the total profit in(b)?

(e) Suppose that in part (a) management specified the objective as maximizing the total numberof printers produced each shift rather than the total profit contribution. With this objective,how many units of each printer should be produced per shift? What effect does thisobjective have on total profit and workload balance?

4. Production Strategy

Fit-Fit manufactures exercise equipment at its plant in York. It recently designed two universalweight machines for the home exercise market. Both machines use Fit-Fit’s patented technologythat provides the user with an extremely wide range of motion capabilities for each type ofexercise performed. Until now, such capabilities have been available only on expensive weightmachines used primarily by physical therapists.

At a recent trade show, demonstrations of the machines resulted in significant dealer interest.In fact, the number of orders that Fit-Fit received at the trade show far exceeded its manu-facturing capabilities for the current production period. As a result, management decided tobegin production of the two machines. The two machines, which Fit-Fit named Body-Firm andBody-Strong, require different amounts of resource to produce.

Body-Firm consists of a frame unit, a press station and a pec-dec station. Each frame produceduses four hours of machining and welding time and two hours of painting and finishing time.Each press station requires two hours of machining and welding and one hour of painting andfinishing, and each pec-dec station uses two hours of machining and welding time and two hoursof painting and finishing time. In addition two hours are spent assembling, testing and packagingeach Body-Firm unit. The raw material costs £450 for each frame, £300 for each press stationand £250 for each pec-dec station. Packaging costs are estimated at £50 per unit.

Body-Strong consists of a frame unit, a press station, a pec-dec station, and a leg press station.Each frame produced uses five hours of machining and welding time and four hours of paintingand finishing time. Each press station requires three hours machining and welding time andtwo hours of painting and finishing time, each pec-dec station uses two hours of machining andwelding time and two hours of painting and finishing time, and each leg press station requires

Page 45: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 40

two hours of machining and welding time and two hours of painting and finishing time. Inaddition, two hours are spent assembling, testing, and packaging each Body-Strong unit. Theraw material costs are: £650 for each frame, £400 for each press station, £250 for each pec-decstation, and £200 for each leg press station; packaging costs are estimated to be £75 per unit.

For the next production period, management estimates that 600 hours of machining and weldingtime, 450 hours of painting and finishing time, and 140 of assembly, testing, and packaging timewill be available. Current labour costs are £20 per hour for machining and welding time, £15per hour for painting and finishging time, and £12 per hour for assembly, testing, and packagingtime. The market in which the two machines must compete suggests a retail price of £2,400for the Body-Firm unit and £3,500 for the Body-Strong unit, although some flexibility may beavailable to Fit-Fit because of the unique capabilities of the new machines. Authorised Fit-Fitdealers can purchase machines for 70% of the suggested retail price.

Fit-Fit’s President believes that the unique capabilities of the Body-Strong unit can help positionFit-Fit as one of the leaders in high-end exercise equipment. Consequently, he has stated thatthe number of units of Body-Strong produced must be at least 25% of the total production.

The problem

Analyse the production strategy at Fit-Fit as follows:

(a) What is the recommend number of Body-Firm and Body-Strong machines to produce inorder to maximize profit.

(b) How does the requirement that the number of units of Body-Strong produced be at least25% of the total production affect profits?

(c) Where should efforts be expended to increase profits?

2.6 Worksheet 1 - Solutions

1. In Fig. A.1(a) the feasible region is shown hashed. As 3x1 + 2x2 = 12 does not form part of theboundary of the feasible region the constraint 3x1 +2x2 ≤ 12 is redundant and may be removedwithout affecting the feasible region.

The objective function has been plotted with z = 6. As this value of z is increased the objectivefunction moves away from the origin and last intersects the feasible region at P . The point P

therefore is the point at which z attains its maximum.

As P lies on the intersection of 3 = x1 +0.5x2 and 8 = 2x1 +2x2 the coordinates of P are (2, 2).Hence the maximum value of z is z = 3(2) + 2(2) = 10.

2. (a) In Fig. A.1(b) the feasible region is shown hashed. The objective function z = 3x1 + 3x2

is shown plotted with z = 6. As z increases this moves away from the origin and lastintersects the feasible region at B. Calculating the coordinates of B from the intersectionof 6x1 + 4x2 = 24 and 2x1 + 4x2 = 12 gives B(3, 1.5) and hence the maximum value ofz = 3(3) + 3(1.5) = 13.5.

Page 46: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 41

(b) In Fig. A.1(b) the objective function z = 2x1 + 6x2 is shown plotted with z = 12. As z

increases this moves away from the origin and last intersects the feasible region at A whichhas coordinates (0, 3), hence the maximum value of z = 2(0) + 6(3) = 18.

5 5

5 5

x1 x1

x2 x2

.....................................

3x1 + 2x2 = 12(redundant)

z = 6 = 3x1 + 2x2

7

x1 + 0.5x2 = 3

2x1 + 2x2 = 8

7 7

(a) (b)

P ................................................................

..............................

6x1 + 4x2 = 24

2x1 + 4x2 = 12

z = 6 = 3x1 + 3x2

z = 12 = 2x1 + 6x2

µ µ

A

B

Figure 2.9: Feasible regions hashed. Objective functions dotted (a) z = 10 max at P (2, 2)(b) z = 2x1 + 6x2 max at A(0, 3), value 18. z = 3x1 + 3x2 max at B(3, 1.5), value 13.5.

3.

Identify the problem

In this problem the questions to be addressed are listed, however if the problem was just ’inves-tigate’ then a list of such questions would need to be constructed.

A good starting point to try and understand any problem is to collect together the data, in thiscase in the form of a table, as follows:

Type Line 1 Line 2 ProfitP100 3 4 £42P150 6 2 £87

Available 480 480time

Table 2.4: Processing times in minutes per item and profit in £ per item. Total of 480min processingtime available for each type

Formulate the model

Page 47: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 42

Let p1 and p2 denote the number of P100 and P150 printers produced in a given shift.The problem will involve maximizing the profit which is given by z = 42p1 + 87p2.The constraints due to the limitation of production time on each line are:

3p1 + 6p2 ≤ 480, 4p1 + 2p2 ≤ 480 p1, p2 ≥ 0 (2.14)

Carry out Mathematics

(a) The feasible region given by the inequalities in Eq(A.1) is shown in the graph in FigureA.2(a). The objective function is shown with z = 3654 = 42p1 + 87p2. Since it is not clearwhether z is max at A or B we can either evaluate z at these points or compare the gradientof AB with that of z.Coordinates of A are (106 2

3 , 26 23) and give z = 6800.

Coordinates of B are (0, 80) and give z = 6960.Hence the recommendation is to produce eighty P150 in the eight hour shift and none ofthe P100 model. This gives a profit of £6960. This may not be acceptable since it is notgood marketing strategy to only have one product.

(b) For the additional constraint p1 ≥ p2 the new feasible region is show in Figure A.2(b). It isclear in this case that the objective function is maximum at C. The coordinates of C are(53 1

3 , 53 13) and at this point z = 6880

Thus if the company is to produce at least as many P100 models as P150 then they shouldproduce 53 units of each. This will give a little slack in the system and will lead to a profitof £6837.(no rounding analysis carried out)

(c) The production time for line 1 is 3p1 + 6p2 which with p1 = p2 = 53 gives 477mins. Theexact value at C giving 480 which is binding. The production time for line 2 is 4p1 + 2p2

which p1 = p2 = 53 gives 318 mins , showing a considerable amount of slack on this line.(this doesn’t improve much if we use the exact values from the coordinates of C).Clearly therefore the production lines are not balanced and this will lead to idle labourwhich cannot be considered as a good thing.

(d) The idea of a fully occupied workforce and the production of both types of product arenow to be thought more important than just theoretically making a maximum profit. Ahappy workforce and long term sales are obviously important. To this aim the companynow imposes a constraint so that there is no more than 30min difference between the twoproduction lines.Thus the additional constraint is

|(3p1 + 6p2)− (4p1 + 2p2)| ≤ 30 ⇒ |4p2 − p1| ≤ 30 ⇒ −30 ≤ 4p2 − p1 ≤ 30

Thus the feasible region has to also lie between the lines −30 = 4p2− p1 and 4p2− p1 = 30.This is shown in Figure A.3(a)The objective function is now maximum at T which has coordinates (96 2

3 , 31 23) which gives

z = 6815 Without doing any rounding analysis we could suggest they produced 96 P100and 31 P150 to satisfy the added requirements.

Page 48: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 43

12

16

8

24

..................

..................

................

B

A

¸

z = 3654 = 42p1 + 87p2

3p1 + 6p2 = 480

4p1 + 2p2 = 480

(a)

p1

p2

12

16

8

24

..................

..................

................

C

p1 = p2

B

A

¸

z = 3654 = 42p1 + 87p2

3p1 + 6p2 = 480

4p1 + 2p2 = 480

(b)

p1

p2

Figure 2.10: Scale on both axes 1:10

(e) Figure A.3(b) is simply Figure A.2(a) with a different objective line. It is clear that themaximum now occurs at A. The coordinates of A are (106 2

3 , 26 23) and the corresponding

value of z is £6800.Since A lies on both the bounding lines for the availability of time on the two lines theconstraints are binding. Thus the two lines have no slack and hence in balance.

4.

Identify the problem

Again the problem states quite specifically which questions to address. However the problemhas a lot data associated with it, this is best extracted and displayed by forming tables.

Body-Firm Frame Press Pec-Dec TotalMach/Weld(hr) 4 2 2 8Paint/Fin(hr) 2 1 2 5

Ass/Test/Pk(hr) - - - 2Cost(£) 450 300 250 1000+pk=1050

Table 2.5: Construction time and costs for the Body-Firm equipment. Packaging (pk) £50/item

Formulate the model

Page 49: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 44

12

16

8

24

..................

..................

...............

C

p1 = p2

B

A

>

z = 3654 = 42p1 + 87p2

3p1 + 6p2 = 480

4p1 + 2p2 = 480

(a)

p1

p2

T

4p2 − p1 = −30

4p2 − p1 = 30

12

16

8

24

z = 80 = p1 + p2

B

A

3p1 + 6p2 = 480

4p1 + 2p2 = 480

(b)

p1

p2

Figure 2.11: Scale on both axes 1:10

Body-Strong Frame Press Pec-Dec Leg-Press TotalMech/Weld(hr) 5 3 2 2 12Paint/Fin(hr) 4 2 2 2 10

Ass/Test/Pk(hr) - - - - 2Cost(£) 650 400 250 200 1500+pk=1575

Table 2.6: Construction time and costs for the Body-Strong equipment. Packaging (pk) £75/item

Let F and S be the number of Body-Firm and Body-Strong pieces of equipment produced. Usingthe data from Table A.2, TableA.3 and Table A.4 for the amount of resource used to produceeach item and the amount of resource available we can write down the following constraints:

8F + 12S ≤ 600 5F + 10S ≤ 450 2F + 2S ≤ 140 F, S ≥ 0 (2.15)

The profit function is the difference of the cost and the revenue. Bearing in mind that thecompany only gets 70% of the RRP the revenue from selling F and S is given by:

Revenue = 2700× 70%× F + 3500× 70%× S = 1680F + 2450S

The cost of material plus packaging is given by 1050F + 1575S and the cost of labour in thethree construction areas is given by:

Labour Cost = (8F + 12S)20 + (5F + 10S)15 + (2F + 2S)12 = 259F + 414S

Page 50: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 45

Available Labourtime(hr) Costs(£/hr)

Mech/Weld(hr) 600 20Paint/Fin(hr) 450 15

Ass/Test/Pk(hr) 140 12

Table 2.7: Available construction times(hr) and associated labour costs (£/hr)

Thus the Total Cost = 1309F + 1989S

Thus the profit function is given by

Profit = Revenue−Cost = z = 371F + 461S (2.16)

Finnally the requirement that the Body-Strong product is at least 25% of the total productiongives:

S ≥ S + F

4⇒ F − 3S ≤ 0 (2.17)

Thus the problem is to maximize the profit function in Eq(A.3) subject to the constraints ofEq(A.2) and Eq(A.4).

Carry out the Mathematics

(a) From Figure A.4 the dotted objective function is clearly a maximum at A or C. Bycalculating the coordinates of these points we find that z is maximum at A, which hascoordinates (16 2

3 , 50), giving z = 26233 13 . Thus the company should aim to produce 16

Body-Strong and 50 Body-Firm machines. This will yield £25926. (without roundinganalysis)

(b) If the constraint F ≤ 3S is dropped the feasible region is enlarged and becomes the polygonORBACD. z will now be maximum at B or R. Calculating the coordinates of thesepoints and calculating the corresponding values of z the maximum occurs at B which hascoordinates (10, 60) with z = £26870. Thus if the constraint is lifted the company canincrease its profit.

(c) Assuming all constraints are in place, as in (a), then the maximum at A can be increasedby causing A to move away from the origin. This can be done by increasing the effort inthe Machine and Welding department.

Page 51: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 2. LINEAR PROGRAMMING - 2 VARIABLES 46

A

C

D

R

B

F = 3S

F + S = 70

2F + 3S = 150

F + 2S = 90

Assemble/Test

Mech/Weld

Paint/Finish

......

......

......

......

......

......

......

......

......

......

......

.

z = 20000 = 371F + 461S

>

Profit

S

F

70

90

O

Figure 2.12:

Page 52: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Chapter 3

Mathematics of Linear Programming -Geometric Approach

3.1 Introduction

In the RealChoc problem, apart from the non-negative condition, there were only two variables andfour constraints. In general, linear programming problems have n variables and m independent con-straints (hence m ≤ n). This condition may appear to be over restrictive but in any real problem itis usually possible to achieve independent rows by using a linear dependence argument. If this is notpossible then the problem is most likely inconsistent, has an empty feasible region and doesn’t in factrepresent a real problem.

Geometrically the feasible region generated by the constraints in the RealChoc problem was seento be a polygon, the objective function was a straight lines and by moving this line parallel to itselfthe optimum solution was found at a corner of the polygon1.

In a problem with three variables the feasible region becomes a solid region in 3-dimensions boundedby plane sides and the objective function becomes a plane. The optimal points again occur at thecorners of the feasible region. For greater dimensions a geometrical description is not possible andthus has to be replaced with an algebraic structure. However the geometrical terms are retained tohelp with the intuitive interpretation of the mathematics.

3.2 Euclidean Space

In linear programming the constraints and objective function are always linear and thus the naturalmathematical object for describing the problem is a vector space. To extend the geometrical ideas ofangles and lengths this vector space will also have an inner product associated with it.

Definition1It is easy to see that under very special circumstances a whole edge of the feasible polygon may be an optimal position

for the objective function, namely when the straight line of the objective function is parallel to one side of the polygon

47

Page 53: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 3. MATHEMATICS OF LINEAR PROGRAMMING - GEOMETRIC APPROACH 48

The Euclidean space En is defined to be:

• The vector space generated from the set of all n-tuples, (x1, x2 . . . xn) using the usual rulesfor addition and scalar multiplication.

• An associated inner (scalar) product defined by:

(x1, x2, . . . xn) · (y1, y2, . . . yn) = x1y1 + x2y2 + . . . xnyn = (x1, x2, . . . xn)

y1

y2...

yn

Notation

For convenience the column

x1

x2...

xn

will be denoted x.

Since without ambiguity x represents a vector in En we will say that x is in En.With this in mind the inner product can be written as xT y

Length, distance and angles

The length of a vector is defined as: |x| = +√

xT x.

The distance between two vectors x and y is given by |x− y|.For a general inner product the Cauchy-Schwarz inequality states |x · y| ≤ |x||y|. Thus it ismeaningful to define the cosine of the angle θ between two non-zero vectors x and y by:

cos θ =xT y

|x||y| . If xT y = 0 then either the angle between x and y is π2 or at least one of the

vectors is zero. In either case the vectors are said to be perpendicular or orthogonal.

3.3 Lines and Planes

The equation of a line in En is given in a parametric form and can easily be seen to agree with familiarforms in the two and three dimensional cases.

Definition of a Line

A line L through two distinct points x1 and x2 in En is the set of points x in En such that:

x = x1 + λ(x2 − x1) λ ∈ R or equivalently x = (1− λ)x1 + λx2 λ ∈ R

Apart from passing through the two points this line is said to run parallel to (x2 − x1). SeeFig. 3.1.

Definition of a Line Segment

If in the above definition of a straight line the values of λ are restricted to 0 ≤ λ ≤ 1 then thisresults in the line segment between x1 and x2, namely AB in Fig. 3.1.

Page 54: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 3. MATHEMATICS OF LINEAR PROGRAMMING - GEOMETRIC APPROACH 49

x1

x2

(x2 − x1)x

P

O

A

B

L

Figure 3.1: From OP = OA + AP = OA + λAB, and AB = AO + OB = −OA + OB = (−x1 + x2) thus theequation of L is given by x = x1 + λ(x2 − x1). If 0 ≤ λ ≤ 1 this line is reduced to the lines segmentAB

The objective function is given by z = c1x1 + c2x2 + . . . cnxn which in the above notation can bewritten as z = cT x. In two dimensions this equation reduces to z = c1x1 + c2x2, which is the equationof a straight line, and in three dimensions it gives z = c1x1 + c2x2 + c3x3, which is the equation of aplane. This idea is generalized as a hyperplane as follows:

Hyperplane

For a given z and c1, c2 . . . cn not all zero, the set of points x ∈ En such that z = c1x1 + . . . cnxn

is called a hyperplane in En.

In the RealChoc problem the objective function was a straight line which was considered to moveparallel to itself in order to locate the optimal point. To capture this idea for a hyperplane the followgeneral definitions are made.

Normal to Hyperplane

Consider two points x1 and x2 on the hyperplane z = cT x, that is to say z = cT x1 and z = cT x2

which, by subtraction, implies that 0 = cT (x2 − x1). Thus c is orthogonal to (x2 − x1).

By definition the vector (x2− x1) is parallel to the line though the two points , also it is easy todeduce2that the line through x1 and x2 lies in the hyperplane. Thus since this is true for any twopoints on the hyperplane it is reasonable to describe c as being orthogonal to the hyperplane.The vector c is also referred to as the normal to the hyperplane.

Two hyperplanes cT x = z0 and c′ T x = z1 are said to be parallel if and only if there exist aλ 6= 0 such that c = λc ′.

2To see that the line lies in the hyperplane:

x = x1 + λ(x2 − x1) ⇒ cT x = cT x1 + λ(cT x2 − cT x1) = z + λ(z − z) = z

Thus all the points on the line lie in the hyperplane.

Page 55: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 3. MATHEMATICS OF LINEAR PROGRAMMING - GEOMETRIC APPROACH 50

Moving Hyperplane

By definition the translation of a point x0 to a point x in the direction of a vector c means that

x = x0 + λc for some λ > 0.

If x0 is a general point on the hyperplane cT x0 = z0 then translating x0 in the direction of thenormal c implies:

cT x = cT x0 + λcT c = z0 + λ|c|2 = z1 > z0

Thus with z1 > z0 the hyperplane cT x = z1 is said to be a translation of cT x = z0 in the directionof the normal c. Since hyperplanes with the same normal are parallel this process can also bethought of as moving the original hyperplane parallel to itself in the direction of the normal.Note that if z0 > z1 then λ < 0 and the hyperplane is moved in the opposite direction to thenormal. (See Fig. 3.2)

6

..........

...

x0 cT x = z0

hyperplanek

normal cx = x0 + λc

A

O

P

....

.

θ

....

.

Figure 3.2: The point A on the hyperplane is moved parallel to the normal c to the point P given byx = x0 + λc, λ > 0. If λ < 0 then P moves below the plane in the direction of −c

Finally it is shown that the distance (ie minimum distance) of the hyperplane from the origin isgiven, in the case z ≥ 0, by z/|c|. Consider a point x0 on the hyperplane and let θ be the anglebetween x0 and c Fig. 3.2, thus:

cT x0 = z ⇒ |c||x0| cos θ = z ⇒ |x0| = z

|c| cos θ

Clearly |x0| is a minimum when θ = 0 hence establishing the result. Additionally since θ = 0the direction of the shortest path x0 is parallel to the normal c.

Dividing Hyperplane

The hyperplane cT x = z divides En into three disjoint parts:

H+ given by cT x > z, H given by cT x = z and H− given by cT x < z

The spaces H+ and H− are referred to as open3 half spaces. If the strict inequalities in H+

and H− are replaced with ≥ and ≤ respectively they become closed3 half spaces and in thiscase H = H+ ∩H−.

Page 56: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 3. MATHEMATICS OF LINEAR PROGRAMMING - GEOMETRIC APPROACH 51

Finally it is worth noting that a hyperplane is a closed3 set in En, indeed this is an extremecase of a closed set where every point is a boundary point. The proof of this statement is notgiven here but can be found in [7] Ch6. p201.

3.4 Convex Sets

The hyperplane has been used to describe a general linear objective function, attention is now turnedto a general description of the feasible region.

Definition of Convex Set

A set X ⊆ En is a convex set if for any x1 and x2 in X the line segment joining x1 to x2 liesentirely in X.

Symbolically:

x1, x2 ∈ X ⇒ x = (1− λ)x1 + λx2 ∈ X for all λ, 0 ≤ λ ≤ 1

Roughly speaking convex set have no holes or inlets with their boundaries bulging outwards.See Fig.3.3 for an example in E2.

X

x1

x2

Part of line segmentlies outside X

Not convex Convex

All line segmentstay inside X

X

(a) (b)

Figure 3.3: Clearly in (a) it is possible to select two points such that the line segment between themhas points outside of X. To avoid this the edges of the set must ”bulge” outwards as seen in (b)

Convex Combination

If x ∈ En is a linear combination of x1, . . . xm then x = c1x1 + . . . cmxm. If additionally thecoefficients are non-negative and their sum equals 1, that is to say

∑mi=1 ci = 1 and ci ≥ 0, then

the combination is referred to as a convex combination of x1, . . . xm. Clearly a line segment isa convex combination of x1 and x2.

3An ε-neighbourhood of a point a ∈ En is the set of all points x ∈ En such that |x − a| < ε. A point x in a setX ⊆ En is an interior point of X if there exists a ε-neighbourhood about x contained entirely in X. A point y is aboundary point of X if every ε-neighbourhood of y contains points both in X and not in X. Open sets are sets thatconsist entirely of interior points and closed sets are sets that contain all their boundary points. See [8] Ch6, p192

Page 57: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 3. MATHEMATICS OF LINEAR PROGRAMMING - GEOMETRIC APPROACH 52

Properties of convex sets

Convex sets have the following properties: (for complete proofs see [7] Ch.6. p203, 204)

• A Hyperplane is a closed convex sets.

As already stated hyperplanes are closed sets.To show that a hyperplane is a convex set consider two points x1 and x2 on thehyperplane cT x = z. This implies that cT x1 = z and cT x2 = z. It is thereforenecessary to show that the line segment joining these two points lies entirely in thehyperplane.A general point on the line segment is given by

x = (1− λ)x1 + λx2, 0 ≤ λ ≤ 1

Thus:

cT x = c{(1− λ)x1 + λx2} = (1− λ)cT x1 + λcT x2 = (1− λ)z + λz = z

This establishes that any point on the line segment is also on the hyperplane. Thusthe hyperplane is convex.

• A half space (open or closed) is a convex set.

• The intersection of a finite number of convex sets (possible mixture of open and close) isconvex.

• The intersection of a finite number of closed convex sets is a closed convex set.

Feasible Region Closed Convex Set

In the RealChoc example of Chapter 2 the feasible region was determined by four constraintinequalities on resources and two non-negative restrictions on the variables. For example theconstraint on the availability of cocoa was x1+4x2 ≤ 40 which is clearly a closed half space in E2.Similarly all the other constraints on the ingredients are closed half spaces. The non-negativeconstraints on the variables, x1 ≥ 0 and x2 ≥ 0, are also closed half spaces.

In a general linear programming problem the constraints always consist of a linear combinationof the variables. However some of the constraints may involve a less than or equals sign, somemay involve a greater than or equals sign and some may simply be equations. In any of thesecases the individual constraint is a closed convex set. The feasible region is determined by solvingall the constraints simultaneously, which is therefore the equivalent of forming the intersectionof closed convex sets. The properties of convex sets from above imply that the feasible regionis a closed convex set.

3.5 Extreme Points

In the RealChoc problem the optimum point was found to be at one of the corners of the feasibleregion. As in general the feasible region is a closed convex set it is necessary to define the generalization

Page 58: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 3. MATHEMATICS OF LINEAR PROGRAMMING - GEOMETRIC APPROACH 53

of such points. The points corresponding to the corners are referred to as extreme points and definedas follows:

Definition of Extreme Point

A point x in a convex set X is said to be an extreme point of X if it is not possible to find twodistinct points x1 and x2, both in X, such that for some λ in the interval 0 < λ < 1,

x = (1− λ)x1 + λx2

Geometrically this is saying that x is an extreme point if it is not on a line segment between twoother points. In Fig. 3.4 the point A is an extreme point since it clearly does not lie on a line

A

EB

x1

x2C

Convex Set XO D

Figure 3.4:

segment between two points in X. Similarly the points at O, B and D are also extreme points.On the other hand the point at C can be seen to lie on many line segments between points inX and hence is not an extreme point. Finally observe that even though the point E is on theboundary of X it is not an extreme point since it is on the line segment joining A to B.

3.6 Supporting Hyperplane

In the two dimensional problem it was seen that at the optimal position the objective function passedthrough one of the corners of the polygon of feasible solutions with the polygon lying entirely on oneside of the line. Additionally the corner points clearly all lie on the boundary of the feasible polygon.

In general any hyperplane that passes through a boundary point of a convex set such that all ofthe convex set lies on one side of the hyperplane, that is to say is in one of the half spaces formed bythe hyperplane, is called a supporting hyperplane. Formally the definition is:

Definition of supporting hyperplane

Let w be a boundary point of a convex set X. Then the hyperplane H defined by cT x = z iscalled a supporting hyperplane at w if:

• w is on H, that is to say cT w = z.

Page 59: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 3. MATHEMATICS OF LINEAR PROGRAMMING - GEOMETRIC APPROACH 54

• All of X lies in one closed half space defined by H.

That is to say either cT u ≤ z for all u ∈ X or cT u ≥ z for all u ∈ X.

A

B

O

C

D

E

P

Q

S

Figure 3.5: Feasible polygon X = OABCDE. Two supporting hyperplanes at B. One supportinghyperplane through P that contains many points of X since it lies along ED and a hyperplane thoughP that isn’t supporting.

Fig. 3.5 show two supporting hyperplanes at B. That is B is a boundary point lying on each ofthe lines and the rest of X is below each of these lines.

The straight line along ED is a supporting hyperplane at any point along ED since the wholeof X is either on or above this line.

The hyperplane QS through the boundary point P is clearly not a supporting hyperplane sincepart of X is above the line QS and part below.

Theorem 3.1 If w is a boundary point of a closed convex set then there exists at least one supportinghyperplane at w

This theorem is not used explicitly in these notes but as it can be seen it grantees the existence ofsupporting hyperplanes at boundary points. Though this result is obvious in 2-dimensions it is notso in general. The proof, which is far from trivial and not in the scope of this course can be found inRef.[7] Ch.6 p212.

3.7 Optimal Position

With the above definitions and theory it is now possible to establish the optimum position of theobjective function in the general case. This does of course turn out to be nothing more than theextreme points defined above; the power of the argument is in the generalization and how this leadsto a method of solution known as the Simplex Method.

Page 60: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 3. MATHEMATICS OF LINEAR PROGRAMMING - GEOMETRIC APPROACH 55

Optimal hyperplane is a supporting hyperplane.

For definiteness consider the argument of maximizing an objective function (the minimizationproblem is similar). In such a case the objective hyperplane z = cT x is moved parallel to itselfuntil z is as large as possible whilst still having at least one point both on the hyperplane andin the convex set X of feasible solutions.

Assuming that there exists such a point given by x = a , it is now shown that the maximalhyperplane zmax = cT x, where zmax = cT a, is a supporting hyperplane for X through a.

The following steps give the result:

• By construction a lies on the hyperplane and is in X.

• Also by construction of the hyperplane zmax ≥ cT x for all x ∈ X. That is to say X is in aclosed half space of the maximal hyperplane.

• To show that a is a boundary point of X it is shown that it can not be an interior point ofX.

Assume that a is an interior point of X. Since it is an interior point of X thereexists an ε-neighbourhood about a contained entirely in X. (See Fig. 3.6 for a twodimensional representation of the following)That is to say:

there exists ε > 0 such that |x− a| < ε ⇒ x ∈ X. (3.1)

Consider the point x1 defined by:

x1 = a +ε

2c

|c| ⇒ x1 − a =ε

2c

|c| ⇒ |x1 − a| =∣∣∣∣ε

2c

|c|

∣∣∣∣ =ε

2

Hence x1 satisfies Eq(3.1), thus x1 is in X.However

x1 = a +ε

2c

|c| ⇒ cT x1 = cT a +ε

2cT c

|c| = zmax +ε

2|c| = z1 > zmax

Thus x1 is both a point in X and a point on the hyperplane cT x = z1 withz1 > zmax. This contradicts zmax being the largest value of cT x for all points inX.Thus the original assumption that a is an interior point is false and thus a mustbe a boundary point

This completes the proof that a maximal hyperplane is a supporting hyperplane.

Theorem 3.2 A closed convex set which is bounded from below has extreme points in every supportinghyperplane.

Page 61: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 3. MATHEMATICS OF LINEAR PROGRAMMING - GEOMETRIC APPROACH 56

εA

convex setX¼

x1

a

)

ε

2c

|c|

P

C

Figure 3.6: The inside of the circle C, radius ε about A, is the ε-neighbourhood about A. The pointP is constructed and shown to be inside the circle. The text produces the contradiction that the valueof cT x at P is greater than its maximum value on the whole of X. Since the argument is based on Abeing an interior point then A must be on the boundary of X.

The proof of this this theorem is beyond the scope of the course4, however it is central to the devel-opment of the Simplex method and solution of the linear programming problem.

What this theorem gives is that if the value of z is evaluated at every extreme point then an optimalsolution will be found. The only requirement on the closed convex set (feasible region X ) is that itshould be bounded below. In linear programming the variables are arranged to be non-negative5, thusx ≥ 0 for all x in X, which means X is bounded from below by 0.

3.8 Conclusion

In the two dimensional problem with four constraints provided by the RealChoc example, the optimalsolution was found by geometric/graphical means. This chapter has shown how geometrically a linearprogramming problem can be extended into n-dimensions with m-constraints.

In the generalized picture the feasible region defined by the constraints becomes a closed convexset and the objective function an hyperplane. A corner of the feasible polygon in 2-dimensions isreplaced with the concept of an extreme point. Also the idea of moving a line parallel to itself isreplaced with the idea of moving one hyperplane parallel to itself.

The optimum point, if it exists, occurs at an extreme point. As described later the Simplex Method4See Ref.[7] Ch.6 p215 for proof5See Sec.4.1 of chapter 4 for standardization of problem

Page 62: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 3. MATHEMATICS OF LINEAR PROGRAMMING - GEOMETRIC APPROACH 57

will work its way from one extreme point to another ensuring at each move z improves6. Eventuallythe extreme point that gives the optimum z is reached since, as it can be shown, there are only a finitenumber of extreme points.

The problem that remains is how, algebraically and numerically, is it possible to move from oneextreme point to the another in the optimum fashion described above. Chapter 4 describes how tocalculate the position of an extreme points and how to move from one to another. It is not until theSimplex method in Chapter 5 that the optimization of each move is considered.

6Improves means z increase for a maximization problem, decreases for minimization problem

Page 63: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Chapter 4

Mathematics of Linear Programming -Algebraic Approach

4.1 Standardized Form

Before solving a linear programming problem using the Simplex Method the problem is written inthe following standardized or canonical form. The inequalities are replaced with equations at theexpense of increasing the number of variables, but not at the expense of the feasible set not remaininga closed convex set bounded from below. This will mean that all the theory of Chapter 3 is stillrelevant and it will still be the extreme points that are to be found.

General linear programming problem.

• Maximize or Minimize z = cT x, where c and x are N × 1 column vectors

• Subject to the constraints

(i)Ax {≤=≥} b

where A is an m×N matrix with m independent rows.b is an N × 1 column{≤=≥} indicates that one of the three is used in each row.

(ii) x ≥ 0

By introducing more variables this can be rewritten using only equals signs.

Standardized linear programming problem

• Maximize or Minimize z = cT x, where c and x are now n× 1 column vectors

• Subject to the constraints:

58

Page 64: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 59

(i)Ax = b

Where now A is an m× n matrix with m independent rows andb is an n× 1 column

(ii) x ≥ 0, b ≥ 0

4.2 Reduction to Standard Form

The following example illustrates how a linear programming problem with three variables and inequal-ity constraints is replaced by one in standard form with seven variables.

Example 4.1

Maximize z = c1x1 + c2x2 + c3x3 subject to

2x1 + 3x2 ≤ 24 (i) x1 + x2 ≥ 5 (ii) 4x1 − x2 ≤ −6 (iii) x1 + 2x2 + x3 ≤ 4 (iv)

With x1, x2, x3 ≥ 0.

The process now introduces more non-negative variables in order to transform the problem into stan-dard form.

For (i) introduce the slack variable s1 ≥ 0 such that

2x1 + 3x2 + s1 = 24

For (ii) introduce the surplus variable s2 ≥ 0 such that

x1 + x2 − s2 = 5

Rewrite (iii) and introduce s3 ≥ 0 such that

−4x1 + x2 − s3 = 6

For (iv) introduce s4 ≥ 0 such that

x1 + 2x2 + x3 + s4 = 4

The problem can now be written in the form Ax = b where A is a 4× 7 matrix, b a 3× 1 column andx an 7× 1 column such that x ≥ 0. Explicitly this is:

2 3 0 1 0 0 01 1 0 0 −1 0 0

−4 1 0 0 0 −1 01 2 1 0 0 0 1

x1

x2

x3

s1

s2

s3

s4

=

24564

Page 65: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 60

The objective function z is now written as:

z = c1x1 + c2x2 + c3x3 + 0s1 + 0s2 + 0s3 + 0s4 = cT x

where cT = (c1, c2, c3, 0, 0, 0, 0).

4.3 Equivalent Optima

Before proceeding further it is necessary to establish an equivalence between the original linear pro-gramming problem and its standardization. That is shown below case that an optimum point in theoriginal problem corresponds to an optimum point in the standard problem and vice versa.

Firstly consider an optimum point in the original problem given by x = a and zopt = cT a. Bythe construction of the slack and surplus variables the vector1{a, s} is a solution of the normalizedproblem. This will yield the same value for the objective function in the normalized problem as in theoriginal problem since in the normalized objective function the coefficients of s are all zero. If {a, s} isnot an optimal solution of the normalized problem then assume {a∗, s∗} gives an improved value, zimp,for the normalized objective function. Again by the construction of the normalized problem x = a∗

will be in the feasible space of the original problem hence yielding z = cT a∗. As mentioned above thez values are the same for both problems thus cT a∗ = zimp which contradicts zopt being the optimalvalue for the original problem. Thus no such a∗ can exist and hence {a, s} is the optimal solution inthe standardized problem with z value equal to zopt.

The converse follows in a similar fashion showing that to an optimum point in the standardizedproblem there corresponds an optimum point in the original problem.

4.4 Unrestricted variables

In the general linear programming problem the variables are always assumed to be non-negative.In most problems this is the case, however it can occurs that some or even all the variables areunrestricted. That is to say they are allowed to take negative and positive values. One might thinkof this as being the most general linear programming problem. Again with the introduction of morevariables the problem can be rewritten in the general form and then in the standardized form. Thefollowing simple example illustrates this process.

Example 4.2

Maximize z = c1x1 + c2x2 + c3x3 subject to

x1 + x2 + x3 ≤ 24 (i) x1 + 2x2 + 3x3 ≥ 5 (ii)

With x1, x2 ≥ 0 and x3 unrestricted.

1s denotes a vector column formed from the slack and surplus variables s1, s2 . . . etc and {a, s} denotes a columnwith the first set of elements given by a and the remainder by s

Page 66: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 61

Since x3 is unrestricted replace it with x3 = x+3 − x−3 , with x+

3 , x−3 ≥ 0. The inequalities (i)and (ii) become:

x1 + x2 + x+3 − x−3 ≤ 24 x1 + 2x2 + 3x+

3 − 3x−3 ≥ 5

Introducing slack variable s1 and surplus variable s2 gives:

x1 + x2 + x+3 − x−3 + s1 = 24 x1 + 2x2 + 3x3 − 3x−3 − s2 = 5

The objective function z is replaced with z = c1x1 + c2x2 + c3x+3 − c3x

−3 + 0s1 + 0s2

Thus in matrix form the problem is to maximize:

cT x = (c1, c2, c3,−c3, 0, 0)

x1

x2

x+3

x−3s1

s2

subject to Ax =(

1 1 1 −1 1 01 2 3 −3 0 −1

)

x1

x2

x+3

x−3s1

s2

=(

245

)

and the non-negative condition on all the variables.

Using a similar argument to that of Sec.4.3 above, it can be shown that replacing the unrestrictedvariable with the difference of two non-negative variables has no affect on the problem.

The following is a novel example of how it may be necessary to introduce an unrestricted variablewhen forming a linear programming problem.

Example 4.3

TopSide burger restaurant is based on selling two types of burger, all meat and cheese. Assume theysell x1 all meat and x2 cheese in a given day. The all meat burgers use 150g of meat whereas thecheese burger uses only 100g of meat.

The standard daily delivery of meat is 100kg, though more can be ordered subject to an additionaldelivery charge of 20p/kg.

They never sell more than 1000 burgers a day and any meat left over is discarded and not car-ried forward.

If the all meat burger makes 50p profit and the cheese burger 40p, what is the best production strategy.

The maximum sales of 1000/day gives:

x1 + x2 ≤ 1000 ⇒ x1 + x2 + s1 = 1000

The amount of meat available is either limited to 100 kg/day or if they decide to order more it isgreater than 100kg. This gives two possibilities:

0.15x1 + 0.1x2 ≤ 100 (a) or 0.15x1 + 0.1x2 ≥ 100 (b)

Page 67: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 62

Introducing an unrestricted variable x3 these two equations can be written as one equation:

0.15x1 + 0.1x2 + x3 = 100

with (a) corresponding to x3 ≥ 0 and (b) corresponding to x3 ≤ 0. Thus setting x3 = x+3 − x−3 gives:

0.15x1 + 0.1x2 + x+3 − x−3 = 100

In solving the problem it will become evident that at least one of x+3 or x−3 is zero, (see below) thus

the objective function can be made to account for the extra delivery charge that occurs in case (b).Thus

z = 0.5x1 + 0.4x2 − 0.2x−3

In matrix form the problem is now to maximize z = cT x such that:

(1 1 1 0 0

0.15 0.1 0 1 −1

)

x1

x2

s1

x+3

x−3

=(

1000100

),

where cT = (0.5, 0.4, 0, 0, −0.2)T

As we shall see later the linear dependence of the last two columns of the matrix above impliesthat at least one of x+

3 or x−3 is zero at the optimum solution.

4.5 RealChoc in Standard Form

Before continuing with the mathematical development of the subject, a fresh look at the RealChocproblem will prove useful to indicate which aspects of solving sets of simultaneous equations to consider.

Introducing the slack variables s1 . . . s4 for the RealChoc problem in Ex(2.1) the inequalities become:

4x1 + x2 + s1 = 40

3x1 + 2x2 + s2 = 35

2x1 + 3x2 + s3 = 35

x1 + 4x2 + s4 = 40 (4.1)

with all variables non-negative; the objective function to be maximized is now:

z = 5x1 + 4x2 + 0s1 + 0s2 + 0s3 + 0s4

As seen in Chapter 2 the optimal point occurred at the intersection of two of the bounding lines atthe point C in Fig. 2.1,(also in Fig. 4.1) which is the intersection of 3x1 +2x2 = 35 and 2x1 +3x2 = 35;that is to say the four equations have been solved with s2 = s3 = 0. In general one could locate all

Page 68: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 63

C

B

A

P

D

E

QR

S

TU

10

s1 = 0s2 = 0

s3 = 0

s4 = 0

All si > 0

x1 + 4x2 = 40

2x1 + 3x2 = 35

3x1 + 2x2 = 354x1 + x2 = 40

=

¼

i*

4

8

4 8 10

Figure 4.1:

the points of intersection of the boundary lines, including the x1 and x2 axes, and calculate the valueof z at each point; thus identifying where z is a maximum. In practice the coordinates of such pointsare obtained by setting in turn two of the variables equal to zero and then solving the four equationsfor the four remaining variables. However this approach will not always give us points that lie in thefeasible region. For example the point Q is obtained by setting s4 = s2 = 0. Solving the remainingequations gives s3 < 0, thus Q is outside the feasible region. In Fig. 4.1 this can be seen to be thecase since Q is above the line BC on which s3 = 0.

To evaluate all the points of intersection can be extremely wasteful as many of the points will lieoutside the feasible region. However this does give an upper bound on the amount of work involved,since each point of intersection is evaluated by setting two of the six variables equal to zero which canbe done in 6C2 = 15 ways. As seen, in the present problem, only six of these are feasible.

In general when solving the standard form Ax = b, where A is m × n, (n − m) of the variablesare set equal to zero. The m equations are then solved for the remaining m unknowns. This can bedone in nCn−m = nCm ways, which for a typical linear programming problem can be extremely largeand hence computationally prohibitive. To reduce the amount of computation the Simplex methodwill ensure that only such points that are feasible are calculated.

Finally it remains to show that the feasible points obtained by putting (n −m) of the variablesequal to zero correspond to the extreme points of the feasible region, since it is at these points that

Page 69: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 64

z is optimum. Before doing this in Sec.4.7 the solution of sets of simultaneous equations is reviewedand a formal definition of ”basic solution” given.

4.6 Solution of Simultaneous Equations

The general problem is to solve the equation Ax = b where A is an m × n matrix; the solutionsthat also satisfy x > 0 are the ones that are of interest in linear programming. Additionally linearprogramming the restriction that A has m independent rows is also imposed.

4.6.1 Unique Solution

If A is an m ×m matrix then the equation Ax = b will have a unique solution if A has an inverse;namely x = A−1b. An alternative way of looking at Ax = b is to consider b as a linear combination ofthe columns ai of A:

Ax = b ⇒ x1a1 + x2a2 + . . . xmam = b.

The columns of A are m× 1 and if they are linearly independent then they form a basis for Em. Thevector b is also an m× 1 column and thus is an element of Em.

Thus the expansion of b in terms of the columns of A is not only possible but unique.

4.6.2 Non-Unique Solution

If the columns of A are not independent then it may happen that there are no solutions to the equation.In terms of vector spaces this occurs if b is not in the subspace of Em spanned by the columns of A.Alternatively there may exist a solution, in such a case there will be an infinite number of solutions.This follows from the fact that if a vector is expressed in terms of a set of dependent vectors then analternative combination can always be found.

4.6.3 Row Reduction

The simple method of row reduction is used to analyse and solve sets of simultaneous equations. Thekey property when row reducing a set of equations is that the solution space stays the same underthe transformations. That is to say after carrying out any one of the elementary row operations thesolution to the transformed problem is the same as the original problem.Recall the elementary row operations are:

• Multiply any row by a non-zero quantity.

• Interchange any two rows.

• To any row add or subtract any multiple of any other row.

Example 4.4 Solve the equations:

x1 − x2 + 2x3 = 4, 2x1 − x2 + x3 = 3.

Page 70: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 65

Writing the question in terms of matrices the problem becomes, solve:

(1 −1 22 −1 1

)

x1

x2

x3

=

(43

)(4.2)

Or in the alternative description find x1, x2 and x3 such that:

x1

(12

)+ x2

( −1−1

)+ x3

(21

)=

(43

)(4.3)

To row reduce first write Eq(4.2) in augmented form:(

1 −1 2 42 −1 1 3

)row 2− 2 row 1

−→(

1 −1 2 40 1 −3 −5

)row 1 + row 2

−→(

1 0 −1 −10 1 −3 −5

)

Using the final augmented matrix the problem now is, find x1, x2 and x3 such that:

x1

(10

)+ x2

(01

)+ x3

( −1−3

)=

( −1−5

)(4.4)

The row reduction process produces as many columns as possible consisting of distinct standardbasis elements, that is to say columns consisting of a single 1 and the rest zeros. From Eq(4.4)it is possible to write down the solutions. However as indicated in Sec.4.5, in a problem wherethere are three variables and 2 independent rows a solution with one of the variables equal tozero would be sought.

Thus setting x3 = 0, Eq(4.4) immediately gives x1 = −1 and x2 = −5. Taking other values ofx3 will yield other values of x1 and x2. In general it is possible to write out the solution using x3

as a parameter as: x1 = −1 + x3 and x2 = −5 + 3x3. However it is the first form, with x3 = 0,that is of interest in linear programming.

4.6.4 Change of Basis Matrix

In terms of vector spaces the process has utilized the first two columns of A as a basis for the vectorspace E2 and then found the expansion of the righthand side Eq(4.3) in terms of this basis.

Indeed having decided to use the first two columns of A the problem is that of solving:

x1

(12

)+ x2

( −1−1

)=

(43

)or equivalently

(1 −12 −1

) (x1

x2

)=

(43

)

Let B =(

1 −12 −1

)denote the choice of basis matrix. Thus

(x1

x2

)= B−1

(43

).

Since B−1

(1 −12 −1

)=

(1 00 1

)then B−1

(12

)=

(10

)and B−1

( −1−1

)=

(01

)

Page 71: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 66

To see this process in terms of the columns of the augmented matrix (A|b) apply B−1 to Eq(4.3) togive:

x1B−1

(12

)+x2B

−1

( −1−1

)+x3B

−1

(21

)= x1

(10

)+x2

(01

)+x3B

−1

(21

)= B−1

(43

)

In general after row reduction:

• The columns of the augmented matrix are equal to B−1 acting on the columns of the originalaugmented matrix.

• The columns that were chosen to use as a new basis are transformed to the standard orderedbasis.

• The transformation of the final column gives the coordinates of b relative to the chosen basis.

• The variables corresponding to the other columns form parameters for the solution set or in thecase of linear programming are set equal to zero.

4.6.5 Row Reduction and the Inverse

The standard method of finding the inverse of a matrix by row reduction is to simultaneously carryout the same row operations on the identity matrix. The following example illustrates how this works:

Example 4.5 Write the equations

x1 + x2 + x3 = 3 x1 − 2x2 + x3 = 0 2x1 + x2 − x3 = 2

in the form Ax = b and by row reduction obtain the inverse of the matrix and hence write down thesolution for x.

In the matrix form Ax = b = Ib:

1 1 11 −2 12 1 −1

x1

x2

x3

=

302

=

1 0 00 1 00 0 1

302

(4.5)

The first row operations are to subtract row(1) from row(2) and 2 row(1) from row(3). Doing this justto the matrix A and the identity I gives:

1 1 10 −3 00 −1 −3

x1

x2

x3

=

1 0 0−1 1 0−2 0 1

302

=

3−3−4

(4.6)

Note how this is equivalent to the standard method of solving equations using row reduction. That isto say equivalent to forming the augmented matrix (A|b) and carrying out the same row operations.This can be seen by comparing Eq(4.6) with the following:

(A|b) =

1 1 1 31 −2 1 02 1 −1 2

row 2− row 1row 3− 2 row 1

−→

1 1 1 30 −3 0 −30 −1 −3 −4

Page 72: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 67

The standard way of displaying this is to write down A and I in the single matrix form (A|I) andthen row reduce.

1 1 1 1 0 01 −2 1 0 1 02 1 −1 0 0 1

row 2− row 1row 3− 2 row 1

−→

1 1 1 1 0 00 −3 0 −1 1 00 −1 −3 −2 0 1

−1

3 row 2−→

1 1 1 1 0 00 1 0 1

3 −13 0

0 −1 −3 −2 0 1

row 1− row 2row 3 + row 2

−→

1 0 1 23

13 0

0 1 0 13 −1

3 0

0 0 −3 −53 −1

3 1

−13 row 3−→

1 0 1 23

13 0

0 1 0 13 −1

3 0

0 0 1 59

19 −1

3

row 1− row 3−→

1 0 0 19

29

13

0 1 0 13 −1

3 0

0 0 1 59

19 −1

3

= (I|B)

Thus the original set of equations in Eq(4.5) become:

Ix = Bb ⇒ x = Bb

Thus the equation Ax = b has been written as x = Bb therefore A−1 = B and:

x = A−1

302

=

19

29

13

13 −1

3 059

19 −1

3

302

=

111

Clearly this method will only produce the inverse of an n× n matrix A if it is possible to row reduceA to the n× n identity I.

4.6.6 Basic Solution

Consider now the solution of Ax = b, where A is m × n, m ≤ n and has m independent rows. Thefirst thing to note is the following theorem from matrix theory:

Theorem 4.1

The number of independent rows2 of a matrix A is equal to the number of independent columns3 of A.

This means that the matrix A considered in the text also has m independent columns. The onlyproblem that may occur is that it can be difficult to see which m columns are independent.

Definition - Basic Solution

A basic solution is formed by selecting m independent columns and then setting the variablesassociated with the other (n−m) columns equal to zero. The problem with just the m variables

2The number of independent rows of A is called the row rank of A3The number of independent columns of A is called the column rank of A

Page 73: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 68

associated with the m independent columns is then solved; as mentioned in Sec.4.6.1 this solutionwill be unique.

The value of x thus obtained is called the basic solution associated with the m independentcolumns.

The variables associated with the independent columns are called the basic variables

The (n−m) variables that are set equal to zero are called the non-basic variables.

If any of the basic variables are zero then the basic solution is said to be degenerate.

Example 4.6 Find all the basic solutions to the equations in Ex(4.4)

Using Eq(4.3) the equations can be written as:

x1

(12

)+ x2

( −1−1

)+ x3

(21

)=

(43

)(4.7)

In Ex(4.4) the basic solution was obtain by selecting the first two columns and hence settingx3 = 0. This gave x1 = −1, x2 = −5 and x3 = 0.

Select different columns.

Recalling that it is only necessary to select two independent columns to create a basic solution,select the first and last columns. It will now therefore be necessary to row reduce the augmentedmatrix so that the first and last column are distinct elements of the standard ordered basis.

Make column(1) =(

10

)and column(3) =

(01

).

(1 −1 2 42 −1 1 3

)row 2− 2 row 1

−→(

1 −1 2 40 1 −3 −5

)row 1 +

23row 2 −→

(1 −1

3 0 23

0 1 −3 −5

) −13 row 2−→

(1 −1

3 0 23

0 −13 1 5

3

)

Rewrite the solution:

x1

(10

)+ x2

( −13

−13

)+ x3

(01

)=

(2353

)

Thus with x2 = 0 the basic variables x1 and x3 are given by x1 = 23 and x3 = 5

3 .

Repeating the process, but selecting column(2) and column(3), gives the basic solution x1 = 0, x2 = −2and x3 = 1.

Page 74: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 69

4.7 Extreme Points and Basic Feasible Solutions

This section formally relates the geometric picture of convex sets and extreme points with the algebraicapproach of simultaneous equations and basic solutions. In word the statement is:

’To each extreme point there exists a basic feasible solution and to each basis feasiblesolution there exist a unique fixed point’.

This guarantees that by visiting each basic feasible solution in tern the extreme point correspondingto the optimum solution will be reached.

Theorem 4.2

Given A is an m× n matrix with m independent rows, let x be a basic feasible solution of

Ax = b x ≥ 0 (4.8)

The vector x is an extreme point in the closed convex space X defined by Eq(4.8).

Proof

Since x is a basic feasible solution (n−m) of its components are zero, hence reorder the variablesuch that x = {xB, 0}, where the curly brackets indicate a column vector4.

As a consequence of this reordering of the variables some of the columns of A will need to beinterchanged. A is then written as A = (B, C), where B is m×m, C is m×(n−m) and BxB = b.

To show that x is an extreme point it is necessary to show that it is not on any line segmentcontained in X. The following is a proof by contradiction.

• Assume, in X, that x lies between the two points x1 and x2 on the line segment joining thepoints. That is to say

there exist λ, 1 > λ > 0 such that x = (1− λ)x1 + λx2 (i)

• Write x1 and x2 in the same split form as x above, as x1 = {u1, v1} and x2 = {u2, v2}.Thus (i) gives:

(1−λ){u1, v1}+λ{u2, v2} = {xB, 0} ⇒ 0 = (1−λ)v1+λv2 (equating just the second component)

Since λ, (1−λ), v1, v2 > 0 this implies that v1 = v2 = 0 ⇒ x1 = {u1, 0}, x2 = {u2, 0}• Consider Ax1 and Ax2

Ax1 = (B, C){u1, 0} = Bu1 = b similarly Ax2 = Bu2 = b ⇒ Bu1 = Bu2

• Since B is m×m and the rows are independent, B has an inverse.

Thus Bu1 = Bu2 ⇒ u1 = u2 ⇒ x1 = x2 thus contradicting that x1 and x2 aredistinct.

4The notation {x, y} indicates a single column vector consisting of the two column vectors x and y.

Page 75: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 70

Hence x is a point in X that does not lie between two points in X on the line segment joiningthe points. Therefore x is an extreme point of X.

The next theorem is essentially the converse of Theorem 4.2 except that for a given extreme pointthere may exist more than one basic feasible solution. This arises when more than n − m of thecomponents of x at the extreme point are zero. In such a case the decomposition of x into its splitform is not unique and hence more than one basic feasible solution is associated with the one x. Insuch a case the extreme point is said to be degenerate.

Theorem 4.3

Given A to be an m×n matrix with m independent rows, and let x∗ be an extreme point of the closedconvex space X defined by:

Ax = b x ≥ 0 (4.9)

The vector x∗ is a basic feasible solution.

Proof

Let x∗ = (x1, x2, . . . xn)T and assume that the variables have been reordered and A adjustedaccordingly so that x1, x2 . . . xk > 0 and the rest equal zero.

Thus Ax∗ = b ⇒ ∑ki=1 xiai = b where ai is the ith column of A.

To show that x∗ = (x1, x2, . . . xn)T is a basic solution it is sufficient to show that the {a1, . . . ak}are linearly independent. This is done by contradiction.

• Assume {a1, . . . ak} are linearly dependent.

Thus there exists λi not all zero such that

k∑

i=1

λiai = 0 (i) (4.10)

• Since xi > 0 for i = 1, . . . k it is possible to find a single value of ε > 0 such that:

xi + ελi > 0 and xi − ελi > 0 for all i = 1, . . . k

Define λ = (λ1, . . . λk, 0)T and two vectors x1 and x2 to give:

x1 = x∗ + ελ > 0 and x2 = x∗ − ελ > 0 (4.11)

From Eq(4.10) Aλ = 0 and thus:

Ax1 = Ax∗ = b and Ax2 = Ax∗ = b

Thus since x1 and x2 are non-negative and satisfy Ax = b they are feasible solutions.

Page 76: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 4. MATHEMATICS OF LINEAR PROGRAMMING - ALGEBRAIC APPROACH 71

• From Eq(4.11) x1 6= x2, since ε > 0 and not all the λi are zero. Also from Eq(4.11) itfollows that:

x∗ =12x1 +

12x2

Thus x∗ is at the mid-point of the line segment joining two points in X. This contradictsx∗ being an extreme point

• Thus the original assumption that the ai were linearly dependent is false. Thus {a1, . . . ak}are linearly independent.

Thus the extreme point x∗ is a basic feasible solution with up to m non-zero components, sincek cannot be greater than m. This follows from the fact that there are m linearly independentrows which, from the theory of matrices, implies there are m linearly independent columns.

4.8 Number of Basic Solutions - Extreme points

The above has established a correspondence between the number of feasible basic solutions and thenumber of extreme points. The only thing to comment on is that there may be more feasible basicsolutions than extreme points due to degeneracy. Also not all basic solutions are feasible. Howeverthe most number of basic solutions that can exist is given by the number of way of selecting the n−m

zero solutions from the total number of variable n; this equals nCn−m.Thus there are only a finite number of basic feasible solutions and thus only a finite number

of extreme points. Thus the search for the optimum extreme point is finite. The Simplex methodsearches through basic feasible solutions in such a manner as to always improve the value of theobjective function; this cuts down the amount of work and makes it unnecessary to calculate all basicfeasible solutions. Geometrically the process moves the solution in an efficient way from one extremepoint to the other, making it unnecessary to visit every extreme point.

Page 77: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Chapter 5

Linear Programming - Simplex

5.1 Introduction

As established in the previous chapters the solution of the linear programming programming problemwill entail moving from one extreme points of the feasible region to another until the optimal value ofthe objective function ,z, is attained. Algebraically this has been shown to be equivalent to movingfrom one feasible basic solution to another. In addition to these ideas the simplex method shortensthe path to the optimal position by, at each step, moving in such a way as the improve the value of z.

5.2 Geometrically motivated Search

Looking at the Real-Choc problem and making reference to Fig. 5.1 the feasible polygon is used todevelop a method. The idea will be to start at a feasible solution (feasible corner) and then movealong an edge to the next feasible corner in such a way as to improve1 the objective function.

Recalling that the constraint equations and objective function for the Real-Choc problem are,

4x1 + x2 + s1 = 40

3x1 + 2x2 + s2 = 35

2x1 + 3x2 + s3 = 35

x1 + 4x2 + s4 = 40 (5.1)

z = 5x1 + 4x2 + 0s1 + 0s2 + 0s3 + 0s4

the following steps are carried out.

(a) Start at the origin O in Fig. 5.1. That is to say set x1 = x2 = 0, these form the non-basic set.Solving Eq(5.1) for the basic set s1 . . . s4, gives the feasible2 solution s1 = 40, s2 = 35, s3 = 35and s4 = 40.

At this point z = 0.1An increase in z in a maximization problem, a decrease in z in a minimization problem2All solutions non-negative

72

Page 78: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 73

C

B

A

P

D

E

QR

S

TU

10

s1 = 0s2 = 0

s3 = 0

s4 = 0

All si > 0

x1 + 4x2 = 40

2x1 + 3x2 = 35

3x1 + 2x2 = 354x1 + x2 = 40

=

¼

i*

4

8

4 8 10

Figure 5.1:

(b) (i) The next step is to interchange one variable from the basic set with one from the non-basicset. Swap x1 and s1. The basic set is now {x1, s2, s3, s4} and solving the equations withx2 = s1 = 0 gives x1 = 10, s2 = 5, s3 = 15 and s4 = 30.At this point z = 50.Geometrically this process corresponds to moving from O to E along the x1-axis.

(ii) Alternatively interchanging x2 and s4.The basic set becomes {x2, s1, s2, s3} and solving the equations with x1 = s4 = 0 givesx2 = 10, s1 = 30, s2 = 15 and s3 = 5.At this point z = 40.Geometrically this process corresponds to moving from O to A along the x2-axis.

(iii) Note that if in (b)(ii) x2 had been swapped with s3, then the process would have movedto the point P outside the feasible polygon. Algebraically solving the equations with x1 =s3 = 0 would give s4 < 0, indicating a non-feasible solution.

(c) Clearly the best move is in (b)(i) since the solution remains feasible and gives the most improve-ment in z.

Moving on from E the diagram indicates that there is only one choice, namely move to D, thisis done by swapping x2 and s2.

The basic set is now {x1, s3, s4, x2} and solving the equations with s1 = s2 = 0 gives x1 = 9,x2 = 4, s3 = 5 and s4 = 15.

Page 79: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 74

At this point z = 61.

It should be noted that algebraically it is possible to interchange x2 and s3 rather than x2 and s2,this corresponds to moving to Q. Alternatively interchanging x2 and s4 corresponds to movingto R. In either of these cases the solution would contain at least one negative value as they areclearly outside the feasible polygon.

(d) If s1 now enters the basis set and s3 leaves geometrically the process moves along DC to C.

The basic set is now {x1, s1, s4, x2} and solving the equations with s2 = s3 = 0 gives x1 = 7,x2 = 7, s1 = 5 and s4 = 5.

At this point z = 63.

(e) A further move from C to B would yield a decrease in z. Thus the problem, as already estab-lished, is optimal at C as described in (d) above.

In the above process there are two steps, namely where to start and how to continue:

• The process starts with a feasible solution obtained by setting (n −m) of the variables equalto zero and solving the remaining m equation in m unknowns. In many problems the startingpoint is at the origin.

• Continue by making a non-basic variable basic and a basic variable non-basic such that:

(i) The new solution is feasible

(ii) The value of z improves

5.3 Optimization in 3-Dimensions by Row Reduction

As seen in Chapter 4 changing from one basic solution to another can be carried out using rowreduction.

Consider the problem of maximizing z = 12x1 + 6x2 + 6x3 subject to

x1 ≤ 6 x2 ≤ 6 x3 ≤ 6 12x1 + 12x2 + 2x2 ≤ 120 x1, x2, x3 ≥ 0

Geometrically the feasible region is the interior and surface of the solid in Fig. 5.2. Introducingthe slack variables {s1 . . . s4} the constraints3can be written in terms of equations as;

x1 + s1 = 6 x2 + s2 = 6 x3 + s3 = 6 12x1 + 12x2 + 2x3 + s4 = 120

These can be written in the form Ax = (D I)x = b as:

1 0 0 1 0 0 00 1 0 0 1 0 00 0 1 0 0 1 012 12 2 0 0 0 1

x1

x2

x3

s1

s2

s3

s4

=

666

120

3The variables are always introduce in such a fashion as to be non-negative

Page 80: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 75

........

........

........

........

.....................................

...............

x1

x2

x3

P Q

R

S

C

BA

E

D

O

(6, 4, 0)

(4, 6, 0)

(3, 6, 6)

(6, 3, 6)

(6, 0, 0)

x3 = s1 = s4 = 0

x3 = s1 = x2 = 0

s3 = s1 = s4 = 0

...

...

...

Figure 5.2:

In augmented form (D I b) this problem is written as:

1 0 0 1 0 0 0 60 1 0 0 1 0 0 60 0 1 0 0 1 0 612 12 2 0 0 0 1 120

v1 v2 v3 e1 e2 e3 e4

(5.2)

where the columns of the matrix A have been labelled as vectors. With this notation the matrixequation can be viewed as expressing the vector b in terms of the columns of A as (first seen inChapter 4 Sec.??):

b = x1v1 + x2v2 + x3v3 + s1e1 + s2e2 + s3e3 + s4e4 (5.3)

Start at the extreme point at the origin: This correspond to selecting the last four columns ofA as the basis vectors. This is possible since they clearly consist of four linearly independent vectors,being the standard ordered basis for E4. Thus the variables corresponding to the first three columnsare set equal to zero, namely x1 = x2 = x3 = 0. Since the independent columns in the basis are simplythe standard ordered basis the corresponding variables s1 . . . s4 are given by the final column b of theaugmented matrix (D I b). That is to say s1 = s2 = s3 = 6, s4 = 120, and at this point z = 0.

With reference to Fig. 5.2, to move to the point P where s1 = x2 = x3 = 0, it is necessary tomove s1 out of the basic set and bring x1 in. This has the effect of writing out b in terms of the new

Page 81: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 76

basic set {x1, s2, s3, s4}.

Thus using the approach seen in Chapter 4 Ex(4.6)), use row reduction to transform v1 (since x1

is incoming) into e1 (since s1 is outgoing) by subtracting 12× row(1) from row(4) :

1 0 0 1 0 0 0 60 1 0 0 1 0 0 60 0 1 0 0 1 0 60 12 2 −12 0 0 1 48

(5.4)

With basic set {x1, s2, s3, s4} the non-basic variables that are set equal to zero are x2 = x3 = s1 = 0.Thus the basic solution becomes x1 = 6, s2 = 6, s3 = 6, s4 = 48. Hence from Eq(5.3) the vector b isnow expressed as:

b = 6v1 + 6e2 + 6e3 + 48e4

Thus row reduction has geometrically moved the solution to another point(namely P ) and algebraicallyexpressed b in terms of a different basis in the column space of A.At this point x1 = 6, x2 = x3 = 0 thus z = 12× 6 + 6× 0 + 6× 0 = 72.

It must always be remembered in general in any given solution (n −m) of the variables are set equalto zero - in this case (7− 4), that is to say 3 variables are set equal to zero at any one time

Two more moves

• To move to Q bring in x2 and take out s4, since as seen in Fig. 5.2 the non-basic variablesat Q are {s1, s4, x3} and hence the basic variables are {x1, s2, s3, x2}. This is achieved usingrow reduction, making column 2 (since it corresponds to the x2 variable) into e4 (i.e. the basisvector in the s4 column).

Thus in Eq(5.4), dividing row(4) by 12 and then subtracting from row(2) gives:

1 0 0 1 0 0 0 60 0 −1

6 1 1 0 − 112 2

0 0 1 0 0 1 0 60 1 1

6 −1 0 0 112 4

(5.5)

Thus with x3 = s1 = s4 = 0 these equations give: x1 = 6, x2 = 4, s2 = 2 s3 = 6.

Thus the solution is at Q and using Eq(5.3) b is now expressed in terms of the new basisas:

b = 6v1 + 4v2 + 2e2 + 6e3

and the value of z at this point is z = 12× 6 + 6× 4 = 96.

• To move to A bring in x3 and take out s3, since as seen in Fig. 5.2 the non-basic variables atQ are {s1, s4, s3} and hence the basic variables are {x1, x2, x3, x4}. This is achieved using

Page 82: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 77

row reduction, making column 3 (since it corresponds to the x3 variable) into e3 (i.e. the basisvector in the s3 column).

Thus in Eq(5.5) add row(3)/6 to row(2) and subtract row(3)/6 from row(4) to give:

1 0 0 1 0 0 0 60 0 0 1 1 1

6 − 112 3

0 0 1 0 0 1 0 60 1 0 −1 0 −1

6112 3

(5.6)

Thus with s3 = s1 = s4 = 0 these equations give: x1 = 6, x2 = 3, s2 = 3 x3 = 6.

Thus the solution is at A and using Eq(5.3) b is now expressed in terms of the new basisas:

b = 6v1 + 3v2 + 3v3 + 6e2

and the value of z at A is given by z = 12× 6 + 6× 3 + 6× 6 = 126.

The row reduction process has transformed the original augmented matrix (D I b) into Eq(5.6), whichis of the form (D′ M d), where:

D′ =

1 0 00 0 00 0 10 1 0

M =

1 0 0 01 1 1

6 − 112

0 0 1 0−1 0 −1

6112

d =

6363

(5.7)

To see the relationship between these matrices consider the original problem written out as:

D

x1

x2

x3

+ I

s1

s2

s3

s4

= Ib (5.8)

After row reduction the matrix I is transformed to M , the matrix D to D′ and the column vector b

to d. Thus in this form the equations are transformed to:

D′

x1

x2

x3

+ M

s1

s2

s3

s4

= Mb = d

Alternatively if Eq(5.8) is pre-multiplied by M it gives

MD

x1

x2

x3

+ M

s1

s2

s3

s4

= Mb (5.9)

Page 83: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 78

Comparing Eq(5.8) and Eq(5.9) gives:

MD = D′ and Mb = d (5.10)

That is to say each column of the final matrix in Eq(5.6) is M times the corresponding column in theoriginal Augmented Matrix in Eq(5.2).

5.4 Simplex Method

Moving from one basic solution to another has been seen to be equivalent to row reduction. Thequestion that is still outstanding is how should the incoming and outgoing variables be chosen suchthat the new solution is still feasible and the value of z, the objective function, is improved. Thesimplex method deals with all these problems by displaying the information in a tableau. Althoughhistorically the transformation from one tableau to the next would have been done by hand, knowinghow the method works enables one to construct a computer program to carry out the operations. Thefinal, or optimal tableau, will contain lots of information regarding the original linear programmingproblem. Using this table it will be possible to find the shadow (dual) prices, ranges of optimality andfeasible ranges for the components of b; these have already been discussed for the Real-Choc problemas well as being computed using Solver for many other problems .

Restating equations Eq(5.1) for the Real-Choc problem:

4x1 + x2 + s1 = 40

3x1 + 2x2 + s2 = 35

2x1 + 3x2 + s3 = 35

x1 + 4x2 + s4 = 40 (5.11)

withz = 5x1 + 4x2 + 0s1 + 0s2 + 0s3 + 0s4

the following table (tableau) is constructed:In detail the table is made up as follows:

The first two rows are fairly obvious with j labelling the variables which are listed in rowtwo. Immediately below the variables in the third row are their coefficients in the objectivefunction z.

The first column is labelled Basic variables and contains the variable that are basic at thispoint in the calculation. Since this is the first point, which as usual is taken to be at theorigin, the slack variables form the basic set. The second column labelled cB, contains thevalues of the coefficients of the basic variables in the objective function z.

Page 84: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 79

j = 1 2 3 4 5 6x1 x2 s1 s2 s3 s4 Solutions ratio

Basic variables cB 5 4 0 0 0 0 d r

s1 0 4 1 1 0 0 0 40 [10]

s2 0 3 2 0 1 0 0 35 1123

s3 0 2 3 0 0 1 0 35 1712

s4 0 1 4 0 0 0 1 40 40

zj = cTBaj 0 0 0 0 0 0 z = cT

Bd

∆z = cj − zj [5] 4 0 0 0 0 z=0

Table 5.1: The solution column refers to the basic variable only, all other variable are zero

The main body of the table, namely the matrix between the double ruled lines, are thecoefficients of the initial set of equations Eq(5.11). These will change as we move throughthe the process of solving the problem due to carrying out row reduction.

The column labelled d contains the current righthand side of the equations. This columnis also labelled solutions as it contains the current values of the basic variables. The restof the solution set consists of the non-basic variables which have been set equal to zero. InTable 5.1 the non-basic variables are x1 = x2 = 0 and the values of the basic variables aregiven by s1 = 40, s2 = 35, s3 = 35 and s4 = 40.

The final column is used to decide which variable is to leave the basic set and is formedfrom the ratios of the components of d with the corresponding coefficients of the incomingvariable. As seen below x1 is the incoming variable thus the ratios are formed from d andthe coefficients in the x1 column.

The final two rows below the double ruled lines are concerned with deciding which variableto bring into the basic set. Indeed the final row contains the change in z due to a unitincrease in each of the respective variables at the expense of changes in the basic variables.These two rows are discussed more fully below.

The cell in the bottom righthand corner contains the current value of z. This is calculatedfrom the current values of the basic variable and there respective coefficient in the objectivefunction. In matrix terms this is cT

B d.For the above table this is: 0× 40 + 0× 35 + 0× 35 + 0× 40 = 0.(The non-basic variables play no roll in calculating z as they are by definition all set equalto zero.)

As seen in the last section to move from one point to another requires that a basic variable and anon-basic variable are swapped over. That is to say a basic variable becomes non-basic, and henceis set to zero, and a previously non-basic variable joins the basic set. (generally its value will becomenon-zero, however it may equal zero and in such a case we say the solution is degenerate)

Page 85: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 80

Bringing in a variableSince this is a maximization problem the incoming variable, which will be one of the non-basic vari-ables, is selected to be the one that increases z the most. The final row of the table shows the changesin z per unit increase in each of these variables. For the existing basic variables the entries in the finalrow are zero, the reason for this is described in (b) below.

(a) Change in non-basic variable Consider a change of ∆x1 in the non-basic variable x1. As in(a) row(1) gives 4x1 + x2 + s1 = 40. If a change in x1 by ∆x1 is made, keeping the other non-basic variable fixed at zero and thus only allowing the basic variable s1 to change the followingis obtained:

4∆x1 + ∆s1 = 0 ⇒ ∆s1 = −4∆x1

Repeating this process with the other three rows gives:

3x1 + 2x2 + s2 = 35 ⇒ ∆s2 = −3∆x1

2x1 + 3x2 + s3 = 35 ⇒ ∆s3 = −2∆x1

x1 + 4x2 + s4 = 40 ⇒ ∆s4 = −∆x1

For clarity of method write out z with general coefficient and then consider its change due tothe change ∆x1 and consequential changes {∆s1, ∆s2, ∆s3, ∆s4} in the basic variables (ie x2

remains non-basic and zero):

z = c1x1 + c2x2 + c3s1 + c4s2 + c5s3 + c6s4 ⇒ ∆z = c1∆x1 + c3∆s1 + c4∆s2 + c5∆s3 + c6∆s4

Thus:∆z

∆x1= c1 − 4c3 − 3c4 − 2c5 − c6 (5.12)

Denoting the coefficients of the basic variables in z by the column vector cB and the jth columnof the matrix in the body of the table as aj then Eq(5.12) gives:

∆z

∆x1= c1 −

(c3, c4, c5, c6

)

4321

= c1 − cT

B a1

(b) Change in basic variable It is seen immediately that it is not possible to change a basicvariable, whilst at the same time keeping the same set of non-basic variables (by definition theseare fixed at zero). For example if a change of ∆s1 is made in s1 then row(1) of the body ofthe tableau, 4x1 + x2 + s1 = 40, implies 4∆x1 + ∆x2 + ∆s1 = 0. However since x1 and x2 areto remain non-basic variables, and hence have the fixed value of zero , ∆x1 = ∆x2 = 0. Thus∆s1 = 0, which means that no such change is possible. Consequently z remains unchanged, thatis to say ∆z = 0.

Algebraically it can be seen that ci − cTB ai = 0, where i corresponds to a column corresponding

to a basic variable. This follows from the fact that for such an i the column will be one of thestandard ordered basis columns and thus cT

B ai = ci.

Page 86: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 81

This process is repeated with all the other variables and the values cTB aj entered into the penultimate

row of the table. The final row contains cj − cTB aj for each of the variables. A change in notation is

made in the table with these final values being denoted simply as ∆z, though of course they are stillthe changes in z per unit change in the variables.

From the final row of the table the greatest affect 4 is obtained by bringing in x1 into the basicset as this gives an increase of 5 units in z.

Take out a variableAs x1 becomes part of the basic set, that is to say its value is increased from zero, it is necessaryto see what is happening to the other variables in the basic set. Eventually one of these variableswill become zero and then negative, the first variable to do so will be the one to take out, as to stayfeasible all variables must be non-negative.

Looking at Eq(5.11), and bearing in mind that the non-basic variable x2 remains zero:

4x1 + s1 = 40 : s1 ≥ 0 ⇒ x1 ≤ 404 = 10

3x1 + s2 = 35 : s2 ≥ 0 ⇒ x1 ≤ 353 = 112

3

2x1 + s3 = 35 : s3 ≥ 0 ⇒ x1 ≤ 352 = 171

2

x1 + s4 = 40 : s4 ≥ 0 ⇒ x1 ≤ 40

Thus it is seen that at x1 = 10 (the smallest value calculated above), s1 will be the first of the slackvariables to become zero. As x1 continues to increase s1 will then be negative. Thus s1 is taken out ofthe basic set and becomes a new non-basic variable. Doing this ensures that the solution has moved toa feasible point with all variables remaining non-negative. These ratios are shown in the final columnof Table. 5.1.

General Rule for taking out a basic variable

In the current Table denote the i-jth term of the matrix of coefficients of the variablesby ai,j ; in the tables these are the values bounded by the double lines. A general rule fordeciding which of the basic variables to remove is to identify the row of this matrix (value

of i) which minimizes the ratio:di

ai,jfor all non-negative5ratios.

That is to say:

Remove the ith basic variable corresponding to mini=1,m

{di

ai,j≥ 0

}(5.13)

where di is the ith component of d, which in general is assumed to have m componentsand j identifies the incoming variable.

4In a maximization problem this is the most positive change and in a minimization problem the most negative change

Page 87: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 82

Loosely speaking the d column is divided by the column corresponding to the incomingvariable and the smallest non-negative value selected.

The moveAs we have seen the move is carried out by row reduction (Sec. 5.3). Since the column correspondingto the outgoing variable s1 is e1

6 and the incoming variable is x1, corresponding to column 1, rowreduction must transforms column 1 into e1. Applying the following steps to the matrix and d columnin Table 5.1 will carry out the necessary calculations:

• Divide row(1) by 4 to create the pivot (the 1) in row(1) col(1).

• To create zero’s below the pivot carry out the following:

row(4)−row(1); row(3)−2row(1); row(2)−3row(1)

The new table is given in Table 5.2. The last row of the table indicates that x2 should be brought

j = 1 2 3 4 5 6x1 x2 s1 s2 s3 s4 Solutions ratio

Basic variables cB 5 4 0 0 0 0 d r

x1 5 1 14

14 0 0 0 10 40

s2 0 0 54 −3

4 1 0 0 5 [4]

s3 0 0 52 −1

2 0 1 0 15 6

s4 0 0 154 −1

4 0 0 1 30 8

zj = cTBaj 5 5

454 0 0 0 z = cT

Bd

∆z = cj − zj 0 [114 ] −5

4 0 0 0 z=50

Table 5.2: Solutions refers to the basic variable only, other variable all equal zero

into the basic set, since 114 is the largest change in z. To decide which of the basic variables should be

taken out, calculate the ratios of the elements of the d column and the column corresponding to x2,namely the second column (j = 2).Thus:

d1

a1,2= 10÷ 1

4= 40 similarly

d2

a2,2= 4,

d3

a3,2= 6,

d4

a4,2= 8

The smallest of these is 4, corresponding to the second row (i = 2) hence indicating that the variables2 should be removed from the basic set. These ratios are shown in Table 5.2.

To carry out the move, since the incoming variable is x2, column 2 will be replaced with the col-umn corresponding to the outgoing variable s2. That is to say, by row reduction column 2 will betransformed into e2. Carrying out the row reduction gives Table 5.3.

5The reason it is only the non-negative ratios that are considered is explained later on in the example where a negativeratio occurs

6Notation for standard ordered basis ei see Sec5.3.

Page 88: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 83

From the table it can be seen that the largest non-negative value in the final row is 25 , thus the

j = 1 2 3 4 5 6x1 x2 s1 s2 s3 s4 Solutions ratio

Basic variables cB 5 4 0 0 0 0 d r

x1 5 1 0 25 −1

5 0 0 9 2212

x2 4 0 1 −35

45 0 0 4 −62

3

s3 0 0 0 1 −2 1 0 5 [5]

s4 0 0 0 2 −3 0 1 15 712

zj = cTBaj 5 4 −2

5115 0 0 z = cT

Bd

∆z = cj − zj 0 0 [25 ] −11

5 0 0 z=61

Table 5.3: Solutions refers to the basic variable only, other variable all equal to zero

variable s1 is brought into the basic set. To decide which variable is to be taken out of the basic setthe ratios of the entries in the solution column and the column corresponding to s1, namely column3 are formed and stored in the ratio column:

d1

a1,3= 9÷ 2

5= 22

12

d2

a2,3= −20

3d3

a3,3= 5

d4

a4,3= 7

12

As noted above only the non-negative ratios are considered when deciding which variable to removefrom the basic set. It can now be seen why this is the case by looking at the equation correspondingto row(2) where the ratio is negative. Noting that s2 = 0, being a non-basic variable, this equation isgiven by:

x2 − 35s1 = 4 ⇒ x2 = 4 +

35s1

from which it can be seen that x2 will remain positive non matter how large the incoming variables1 becomes. Thus a negative ratio indicates no restriction, therefore it is only necessary to considerthe non-negative ratios when deciding which variable to make non-basic. In this case the smallestnon-negative ratio is 5 corresponding to s3. Thus s3 is taken out of the basic set and replace withs1. This is achieved by row reduction such that the s1 column is replaced by the s3 column, namelyby e3. Doing this produces Table 5.4.

Since the entries in the final row of Table 5.4 are now all zero or negative there is no advantagein making any further moves and the problem is optimal. The proof that the overall optimal valuehas been reached can be found in [8] Chapter 3 p95.

5.5 Simplex Tableau - Dual Prices

Recall that the dual or shadow price corresponding to a given constraint is the change in z per increasein the righthand side of the constraint. Usually this is an increase in a resource. Referring to the last

Page 89: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 84

j = 1 2 3 4 5 6x1 x2 s1 s2 s3 s4 Solutions ratio

Basic variables cB 5 4 0 0 0 0 d r

x1 5 1 0 0 35 −2

5 0 7

x2 4 0 1 0 −25

35 0 7

s1 0 0 0 1 −2 1 0 5

s4 0 0 0 0 1 −2 1 5

zj = cTBaj 5 4 0 7

525 0 z = cT

Bd

∆z = cj − zj 0 0 0 −75 −2

5 0 z=63

Table 5.4: Solutions refers to the basic variable only, other variable all equal zero

problem it can be seen from Eq(5.11) that a unit increase in the righthand side of any of the equationsis equivalent to a unit decrease in the corresponding slack variable. In detail the second equation inEq(5.11) is 3x1 + 2x2 + s2 = 35. Thus if the resource is increase to 36 the equation becomes

3x1 + 2x2 + s2 = 36 ⇒ 3x1 + 2x2 + (s2 − 1) = 35

That is to say an increase in the resource is equivalent to a decrease in the corresponding slack variable.From the optimal table for this problem, Table 5.4, the change in z due to an increase in s2 is −7

5 ,thus the change in z due to a decrease in s2 is 7

5 . Since the objective coefficients for the slack variablesare zero this value is to found in the penultimate row of the table. Similarly the dual price for thecommodity corresponding to s3 is 2

5 .The dual prices for the other two commodities are zero. This can be seen from the table as well asfrom noting that s1 and s4 are part of the basic set with non-zero values. Hence there is slack in thesystem with respect these two commodities and hence any change will merely change the amount ofslack and contribute nothing to the profit.

5.6 Simplex Tableau - Feasible Range

As seen in Sec. 2.2.3 there is a range of values for each bi for which the solution still remains optimal inthe sense that it is described by the same basic set. These ranges are referred to as feasible rangesand can be obtained from the optimal tableau as follows.

The values of the basic variables in the optimal solution are found in the last column of Table 5.4,which as seen in Eq(5.10) is given by Mb.7 If b is replaced by b + ∆b then following the same rowreduction steps the new solution becomes

M(b + ∆b) = Mb + M∆b = old solution + M∆b (5.14)

For this solution to remain feasible ∆b must be such that all the solutions remain non-negative. Sinceonly one of the components of b is changed at a time this problem is easier than it looks. For example

Page 90: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 85

to compute the range of feasibility for the second component of b then for the solution to remainnon-negative Eq(5.14) implies that:

7755

+

0 35 −2

5 00 −2

535 0

1 −2 1 00 1 −2 1

0∆b2

00

≥ 0

This leads to four inequalities to determine the range of ∆b2.:

7 +35∆b2 ≥ 0 ⇒ ∆b2 ≥ −35

3

7− 25∆b2 ≥ 0 ⇒ ∆b2 ≤ 35

2

5− 2∆b2 ≥ 0 ⇒ ∆b2 ≤ 52

5 + ∆b2 ≥ 0 ⇒ ∆b2 ≥ −5

Thus the range of ∆b2 is:

−5 ≤ ∆b2 ≤ 52

Similar calculations can be carried out for changes in the other components of b.

5.7 Simplex Tableau - Optimal Range

Recall that the range of optimality applies to the coefficients in the objective function; these werecalculated for the Real-Choc problem in Sec. 2.2.1. Consider the change in the coefficient of x2 andwrite z = 5x1 + αx2. Bearing in mind that the range of optimality is calculated at the optimal pointchanging the optimal tableau Table 5.4 to include the α gives Table 5.5.

For the table to remain optimal α must be such that ∆z ≤ 0 thus:

5− 3 ≤ 0 ⇒ α ≤ 15

2

2− 3α

5≤ 0 ⇒ α ≥ 10

3

Thus the range of optimality for the x2 coefficient is [313 , 71

2 ].

This range was first calculated in Chapter 2 and given in Eq(2.2).

If instead of replacing the coefficient of x2 with α the coefficient of x1 is replaced with α then asimilar calculation gives the range of optimality for the x1 coefficient; Ref Table 5.6. For the solution

7Note that M is the matrix in the optimal tableau Table 5.4 in the slack variable columns.

Page 91: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 86

j = 1 2 3 4 5 6x1 x2 s1 s2 s3 s4 Solutions ratio

Basic variables cB 5 α 0 0 0 0 d r

x1 5 1 0 0 35 −2

5 0 7

x2 α 0 1 0 −25

35 0 7

s1 0 0 0 1 −2 1 0 5

s4 0 0 0 0 1 −2 1 5

zj = cTBaj 5 α 0 3− 2α

5 −2 + 3α5 0 z = cT

Bd

∆z = cj − zj 0 0 0 2α5 − 3 2− 3α

5 0 z=35 + 7α

Table 5.5:

j = 1 2 3 4 5 6x1 x2 s1 s2 s3 s4 Solutions ratio

Basic variables cB α 4 0 0 0 0 d r

x1 α 1 0 0 35 −2

5 0 7

x2 4 0 1 0 −25

35 0 7

s1 0 0 0 1 −2 1 0 5

s4 0 0 0 0 1 −2 1 5

zj = cTBaj α 4 0 (3α−8)

5(12−2α)

5 0 z = cTBd

∆z = cj − zj 0 0 0 − (3α−8)5 − (12−2α)

5 0 z=28 + 7α

Table 5.6:

in Table 5.6 to remain optimal α must be such that ∆z ≤ 0 thus:

(8− 3α)5

− 3 ≤ 0 ⇒ α ≥ 83

(2α− 12)5

≤ 0 ⇒ α ≤ 6

Thus the interval of optimality for the x1 coefficient is [223 , 6], as first shown in Chapter 2, Eq(2.3).

5.8 Artificial Starting Variables

The Simplex Method always requires that we start at a feasible solution. So far this has been obtainedby using the slack variables as the initial basic set, geometrically corresponding to starting at the originin the decision variable space. In detail the standard form Ax = b was written as (D I)x = b withthe identity matrix I corresponding to the slack variables. Although the method will always startwith the problem in this form there may not be sufficient slack variables, thus it will be necessary to

Page 92: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 87

introduce more variables as follows.Consider the following problem:

Example 5.1 Minimize z = 4x1 + x2 subject to:

x1 + 2x2 ≤ 4 4x1 + 3x2 ≥ 6 3x1 + x2 = 3 x1, x2 ≥ 0

Introducing one slack variable s1 and one surplus variable s2 the constraints take the standard form:

4x1 + 2x2 + s1 = 4 (i) 4x1 + 3x2 − s2 = 6 (ii) 3x1 + x2 = 3 (iii)

It is not possible to start at the origin x1 = x2 = 0 since (ii) implies that s2 < 0 thus infeasible, and(iii) is not satisfied.

Introduce artificial variables a1, a2 ≥ 0 as follows:

x1 + 2x2 + s1 = 4 4x1 + 3x2 − s2 + a1 = 6 3x1 + x2 + a2 = 3

Thus reordering the variables with the slack and artificial variables at the end, these equationscan be written in the standard form (D I)x = b as:

1 2 0 1 0 04 3 −1 0 1 03 1 0 0 0 1

x1

x2

s2

s1

a1

a2

=

463

Thus it is possible to start the problem with the basic set {s1 = 4, a1 = 6, a2 = 3} and the non-basicset {x1 = x2 = s2 = 0}.

Since neither a1 nor a2 form part of the problem as slack or surplus variable a solution is sought in whichthese variables are zero. In order to force these variables to zero artificial coefficients in the objectivefunction are introduced. The problem is recast as minimizing z′ = 4x1 + x2 + 0s2 + 0s1 + Ma1 + Ma2

where M is a large positive constant. Since the problem is one of minimization and M is large andpositive the optimization process will tend to force the artificial variables a1 and a2 to zero, thusleaving the original objective function. If the problem had been a maximization problem then −M

would have been introduced rather than +M .

The initial tableau is now given in Table 5.7. Note that a final column has been added to the ta-ble to calculate the ratio necessary to indicate which variable to take out of the basic set. Rememberwe look for the least non-negative value.

Page 93: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 88

j = 1 2 3 4 5 6x1 x2 s2 s1 a1 a2 Solutions di

ai,1

Basic Variables cB 4 1 0 0 M M d

s1 0 1 2 0 1 0 0 4 4

a1 M 4 3 −1 0 1 0 6 1.5

a2 M 3 1 0 0 0 1 3 1

z′j = cTBaj 7M 4M −M 0 M M z = cT

Bd

∆z′ = cj − z′j 4− 7M 1− 4M M 0 0 0 = 9M

Table 5.7: For large M the most negative value in bottom row is (4− 7M) thus bring x1 into the basicset; least non-negative value in final column is 1, thus take out a2

j = 1 2 3 4 5 6x1 x2 s2 s1 a1 a2 Solutions di

ai,2

Basic variables cB 4 1 0 0 M M d

s1 0 0 53 0 1 0 −1

3 3 95

a1 M 0 53 −1 0 1 −4

3 2 65

x1 4 1 13 0 0 0 1

3 1 3

z′j = cTBaj 4 5M+4

3 −M 0 M −4M+43 z = cT

Bd

∆z′ = cj − z′j 0 −5M+13 M 0 0 7M−4

3 = 2M + 4

Table 5.8: For large M the most negative value in bottom row is −5M+13 thus bring x2 into the basic

set; least non-negative value in final column is 65 , thus take out a1

Recall that this is a minimization problem thus the process stops when all the ∆z values are non-negative, as this implies that any further move will increase z. The problem is optimal in Table 5.11with x1 = 2

5 , x2 = 95 and the minimum value of z = 17

5 Note that z = z′ since both the artificialvariables are zero.

Dual variablesThese are shown in [ ] and are found as before in the penultimate row of the table in the columnsoccupied in the first tableau by the identity matrix I. That is to say the columns corresponding tothe slack and artificial variables. Recall that the dual variables are the changes in z per increase ineach of the components of b. In the final row of the table in the a1 and a2 columns the terms involveM . This however is not a problem since although this row is labelled ∆z′, it is in fact ∆z′ per changein the variables, and from:

z′ = z + Ma1 + Ma2 ⇒ ∆z′ = ∆z + M∆a1 + M∆a2

Page 94: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 89

j = 1 2 3 4 5 6x1 x2 s2 s1 a1 a2 Solutions di

ai,3

Basic variables cB 4 1 0 0 M M d

s1 0 0 0 1 1 −1 1 1 1

x2 1 0 1 −35 0 3

5 −45

65 -2

x1 4 1 0 15 0 −1

5915

35 3

z′j = cTBaj 4 1 1

5 0 −15

85 z = cT

Bd

∆z′ = cj − z′j 0 0 −15 0 M + 1

5 M − 85 = 18

5

Table 5.9: For large M the most negative value in bottom row is −15 thus bring s2 into the basic set;

least non-negative value in final column is 1, thus take out s1

j = 1 2 3 4 5 6x1 x2 s2 s1 a1 a2 Solutions

Basic variables cB 4 1 0 0 M M d

s2 0 0 0 1 1 −1 1 1

x2 1 0 1 0 35 0 −1

595

x1 4 1 0 0 −15 0 2

525

z′j = cTBaj 4 1 0 [−1

5 ] [0] [75 ] z = cTBd

∆z′ = cj − z′j 0 0 0 15 M M − 7

5 = 175

Table 5.10: For large M there are no non-negative values in the bottom row, thus the tableau is optimal

a change in a1 implies:∆z

∆a1=

∆z′

∆a1− M and a change in a2 implies:

∆z

∆a2=

∆z′

∆a1− M and for

changes of any other variables ∆z = ∆z′.

Thus to consider the change in z the entries in the last row of cols(5) and cols(6) require M tobe subtracted leaving respectively 0 and −7

5 . As discussed before the actual values required are thenegatives of these values which again are seen in their correct position in the penultimate row; termsin the square brackets.

5.9 Problems with Simplex

5.9.1 Degeneracy

When carrying out the simplex method, as seen in Eq(5.14), it is necessary to calculate the minimumnon-negative element of the set { di

ai,j} in order to determine which variable to take out of the basic

set. It may happen that at least two of these values are the same. In such a case, just for definiteness,the variable corresponding to the smallest i is removed. Because two of the ratios are the same the

Page 95: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 90

next simplex tableau will have one of its basic variable equal to zero, that is to say one of the variableswill become degenerate. This can be seen in the following fragments of a simplex problem: The final

basic v1 v2 v2 s1 d ratiov1 1 0 0 2 4 4

2 = 2v2 0 1 0 1 3 3

1 = 1v3 0 0 1 4 8 8

4 = 2

Table 5.11: Fragment of Simplex Tableau with basic variables v1, v2 and v3 and new incoming variables1

column of Table 5.11 indicates that either v1 or v3 is removed from the basic set since both these ratiosare the same. For definiteness v1 is removed and replaced by the incoming variable s1. This gives thefollowing tableau: As can be seen in Table 5.12 the basic variable v3 is zero and hence degenerate.

basic v1 v2 v2 s1 d ratios1 0.5 0 0 1 2 2

0.5 = 4v2 −0.5 1 0 0 1 1

−0.5 = −2v3 −2 0 1 0 0 0

−2 = 0

Table 5.12: New Simplex Tableau with basic variables s1, v2 and v3. The variable v3 is now degenerate.

This causes no problems other than in very rare cases where the next tableau may revert back toTable 5.11 and hence an infinite cycle is set up. This event is so rare that commercial programs donot accommodate it as a problem.

5.9.2 Non-Uniqueness

Although the optimal value of the objective function in a linear programming problem is unique thevalues of the variables that give this value may not be. The following simple two dimensional problemin Fig. 5.3 illustrates this clearly. The objective function is a line parallel to one side of the feasibleregion, thus any point on the line segment AB will give the same optimal value for z. Again this isnot a problem for the simplex method, however one should always be aware that there may be othervalues of the variables giving the same optimal value.

5.9.3 Unboundedness

A problem is said to be unbounded if for any given B > 0 there exists a point in the feasible regionsuch that the objective function z satisfies, in a maximization problem z > B or in a minimizationproblem z < −B.Fig. 5.4 illustrates the simply unbounded maximization problem:

maximize z = 2x1 + x2 given that 0 ≤ x2 ≤ 1, x1 + x2 ≥ 1.5, x1 ≥ 0 (5.15)

Page 96: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 91

............................................................................ z

Objective Function

O

A

B

Cx1

x2

Figure 5.3: Objective function z parallel to AB. Feasible region shown as hashed. z maximum at anypoint along AB

.......................................................

z = 2 = 2x1 + x2

x2 = 1

x1 + x2 = 1.5

x1

x2

Figure 5.4: Problem given by Eq(5.15). Feasible region shown hashed. Objective function z shown indots with z = 2

As can be seen in Fig. 5.4 the objective function z, which is shown drawn in dots with z = 2, canbe increased without bound and still intersect the feasible region. That is to say geometrically thedotted line can be moved indefinitely to the right and still intersect the hashed region.

If an unbounded problem is being solved using the Simplex Method then at some stage all the ratioterms become less than zero, indicating that any of the basic variables can be increased indefinitelywithout violating the constraints.

5.9.4 Infeasibility

If the set defined by the constraints is empty then the problem is infeasible. The following twocomments are relevant when solving using the Simplex method.

• If the problem is of the form Ax ≤ b with x ≥ 0 and b ≥ 0 then the feasible region is not empty

Page 97: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 5. LINEAR PROGRAMMING - SIMPLEX 92

since it contains the origin 0. In terms of the Simplex method this would correspond to x = 0and all the slack variables equal to b.

• If a problem requiring the introduction of artificial variables reaches an optimal solution in whichone of the artificial variables is part of the basic set and non-zero then the original problem wasinfeasible.

Page 98: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Chapter 6

Linear Programming - Dual Problem

6.1 The Diet Problem

To illustrate the natural way in which one linear programming problem defines another consider thefollowing classical problem based on food and dietry requirement. The problem has been kept simplein order to illustrate the essential points of the dual problem, it is not recommended that you baseyou eating habits on it.

Example 6.1 Vitamins A and C can be obtained by eating carrots and apples. Table 6.1, gives theamounts of vitamins , measured in mg, in 100g of each food type and the required daily amounts ofeach vitamin.If the consumer purchases y1 carrots and y2 apples (measured in 100g units) then Table 6.1 gives the

Carrot Apple RDAVit A 1.0 0.1 8Vit C 0.2 2.0 12

Table 6.1: Vitamin contents in milligrams per hundred grams of food; Required Daily Amount of eachvitamin measured in milligrams

folowing constraints:1.0y1 + 0.1y2 ≥ 8 0.2y1 + 2y2 ≥ 12 (6.1)

Which, introducing a matrix M and vector c, is written as:(

1.0 0.10.2 2

)(y1

y2

)≥

(812

)⇒ My =≥ c (6.2)

If carrots cost 15p and apples 25p for 100g then, introducing the variables z and b, the objective costfunction is given by:

Cost = 15y1 + 25y2 ⇒ z = b1y1 + b2y2 ⇒ z = bT y (6.3)

Thus the linear programming problem is to minimize z in Eq(6.3) subject to the constraints of Eq(6.2).

93

Page 99: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 6. LINEAR PROGRAMMING - DUAL PROBLEM 94

The problem is now viewed from the point of a drugs company who wish to sell vitamin tablets tothe public. Clearly they will be interested in maximizing the cost, and hence the profit, of the vitamintablets. Assuming the drug company sells the vitamins at x1p per milligram for vitamin A and x2pper milligram for vitamin C and using the idea of ”required daily amount” it is in the interest of thedrug company to maximize:

z = 8x1 + 12x2 ⇒ z = cT x (6.4)

However the drug company cannot just charge any amount, there is a limit on the amount thecustomer will pay for vitamins. It is reasonable to assume that the customer is not going to pay morefor his vitamin tablets than he would for the equivalent amount of food. (ı.e. the amount of food thatprovides the same amount of vitamins)

Thus the cost of the amount of vitamins A and C found in 100g of carrots must not exceed 15p,since that is the amount the customer would pay in order to get the same amount of vitamins byconsuming carrots. Similarly the cost of vitamins A and C found in 100g of apples must not exceed25p.

This give the following two constraints:

1.0x1 + 0.2x2 ≤ 15 0.1x1 + 2.0x2 ≤ 25 (6.5)

In matrix form this is written as:(

1.0 0.20.1 2.0

)(x1

x2

)≤

(1525

)⇒ MT x ≤ b (6.6)

The above example develops two linear programming problems, each of which is the dual of the other.The tendency in the literature is to call the actual problem under consideration, the primal problemand its dual, the dual problem, though mathematically neither has precedence over the other. Tosummarize the two problems, and standardizing the notation with MT = A the above gives:

Maximize z = cT x subject to Ax ≤ b, x ≥ 0Minimize z = bT y subject to AT y ≥ c, y ≥ 0 (6.7)

6.2 General Dual Problem

This section writes down the general linear programming problem and its dual as given for example by[6] (Gale). It is worth noting that the restriction b ≥ 0 is dropped from this formulation. This is not aproblem when solving using the Simplex method as slack, surplus or artificial variables can always beintroduced in order to get the problem into the standard equation form with positive righthand sides.

Page 100: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 6. LINEAR PROGRAMMING - DUAL PROBLEM 95

General Primal Maximization - Dual Minimization ProblemLet A be an m× n matrix and define the sets M and N with subsets S and T as follows:

S ⊆ N = {1, . . . n} and T ⊆ M = {1, . . . m}

In the formulation all vectors are column vectors, with their components denoted appropriately, andthe element of A in its ith row and jth column is denoted as ai,j .

The general maximization problem is to maximize z = cT x subject to:

• xj ≥ 0 ∀j ∈ S

•n∑

j=1

ai,j xj ≤ bi ∀i ∈ T

•n∑

j=1

ai,j xj = bi ∀i ∈ T ′ where T ′ is the complement of T in M .

The dual of the general maximization problem is the following minimization problemMinimize z = bT y subject to:

• yi ≥ 0 ∀i ∈ T

•m∑

i=1

ai,j yi ≥ cj ∀j ∈ S

•m∑

i=1

ai,j yi = cj ∀j ∈ S′ where S′ is the complement of S in N .

As can be seen the definitions are symmetric and one could think of the minimization problem as theprimal problem and the maximization problem as its dual.

To see how this general definition fits in with the problems already considered let S = N and T = M ,thus S′ and T ′ are empty. The maximization problem reduces to

maximize z = cT x given x ≥ 0, Ax ≤ b

Note that there are now no equation constraints in the original problem as T ′ is empty. The non-negative constraint on x applies to all components, thus it can be written in vector form. Similarlythe inequality constraint applies to all the equations and can be written in a matrix-vector form.

The dual problem can now be written as:

minimize z = bT y given y ≥ 0, AT y ≥ c

Since S′ is empty there are no equation constraints in the dual problem. The non-negative constrainton y is true for all components and the inequality constraint is true for all equations, thus the problemcan be written in matrix form.

Page 101: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 6. LINEAR PROGRAMMING - DUAL PROBLEM 96

6.3 Dual Theorem

Result 6.1 If x and y are any feasible solutions of the two inequalities

Ax ≤ b and c ≤ AT y

thencT x ≤ bT y

Proof

cT x ≤ (AT y)T x = yT Ax ≤ yT b = bT y

Thus as the primal problem and its dual are solved the value of z in the maximal primal problem isalways less than or equal to the value of z in the dual problem. The following result is therefore notsurprising:

Result 6.2 If x and y are feasible solutions of Ax ≤ b and c ≤ AT y and cT x = bT y then bothsolutions are optimal with the same value of z for both the primal and dual problems.

ProofIf x′ is any feasible solution of Ax ≤ b then by Result 6.1:

cT x′ ≤ bT y = cT x

Thus for all feasible solutions x′, cT x′ ≤ cT x which implies that x is an optimal maximum solution.

Similarly y is a minimal optimal solution.

The following theorem, which is not proved, is the key link between a problem and its dual. Theprogram and its dual referred to in the theorem not only covers the problem stated in Sec. 6.1 butalso the most general formulation of Sec. 6.2.

Theorem 6.1 Dual TheoremIf both a program and its dual are feasible then both have optimal vectors such that the z values(objective functions) of the two programs are the same. If either program is infeasible then neitherprogram has an optimal solution

The last result in this chapter is to relate the simplex tableau to the dual problem. Fortunately oncethe primal problem has been solved using the simplex method the final optimal tableau also give thesolution to the dual problem. As seen in the Dual Theorem when optimal the objective functions havethe same value thus the optimal value of z in the final tableau is also the optimal value of z for thedual problem. The following result reveals the position of the dual variables in the final tableau.

Page 102: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 6. LINEAR PROGRAMMING - DUAL PROBLEM 97

Result 6.3 The dual or shadow prices are the dual variables that satisfy the optimal dual problem.These are to be found in the penultimate row of the final tableau in the columns corresponding to theinitial slack and artificial variables.

ProofIn the simplex method the inequalities and equations of the original problem are written in augmentedmatrix form as (D I b), this forming the body of the initial tableau. On completion this part of thetableau has been row reduced to (D′ M d). Denoting the jth column of (D′ M) by aj , the elementsin the penultimate row of the tableau were calculated as cT

B aj . Thus the end part of the penultimaterow of the tableau, corresponding to the columns originally occupied by I, are given by cT

B M , whichexpressed as a column is written as MT cB. The vector cB consists of the coefficients of the final basicvariables in the objective function.

Thus it is required to prove that y = MT cB is the solution of the dual problem at its optimalpoint.

Using the notation of Eq(6.7) first prove that y = MT cB is a feasible solution of the dual prob-lem, that is to say:

show that AT (MT cB) ≥ c (6.8)

Since the final tableau for the primal maximization problem is optimal all elements in the final rowof the body of the table are non-positive. (Recalling that these elements are the increase in z due toincreases in each of the variables, non-positive indicating that there is no benefit in swapping basicand non-basic variables). Using the notation of the tableau this gives:

cj − zj ≤ 0 ⇒ cj − cTB aj ≤ 0 j = 1, . . . n (6.9)

Although this is true for all j, that is to say every column , consider only the columns of the tableauthat correspond to the original A matrix. These will be the first columns of the augmented matrix thatcorrespond to the original x-variables. Since each column of the final tableau = M× the correspondingcolumn of the original augmented matrix and considering only the first columns that evolved from A

Eq(6.9) can be considered for just these first columns and written as:

cT − cTB MA ≤ 0

Taking the transpose give:

c− (MA)T cB ≤ 0 ⇒ (MA)T cB − c ≥ 0 ⇒ AT (MT cB) ≥ c (6.10)

Thus the inequality Eq(6.8) is proved and MT cB is a feasible solution of the dual problem.

By Result 6.2 if the z variables for the primal and dual are the same, that is to say cT x = bT (MT cB),then the solutions are both optimal, and in particular the solution y = MT cB of the dual is optimal.

Page 103: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 6. LINEAR PROGRAMMING - DUAL PROBLEM 98

Recall that d = Mb, thus the optimal basic solution is given as xB = Mb, with the non-basic variableset equal to zero. Thus:

z = cT x using only basic variable ⇒ z = cTB xB (6.11)

Substituting for xB = Mb gives:

z = cTB (Mb) = (cT

B M) b = bT (cTB M)T = bT (MT cB) (6.12)

Thus it is shown that y = MT cB is an optimal solution of the dual problem, as required.

Example 6.2 (Solution of Example 6.1)Example 6.1 is now first solved using the Simplex method and then again along with its dual usingSolver. However it should be noted that it is the maximization problem, namely the view of thedrug company, that is considered to be the primal problem. Table 6.2 shows the initial tableau forthe maximization problem with an additional final column showing the ratios used in deciding whichbasic variable should leave. Table 6.4 is the final optimal tableau since the entries in the final row ofthe body of the table are all non-positive.

j = 1 2 3 4x1 x2 s1 s2 Solutions di

ai,2

Basic variables cB 8 12 0 0 d

s1 0 1.0 0.2 1 0 15 75

s2 0 0.1 2.0 0 1 25 12.5

zj = cTBaj 0 0 0 0 z = cT

Bd

∆z = cj − zj 8 12 0 0 =0

Table 6.2: Since 12 is the largest positive value in the bottom row add x2 to the basic set; since 12.5is the least positive value in the last column remove s2 from the basic set

From Table 6.4:

• The optimal price for the drugs should be: x1 = 12.63p/mg for vitamin A; x2 = 11.87p/mg forvitamin C.

• The profit made on supplying the required daily dose is £2.43.

Also from Table 6.4 the dual variable (shadow prices) are seen to be y1 = 7.47 and y2 = 5.25 (takenform the penultimate row of the table in the columns corresponding to the original slack variables s1

and s2.) In terms of the problem this means that one would have to consume 747g of carrots and 525g

Page 104: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 6. LINEAR PROGRAMMING - DUAL PROBLEM 99

j = 1 2 3 4x1 x2 s1 s2 Solutions di

ai,1

Basic variables cB 8 12 0 0 d

s1 0 0.99 0 1 −0.1 12.5 12.63

x2 12 0.05 1 0 0.5 12.5 250

zj = cTBaj 0.60 12 0 6.0 z = cT

Bd

∆z = cj − zj 7.4 0 0 −6.0 =150

Table 6.3: Since 7.4 is the largest positive value in the bottom row add x1 to the basic set; since 12.63is the least positive value in the last column remove s1 from the basic set

j = 1 2 3 4x1 x2 s1 s2 Solutions

Basic variables cB 8 12 0 0 d

x1 8 1 0 1.01 −0.1010 12.6262

x2 12 0 1 −0.0505 0.505 11.8687

zj = cTBaj 8 12 7.474 5.252 z = cT

Bd

∆z = cj − zj 0 0 −7.474 −5.252 =243.43

Table 6.4: Since all the values in the last row are all non-positive the optimal point has been reached

of apples to get the required amount of vitamins A and C. The cost of this is the same as the drugcompanies profit, namely £2.43

In Fig 6.1 the primal and dual problems have been set up in Excel and solved with Solver. It canbe seen that the shadow prices in one solution are the final values of the variables in the other andvice versa. Note that other properties associated with the constraints in one problem are the same asthose associated with the variables in the other; such as allowable increase etc. In both cases the finalvalues of the z variables are the same.

Page 105: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 6. LINEAR PROGRAMMING - DUAL PROBLEM 100

Adjustable Cells

Final Reduced Objective Allowable Allowable

Cell Name Value Cost Coefficient Increase Decrease

$A$21 x1(vit A) 12.626 0.000 8 52 7.4$B$21 x2(vit C) 11.869 0.000 12 148 10.4

Constraints

Final Shadow Constraint Allowable Allowable

Cell Name Value Price R.H. Side Increase Decrease

$C$3 Carrots 15 7.4747 15 235 12.5$C$4 Apples 25 5.2525 25 125 23.5

Target Cell (Max)

Cell Name Original Value Final Value

$A$26 z 1.0000 243.4343

Constraints

Cell Name Cell Value Formula Status Slack

$C$3 Carrots 15 $C$3<=$B$3 Binding 0$C$4 Apples 25 $C$4<=$B$4 Binding 0

Adjustable Cells

Final Reduced Objective Allowable Allowable

Cell Name Value Cost Coefficient Increase Decrease

$A$21 y1 7.475 0.000 15 235 12.5$B$21 y2 5.253 0.000 25 125 23.5

Constraints

Final Shadow Constraint Allowable Allowable

Cell Name Value Price R.H. Side Increase Decrease

$C$3 Vit A 8 12.6263 8 52 7.4$C$4 Vit B 12 11.8687 12 148 10.4

Target Cell (Min)

Cell Name Original Value Final Value

$A$26 z 1.0000 243.4343

Constraints

Cell Name Cell Value Formula Status Slack

$C$3 Vit A 8 $C$3>=$B$3 Binding 0$C$4 Vit B 12 $C$4>=$B$4 Binding 0

Report for Maximization Problem (Primal problem)

Report for Minimization Problem (Dual problem)

Figure 6.1: Primal maximization problem and dual minimization problem for Eg. 6.1 using Solver

Page 106: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Chapter 7

Networks and Graphs

7.1 Graphs

Many problems can be represented by a network, already seen in Chapter 1. Formally a network is anexample of the mathematical object known as a Graph. Thus in this section a few formal definitionsare made.

Definition - Graph

A Graph G is an ordered pair (V,E) of a set of vertices (or nodes) V and a collection1

of edges E, such that to each edge is assigned a unique pair of (not necessarily distinct)vertices. The edge is said to join the vertices.

The vertices or nodes are usually represented by points and the edges by lines joining pairsof points.

If an edge e joins two vertices v1 and v2 then v1 and v2 are said to be adjacent and theedge e is said to be incident with both the vertices. As indicated in the definition an edgecan join a vertex to itself, in such a case the edge is said to be a loop.

A graph that contains no loops or in which no pair of vertices are joined by more than oneedge is said to be simple.

Definition - Path

If an edge e is associated with the vertices u and v then without regard to order denote e

by uv.

A path in G is a sequence of edges in G where one vertex of one edge is contained in thenext, that is to say a sequence of edges of the form:

u0u1, u1u2, u2u3, . . . , un−1un

such that:1As a given edge may appear more than once the expression collection of edges rather than set of edges is used; recall

that in a set items are only listed once.

101

Page 107: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 102

• all the edges are distinct

• with the possible exception of u0 and un all the vertices are distinct.

The definition gives an implied direction of the path, thus u0 is referred to as the initial vertex andun the final vertex of the path (See Fig 7.1). If u0 = un then the path is called a cycle.

...............................................................................................

..............

...

..................

u0

u1

u2

u3

Figure 7.1: A path from u0 to u3 shown in solid line, other edges shown in dotted line.

The idea of one part of the graph being joined to another via a path is contained in the next definition:

Definition - Connected

A graph G is connected if for each pair of distinct vertices u and v in G there is a pathfrom u to v.

In many problems the construction of as simple a graph as possible gives the required solution, thusthe following definition becomes useful:

Definition - Tree

A tree is a connected simple graph with no cycles.

In general the tree may only be part of the graph G, Fig 7.2(a), however if the graph G is connectedthen it is possible to connect all the vertices with a single tree Fig 7.2(b). This leads to the followingdefinition:

Definition - Spanning Tree

A spanning tree of a connected graph G is a tree with contains all the vertices of G andwhich is a subgraph of G.

One property that reinforces the idea that a tree is in someway optimal is that there are, by definition,no cycles in a tree.

Page 108: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 103

.........................

......

......

......

......

..

........

........

........

.....

.....................................

(a) (b)

........

........

.......

Figure 7.2: (a) Non-connected graph, tree shown in solid lines other edges shown in dotted lines(b) Connected graph with spanning tree shown in solid line and other edges in dotted line - note:all vertices visited by the tree; tree contains no cycles.

Result 7.1 If an edge is added to a tree then a cycle is created.

ProofIf an edge is added to a tree then it must connect two vertices that are already connected thus a cycleis formed.

The following result (without proof) give equivalent definitions of a tree:

Result 7.2 Let T be a simple graph with p vertices, then the following statements are equivalent:

• T is a tree.

• T has p− 1 edges and no cycles

• T has p− 1 edges and is connected.

Types of Graphs

The definition of a graph is sometimes qualified as follows:

If to each edge in G is assigned a unique ordered pair of vertices the graph G is said to bedirected. This is indicated by placing a suitable arrow on the edge in the diagram.

If in G no edge is assigned to an ordered pair then G is said to be undirected.

If in G some of the edges are assigned to an ordered pair and some are not then the graphG is said to be mixed

7.2 Minimal Spanning Tree

In Chapter 1 Ex(1.3) the problem of a cable company connecting several towns was introduced. Inthis type of problem each arc has associated with it a non-negative number and the object of the

Page 109: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 104

v1

v4

v3

v2

e1e2

e4

e3

(a)(b)

v1

v2

v3

e1

e2

e4

e3v4

e0

Figure 7.3: (a)Undirected simple graph. (b)Directed non-simple graph; There is no meaning to the loopbeing directed

problem is to find the path that links all nodes such that the sum of the arc lengths is a minimum.Clearly such a path will be spanning tree, since such a tree visits all the nodes in the graph (network)and contains no cycles and hence no unnecessary links. A given graph may have many spanning treesthus in any problem it will be necessary to find the one of minimum length.

Example 7.1 (Spanning Tree Problem)A company, operating on a large industrial site in several buildings, needs to install five lines to con-nect its central computer to five other buildings. Communication links do not necessarily have tobe direct, it being possible for one building to tap into an existing connection in a near by build-ing. Since installing the lines involves tunnelling and is expensive it is of obvious advantage if thetotal distance of all the connections is kept to a minimum. The following graph indicates the dis-tances of paths between buildings, in km, along which cable can be laid. How should the links bemade? The answer to this problem is to construct a minimal spanning tree for the graph. There

1

2

5

3

4

6

2

2

4

4 4

4

5

3 3

3

1

Computer Centre

Figure 7.4:

Page 110: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 105

are two main algorithms that may be used for this problem, one due to Prim and the other to Kruskal.

Prim’s AlgorithmGiven a connected graph G let C initially be the empty set φ.

(i) Choose any vertex and add to the set C.

(ii) Find a vertex in G− C that is linked directly with shortest arc length to a vertex in C. Add itand the associated arc to C. (in the event that there is a tie for the shortest arc add one andthen repeat with the others)

(iii) Repeat step (ii) until G− C is empty. C will now be a minimal spanning tree.

Applying this algorithm, starting with node(1), the set C is constructed as shown in Fig. 7.5. It is

1

C1

1

22

C2

1

22

4

3

C3

1

22

4

3

31

C4

1

22

4

3

31

C5

6

2

1

22

4

3

31

62

53

C6

Figure 7.5: The set C has been indexed C1 . . . C6 as each node and arc is added. C6 is a minimalspanning tree with length 11

in fact true that if all the arcs are of different length then the spanning tree is unique. In other casesstarting with a different node may give a different set of arcs for the minimal spanning tree, howeverthe value of the tree is always unique.

Proof of Prim’s AlgorithmFor a connected finite graph G there will always exist a minimal spanning tree. By construction thetree given by Prim’s algorithm, Y , will span G. It is therefore necessary to show that Y is indeedminimal.

The proof takes a minimal spanning tree, Y1, that is different from the one obtained by Prim’s methodand by replacing edges one at a time, in such a manner as not to change it value, it is transformedinto Prim’s tree. Since at each stage the property of being a minimal spanning tree is preserved thelast step implies that Prim’s tree is minimal.

To help visualize the proof consider the example in fig.7.6 where it is assumed that for a given graph

Page 111: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 106

G, (not shown) the tree Y is that obtained by applying Prim’s algorithm and the tree Y1 is a knownminimal spanning tree.

a

b

c

d

e

f

g

h

(1)

(2)

(4) (5)

(3)

(6)(7)

Prim’s Tree Y

a

b

c

d

e

f

g

h

Minimal Spanning Tree Y1

Figure 7.6: The numbers on the edges of Prim’s tree indicate the order in which they were added whenimplementing the algorithm. Thus starting at vertex {b} the edge {bc} is the first to be included usingPrim’s method, followed by {cd}, {dg} etc

.

• If Y = Y1 then there is nothing to prove.

• Assuming that Y 6= Y1, let α be the first edge added to the construction of Y that is not in Y1;in the example this is the edge {dg}. Let V be the set of vertices added before the addition ofα; in the example V = {b, d, e}.

• Since Y1 is a spanning tree for G there is a path in Y1 joining the two end points of α. Thusthere must exist an edge β joining a vertex in V to one not in V . In the example the path is{dchg} and β = {ch}.

• Transform Y1 into Y2 by deleting β from Y1 and adding α.

(i) Y2 is still a spanning tree for G because:

(a) All the points not in V that were on the path above are now accessible along α.(Hence still connected and spanning)

(b) Y2 has the same number of edges as Y1.(Hence tree, Result 7.2)

(ii) value(Y2)=value(Y1)

(a) When α was added to Y Prim’s algorithm would have also considered the edge β,since it connects a vertex not in V to one in V . Since α was chosen this means thatvalue(α) ≤ value(β). Thus we can deduce that value(Y2) ≤ value(Y1).

(b) By (i) Y2 is a spanning tree and since Y1 is a minimal spanning tree it follow thatvalue(Y2) = value(Y2). 2

2This implies that value(α)=value(β). If the values of all the edges of G are distinct the minimal spanning tree isunique, since in this case no such β will ever exist, thus Prim’s tree will be identical to any other minimal spanning tree.

Page 112: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 107

Thus Y2 is a minimal spanning tree for G that has one more edge in common with Prim’s treeY than Y1 did.

• The process continues, adding edges to Y using Prim’s method until the next edge to be addedin not in, what is now Y2. The exchange of edges is made as before yielding a new minimalspanning tree Y3.

This process continues until Y is complete, at which time it will be the same as a minimalspanning tree Yn, for some n.

This completes the proof that the tree obtained using Prim’s algorithm is indeed a minimalspanning tree.

Kruskal’s AlgorithmIn this method the spanning tree is built by adding edges in ascending order of lengths. Denote theoriginal graph as G = (V, E) with vertices V and edges E. The algorithm builds the spanning tree T

as follows:

(i) Start with T = (G,φ). ie just the vertices. Trivially each vertex is a connected componentby itself.

(ii) Consider the edge e in E that has smallest size that has not yet been considered. (initially thisis all of E) If there is more than one arc of smallest length, arbitrarily select one.

(iii) If the edge e connects two different components then include as part of T .

(iv) If the edge e connects two vertices in the same component then discard. (Inclusion will create acycle)

(v) Repeat (ii) until all edges have been considered.

With reference to Fig. 7.7 the spanning tree T is constructed from the set of vertices and edges asfollows:

(a) The edge of lowest length namely 1, is added to the diagram, being the edge between node(3)and node(4).

(b) The next largest length is 2. There are two edges of length 2, the one between node(1) andnode(2) has been arbitrarily selected and added.

(c) The second edge of length 2 is added between node(4) and node(6).

(d) There are three edges of length 3. However the edge between node(3) and node(6) is discardedsince it will be adding to an existing component. This is not allowed by step (iv) of the algorithm.Add the edge of length 3 between node(3) and node(5).

(e) Add the second edge of length 3 between node(1) and node(4).

Page 113: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 108

2

1

3

4

5

6

1

2

1

3

4

5

6

12

2

1

3

4

5

6

12

2

2

1

3

4

5

6

12

2

32

1

3

4

5

6

12

2

3

3

(a) (b) (c)

(d) (e)

Figure 7.7: Edges are added in ascending order, not adding an edge to an existing component; (e) isthe minimal spanning tree length = 11

.

Consider edges of length 4. It is immediately obvious that all of these are discounted since theyconnect vertices of an existing component. Similarly the edge of length 5 is discounted.

As all edges have been considered the tree in (e) is the minimal spanning tree. This tree is infact the same tree as obtained using Prim’s method. Fig. 7.5.

7.3 Shortest Path Algorithm

In the previous section a path along which the total path value was a minimum was found using oneof two algorithms. As a general rule Kruskal’s algorithm tends to be slightly quicker, though thereisn’t a lot in it. The present section looks at the shortest route through a network, again the edgesare assumed to have assigned to them a positive value. As will be seen below the value assigned toan edge can represent quantities other than just distance, however for the present thinking in termsof distances gives the work a more intuitive flavour.

The first of the two algorithms considered below finds the shortest path from a chosen vertex toall the other vertices in the network whereas the second algorithm finds the shortest path between allpairs of vertices.

7.3.1 Dijkstra’s Algorithm

This algorithm finds the shortest path form a chosen vertex (node) S, to all the other nodes in thenetwork. It relies on a labelling system that records the shortest distance from any chosen labellednode to S along with the previous node visited before arriving at the chosen node. The algorithm can

Page 114: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 109

be applied to a mixed graph, but one needs to be aware that a directed edge can only be traversed inthe direction of the arrow. In most of the problems considered, the network (Graph) will be a directedgraph.

DefinitionA temporary label for node(j) is denoted [uj , i], with uj the distance from the initial node S tonode(j), and i the last node passed through before reaching node(j). In the algorithm the labels arealso given the status of permanent, in which case they are denoted [uj , i].

Dijkstra’s AlgorithmTo find the shortest paths from node S to all the other nodes in a network.

(i) Label node S with temporary label [0, S].

(ii) Make the temporary label with smallest u value permanent.

(iii) Consider all the nodes that can be reached directly from the last created permanent node. Foreach of these nodes that:

(a) has no label, add a temporary label.

(b) has a permanent label, do nothing

(c) has a temporary label with larger u value, replace with new temporary label, otherwise donothing.

(iv) Repeat from (ii) until all labels are permanent.

The u values in each of the permanent label which are now attached to each node give the distancesfrom each node to S. By using the second part of the label it is possible to trace back the path fromany given node to S. Hence the values of the shortest paths and the paths are attained.

Example 7.2 Given the following directed graph, Fig. 7.8, find the shortest paths from S to the othernodes Node S is first given the temporary label [0, S] and then being the only temporary node is

S

2

3

4

5- -

7

w

¾

µ

w

20

6 12

102

3

4

Figure 7.8:.

made permanent and labelled [0, S].

Page 115: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 110

In the following (a) - (g) refer to Fig. 7.9.

(a) Nodes 2 and 3 are directly linked to the last permanently labelled node, namely node S, hencelabel nodes 2. and 3 with temporary labels.

(b) Since amongst the temporary labels node(3) has the smallest u value, make the node(3) labelpermanent.

(c) Since node(3) was the last permanent label look at all the nodes directly linked to node(3).These are nodes 4 and 5 and since they have no labels, attach temporary labels. The u valuesfor these labels are calculated from the u value on node(3) and the corresponding arc lengths.

(d) The temporary label, from amongst all the temporary labels, with the smallest u value is atnode(4). Make the temporary label on node(4) permanent.(note that the temporary labels on nodes 2 and 5 have u values of 20 and 18 respectively greaterthan that of node(4))

(e) Nodes 2 and 5 are directly attached to node(4), the last permanently created label. Nodes 2and 5 both already have temporary labels; a temporary label is only replaced if the new u valueis less than the existing one. The new label at node(5) would be [18, 4], which has the same u

value as the existing label, hence do not replace. However the new label at node(2) would be[11, 4], which has a lower u value than the existing label, hence replace.

(f) The lowest temporary label is at node(2), make this permanent.

(g) There are no nodes connected to node(2) with either no labels or only temporary labels, thus nolabels to add. Finally make the lowest temporary label permanent, this is node(5). All nodesare now permanent - STOP.

Page 116: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 111

S

2

3

4

5- -

7

w

¾

µ

w

20

6 12

10

2

3

4

S

2

3

4

5- -

7

w

¾

µ

w

20

6 12

10

2

3

4

[0, S]

[20, S]

[6, S]

[20, S]

[6, S][0, S]

(a) (b)

S

2

3

4

5- -

7

w

¾

µ

w

20

6 12

10

2

3

4

[20, S]

[6, S][0, S]

(c)[8, 3]

[18, 3]

S

2

3

4

5- -

7

w

¾

µ

w

20

6 12

10

2

3

4

[20, S]

[6, S][0, S]

(d)[8, 3]

[18, 3]

S

2

3

4

5- -

7

w

¾

µ

w

20

6 12

10

2

3

4

[20, S]

[6, S][0, S]

(e)[8, 3]

[18, 3]

[11, 4]

S

2

3

4

5- -

7

w

¾

µ

w

20

6 12

10

2

3

4

[11, 4]

[6, S][0, S]

(f)[8, 3]

[18, 3]

S

2

3

4

5- -

7

w

¾

µ

w

20

6 12

10

2

3

4

[11, 4]

[6, S][0, S]

(g)[8, 3]

[18, 3]

Figure 7.9: Dijkstra’s method for Ex(7.2).

Page 117: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 112

By tracing back to node(S) from each node gives the following paths and their (lengths):

S → 3 → 4 → 2 (11) S → 3 → 5 (18) S → 3 → 4 (8) S → 3 (6)

The following example develops a network where the numbers associated with the arcs are linked toa probability. This is a good example of the variation of the type of problems that may fall into theminimum path classification and are solvable using Dijkstra’s algorithm.

Example 7.3 (Most reliable path problem)The network below shows the various routes available to me in travelling from home to work.Each leg of the journey is roughly the same distance thus the shortest route would consist of the three

H

2 4 6

3 5 W

6

- -

R- - -R R

0.2

0.8 0.5

0.7

0.1

6

0.4

0.5

0.25

0.4

0.45

Figure 7.10: Probabilities of not being delayed on each leg

legs H → 3 → 5 → W . However this may not be the quickest route since on each route there aretraffic lights that cause delays. Indeed even one delay will always mean that it takes longer than ona route without a delay.

The number on each edge of the network indicates the probability of not being delayed on thatleg of the journey. My problem is to find the route that minimizes my chance of being delayed.

Consider a path consisting of k legs with a probabilities p1, p2 . . . , pk of not being delayed on each leg.Thus the probability of not being delayed on the whole path is the product of these values.

P (no delay) = p1 × p2 × . . . pk

Thus it is the product of the values that needs to be maximized rather than the sum minimized.Taking the logarithm of this equation gives:

ln(P ) = ln p1 + ln p2 + · · ·+ ln pk

Since ln is an increasing function maximizing P is equivalent to maximizing ln(P ), which in turn isequivalent to minimizing − ln(P ).

Page 118: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 113

Redrawing the network with the value of − ln pi on the ith arc rather than pi, Fig. 7.11, the problemis reduced to finding the shortest path from H to W . Dijkstra’s algorithm will in fact give us morethan this, providing the best route to any of the nodes from H.

H

2 4 6

3 5 W

6

- -

R- - -R R

1.609

0.223 0.693

0.357

2.303

6

0.916

0.693

1.386

0.916

0.799

Figure 7.11: − ln of the probabilities of not being delayed

Applying Dijkstra gives:

H

2 4 6

3 5 W

6

- -

R- - -R R

1.609

0.223 0.693

0.357

2.303

6

0.916

0.693

1.386

0.916

0.799

[0,H]

[0.223,H] [0.580, 2] [1.496, 4]

[1.379, 4][0.916, 2] [2.072, 5]

Figure 7.12: Completed network - all labels permanent

Thus the path from H to W is H → 2 → 4 → 5 → W and − ln P = 2.072 ⇒ P = 0.126. There-fore the path along which the chance of not being delayed is a maximum and has a probability of 0.126.

The labels on the other nodes can similarly be used to find the paths that maximizes the chanceof not being stopped between H and these nodes, together with the associated probability.

Page 119: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 114

7.3.2 Floyd’s Algorithm

Floyd’s algorithm finds, in a single process, the shortest path between each pair of nodes in the net-work. The basic idea of the algorithm is to replace a direct path between two node with a shorter onevia a third node if it exists. The process has to keep track as longer paths are replaced with shorterones. To do this the incidence matrix D is introduced.

The incidence matrix D is defined by:

Di,j = distance from i to j i 6= j and Di,i = ∗

Example 7.4 Consider the following mixed network:

1

2

4

3

363 1

6

8

2 4

Figure 7.13:

The incidence matrix for this network, entering ∞ if a node is not directly connected to another,is given by:

D =

∗ 3 2 8∞ ∗ ∞ 12 6 ∗ 48 1 4 ∗

The algorithm selects node(1) as a pivot. It then considers the distance of a direct route betweenany other pair of nodes and compares it to the distance of the path between the nodes that goes vianode(1). If the distance via node(1) is shorter, D is changed and the fact that the preferred route isvia node(1) is recorded in an auxiliary matrix M . After all pairs of nodes have been considered thealgorithm makes node(2)the pivot and repeats the process. The process is repeated until all nodeshave been pivots.

This process can be carried out by changing the matrix D and an auxiliary matrix M as follows:

D0 =

∗ 3 2 8∞ ∗ ∞ 12 6(5) ∗ 48 1 4 ∗

M0 =

1 2 3 41 2 3 41 2(1) 3 41 2 3 4

(7.1)

Page 120: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 115

With node(1) as pivot

In Eq(7.1) the first row and first column,which are lined off, represent the distance ofroutes directly to and from node(1). Looking at entries that are not in the first row orcolumn is equivalent to looking at the distance of routes between pairs of nodes that donot include node(1). Look at the (third row-second column) entry. This indicates that thedirect distance from node(3) to node(2) is 6. On the other hand the term in the (thirdrow-first column) is 2 and in the (first row-second column) is 3. It is therefore shorter tomove from node(3) to node(2) via node(1) than go directly. This can be seen in Fig. 7.14.

1

2

6

3

36

ª

row(3)-col(2) entry in D0

N3

row(1)-col(2) entry in D0

row(3)-col(1) entry in D0

1 2

Figure 7.14: D3,2 > D3,1 + D1,2 hence take route via node(1)

Note: In general if Di,j > Di,k + Dk,j the route from node(i) to node(j) via the pivot k

is chosen.

D0 is updated with the 6 in row(3)-column(2) being replaced with a 5 (shown in brackets).The fact that the route from node(3) to (2) is best via node(1) is recorded in M0 by placinga 1 in row(3)-column(2) (shown in brackets.)

With node(1) as a pivot this is the only change to be made.

With node(2) as pivot

Updating D0 and M0 gives D1 and M1. With node(2) as pivot further changes are shownin brackets.

D1 =

∗ 3 2 8(4)∞ ∗ ∞ 12 5 ∗ 48 1 4 ∗

M1 =

1 2 3 4(2)1 2 3 41 1 3 41 2 3 4

(7.2)

Looking at the numbers not in row(2) or column(2) and comparing with the sum of thecorresponding terms in row(2) and column(2) gives that there is only one change to make.

Page 121: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 116

Dropping the suffix on the matrix D1, Eq(7.2)gives:

D1,4 = 8 and D1,2 + D2,4 = 3 + 1 = 4

Thus the term in row(1)-column(4) of D1 is changed to 4 and the term in row(1)-column(4)of M1 is changed to 2. Both shown in brackets in Eq(7.2).

With node(3) as pivot

Updating D1 and M1 gives D2 and M2. With node(3) as pivot further changes are shownin brackets.

D2 =

∗ 3 2 4∞ ∗ ∞ 12 5 ∗ 4

8(6) 1 4 ∗

M2 =

1 2 3 21 2 3 41 1 3 4

1(3) 2 3 4

(7.3)

Again there is only one change to make, dropping the suffix on the matrix D2, Eq(7.3)gives:

D4,1 = 8 and D4,3 + D3,1 = 4 + 2 = 6

Thus the term in row(4)-column(1) of D2 is changed to 6 and the term in row(4)-column(1)of M2 is changed to 3. Both shown in brackets in Eq(7.3).

With node(4) as pivot

Updating D2 and M2 gives D3 and M3. With node(4) as pivot further changes are shownin brackets.

D3 =

∗ 3 2 4∞(7) ∗ ∞(5) 1

2 5 ∗ 46 1 4 ∗

M3 =

1 2 3 21(4) 2 3(4) 41 1 3 43 2 3 4

(7.4)

There are now two changes to make, dropping the suffix on the matrix D3, Eq(7.4)gives:

D2,1 = ∞ and D2,4 + D4,1 = 1 + 6 = 7 D2,3 = ∞ and D2,4 + D4,3 = 1 + 4 = 5

Both these changes are shown in brackets in Eq(7.4).

Thus the final matrices are:

D4 =

∗ 3 2 47 ∗ 5 12 5 ∗ 46 1 4 ∗

M4 =

1 2 3 24 2 4 41 1 3 43 2 3 4

(7.5)

The matrix D4 gives the shortest distance between any pair of node and the route is given in M4.

To recover the route from node(2) to node(1)

Page 122: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 117

The distance from node(2) to node(1) is, from row(2)-col(1) of D4, equal to 7.

From M4 the (second row-first column) is 4 which indicate that the route is 2 → 4.

Since the route must now go from 4 to 1 look in row(4)-col(1) of M4, this is a 3, whichmean the route is now 2 → 4 → 3.

To go from 3 to 1 look in row(3)-col(1) of M4, this is a 1, thus the route is now direct.

The final route is therefore 2 → 4 → 3 → 1.

Other results

1 → 2 → 4 distance =4

3 → 1 → 2 distance =2

7.4 Maximum Flow Problem

This section deals with flow through a network. Two examples of such a problem are: a) The flow ofoil from say the oil wells via pumping stations to the refineries. b) The flow of traffic in a road network.As with all network problems the applications are quite wide and other examples can be sort. Theeasiest problem to visualize is the flow of oil or any liquid or gas through pipes. The following networkrepresents such a system: Many of the algorithms for analyzing the flow through such a network are

S

1

2

3

4

5

6

7

8

T

- -

-

µ

R

7

-

µ

R...................

.................... ..........

..........

.

.....................

Boosters RefineriesWells

Single artificialsource

Single artificialsink

Figure 7.15: node(1) and node(2) are wells; nodes 3-6 are boosters and nodes 7 and 8 are refineries.The network is standardized to, single source and single sink, by introducing an artificial source andan artificial sink

based on a network with a single source and a single sink. Thus for computational reasons networkshave to be converted into this single form.

Definition - Basic NetworkA basic network is:

Page 123: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 118

(a) A directed graph with at most a single edge from one node to another. Typically the edge from

node(i) to node(j) is depicted as -i j

(b) To each edge from node(i) to node(j) is associated a positive constant ci,j called the capacityof the edge.

(c) The network contains two special nodes, a source S with no incoming arcs and a sink T withno outgoing arcs

Having introduced the capacity of an arc, the amount of substance that is actually flowing down thearc is also defined and hence the amount of flow through the whole network is given.

Definition - Flow

To each arc of the basic network is assigned a non-negative number. The number assignedfor the arc from node(i) to node(j) is denoted as fi,j and is referred to as the flow alongthe arc from node(i) to node(j). The collection of all flows for the network is denoted asf . The individual flows must have the following properties:

(i) 0 ≤ fi,j (non-negative condition)

(ii) fi,j ≤ ci,j (feasibility condition)

(iii) Total flow into a node = total flow out of the node, with the exception of S and T

(conservation of flow)

Consider a node(j) with incoming arcs from nodes k and outgoing arcs to nodes i.

j- -*

~3

~k i

then∑

k

fk,j =∑

i

fj,i where the summations are

over incoming and outgoing arcs. Also since no flow is lost the flow out of the sourceS must equal the flow into the sink T . Thus

i

fS,i =∑

j

fj,T this is called the value of the flow f

More simply the value of the flow of f is called the flow for the network.

Definition - Maximal Flow

The maximal flow is the flow of largest possible value.

Example 7.5 Consider the following network, Fig. 7.16, in which each arc has been labelled with itsflow and its capacity, using the notation [flow, capacity]. Thus for example the arc from S to a has acapacity of 3 with an initial flow of 2. The object of this example is to see how the flows in the networkcan be increased, first however consider the following two points which follow from the definition offlow.

Page 124: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 119

• Note that the flow for the network is 3. This can be seen by either looking at the total flowout of node(S) or the total flow into node(T ), conservation of flow means that both these valuesmust be the same.

• Initially it is worth checking that at each node the total flow into the node is the same as thetotal flow out of the node, with of course the exception of nodes S and T . For example atnode(d), there are two units entering from node(b) and one unit from node(a)which equals thethree units leaving to go to node(T ).

S

a

b

c

d

T

µ-

R

>

-~ Rª

[2, 3]

[1, 2]

[0, 4]

[1, 2][1, 1]

[2, 3]

[3, 4][1, 3]

[3, 3]

[2, 2]

[1, 4]

Figure 7.16: Notation is [flow, capacity]. The flow on the path S → a → c → T has been increased by1 unit. The labels for the original network have been crossed out and replaced with the updated labelswhich indicate an increase of one unit in the flow. Total flow for the network has been increased to 4

Increase Flow

(i) Consider the path S → a → c → T . On the first part of the path, from S → a, there is aspare capacity of 1 unit, since the flow is 2 units and the capacity is 3 units. That is to say it ispossible to increase the flow by 1 unit. Similarly on the link from a → c there is a spare capacityof 1 unit. On the final link there is a spare capacity of 4 units since there is zero flow down thislink which has a capacity of 4. Thus it is clear that the maximum increase in flow that can beapplied to the path S → a → c → T is 1 unit; the minimum of all the spare capacities on thepath. Carrying out this increase gives an increase in flow for the network to 4 units. The labelsare shown to be updated in Fig. 7.16.

(ii) Consider the path S → b → c → T . This is a path in the graph but clearly there can be no netflow along this path since the flow between node(b) and node(c) is opposed to the direction ofthe path. However it can be used to increase the flow in the network. If the flow from c → b isdecreased by 1 unit and the flows in the other two links increased by 1 unit then conservation offlow at the nodes is still maintained and the net flow out of S or equivalently into T is increasedby 1. This process can be thought of as redirecting the flow from c → b to be from c → T . At

Page 125: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 120

the same time this allows, or indeed demands due to conservation of flow at node(b), an increasein the flow from S → b. The following diagram illustrates the changes:

S

b~

c

[1, 3]T+

.......................

R

[2, 2]

[0, 2][2, 3] ........................

[2, 3]

[1, 4]

[1, 2]

[2, 4]

In making the changes to a path that has an opposed flow the constraints are that the opposedflow is non-zero, otherwise it cannot be reduced, and that there is sufficient spare capacity inthe forward flows to make the increase.

(iii) Finally consider the path S → b → d → T . Fig. 7.17 shows the network updated from steps (i)and (ii). Additionally since there is a spare capacity of 1 unit all the way along the path theflows are shown updated by 1 unit and the old flows crossed out. Thus the flow in the totalnetwork is now 6 units.

S

a

b

c

d

T

µ-

R

>

-~ Rª

[2, 2]

[2, 4][3, 3]

[0, 2][1, 1]

[2, 3]

[3, 4][2, 3][3, 3]

[3, 3]

[4, 4]

Figure 7.17:

Since the output from S is at capacity along both paths the flow of 6 in the network is maximal, thatis to say no other increase is possible.

Page 126: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 121

Example 7.5 leads to the following definitions.

Definition - Saturated

The arc from node(i) to node(j) is said to be saturated if fi,j = ci,j otherwise it is saidto be unsaturated.

Definition - Flow augmenting path

A flow augmenting path in a basic network with source S and sink T is a path from S

to T consisting only of:

• Unsaturated arcs in the direction of the path (unsaturated forward arcs)

• Arcs with non-zero flow against the direction of the path (non-zero backward arcs)

In Example 7.5 the paths chosen along which to increase the flow were all ’flow augmenting paths’.After augmentation the paths contained at least one saturated forward arc or a zero flow opposed arc(or indeed both in (iii)).

Augmenting a network

Given a flow augmenting path P define m to be:

m = mine∈P

{capacity of e− flow along e for forward arcs eflow along e for backward arcs e

}

The flow in the network can then be increased by m by:

• Adding m to all the forward arcs in P

• Subtracting m from all the backward arcs in P

7.5 Ford - Fulkerson Maximum Flow Algorithm

To find the maximum flow possible through a large network is a very important problem. The Ford-Fulkerson algorithm does this by finding flow augmenting paths, which it then augments up to thepoint of saturation. The involved arcs are updated accordingly. During the process of finding a paththe nodes on the path are labelled, however after establishing a flow augmenting path and updatingthese labels are cleared and the process repeated.

The labelling of the nodes is different to the labelling on the arcs. On the arcs the conventionestablished above is continued, namely [flow, capacity], however for the nodes the label is

node label: (previous node, spare capacity).

Additionally if the path from the previous node is a backward path, flow opposed, then a negativesign is inserted in the label before the previous node field.

Page 127: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 122

The following is the formal algorithm for the process, however you should not loose sight of whatis being achieved, that is to say flow augmenting paths are being sort and updated.

Step 1 All the flows in the network are set to zero as in Fig. 7.18.

S

a

b

c

d

T

[0, 3]

[0, 3]

[0, 3]

[0, 4]

[0, 4]

[0, 2]

[0, 2][0, 1]

Figure 7.18: The notation on each arc: [flow, capacity]; Source at node S and Sink at node T

Step 2 Clear all labels on the nodes (initially there are no labels on the nodes) and treat each nodeas unscanned (see below for ’unscanned’).

Step 3 Label node S as (S,∞).

Step 4 Scan for paths.

i loop Choose a labelled unscanned node i

j loop For each adjacent unlabelled node j

If fi,j < ci,j label node j as (q, δj) where forward flow

q = i δj = min{ci,j − fi,j , δi}

Else If fj,i > 0 label node j as (q, δj) where reverse flow

q = −i δj = min{fj,i, δi}

End IfIf j=T then goto step 6

End of j loop

node i is now labelled as a scanned node

End of i loop

Step 5 Finish - Flow max

Page 128: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 123

Step 6 Augment path

The last node visited was T, thus backtrack using the (±q, δj) label on each node, follow theflow augmenting path. Update the path by adding δj to the forward paths and subtracting δj

from the opposed paths. The direction of the path is indicated by ±q in the node label.

Goto Step 2

Apply the algorithm

The following steps carry out the algorithm up to the point of updating the first flow augmentingpath, this is shown in Fig. 7.19.

step 1 all flows set to zero - as in Fig. 7.18.

step 2 initially there are no labels on the nodes.

step 3 label node(S) as (S, ∞).

S

a

b

c

d

T

µ-

R

>

-~ Rª

[0, 2]

[0, 4][0, 3]

[0, 2][0, 1]

[0, 3] [0, 4]

[0, 3]

S

a

b

c

d

T

µ-

R

>

-~ Rª

[0, 2]

[0, 4][0, 3]

[0, 2][0, 1]

[0, 3] [0, 4]

[0, 3]

(S, ∞)

(S, 3)

(S, 3)

(a, 2)

(a, 1)

(c, 2)

[2, 3]

[2, 2]

[2, 4]

(a) (b)

Figure 7.19: a) label nodes b) update path

step 4

• Choose i = S this is the only choice at this stage

• The two adjacent unlabelled nodes to node(S) are a and b. Hence in turn consider j equalto these nodes:

j = a : since the flow (= 0) in arc (S, a) is less than the capacity (= 3) in the arclabel node(a) as (S, 3). (the 3 being less than the ∞ in the spare capacity field in thelabel at S.)

Page 129: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 124

j = b : since the flow (= 0) in arc (S, b) is less than the capacity (= 3) in the arc la-bel node(b) as (S, 3). (Again the 3 is less than the spare capacity in the label at S, ie∞.)

node(S) is now scanned.

• There are now two labelled unscanned nodes, namely a and b. Initially take i = a

• The two adjacent unlabelled nodes to node(a) are c and d. Hence in turn consider j equalto these nodes:

j = c : since the flow (= 0) in the arc (a, c) is less than the capacity (= 2) in the arc,decide to label node(c). Also since the spare capacity in arc(a, c) is 2 and this is lessthan the spare capacity label at node(a), which is 3, label node(c) as (a, 2).

j = d : since the flow (= 0) in the arc (a, d) is less than the capacity (= 1) in the arc,decide to label node(d). Also since the spare capacity in arc(a, d) is 1 and this is lessthan the spare capacity label at node(a), which is 3, label node(d) as (a, 1).

node(a) is now scanned.

• Take i = b, the other value of i to be considered.

• Since b now has no unlabelled adjacent nodes there is nothing to be done. (zero trip j loop)

• node(b) is now scanned.

• Start new i-loop. Set i equal to a labelled unscanned node. Thus take i equal to c and d

in turn.Taking i = c:

• There is only one adjacent unlabelled node to node(c), namely node(T ).

j = T : since the flow (= 0) in the arc (c, T ) is less than the capacity (= 4) inthe arc, decide to label node(T ). Also since the spare capacity in arc(c, T ) is 4 andthis is larger than the spare capacity label at node(c), which is 2, label node(T ) as (c, 2).

Since j = T the process has found a flow augmenting path and thus jumps to step 6of the algorithm to update the path. The amount by which the path is updated is thevalue of the spare capacity field in the node(T ) label, namely 2.

step 6 To update, starting at node(T ) use the first field in the node label at T to identify that theflow augmenting path came into T from c. Update the arc(c, T ) label to [2, 4]. At node(c) thefirst field in the node label is a thus the incoming path was from a. Update the arc(a, c) labelto [2, 2]. Finally the label at node(a) indicates that the incoming path was from node(S), thusupdate the arc(S, a) label to [2, 3]. The final network is shown in Fig. 7.19(b).

Goto step 2

Page 130: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 125

The process starts again from step 2 of the algorithm, that is to say all node labels are clearedand all nodes are assumed to be unscanned.

Note that the flow augmented path found above is fully augmented in the sense that its flow cannot beincreased. This is evident from the fact that one of its arcs is saturated, namely the arc from node(a)to node(c).

The algorithm requires two more loops before the network is flowing at maximum capacity. These aregiven in the diagrams in Fig. 7.20 and Fig. 7.21.

Note that the backward flow label appears in the network in Fig. 7.21(a) though it isn’t actuallyused in the final flow augmenting path.

S

a

b

c

d

T

µ-

R

>

-~ Rª

[2, 2]

[2, 4][2, 3]

[0, 2][0, 1]

[0, 3] [0, 4]

[0, 3]

S

a

b

c

d

T

µ-

R

>

-~ Rª

[2, 2]

[2, 3]

[0, 2]

[0, 1]

[0, 3]

[0, 4]

[0, 3]

(S, ∞)

(S, 1)

(S, 3) (a, 1)

(d, 1) [1, 1]

[3, 3]

[1, 4]

[2, 4]

(a) (b)

Figure 7.20: a) initial flow 2, insert node labels using algorithm b) update path S → a → d → T ,flow now 3

For the first of the next two loop the flow augmenting path is S → a → d → T with a spare capacityof 1 unit. The network is updated in Fig. 7.20(b).

In the final step the flow augmenting path is S → b → d → T with a spare capacity of threeunits. The network is updated in Fig. 7.21(b). The maximal flow in the network is 6 units

In Fig. 7.21(a) the label on node(a) is (−d, 1), the minus sign indicates that when tracing the pathback to node(d) the flow is from a to d rather than from d to a.

Page 131: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 126

S

a

b

c

d

T

µ-

R

>

-~ Rª

[2, 2]

[2, 4][3, 3]

[0, 2][1, 1]

[0, 3] [1, 4]

[0, 3]

S

a

b

c

d

T

µ-

R

>

-~ Rª

[2, 2]

[2, 4][3, 3]

[0, 2]

[0, 3]

[3, 3]

[1, 4]

[0, 3]

(S, ∞)

(−d, 1)

(S, 3) (b, 3)

(d, 3)

[3, 3]

[1, 1]

[4, 4]

(a) (b)

Figure 7.21: a) initial flow 2, insert node labels using algorithm b) update path S → b → d → T ,flow now 3

7.6 Maximum Flow-Minimum Cut Theorem

The problem of finding the maximum flow in Example 7.5 is now considered from a different pointsof view. The idea is based on the fact that if we break the connection between the source node S andthe sink node T by removing links then any existing flow could not have been more than the sum ofthe capacities of the links removed.

To be more precise, for a basic network remove enough arcs such that the network (graph) is splitinto two separate subgraphs X and Y , such that S ∈ X and T ∈ Y . Then the value of any flow fromS to T and hence from X to Y cannot be more than the sum of the capacities of the removed arcsthat flow from X to Y . Since it is only the flow from X to Y that is of interest the capacity of anyremoved arc whose flow is from Y to X is not relevant.

Consider Fig. 7.22(a). The subgraph X consists of the three nodes s, a and c and arcs (S, a) and(a, c).The subgraph Y consists of the other three nodes T , d and b and arcs (b, d) and (d, T ). The arcsremoved are shown in dotted lines and are (S, b), (a, d), (c, b) and (c, T ). Since all the removed arcsflow from X to Y , any flow in the network cannot exceed the sum of the capacities of these arcs,namely 3 + 1 + 2 + 4 = 10. This does not imply that 10 is the maximal flow or indeed that such aflow can exist in the network.

In Fig. 7.22(b) the sum of the capacities of the arcs removed that flow from X to Y is only 8, thus wecan now say that any flow cannot exceed 8.

Finally in Fig. 7.22(c) the sum of the arcs removed that flow from X to Y is only 6. This actu-ally agrees with the result obtained using the Ford-Fulkerson algorithm though at this stage there isno way of telling that this is in fact the maximal flow. Also in this diagram the arc from c to b wasremoved however since the flow along it is from Y to X it is not relevant when considering flows from

Page 132: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 127

X to Y .

Definition - Cut

A cut in a basic network with source S and sink T is a set of arcs whose removal separatesthe network into two distinct parts X and Y such that S ∈ X and T ∈ Y .

The capacity of a cut is the sum of the capacities of the arcs in the cut that are directedfrom X to Y .

A minimum cut is a cut of smallest possible capacity.

.................

................................

....................

................................3

21 4

S

a

b

c

d

T

X

Y

(a)

.....................

................................

....................

3

Y

1 4

S

a

b

c

d

T

X(b)

.....................

.....................

................................

................................

21S

a

b

c

d

T

X

Y

(c)2

3

Figure 7.22: Three different cuts for the network from Example 7.5; cut arcs shown in dots with theirassociated capacities. Value of cut(a)=10, value of cut(b)=8 and value of cut(c)=6

The fact that the maximal flow is equal to the value of a cut is no coincidence. Indeed a good way ofspotting the maximum flow is to construct by inspection a flow and a cut of the same value. Sincethe values of all flows is less than or equal to the value of all cuts, it follow that the maximum flowmust be less than or equal to the minimum cut. Thus when the two are found to be the same themaximum flow must have been attained. The following theorem states very clearly the relationshipbetween the maximum flow and the minimum cut:

Theorem 7.1 Max flow - Min cut

This theorem is due to Ford and Fulkerson 1956 and states:

In any basic network the value of the maximum flow is equal to the value of the minimumcut.

An alternative way of illustrating a cut is to draw a curve through the arcs that are removed. It isthen easy to see that the network is indeed split into two separate part, one containing S and onecontaining T . The value of the cut can then be read off from the capacities of the arcs from X to Y .

Example 7.6 Consider the following network, by inspection construct a cut and a flow that have thesame value. Thus write down the value of the maximal flow for the network and how it is attained.

Forming a flow is the more difficult, you need to make sure that as you increase the flows along

Page 133: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 128

S

a

b

c

T- -

6

?

3

j

3

s

S

a

b

c

T- -

6

?

3

j

3

s

[4,4] [2,2]

[2,5]

[4,4][1,1]

[3,5] [2,2][1,1]

4 25

4

25

1

1

Cut value = 8

Cut value = 8Cut value = 10 Flow = 8

(a) (b)

Figure 7.23: (a) Three cuts are constructed two with value 8 and one with value 10 (b) A flow hasbeen constructed with value 8. Since a cut value and flow value are the same the maximal flow is 8.

a path you always have: flow into a node = flow out of the node; no capacities are exceeded. It is infact quite easy to construct the flow augmenting paths and update. In the example there is a cut of8 and a flow of 8, thus the maximal flow is 8.

7.7 Flow Problem Variations

1. Bi-direction Flows

Up to now the link has been either from node(i) to node(j) or vice versa. However it is possiblethat flow can take place in both directions, for example two way traffic. In such a case the flowsmay be different as may the capacities. This is easily remedied by having two arcs between thenodes, one in one direction and one in the other. The above theory can then be applied to findthe maximal flow.

i j

ci,j

fi,j

cj,ifj,i

2. Multiple Sources and Sinks

In a case where there are multiple sources, several oil wells for example, a single artificial sourcecan be introduced. The only restriction is that an arc leaving the artificial source must have atleast the capacity of the arcs leaving the corresponding multiple source. In Fig. 7.24 the capacityof the arc from the artificial source S to S1 is made the same as the sum of the capacities of

Page 134: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 7. NETWORKS AND GRAPHS 129

the arcs leaving S1, namely 3 + 5 = 8. Similarly the arcs (S, S2), (T1, T ), (T2, T ) and (T3, T ) areconstructed.

S1

S2

T1

T2

T3

B1

B2

z

-

3

j*

~

>

~

Á3

5

4

2

1

2

3

4

5

Sources Sinks

S1

S2

T1

T2

T3

B1

B2

z

-

3

j*

~

>

~

Á3

5

4

2

1

2

3

4

5

Sources Sinks

S

ArtificialSource

>

s

8

6T

R->Artificial

Sink

3

7

5

Figure 7.24: The arcs are labelled with their capacities. The multiple sources and sinks in the first dia-gram are brought together to give a basic network with a single source S and sink T . The introductionof S and T is artificial but enables the application of the above techniques

3. Restricted Nodes

Up to now it is assumed that there is no restriction of flow through a node, the only restrictionhas been on the capacities of the arcs. In practice a node may impose a restriction, for examplea roundabout at a road junction, where if the incoming roads try to run at full capacity a queuewill form. This scenario can easily be accommodated by replacing the restricting node withtwo non-restricting nodes and an arc. The arc will have a capacity equal to the capacity of theoriginal restricting node. The following diagram Fig. 7.25 shows a restricting node with capacity6 being replaced by two non-restricting nodes and an arc with capacity 6.

N~*

3

s

2

5

4

1

node capacity 6

N1 N2

~*

3

s

-2

5

4

1

6

unrestricted nodes

arc capacity 6

Figure 7.25: Single restricted node N , capacity 6, replaced by two unrestricted nodes N1 and N2 andarc with capacity 6

4. Lower Capacity

In some problems it is necessary to always have a minimum flow in some of the arcs, for exampleoil pipe lines in Alaska will freeze if the oil is not moving. If a lower capacity, li,j is introducedthen the flow must satisfy li,j ≤ fi,j ≤ ci,j . The Ford-Fulkerson algorithm will need a slightadjustment to implement this requirement.

Page 135: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Chapter 8

Dynamic Programming

This topic is developed through the study of three very diverse problems all of which can be solvedunder the general heading of Dynamic Programming. All problems are trying to optimize somequantity, such as minimizing costs or distances or maximizing profits etc etc. As will be seen thecommon approach to the solution will to be to split the problem into stages. Rules are then developedthat move the solution from one stage to the next. The basic principle that is applied is that if at oneparticular stage a state variable is part of the overall optimal solution then an optimal solution fromthat point on is also part of the overall optimal solution. At present this idea is rather vague but itcan be easily seen in the first example where a network is considered and the shortest path throughthe network sort.

1

4

3

2

5

6

7

8

9

10

2

123

5

2

1011

1

5

1213

410

6

149

5

6

8

-

Figure 8.1: All edges are assumed to be directed from a lower numbered node to a higher numberednodes: Find the shortest path from node 1 to node 10

8.1 Shortest Route Problem

The network in Fig. 8.1 represents possible one-way road routes from node(1) to node(10), the numberson each arc representing the distance between nodes. The problem is to find the shortest route from

130

Page 136: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 131

node(1) to node(10). In Sec. 1.5 of Chapter 1 a similar problem was solved using a forward labellingmethod. The solution here is very similar, however the process is started at node(10) rather thannode(1). Additionally the intention is to use the present problem to develop a more general approachto the solution of a class of problem that are solved using Dynamical Programming.

The problem is first split into stages, this is characteristic of any dynamical programming prob-lem. First identify the nodes as being one, two, three or four arcs away from node(1) and define thefollowing sets accordingly:

S5 = {10} S4 = {8, 9} S3 = {5, 6, 7} S2 = {2, 3, 4} S1 = {1}

A stage can then be defined as the transition from Si to Si+1 with the output of one stage being theinput of the next. The stages can be visualized as in Fig. 8.2, with the input from the left of eachstage and the output to the right.In order to construct the optimal path from node(1) to node(10) dynamical programming looks at

Stage 1 Stage 2 Stage 3 Stage 4 10

8

9

8

9

5

6

7

5

6

7

4

3

2

4

3

2

1

-Input Output

Figure 8.2: Input to each stage from the left

one stage at a time. At each stage an optimal criteria is applied to move the process from one stageto the next.

The following principle is the basis of all Dynamical Programming and was proposed by Bellmanin 1957.Bellman’s Principle of Optimality

”An optimal policy has the property that whatever the initial state and initial decision are,the remaining decisions must constitute an optimal policy with regard to the state resultingfrom the first decision.”

In this problem the Optimal Policy is to find the shortest route from node(1) to node(10). To interpretthis in terms of Bellman’s statement consider the following:

• At the very start the term ”whatever the initial state” is over general for this problem as thereis only one initial state, namely node(1).

• At any stage there are many decisions to choose from, the phrase ”whatever the initial decision”refers to the decision made at the first stage when applying the optimizing criteria.

Page 137: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 132

• If after this first decision the system is at node(x), (”the sate resulting from the first decision”)and if the optimizing criteria is applied to node(x) as the first node, the same decisions will bemade as were made when starting from node(1): this is what is meant by ”remaining decisions”.

• Thus the optimal path from node(1) to node(10) will, with the exception of the path fromnode(1) to node(x), coincide with that from node(x) to node(10).

Fig.8.3 illustrates the above principle. In (a) the line from x1 to xn represents the optimal policy whichhas been created using some optimizing criteria. In (b) it is assumed that the optimizing criteria hasbeen applied from x2 onwards. Bellman’s principle asserts that the optimal policy created from thispoint on will be identical, from this point on, to the one in (a).

x1

S1

x2

S2

x3

S3

x4

S4

xn

Sn

x1

.......................................

S1

x2

S2

x3

S3

x4

S4

xn

Sn

stage 1

.......................................

stage 2 stage 3 stage (n-1)(a)

(b)

Figure 8.3: State variables xi ∈ Si; stage i is a transition from Si to Si+1

Although the above refers to the first node the argument can be reapplied to the second node onthe path and so on. Thus for the network path problem this gives the following: if a given node(k) ison the optimal path for the complete system then the optimal path from node(k) to the end, node(n),is also on the optimal path.

Restatement of Bellman’s principle

”Any partial solution of an optimal solution to the whole problem is itself an optimalsolution to the corresponding subproblem”

Stage Transitions

Stage 4

If node(9) is on the optimal path from node(1) to node(10) then the optimal path from(9) to (10) is also on this path. In this case the result is trivial since there is only one pathfrom (9) to (10) which is of length 2. Label node(9) as [2,10].

Page 138: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 133

If node(8) is on the optimal path from node(1) to node(10) then the optimal path from(8) to (10) is also on this path. As before this is trivial thus Label node(8) as [5,10].

The whole transition process and the decisions made are summarized in Table 8.1.

Label Input Arc Output Shorteststage 1 Decision stage 1 distance

[5, 10] 8 (8,10) 10 5[2, 10] 9 (9,10) 10 2

Table 8.1: Stage 1 transition

For each input an arc has been selected from the decision set D4 = {(8, 10), (9, 10)}.

Stage 3

In this stage the set of possible arc decisions is the set

D3 = {(5, 9), (5, 8), (6, 8), (6, 9), (7, 8), (7, 9)}.

For each input to this stage the optimal policy will be used to select one of the arcs. It isnow that Bellman’s Principle of Optimality comes into its own. If node(5) is on the optimalroute then the shortest path from node(5) to node(10) is also on the optimal route. If thearc (5,8) is selected then the distance to node(10) via node(8) is 3+5=8. On the otherhand if the arc (5,9) is selected then the distance to node(10) via node(9) is 9+2=11. Sincethe optimal policy is to look for the shortest route then if node(5) is on the optimal routeselect (5,8) from the decision set D3. Repeating the same argument for nodes 6 and 7gives the following summary Table 8.2. The labels can be placed on the network. The

Label Input Arc Output Shorteststage 3 Decision stage 3 distance

[8, 8] 5 (5,8) 8 8[7, 9] 6 (6,9) 9 7[12, 9] 7 (7,9) 9 12

Table 8.2: Stage 3 transition

calculation then moves to the next stage.

Stage 2

At stage2 the decision set is:

D2 = {(2, 5), (2, 6), (2, 7), (3, 5), (3, 6), (3, 7), (4, 5), (4, 6)}

Arguing as before: if for example node(4) is on the optimal path then the optimal pathfrom one of the nodes 5, 6, or 7 to node 10 must be part of the overall optimal path.

Page 139: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 134

Hence the link from node(4) to one of these, that gives the shortest path from node(4) tonode(10), is the one to select.

Using the recorded distances from nodes 5,6, and 7 to node(10) and adding the corre-sponding distances from node(4) to these distances it can be seen that the smallest overalldistance is attained by selecting the arc (4,5).

Repeating this argument with the other two input states to stage 2, namely node(3) andnode(2), gives the following table:

Label Input Arc Output Shorteststage 2 Decision stage 2 distance

[19, 6] 2 (2,6) 6 19[14, 5] 3 (3,5) 5 14[20, 5] 4 (4,5) 5 20

Table 8.3: Stage 2 transition

Label the nodes on the network.

Stage 1

For this stage the decisions are:

D1 = {(1, 4), (1, 3), (1, 2)}

Clearly here the arc decision is (1,3) giving an overall distance of 19.

Using the labels it is possible to trace the route back to give the shortest path as

1 → 3 → 5 → 8 → 10 min distance = 19

8.2 Generalization of Dynamic Programming

The shortest route problem of Sec. 8.1 can be used to formulate a general Dynamical Programmingapproach. Consider stage 3 of the problem, diagrammatically this is shown in Fig 8.4 Where as seenabove

D3 = {(5, 9), (5, 8), (6, 8), (6, 9), (7, 8), (7, 9)}.Definitions

Define xi to be the input to stage i.

Thus in the notation of the last problem x5 = 10, x4 ∈ {8, 9}, x3 ∈ {5, 6, 7} etc.

Define di to be the decision made at stage i, thus di ∈ Di.

In the the last problem d4 = (8, 10), d3 = (5, 8), d2 = (3, 5) and d1 = (1, 3)

Page 140: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 135

Decision Set Di

For a given input xi

which arc can be selectedfor output

Decision CriteriaA policy for selecting

a specific arc di

- -

Input Output

xi ∈ {5, 6, 7} xi+1 ∈ {8, 9}xi+1 = ti(xi, di)

?ri(xi, di)

Figure 8.4: Process at stage i = 3: input xi , output xi+1 , decision di , transformation function ti ,reward ri

Define ti(xi, di) to be the output at stage i given that the input was xi and the decisionmade was di. ti is called the transformation function for stage i. The domain of ti is asubset of Si×Di. Thus in general, with the stages numbered from the end of the problem,

xi+1 = ti(xi, di)

Define ri(xi, di): At each stage there is a reward based on the input and the deci-sion made. In this problem the reward is the distance along the arc selected. Letri(xi, di) be the reward at stage i for given input xi and decision di. In this problem1

ri(xi, di) = dist(xi, xi+1)

In the problem, as the process moves from stage to stage, it applies the optimizing criteriaand calculates the minimum distance from the end node to the current position. Let fi(xi)be the distance of the shortest path from node(10) to node xi in stage i. In the problem,at stage 3 for example, f3(5) = 8, f3(6) = 7 and f3(7) = 12. f is sometimes called theoptimization functional and is defined by a recurrence relation as follows.

In detail, at stage 3, when calculating the shortest distance to node(5) from node(10) thefollowing calculations are carried out:

[distance from node(5) to node(8) ]+ [shortest distance of node(8) from 10]

was compared with

[distance from node(5) to node(9) ] + [shortest distance of node(9) from 10) ].1Where dist(xi, xi+1) is the distance along the arc from node xi to node xi+1

Page 141: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 136

and the minimum value selected.

Bearing in mind that from the definition of fi, the distance of node(9) to 10 is f4(9) andthe distance of node(8) to (10) is f4(8) it follows that:

f3(5) = minall(5,x4)arcs

{dist(5, x4) + f4(x4)}

In the general network problem for finding the minimum path the optimization functional is definedby:

fi(xi) = minall(xi,xi+1)arcs

{dist(xi, xi+1) + fi+1(xi+1)} i = 1 . . . 4

If the problem is to find the longest path then an optimal policy of maximizing at each stage is adoptedand the optimization functional is defined as:

fi(xi) = maxall(xi,xi+1)arcs

{dist(xi, xi+1) + fi+1(xi+1)} i = 1 . . . 4

In both cases f5(x5) is set equal to zero.

Clearly this can be extended to other criteria such as the path with the longest legs or the pathwith the shortest legs.

8.3 Method of Solution for Networks

The above ideas are central to all Dynamical Programming type problems, however for the networkproblem, which is quite common, a fairly simple approach can be adopted. To do this the processstarts at the final node and works back, at each stage the nodes are labelled with [fi(xi), xi+1] where(xi, xi+1) is the decision made for input xi at stage i. (That is to say the arc from xi to xi+1 isselected as the optimal route for input xi). As usual the stages are numbered in ascending order fromthe first and fi(xi) is the optimization functional for xi. Usually this is the shortest or longest pathfrom node xi to the final node, however in the following example another criteria for optimal route isalso considered.

Example 8.1 Using the methodology of dynamic programming we are required to find for the networkin Fig. 8.5:

(i) The shortest path from node(1) to node(10).

(ii) The longest path from node(1) to node(10).

(iii) The path from node(1) to node (10) containing the shortest legs.

Before carrying out the calculations identify the following;

• Suitable stages for the process.

• The decision set Di at each stage.

Page 142: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 137

• The state variables xi at each stage.

• The optimization functional for each of (i), (ii) and (iii) above.

Carry out the calculations for (i), (ii) and (iii) using the following three diagrams.

1

2

3

4 7

10

96

5 8

7

- -

R

w- -

µ

~

^

s- -

s

3

73

9

8

7

9

6

4

6

12

10

4

8

710

5

812

9

Figure 8.5: Network for Ex(8.1)

• Numbering from left to right the stages are as follows. Stage 1: the transition from node(1) tonodes (2), (3). Stage 2: the transition form nodes (2) and (3) to nodes (4),(5) and (6). Stage3: the transition from nodes (4), (5) and (6) to nodes (7), (8) and (9). Stage 4: the transitionfrom nodes (7), (8) and (9) to node(10). Although not really necessary stage 5 could be the finalstage with input node(10) and no output and stage 0 the first stage with no input and outputnode(1).

• The decision sets at each stage are simply the possible choices of arcs to traverse when movingthrough the network from node(1) to node(10). Thus:

D1 = {(1, 2), (1, 3)} D2 = {(2, 4), (2, 5), (2, 6), (3, 4)}D3 = {(4, 7), (4, 8), (5, 7), (5, 8), (5, 9), (6, 7), (6, 8), (6, 9)} D4 = {(7, 10), (8, 10), (9, 10)}

• The state variables are the inputs to the stages and with the usual notation:

x4 ∈ {7, 8, 9} x3 ∈ {4, 5, 6} x2 ∈ {2, 3} x1 = 1 and x5 = 10

• For each of the three questions the optimization functional is given below, with in each casef5(10) = 0:

(i) fi(xi) is the shortest path from node xi at stage i to node(10). Mathematically this iswritten as:

fi(xi) = minall(xi,xi+1)arcs

{dist(xi, xi+1) + fi+1(xi+1)} i = 1 . . . 4

Page 143: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 138

(ii) fi(xi) is the longest path from node xi at stage i to node(10). Mathematically this iswritten as:

fi(xi) = maxall(xi,xi+1)arcs

{dist(xi, xi+1) + fi+1(xi+1)} i = 1 . . . 4

(iii) fi(xi) is the length of the longest leg on the path from node xi at stage i to node(10) whichhas the smallest longest leg. That is to say the path with minimum maximum leg length.Mathematically this is written as:

fi(xi) = minall(xi,xi+1)arcs

{max {dist(xi, xi+1), fi+1(xi+1)}} i = 1 . . . 4

To carry out the three calculations the nodes are labelled as described above, for (i) there are threediagrams illustrating the first two phases of labelling and then the final result. For (ii) and (iii) thediagrams show the final labels.

1

2

3

4 7

10

96

5 8

7

- -

R

w - -

µ

~

^

s- -

s

3

739

8

7

9

6

4

6

12

10

4

8

7

10

5

8

12

9

[12, 10]

[8, 10]

[10, 10]

1

2

3

4 7

10

96

5 8

7

- -

R

w - -

µ

~

^

s- -

s

3

739

8

7

9

6

4

6

12

10

4

8

7

10

5

812

9

[12, 10]

[8, 10]

[10, 10]

[17,8]

[15, 9]

[14, 9]

Figure 8.6: Problem (i), with the third and fourth stage input nodes labelled. To label node(4), forexample, the route back via node(7) is (6+12) and via node(8) is (9+8), thus label as [17,8]. Note thevalues of 12 and 8 are taken from the labels on nodes (7) and (8) respectively; there is never any needto look any further along the path for these values.

Page 144: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 139

1

2

3

4 7

10

96

5 8

7

- -

R

w- -

µ

~

^

s- -

s

3

739

8

7

9

6

4

6

12

10

4

8

710

5

812

9

[12, 10]

[8, 10]

[10, 10]

[17,8]

[15, 9]

[14, 9]

[20,6]

[18,6]

[26,3]

Figure 8.7: Final solution to(i); shortest path 1 → 3 → 6 → 9 → 10 length = 26

1

2

3

4 7

10

96

5 8

7

- -

R

w- -

µ

~

^

s- -

s

3

739

8

7

9

6

4

6

12

10

4

8

710

5

812

9

[12, 10]

[8, 10]

[10, 10]

[18,7]

[24, 7]

[22, 7]

[33,5]

[26,6]

[42,2]

Figure 8.8: Final solution to(ii); longest path 1 → 2 → 5 → 7 → 10 length = 42

Page 145: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 140

1

2

3

4 7

10

96

5 8

7

- -

R

w- -

µ

~

^

s- -

s

3

739

8

7

9

6

4

6

12

10

4

8

710

5

812

9

[12, 10]

[8, 10]

[10, 10]

[9,8]

[8, 8]

[8, 8]

[8,6]

[8,6]

[8,3]

Figure 8.9: Final solution to (iii); path along which the maximum leg is minimized. 1 → 3 → 6 → 8 →10 max leg length = 8. At node(4), for example, returning to node(10) via node(7) will encounter a leglength of at most the max(6,12)=12, whereas returning via node(8) a max leg length of max(9,8)=9 isencountered. The minimum of 12 and 9, namely 9 gives us the route that contains the minimum leglength. Thus node(4) is labelled [9, 8].

8.4 Equipment Replacement Problem

A form of the equipment replacement problem was considered in Lectures 7 and 8 where the problemwas formed as a shortest path network problem and solved using Dijkstra’s algorithm. A differentapproach, and arguably a more flexible approach, is via Dynamic Programming. As seen here one ofthe most difficult features of this approach is constructing the model in a Dynamical Programmingformat.

Example 8.2 Equipment Replacement ProblemA Company needs to determine the best replacement strategy for a large piece of equipment over thenext four year period. At present the equipment is two years old and the policy is never to run apiece of equipment for more than five years. Over its lifetime the equipment will generate revenue,however this revenue will decrease with time whilst the running cost will increase with time. The costof purchasing a new piece of equipment is assumed to remain constant at £200000 with the the oldequipment being sold on the secondhand market.

The problem is to determine the best time (or times) to replace the equipment such that at theend of the four year period the residual value of the then current machine plus the net income madefrom the machine over the period (taking into account the cost of replacement and receipts obtainedfrom selling secondhand equipment) is a maximum.

Page 146: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 141

The following table, Table 8.4 contains the annual revenue and the operating cost of a machinewhich is t years old at the start of the year. The secondhand values are those of a t year old machine.In all cases it is assumed that the machine is at least a year before being sold.

Age of Machine Revenue Operating Cost Secondhand Valuet yrs r(t) c(t) s(t)

0 40 0.8 −1 38 1 1502 37 1.5 1203 34 2.0 1004 31 3.0 605 − − 40

Table 8.4: All values are in thousands of pounds sterling

Solution

Stages and State variables.In this problem the stages will be the four years with a final stage being the selling of the secondhandmachine. The states xi will be the age of the machine at the start of the ith year.DecisionsAt each stage the only decisions are to Keep or Replace the machine.

2

1

3

1

2

4

1

2

3

5

1

2

3

4

µ-

: -

w-

z

¸

s

>

q

*7

j

s

j

7

7 zR

R R

R

R R

R

R

R

R

K

K K

K

KK

K

K

K

Sell

Rq

*7

stage 1 stage 2 stage3 stage 4 stage 5

x1 = 2 x2 ∈ {1, 3} x3 ∈ {1, 2, 4} x4 ∈ {1, 2, 3, 5} x5 ∈ {1, 2, 3, 4} x6 = sell

Figure 8.10: The input values xi (state variables) to stage i are shown. The decisions to replace orkeep are denoted by R and K respectively. It is stressed that only the possible states and decisions areshown.

The network in Fig. 8.10 illustrates the possible state variables xi at each stage and the associated

Page 147: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 142

decisions.ReturnThe return at each stage is shown in Fig.8.11 with the greatest influence being whether or not it isdecided to replace or keep the equipment.Transformation FunctionFrom Fig. 8.11 the transformation function can formally be seen to be ti(xi, R) = 1 and ti(xi,K) =xi + 1Optimization FunctionalTo construct the optimal functional define fi(xi) to be the maximim net return from stage i withinput xi to stage 5 (the final stage). Fig. 8.11 shows the construction of the recurrence relation ingeneral and in the specific case for f3(2). Since the problem is to make as much profit as possible the

xi

1

xi+1

>

s

R

K

return = r(0) + s(xi)− c(0)− 200

return = r(xi)− c(xi)

fi+1(1)

fi+1(xi + 1)

fi(xi)

xi+1 = xi + 1

2

1

3

>

s

R

K

return = 40 + 120− 0.8− 200

return = 37− 1.5

f4(1)

f4(3)

f3(2)

x4 = x3 + 1 = 3

(a) (b)

Figure 8.11: (a) The general case from state xi to xi+1 (b) the case for x3 = 2 In both cases thereturns are shown for each of the decisions replace and keep.

problem will be to maximize fi(xi). Thus with reference to Fig.8.11 the recurrence relation for fi(xi)is given by:

fi(xi) = Max

fi+1(1) + r(0) + s(xi)− c(0)− 200 if Replace

fi+1(xi + 1) + r(xi)− c(xi) if Keep

i = 1 . . . 4 f5(x5) = s(x5)

Introducing the notation [fi(xi), R/K/S] the method of solving the problem by labeling the nodes isas follows.

stage 5 This is a simple stage where the item is sold at secondhand value and f5(x5) is the correspondingsecondhand value of each of the possible x5 values at this stage. Thus the labels [150, S], [120, S],[100, S] and [60, S] are respectively placed on the four nodes (1), (2), (3) and (4) in Fig. 8.12.

stage 4 x4 = 1 f4(1) = Max{

150 + 40 + 150− 0.8− 200 = 139.2 R120 + 38− 1 = 157 K

}⇒ label = [157,K]

x4 = 2 f4(2) = Max{

150 + 40 + 120− 0.8− 200 = 109.2 R100 + 37− 1.5 = 135.5 K

}⇒ label = [135.5,K]

x4 = 3 f4(3) = Max{

150 + 40 + 100− 0.8− 200 = 89.2 R60 + 34− 2 = 92 K

}⇒ label = [92,K]

Page 148: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 143

2

1

3

1

2

4

1

2

3

5

1

2

3

4

µ

-:

-

w-

z

¸

s

>

q

*7

j

s

j

7

7 zR

R R

R

RR

R

R

R

R

K

KK

K

KK

K

K

K

Sell

Rq

37

stage 1 stage 2 stage3 stage 4 stage 5

x1 = 2 x2 ∈ {1, 3} x3 ∈ {1, 2, 4} x4 ∈ {1, 2, 3, 5} x5 ∈ {1, 2, 3, 4} x6 = sell

[150,S]

[120,S]

[100,S]

[60,S]

[157,K]

[135.5,K]

[92,K]

[29.2,R]

[172.5,K]

[127.5,K]

[57.2,K]

[164.5,K]

[111.7,R]

[147.2,K]

Figure 8.12: the labels on the nodes are calculated in stages 1 - 5 below

x4 = 5 f4(5) = Max{

150 + 40 + 40− 0.8− 200 = 29.2 R} ⇒ label = [29.2,R]

stage 3 x3 = 1 f3(1) = Max{

157 + 40 + 150− 0.8− 200 = 146.2 R135.5 + 38− 1 = 172.5 K

}⇒ label = [172.5,K]

x3 = 2 f3(2) = Max{

157 + 40 + 120− 0.8− 200 = 116.2 R92 + 37− 1.5 = 127.5 K

}⇒ label = [127.5,K]

x3 = 4 f3(4) = Max{

157 + 40 + 60− 0.8− 200 = 56.2 R29.2 + 31− 3 = 57.2 K

}⇒ label = [57.2,K]

stage 2 x2 = 1 f2(1) = Max{

172.5 + 40 + 150− 0.8− 200 = 161.7 R127.5 + 38− 1 = 164.5 K

}⇒ label = [164.5,K]

x2 = 3 f2(3) = Max{

172.5 + 40 + 100− 0.8− 200 = 111.7 R57.2 + 34− 2 = 89.2 K

}⇒ label = [111.7,R]

stage 1 x1 = 2 f1(2) = Max{

164.5 + 40 + 120− 0.8− 200 = 123.7 R111.7 + 37− 1.5 = 147.2 K

}⇒ label = [147.2,K]

Thus the solution to the problem is to keep the machine for the first year, then replace it and thenkeep it to the end of the period. Doing this the maximum net profit is equal to £ 147200.

Page 149: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 144

8.5 Knapsack Problem

The original Knapsack Problem concerned the packing of a knapsack with different amounts of differ-ent items. For example how many pairs of socks, shirts, bars of soap, tins of food etc should a personpack. To each item is attributed a value and the problem is to decide how much of each should bepacked in order to maximize the total value of the knapsack. Clearly there is a restriction on how muchthe knapsack can hold plus the complication that different items will take up different amounts of space.

A more useful example of the problem could be that of loading a cargo ship. The space is lim-ited and different items take up different amounts of space but at the same time are worth differentamounts. Therefore how should the cargo ship be loaded to maximize the value of the cargo.

The following problem may at first sight not appear to be a knapsack type problem however oncloser inspection it becomes evident that the knapsack method is applicable..

Example 8.3

A building maintenance firm carries out four different types of repair. Each job takes a certain amountof time and each job is worth a certain amount. The local council has a list of such jobs that needto be completed and the firm has first choice in deciding which jobs to work on and complete in thenext ten day period. It is therefore the job of the manager to select the jobs at the start of the periodthat will maximize the firm’s return.

In Table 8.5 the job types are numbered 1 . . . 4. The table also shows the total number of jobs thecouncil has available and the time in days that the firm will take to complete each type of job. Finallythe value of each job to the firm is given in £100 units. Thus as an example the firm may decide to

Job Type Number of Time/job τi Value ρi

i Available Jobs in days in £1004 4 1 23 3 3 82 2 4 111 2 7 20

Table 8.5:

take on two jobs of type 2 and and two jobs of type 4, this giving a return of £2600.

Consider the problem using the general approach outlined in the last section with reference to Fig. 8.13.

Stages

The first thing to do is to split the problem into stages. The obvious way to do this is toassign a stage to the allocation of each job type, thus there will be four stages. As in the

Page 150: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 145

network problem let the first stage in the sequence be labelled stage 1. At this stage thenumber of days to be spent on job type 1 is decided.

State variable

Let xi be the number of days available at the start of stage i. Thus at the start of theproblem when no time has been allocated there are 10 days left, thus x1 = 10.

Decision Variable

Let di be the number of jobs of type i that are allocated at stage i.

10

3

10

3

2

6

10

3

0

2

6

1

4

7

10

0

¸

U

-

7

3

-

*

:

:

1

1

-

q

s

R~j

3

:3

6

2

1

0

2

00

00

0

7

Á

1

1

1

1

2

2

3

0

x1 = 10

x2 ∈ {3, 10}x3 ∈ {3, 2, 6, 10}

x4 ∈ {0, 1, 2, 3, 4, 6, 7, 10}

x5 ∈ {0, 2, 3, 6}

stage 1 stage 2 stage 3 stage 4

j

-

-

3

0

2

1

4

4

4

4

Figure 8.13: The arcs are labeled with the decision values di. For the last stage the decisions are equalto the corresponding value of x4 ≤ 4 and 4 otherwise. This uses up all the available time and hencemaximize the return for this final stage. (possible since one job 4 only takes up one unit of time

Return

The return at stage i is calculated from the last column of Table 8.5 and will depend onthe number of jobs of type i that it is decided to carry out. Thus ri(xi, di) = ρi × di

Transformation function

At stage i there are xi days left thus if it is decided to carry out di jobs of this type, usingTable 8.5 for τi , the number of days remaining is xi+1 = ti(xi, di) = xi − τidi.

Page 151: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 146

Optimization Functional

Define fi(xi) to be the maximal total return from stage i to stage 4 for the given input xi

at stage i. Fig. 8.14 is useful in constructing the functional fi(xi) as:

fi(xi) = maxdi∈Di

{fi+1(xi − τidi) + di × ρi} 1 = 1 . . . 4 f5(x5) = 0

= x1 − 7d1

- -

?

?6x1 = 10

d1 ∈ {0, 1}

x2 ∈ {10, 3}

r1(x1, d1) = 20d1

x2 = t1(x1, d1)= xi − τidi

- -

?

?6xi

di ∈ Di

xi+1

ri(xi, di) = ρidi

xi+1 = ti(xi, di)

Figure 8.14: (a) General transition at stage i (b) Process at initial stage i = 1: input x1 = 10 , outputx2 , decision d1 , transformation function t1 , reward r1

Solution to problemIntroducing the notation [fi(xi), xi+1] the nodes in the network representation of the problem inFig. 8.13 can be solved in the usual way starting at stage 4.

Stage 4

Since the time for job 4 is 1 day all the available time, up to four days, is allocated at stage 4,this will ensure a maximum return at this stage. These entries are entered in Fig. 8.15 on thestage 4 nodes.

Stage 3

x3 = 3 maxd3

{6 + 0, d3 = 0 : 0 + 8, d3 = 1} = 8 label = [8,0]

x3 = 2 maxd3

{4 + 0, d3 = 0} = 4 label = [4,2]

x3 = 6 maxd3

{6 + 8, d3 = 1 : 0 + 16, d3 = 2 : 8 + 0, d3 = 0} = 16 label = [16,0]

x3 = 10 maxd3

{2+24, d3 = 3 : 8+16, d3 = 2 : 8+8, d3 = 1 : 8+0, d3 = 0} = 26 label = [26,1]

Stage 2

x2 = 3 maxd2

{8 + 0, d2 = 0} = 8 label = [8,3]

x2 = 10 maxd2

{4 + 22, d2 = 2 : 16 + 11, d2 = 1 : 26 + 0, d2 = 0} = 27 label = [27,6]

Page 152: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

CHAPTER 8. DYNAMIC PROGRAMMING 147

10

3

10

3

2

6

10

3

0

2

6

1

4

7

10

0

¸

U

-

7

3

-

*

:

:

1

1

-

q

s

R~j

3

:3

6

2

1

0

2

00

00

0

7

Á

1

1

1

1

2

2

3

0

x1 = 10

x2 ∈ {3, 10}x3 ∈ {3, 2, 6, 10}

x4 ∈ {0, 1, 2, 3, 4, 6, 7, 10}

x5 ∈ {0, 2, 3, 6}

stage 1 stage 2 stage 3 stage 4

j

-

-

[6,0]

[0,0]

[4,0]

[8,2]

[2,0]

[8,0]

[8,3]

[8,6]

[8,0]

[4,2]

[16,0]

[26,1]

[8,3]

[27,6]

[28,3]

3

0

2

41

4

4

4

Figure 8.15: The diagram only shows the outputs from stage 4 that yield a maximum return for thisfinal stage. The optimal path is shown in bold.

Stage 1

x1 = 10 maxd1

{8 + 20, d1 = 1 : 27 + 0, d1 = 0} = 28 label = [28,3]

Thus the most profitable way to allocate the jobs is to do one job oftype 1, one job of type 3 and no jobs of types 2 and 4. The maximumvalue of this strategy is £2800.

Page 153: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Appendix A

Worksheets

A.1 Worksheet 1

1. Inequalities

Graphically display the feasible region defined by the following inequalities:

2x1 + 2x2 ≤ 8 3x1 + 2x2 ≤ 12 x1 + 0.5x2 ≤ 3 x1 ≥ 0, x2 ≥ 0

Maximize z = 3x1 + 2x2 on the feasible region. Which, if any, of the first three inequalities maybe removed without affecting the optimum solution?

2. Inequalities

Consider the following linear programming model:

Maximize the objective function z = 3x1 + 3x2 subject to the constraints:

2x1 + 4x2 ≤ 12 6x1 + 4x2 ≤ 24 x1 ≥ 0, x2 ≥ 0

(a) Find the optimal solution using graphical means.

(b) If the objective function is changed to z = 2x1 + 6x2 what will the optimum solution be.

3. Workload Balancing

The company Snap produces photo printers for both the professional and consumer markets.The Snap consumer division recently introduced two photo printers that provide colour printsrivaling those produced by a professional processing lab. The P100 model can produce a 100mm× 150mm borderless print in 40 seconds. The more sophisticated and faster P150 can evenproduce a 300mm× 500mm print. Financial projections show profit contributions of £42 foreach P100 and £87 for each P150.

The printers are assembled, tested and packaged at Snap’s plant located in New Barnet. Thisplant is highly automated and uses two manufacturing lines to produce the printers. Line 1performs the assemble operation with times of 3 mins per P100 printer and 6 mins per P150printer. Line 2 performs both the testing and packaging operations. Times are 4 mins per P100

148

Page 154: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 149

printer and 2 mins per P150 printer. The shorter time for the P150 is a result of its faster printspeed. Both manufacturing lines are in operation for one 8-hour shift per day.

The problem

Perform an analysis for Snap by consider the following points.

(a) Obtain the best number of units of each type to produce in order to maximize the totalcontribution to profit in an 8 hour shift. What reasons might management have for notimplementing your recommendation?

(b) Suppose that management also states that the number of P100 printers produced shouldbe at least as great as the number of P150 produced? Again assuming that the objectiveis to maximize the total contribution to profit in an 8 hour shift, how many units of eachprinter should be produced?

(c) Does the solution you have in (b) balance the total time spent on Line 1 with that on Line2? Why should this be of concern to management?

(d) Management requested an expansion of the model in (b) that would produce a betterbalance between the total time on Line 1 and that on Line 2. They want to limit thedifference between the time spent on the two lines in the 8-hour shift to be no more than30mins. If the objective is still to maximize the total profit how many units of each printershould be produced? What effect does this work-load balance have on the total profit in(b)?

(e) Suppose that in part (a) management specified the objective as maximizing the total numberof printers produced each shift rather than the total profit contribution. With this objective,how many units of each printer should be produced per shift? What effect does thisobjective have on total profit and workload balance?

4. Production Strategy

Fit-Fit manufactures exercise equipment at its plant in York. It recently designed two universalweight machines for the home exercise market. Both machines use Fit-Fit’s patented technologythat provides the user with an extremely wide range of motion capabilities for each type ofexercise performed. Until now, such capabilities have been available only on expensive weightmachines used primarily by physical therapists.

At a recent trade show, demonstrations of the machines resulted in significant dealer interest.In fact, the number of orders that Fit-Fit received at the trade show far exceeded its manu-facturing capabilities for the current production period. As a result, management decided tobegin production of the two machines. The two machines, which Fit-Fit named Body-Firm andBody-Strong, require different amounts of resource to produce.

Body-Firm consists of a frame unit, a press station and a pec-dec station. Each frame produceduses four hours of machining and welding time and two hours of painting and finishing time.Each press station requires two hours of machining and welding and one hour of painting andfinishing, and each pec-dec station uses two hours of machining and welding time and two hours

Page 155: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 150

of painting and finishing time. In addition two hours are spent assembling, testing and packagingeach Body-Firm unit. The raw material costs £450 for each frame, £300 for each press stationand £250 for each pec-dec station. Packaging costs are estimated at £50 per unit.

Body-Strong consists of a frame unit, a press station, a pec-dec station, and a leg press station.Each frame produced uses five hours of machining and welding time and four hours of paintingand finishing time. Each press station requires three hours machining and welding time andtwo hours of painting and finishing time, each pec-dec station uses two hours of machining andwelding time and two hours of painting and finishing time, and each leg press station requirestwo hours of machining and welding time and two hours of painting and finishing time. Inaddition, two hours are spent assembling, testing, and packaging each Body-Strong unit. Theraw material costs are: £650 for each frame, £400 for each press station, £250 for each pec-decstation, and £200 for each leg press station; packaging costs are estimated to be £75 per unit.

For the next production period, management estimates that 600 hours of machining and weldingtime, 450 hours of painting and finishing time, and 140 of assembly, testing, and packaging timewill be available. Current labour costs are £20 per hour for machining and welding time, £15per hour for painting and finishging time, and £12 per hour for assembly, testing, and packagingtime. The market in which the two machines must compete suggests a retail price of £2,400for the Body-Firm unit and £3,500 for the Body-Strong unit, although some flexibility may beavailable to Fit-Fit because of the unique capabilities of the new machines. Authorised Fit-Fitdealers can purchase machines for 70% of the suggested retail price.

Fit-Fit’s President believes that the unique capabilities of the Body-Strong unit can help positionFit-Fit as one of the leaders in high-end exercise equipment. Consequently, he has stated thatthe number of units of Body-Strong produced must be at least 25% of the total production.

The problem

Analyse the production strategy at Fit-Fit as follows:

(a) What is the recommend number of Body-Firm and Body-Strong machines to produce inorder to maximize profit.

(b) How does the requirement that the number of units of Body-Strong produced be at least25% of the total production affect profits?

(c) Where should efforts be expended to increase profits?

A.2 Worksheet 1 - Solutions

1. In Fig. A.1(a) the feasible region is shown hashed. As 3x1 + 2x2 = 12 does not form part of theboundary of the feasible region the constraint 3x1 +2x2 ≤ 12 is redundant and may be removedwithout affecting the feasible region.

The objective function has been plotted with z = 6. As this value of z is increased the objectivefunction moves away from the origin and last intersects the feasible region at P . The point P

therefore is the point at which z attains its maximum.

Page 156: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 151

As P lies on the intersection of 3 = x1 +0.5x2 and 8 = 2x1 +2x2 the coordinates of P are (2, 2).Hence the maximum value of z is z = 3(2) + 2(2) = 10.

2. (a) In Fig. A.1(b) the feasible region is shown hashed. The objective function z = 3x1 + 3x2

is shown plotted with z = 6. As z increases this moves away from the origin and lastintersects the feasible region at B. Calculating the coordinates of B from the intersectionof 6x1 + 4x2 = 24 and 2x1 + 4x2 = 12 gives B(3, 1.5) and hence the maximum value ofz = 3(3) + 3(1.5) = 13.5.

(b) In Fig. A.1(b) the objective function z = 2x1 + 6x2 is shown plotted with z = 12. As z

increases this moves away from the origin and last intersects the feasible region at A whichhas coordinates (0, 3), hence the maximum value of z = 2(0) + 6(3) = 18.

5 5

5 5

x1 x1

x2 x2

.....................................

3x1 + 2x2 = 12(redundant)

z = 6 = 3x1 + 2x2

7

x1 + 0.5x2 = 3

2x1 + 2x2 = 8

7 7

(a) (b)

P ................................................................

..............................

6x1 + 4x2 = 24

2x1 + 4x2 = 12

z = 6 = 3x1 + 3x2

z = 12 = 2x1 + 6x2

µ µ

A

B

Figure A.1: Feasible regions hashed. Objective functions dotted (a) z = 10 max at P (2, 2)(b) z = 2x1 + 6x2 max at A(0, 3), value 18. z = 3x1 + 3x2 max at B(3, 1.5), value 13.5.

3.

Identify the problem

In this problem the questions to be addressed are listed, however if the problem was just ’inves-tigate’ then a list of such questions would need to be constructed.

A good starting point to try and understand any problem is to collect together the data, in thiscase in the form of a table, as follows:

Formulate the model

Page 157: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 152

Type Line 1 Line 2 ProfitP100 3 4 £42P150 6 2 £87

Available 480 480time

Table A.1: Processing times in minutes per item and profit in £ per item. Total of 480min processingtime available for each type

Let p1 and p2 denote the number of P100 and P150 printers produced in a given shift.

The problem will involve maximizing the profit which is given by z = 42p1 + 87p2.

The constraints due to the limitation of production time on each line are:

3p1 + 6p2 ≤ 480, 4p1 + 2p2 ≤ 480 p1, p2 ≥ 0 (A.1)

Carry out Mathematics

(a) The feasible region given by the inequalities in Eq(A.1) is shown in the graph in FigureA.2(a). The objective function is shown with z = 3654 = 42p1 + 87p2. Since it is not clearwhether z is max at A or B we can either evaluate z at these points or compare the gradientof AB with that of z.

Coordinates of A are (106 23 , 26 2

3) and give z = 6800.

Coordinates of B are (0, 80) and give z = 6960.

Hence the recommendation is to produce eighty P150 in the eight hour shift and none ofthe P100 model. This gives a profit of £6960. This may not be acceptable since it is notgood marketing strategy to only have one product.

(b) For the additional constraint p1 ≥ p2 the new feasible region is show in Figure A.2(b). It isclear in this case that the objective function is maximum at C. The coordinates of C are(53 1

3 , 53 13) and at this point z = 6880

Thus if the company is to produce at least as many P100 models as P150 then they shouldproduce 53 units of each. This will give a little slack in the system and will lead to a profitof £6837.(no rounding analysis carried out)

(c) The production time for line 1 is 3p1 + 6p2 which with p1 = p2 = 53 gives 477mins. Theexact value at C giving 480 which is binding. The production time for line 2 is 4p1 + 2p2

which p1 = p2 = 53 gives 318 mins , showing a considerable amount of slack on this line.(this doesn’t improve much if we use the exact values from the coordinates of C).

Clearly therefore the production lines are not balanced and this will lead to idle labourwhich cannot be considered as a good thing.

(d) The idea of a fully occupied workforce and the production of both types of product arenow to be thought more important than just theoretically making a maximum profit. Ahappy workforce and long term sales are obviously important. To this aim the company

Page 158: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 153

12

16

8

24

..................

..................

................

B

A

¸

z = 3654 = 42p1 + 87p2

3p1 + 6p2 = 480

4p1 + 2p2 = 480

(a)

p1

p2

12

16

8

24

..................

..................

................

C

p1 = p2

B

A

¸

z = 3654 = 42p1 + 87p2

3p1 + 6p2 = 480

4p1 + 2p2 = 480

(b)

p1

p2

Figure A.2: Scale on both axes 1:10

now imposes a constraint so that there is no more than 30min difference between the twoproduction lines.Thus the additional constraint is

|(3p1 + 6p2)− (4p1 + 2p2)| ≤ 30 ⇒ |4p2 − p1| ≤ 30 ⇒ −30 ≤ 4p2 − p1 ≤ 30

Thus the feasible region has to also lie between the lines −30 = 4p2− p1 and 4p2− p1 = 30.This is shown in Figure A.3(a)The objective function is now maximum at T which has coordinates (96 2

3 , 31 23) which gives

z = 6815 Without doing any rounding analysis we could suggest they produced 96 P100and 31 P150 to satisfy the added requirements.

(e) Figure A.3(b) is simply Figure A.2(a) with a different objective line. It is clear that themaximum now occurs at A. The coordinates of A are (106 2

3 , 26 23) and the corresponding

value of z is £6800.Since A lies on both the bounding lines for the availability of time on the two lines theconstraints are binding. Thus the two lines have no slack and hence in balance.

4.

Identify the problem

Again the problem states quite specifically which questions to address. However the problemhas a lot data associated with it, this is best extracted and displayed by forming tables.

Page 159: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 154

12

16

8

24

..................

..................

...............

C

p1 = p2

B

A

>

z = 3654 = 42p1 + 87p2

3p1 + 6p2 = 480

4p1 + 2p2 = 480

(a)

p1

p2

T

4p2 − p1 = −30

4p2 − p1 = 30

12

16

8

24

z = 80 = p1 + p2

B

A

3p1 + 6p2 = 480

4p1 + 2p2 = 480

(b)

p1

p2

Figure A.3: Scale on both axes 1:10

Body-Firm Frame Press Pec-Dec TotalMach/Weld(hr) 4 2 2 8Paint/Fin(hr) 2 1 2 5

Ass/Test/Pk(hr) - - - 2Cost(£) 450 300 250 1000+pk=1050

Table A.2: Construction time and costs for the Body-Firm equipment. Packaging (pk) £50/item

Formulate the model

Let F and S be the number of Body-Firm and Body-Strong pieces of equipment produced. Usingthe data from Table A.2, TableA.3 and Table A.4 for the amount of resource used to produceeach item and the amount of resource available we can write down the following constraints:

8F + 12S ≤ 600 5F + 10S ≤ 450 2F + 2S ≤ 140 F, S ≥ 0 (A.2)

The profit function is the difference of the cost and the revenue. Bearing in mind that thecompany only gets 70% of the RRP the revenue from selling F and S is given by:

Revenue = 2700× 70%× F + 3500× 70%× S = 1680F + 2450S

The cost of material plus packaging is given by 1050F + 1575S and the cost of labour in thethree construction areas is given by:

Labour Cost = (8F + 12S)20 + (5F + 10S)15 + (2F + 2S)12 = 259F + 414S

Page 160: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 155

Body-Strong Frame Press Pec-Dec Leg-Press TotalMech/Weld(hr) 5 3 2 2 12Paint/Fin(hr) 4 2 2 2 10

Ass/Test/Pk(hr) - - - - 2Cost(£) 650 400 250 200 1500+pk=1575

Table A.3: Construction time and costs for the Body-Strong equipment. Packaging (pk) £75/item

Available Labourtime(hr) Costs(£/hr)

Mech/Weld(hr) 600 20Paint/Fin(hr) 450 15

Ass/Test/Pk(hr) 140 12

Table A.4: Available construction times(hr) and associated labour costs (£/hr)

Thus the Total Cost = 1309F + 1989S

Thus the profit function is given by

Profit = Revenue−Cost = z = 371F + 461S (A.3)

Finnally the requirement that the Body-Strong product is at least 25% of the total productiongives:

S ≥ S + F

4⇒ F − 3S ≤ 0 (A.4)

Thus the problem is to maximize the profit function in Eq(A.3) subject to the constraints ofEq(A.2) and Eq(A.4).

Carry out the Mathematics

(a) From Figure A.4 the dotted objective function is clearly a maximum at A or C. Bycalculating the coordinates of these points we find that z is maximum at A, which hascoordinates (16 2

3 , 50), giving z = 26233 13 . Thus the company should aim to produce 16

Body-Strong and 50 Body-Firm machines. This will yield £25926. (without roundinganalysis)

(b) If the constraint F ≤ 3S is dropped the feasible region is enlarged and becomes the polygonORBACD. z will now be maximum at B or R. Calculating the coordinates of thesepoints and calculating the corresponding values of z the maximum occurs at B which hascoordinates (10, 60) with z = £26870. Thus if the constraint is lifted the company canincrease its profit.

(c) Assuming all constraints are in place, as in (a), then the maximum at A can be increasedby causing A to move away from the origin. This can be done by increasing the effort inthe Machine and Welding department.

Page 161: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 156

A

C

D

R

B

F = 3S

F + S = 70

2F + 3S = 150

F + 2S = 90

Assemble/Test

Mech/Weld

Paint/Finish

......

......

......

......

......

......

......

......

......

......

......

.

z = 20000 = 371F + 461S

>

Profit

S

F

70

90

O

Figure A.4:

A.3 Worksheet 2

The problems on this sheet should be done using Solver in Excel.

1. Maximize z = 120x1 + 80x2 + 14x3 subject to

4x1 + 8x2 + x3 ≤ 200 2x2 + x3 ≤ 300 32x1 + 4x2 + 2x3 = 400 x1, x2, x3 ≥ 0

2. Minimize z = −4x1 + 5x2 + 5x3 subject to

x2 + x3 ≥ 2 − x1 + x2 + x3 ≥ 1 x3 ≥ 1 x1, x2, x3 ≥ 0

3. ”Frosties” sells three different types of ice cream, chocolate vanilla and banana. Due to extremelyhot weather and a high demand for its products, Frosties has run short of its supply of ingredients:milk, sugar and cream. Hence Frosties will not be able to fill all the orders received from itsretail outlets. Due to these circumstances Frosties decides to make the most profitable amountsof the three flavours, given the constraints on the supply of the basic ingredients. The companywill then ration its supply of ice cream to its outlets.

Page 162: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 157

The following table gives the ingredients and profit per gallon of ice cream of each type.

Type Profit Milk Sugar Cream£ (gallons) (pounds) (gallons)

Chocolate 1 0.45 0.50 0.1Vanilla 0.90 0.50 0.40 0.15Banana 0.95 0.40 0.40 0.20

Availability 200 150 60

(a) Determine the optimal production mix for Frosties

(b) By how much should the profit on chocolate be raised to ensure that Frosties produce thisline.

(c) In which resource would you endeavor to make a small increase in order to have the mosteffect on the profit?

(d) Is it useful if any amount of extra milk becomes available?

(e) If the availability of sugar is increased to 175 pounds and cream to 70 gallons find the newoptimal production.

A.4 Worksheet 2 - Solution

In questions one and two you should be aware that the value of the optimum is unique whereas thevalues of x1, x2 . . . may not be.

1. Maximum value of z = 2800 at x1 = 10, x2 = 20 and x3 = 0

2. Maximum value of z = 6 at x1 = 1, x2 = 0 and x3 = 2

3. In this problem the questions to be addressed are clearly given and the data is already presentedin a table, thus we can easily proceed to the formulate the model stage. Note however the phrase’ration its supply ....’ is simply indicating that they can sell all that they produce. This is abasic assumption in all our problems.

Formulate the Model

Let x1, x2 and x3 be respectively the number of gallons of chocolate, vanilla and banana icecream to be produced from the available supply of ingredients.

Profit:

From the profit column of the data the objective function to be maximized is givenby:

z = x1 + 0.9x2 + 0.95x3

Page 163: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 158

and represents the profit measured in £.

Constraints

From the other three columns of the table the constraints on the availability of materialare given by:

Mlk: 0.45x1+0.5x2+0.4x3 ≤ 200 Sug: 0.5x1+0.4x2+0.4x3 ≤ 150 Crm: 0.1x1+0.15x2+0.2x3 ≤ 60

As usual the non-negative condition x1, x2, x3 ≥ 0 is assumed.

Carry out the Mathematics

In this problem we simply run solver to give the output in Table A.5 and Table A.6.

Report

(a) From the Answer Report of Table A.5 the Final Value of the Target Cell is 341.25. Henceoptimal return is £341.25

From the Final Value column of the Adjustable Cells section, the optimal amount ofchocolate(x1) is zero, of vanilla(x2) is 300 gallons and banana(x3) is 75 gallons.

(b) Since the amount of chocolate is zero we can, by increasing the profit on chocolate, make itworthwhile to produce some. The reduced cost is precisely the amount by which this amountshould be changed to give a solution that involves a non-zero production of chocolate. Fromthe Adjustable Cells section of the Sensitivity Report the reduced cost for x1 is -0.0375. Thatis to say the profit on chocolate should be reduced by a negative amount, which we takeas an increase of 4p. Thus Frosties would need to adjust their price of chocolate to make aprofit of 1.04p/gallon.

(c) From the Constraints section of the Sensitivity Report the largest shadow (dual) priceis for Sugar. Thus for every 1 lb increase in the availability of sugar the company canmake an extra £1.875. Thus in the first instance an increase in sugar supply is the mostadvantageous.

(d) In the Constraints section of the Sensitivity Report the allowable increase for Milk is infinite(1E+30), no change in the solution no matter how much more milk we have. This alsofollows from the Constraints section of the Answer Report as Milk is listed as not Binding.That is to say there is already slack in the system at this optimum and increasing thesupply is only going to produce more slack.

(e) In Table A.6 the new optimum value is now £397.05 and the production levels are 28.57gallons of Chocolate, 264.28 gallons of Vanilla and 137.5 gallons of Banana.

Page 164: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 159

Microsoft Excel 9.0 Answer Report

Worksheet: [OR_Ex21_ASW_p274.xls]Sheet1

Report Created: 08-Feb-06 09:52:23

Target Cell (Max)

Cell Name riginal ValuFinal Value

$H$13 z 2.85 341.25

Adjustable Cells

Cell Name riginal ValuFinal Value

$A$13 x1 1 0

$B$13 x2 1 300$C$13 x3 1 75

Constraints

Cell Name Cell Value Formula Status Slack

$E$5 Milk Consu 180 $E$5<=$F$Not Binding 20

$E$6 Sugar Cons 150 $E$6<=$F$Binding 0$E$7 Cream Con 60 $E$7<=$F$Binding 0

Microsoft Excel 9.0 Sensitivity Report

Worksheet: [OR_Ex21_ASW_p274.xls]Sheet1

Report Created: 08-Feb-06 09:52:23

Adjustable Cells

Final Reduced Objective Allowable Allowable

Cell Name Value Cost Coefficient Increase Decrease

$A$13 x1 0 -0.0375 1 0.0375 1E+30

$B$13 x2 300 0 0.9 0.05 0.0125$C$13 x3 75 0 0.95 0.021429 0.05

Constraints

Final Shadow Constraint Allowable Allowable

Cell Name Value Price R.H. Side Increase Decrease

$E$5 Milk Consu 180 0 200 1E+30 20

$E$6 Sugar Cons 150 1.875 150 10 30$E$7 Cream Con 60 1 60 15 3.75

Microsoft Excel 9.0 Limits Report

Worksheet: [OR_Ex21_ASW_p274.xls]Sheet1

Report Created: 08-Feb-06 09:52:23

Target

Cell Name Value

$H$13 z 341.25

Adjustable Lower Target Upper Target

Cell Name Value Limit Result Limit Result

$A$13 x1 0 0 341.25 2.96E-10 341.25

$B$13 x2 300 0 71.25 300 341.25$C$13 x3 75 0 270 75 341.25

Table A.5: Output for Q3. (a)-(d)

Page 165: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 160

Microsoft Excel 9.0 Answer Report

Worksheet: [OR_Ex21_ASW_p274.xls]Sheet1

Report Created: 08-Feb-06 10:02:21

Target Cell (Max)

Cell Name riginal ValuFinal Value

$H$13 z 384.9107 397.0536

Adjustable Cells

Cell Name riginal ValuFinal Value

$A$13 x1 85.71429 28.57143

$B$13 x2 292.8571 264.2857$C$13 x3 37.5 137.5

Constraints

Cell Name Cell Value Formula Status Slack

$E$5 Milk Consumption 200 $E$5<=$F$Binding 0

$E$6 Sugar Consumption 175 $E$6<=$F$Binding 0$E$7 Cream Consumption 70 $E$7<=$F$Binding 0

Microsoft Excel 9.0 Sensitivity Report

Worksheet: [OR_Ex21_ASW_p274.xls]Sheet1

Report Created: 08-Feb-06 10:02:21

Adjustable Cells

Final Reduced Objective Allowable Allowable

Cell Name Value Cost Coefficient Increase Decrease

$A$13 x1 28.57143 0 1 0.0375 0.290625

$B$13 x2 264.2857 0 0.9 0.2325 0.0125$C$13 x3 137.5 0 0.95 0.021429 0.121429

Constraints

Final Shadow Constraint Allowable Allowable

Cell Name Value Price R.H. Side Increase Decrease

$E$5 Milk Consumption 200 0.107143 200 10 30.83333

$E$6 Sugar Consumption 175 1.660714 175 37 5$E$7 Cream Consumption 70 1.214286 70 5 13.75

Microsoft Excel 9.0 Limits Report

Worksheet: [OR_Ex21_ASW_p274.xls]Sheet1

Report Created: 08-Feb-06 10:02:21

Target

Cell Name Value

$H$13 z 397.0536

Adjustable Lower Target Upper Target

Cell Name Value Limit Result Limit Result

$A$13 x1 28.57142857 0 368.4821 28.57143 397.0536

$B$13 x2 264.2857143 0 159.1964 264.2857 397.0536$C$13 x3 137.5 0 266.4286 137.5 397.0536

Table A.6: Output for Q3 (e)

Page 166: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 161

A.5 Worksheet 3

1. The standard or canonical form of the linear programming problem is:

Given Ax = b such that x ≥ 0, b ≥ 0 maximize or minimize z = cT x

Write the following problems in standard form:

(a) Maximize z = −x1 − 2x2 + x3 subject to:

3x2 + 2x1 + x3 ≤ 3 (i) x1 + x2 + x3 ≤ 1 (ii) x1, x2 x3 ≥ 0

(b) Maximize z = 2x1 + 4x2 + x3 subject to:

x1 + x2 + x3 = 1 2x1 + x2 − x3 ≤ 2 x1 + x2 ≥ −4 x2 + x3 ≥ 1

With x1, x2 ≥ 0 and x3 unrestricted

2. Use Solver to find the solutions to the problems in Q1.

(note that it is not necessary to write the problem in standard form to use solver - this is doneautomatically inside solver

3. Given:

x1

(12

)+ x2

(31

)+ x3

(11

)=

(43

)

use the direct method of solving simultaneous equations (non-matrix) to obtain the three basicsolutions to the problem.

4. The points satisfying

x1 + x2 + x3 ≤ 4 x1 ≤ 2 x2 ≤ 1 and x1, x2, x3 ≥ 0 (A.5)

are all the points inside and on the solid shown in Fig. ??.

Writing Eqs(A.5) in the form x1 + x2 + x3 + s1 = 4, x1 + s2 = 2 and x2 + s3 = 1 write downthe basic variables at each of the points A, B, C and D in Fig. ??.

Apply row reduction to

1 1 1 1 0 0 41 0 0 0 1 0 20 1 0 0 0 1 1

to emulate moving from A to B, B to C and C to D. Use your matrix to write down the values ofthe basic variables at each point. Do these values agree with what you expect from the diagram.

5. For Q1(a) write down the augmented matrix (A b) in the form (D I b), for suitable matrix D

and identity matrix I.

Additionally let s1 be the slack variable for (i) and s2 the slack variable for (ii).

Page 167: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 162

...

...

...

...

...

...

...

...

...

...

...

...

...

...

.

.........................

...........x1 = 2

x1

x2

x3

x2 = 1

x1 + x2 + x3 = 4

j

9

z A

B C

D

Figure A.5:

(a) Use your augmented matrix to write out b in terms of the basic variables s1, s2 and thestandard ordered basis e1 and e2 in R2. (give the values of s1 and s2)

(b) Use row reduction to make x1 and s2 basic variables. Hence write out b in terms of theoriginal columns of A.

(c) Use one more row reduction to try and make x1 and x3 basic variables. Why does thisprocess fail to give an answer to the problem?

A.6 Worksheet 3 - Solutions

1. (a) Introduce slack variables s1 ≥ 0 and s2 ≥ 0 to give:

2x1 + 3x2 + x3 + s1 = 3 x1 + x2 + x3 + s2 = 1

Thus: (2 3 1 1 01 1 1 0 1

)x =

(31

)

where x = (x1, x2, x3, s1, s2)T and z = −x1 − 2x2 + x3 + 0s1 + 0s2

(b) Introduce slack variable s1 ≥ 0, and surplus variables s2 ≥ 0, s3 ≥ 0 . Since x3 isunrestricted set x3 = x+

3 − x−3 with x+3 , x−3 ≥ 0. Thus the constraints become:

x1 + x2 + x+3 − x−3 = 1

2x1 + x2 − x+3 + x−3 + s1 = 2

−x1 − x2 + s2 = 4x2 + x+

3 − x−3 − s3 = 1

1 1 1 −1 0 0 02 1 −1 1 1 0 0

−1 −1 0 0 0 1 00 1 1 −1 0 0 −1

x =

1241

Page 168: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 163

where x = (x1, x2, x+3 , x−3 , s1, s2, s3)T and z = 2x1 + 4x2 + x+

3 − x−3 + 0s1 + 0s2 + 0s3

2. (a) Use solver to give x1 = x2 = 0, x3 = 1, zmax = 1

(b) Use solver to give x1 = 0, x2 = 1.5, x3 = −0.5, zmax = 2.5

3. The three basic solutions are obtained as follows

(a) Selecting the first two columns and setting x3 = 0 we need to solve:

x1

(12

)+ x2

(31

)=

(43

)⇒ x1 + 3x2 = 4

2x1 + x2 = 3⇒ x1 = x2 = 1

Basic solution: x1 = x2 = 1, x3 = 0

(b) Selecting the first and last column and setting x2 = 0 gives:

x1

(12

)+ x3

(11

)=

(43

)⇒ x1 + x3 = 4

2x1 + x3 = 3⇒ x1 = −1, x3 = 5

Basic solution: x1 = −1, x2 = 0, x3 = 5

(c) Selecting the last tow column and setting x1 = 0 gives:

x2

(31

)+ x3

(11

)=

(43

)⇒ 3x2 + x3 = 4

x2 + x3 = 3⇒ x2 = 1/2, x3 = 5/2

Basic solution: x1 = 0, x2 = 1/2, x3 = 5/2

4. The basic variables are A(s1, s2, s3), B(s1, x1, s3), C(s1, x1, x2) and D(x3, x1, x2).

At A:

1 1 1 [1] 0 0 41 0 0 0 [1] 0 20 1 0 0 0 [1] 1

⇒ s1 = 4, s2 = 2, s3 = 1

To move to B introduce x1 and take out s2. Thus row reduce to make column 1 (the x1 col)= e2. (notation: standard ordered basis ei.)

At B:

0 1 1 [1] −1 0 2[1] 0 0 0 1 0 20 1 0 0 0 [1] 1

⇒ x1 = 2, s1 = 2, s3 = 1

To move to C introduce x2 and take out s3. Thus row reduce to make column 2 (the x2 col)= e3.

At C:

0 0 1 [1] −1 −1 1[1] 0 0 0 1 0 20 [1] 0 0 0 1 1

⇒ x1 = 2, x2 = 1, s1 = 1

To move to D introduce x3 and take out s1. Thus row reduce to make column 3 (the x3 col)= e1. (no row reduction actually necessary, just relabel pivot)

Page 169: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 164

At D:

0 0 [1] 1 −1 −1 1[1] 0 0 0 1 0 20 [1] 0 0 0 1 1

⇒ x1 = 2, x2 = 1, x3 = 1

Recall that non-basic variable are, by design, always zero. Thus picking off the x-coordinates ofthe points A, B, C and D from above gives:

At A (x1, x2, x3) = (0, 0, 0) At B (x1, x2, x3) = (2, 0, 0)At C (x1, x2, x3) = (2, 1, 0) At D (x1, x2, x3) = (2, 1, 1)

These are seen to correspond to the coordinates of the points on the diagram.

5.

(D I b) =

2 3 1

... [1] 0... 3

1 1 1... 0 [1]

... 1

(a) In general:

b =(

31

)= x1

(21

)+ x2

(31

)+ x3

(11

)+ s1

(10

)+ s2

(01

)(A.6)

Starting with basic variables s1 and s2, thus all the x variables have been set to zero gives

b =(

31

)= s1 e1 + s2 e2 ⇒ s1 = 3, s2 = 1

(b) Introduce x1 and take out s2. That is to say use row reduction to make col(1) = e2.(

0 1 −1 [1] −2 1[1] 1 1 0 1 1

)

With x1 and s1 as basic variables and all the others zero, the pivots [1] in the matrix givex1 = 1 and s1 = 1. Thus from Eq(A.6)

(31

)= b = x1

(21

)+ s1

(10

)=

(21

)+

(10

)

(c) Introduce x3 and take out s1 by making col(3)=e1:(

0 −1 [1] −1 2 −1[1] 2 0 1 −1 2

)

Thus the basic variables are x1 = 2 and x3 = −1, all other variables set equal to zero. ThusEq(A.6) gives:

(31

)= b = x1

(21

)+ x3

(11

)= 2

(21

)−

(11

)

This is not a feasible solution since the variable are not all non-negative, namely x3 < 0.

Page 170: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 165

A.7 Worksheet 4

1. Simplex - all slack variables

Given

4x1 + 3x2 + 3x3 ≤ 12 3x1 + 4x2 + 4x3 ≤ 12 x3 ≤ 1 x1, x2, x3 ≥ 0

this question asks you to investigate the maximization of the objective function

z = 2x1 + 2x2 + 3x3

using the Simplex Method as follows:

(a) Write the constraints in the standard form Ax = b where A is a suitable matrix of the form(D I) and I is the identity matrix. x and b are suitable column vectors such that x ≥ 0and b ≥ 0.

(b) Set up the Simplex Tableau and hence solve the problem.

(c) Use the final tableau to

i. Obtain the dual (shadow) values corresponding to each of the first three constraint.

ii. Find the feasible ranges of each of the components of b

iii. The range of optimality for each of the coefficients in the objective function z.

2. Simplex - Artificial variables

Consider the problem:

Maximize z = 2x1 + x2 subject to

x1 + x2 ≤ 2 (i) x1 + 3x2 ≥ 3 (ii) x1, x2 ≥ 0

(a) Introducing a slack variable s1 and a surplus variable s2 write the problem in the formAx = b, and z = cT x, where x, b ≥ 0.

Why is it not possible to initially use s1 and s2 as basic variables?

(b) Introduce an additional artificial variable a1 ≥ 0, such that a1 and s1 can be used as initialbasic variables.

(c) Introducing the variable M in the objective function write down the Simplex Tableau forthis problem. Hence solve using the Simplex Method.

(d) Using the optimal tableau write down the shadow values for the problem.

(e) Solve the problem graphically.

Indicate the order in which the Simplex Method visited the corners of the feasible region.

Use your graph to find the maximum value of z if in constraint (i) the righthand side isincreased to 3. Is this consistent with your results for the dual values in (d).

Page 171: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 166

A.8 Worksheet 4 - Solutions

1. (a) Introducing slack variables s1, s2, s3 ≥ 0 the inequalities become:

4x1 + 3x2 + 3x3 + s1 = 12, 3x1 + 4x2 + 4x3 + s2 = 12, x3 + s3 = 1, x1, x2, x3 ≥ 0

In the required matrix form:

Ax = (D|I)x =

4 3 3 1 0 03 4 4 0 1 00 0 1 0 0 1

x =

12121

= b

Where x = (x1, x2, x3, s1, s2, s3)T and z = cT x = 2x1 + 2x2 + 3x3 + 0s1 + 0s2 + 0s3.

(b) The first simplex tableau:

x1 x2 x3 s1 s2 s3 b ba

Basic Var cj 2 2 3 0 0 0 ratio

s1 0 4 3 3 1 0 0 12 4s2 0 3 4 4 0 1 0 12 3s3 0 0 0 1 0 0 1 1 [1]zj 0 0 0 0 0 0 z =∆z 2 2 [3] 0 0 0 0

Table A.7: Since this is a maximization problem, add to the basic set the variable corresponding to themaximum positive value in the final row. Remove from the basic set the variable corresponding to thesmallest non-negative value in the final column.

In the final row (variable columns), [3] is the maximum value, thus introduce x3 into thebasic set. The ratio column consists of the d column elements divided by the correspondingterms in the x3 column. Select the variable corresponding to the smallest non-negativevalue in the ratio column, namely s3, to remove from the basic set.

Row reduce to make the x3 column into the old s3 column, that is to say row reduce tomake the x3 column equal to e3.

x1 x2 x3 s1 s2 s3 d da

Basic Var cj 2 2 3 0 0 0 ratio

s1 0 4 3 0 1 0 −3 9 [9/4]s2 0 3 4 0 0 1 −4 8 8/3x3 3 0 0 1 0 0 1 1 ∞zj 0 0 3 0 0 3 z =∆z [2] 2 0 0 0 −3 3

Table A.8: This table shows the next step is to add x1 to the basic set and remove s1.

In Table A.8 there are two positive maximum values in the final row, hence it is equallyacceptable to add either x1 or x2 to the basic set: I have add x1 to the basic set. The

Page 172: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 167

smallest non-negative value in the final column corresponds to s1, hence remove s1 fromthe basic set.

Thus row reduce to make the x1 column equal to the old s1 column, that is to say makecolumn 1 equal to e1.

x1 x2 x3 s1 s2 s3 d da

Basic Var cj 2 2 3 0 0 0 ratio

x1 2 1 3/4 0 1/4 0 −3/4 9/4 3s2 0 0 7/4 0 −3/4 1 −7/4 5/4 [5/7]x3 3 0 0 1 0 0 1 1 ∞zj 2 3/2 3 1/2 0 3/2 z =∆z 0 [1/2] 0 −1/2 0 −3/2 15/2

Table A.9: This table shows that the next step is to add x2 to the basic set and remove s2.

Thus row reduce to make the x2 column equal to the old s2 column, that is to say column2 becomes e2

x1 x2 x3 s1 s2 s3 d da

Basic Var cj 2 2 3 0 0 0 ratio

x1 2 1 0 0 16/28 −12/28 0 48/28x2 2 0 1 0 −3/7 4/7 −1 5/7x3 3 0 0 1 0 0 1 1zj 2 2 3 (2/7) (2/7) (1) z =∆z 0 0 0 −2/7 −2/7 −1 55/7

Table A.10: Since the final row (variable columns) has no positive elements the process terminates.

The final row indicates that ∆z is either zero or negative, thus no change will improve thevalue of z and hence the optimum is reached. From the table the maximum value of z = 7 6

7

and the values of the variables are x1 = 12/7, x2 = 5/7, x3 = 1.

(c) i. The dual variables are indicated in Table A.10 with(). Thus corresponding to the threeconstraints the dual variables are respectively 2/7, 2/7, 1.

ii.

∆b =

δ00

⇒ δ

4/7−3/7

0

+

12/75/71

≥ 0 ⇒

δ ≥ −3 and − 3δ + 5 ≥ 0 ⇒ 5/3 ≥ δ

Thus−3 ≤ δ ≤ 5/3 ⇒ 12− 3 ≤ b1 ≤ 12 + 5/3 ⇒ 9 ≤ b1 ≤ 13

23

∆b =

0δ0

⇒ δ

−3/74/70

+

12/75/71

≥ 0 ⇒

Page 173: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 168

−3δ + 12 ≥ 0 ⇒ δ ≤ 4 and 4δ + 5 ≥ 0 ⇒ δ ≥ −5/4

Thus

−5/4 ≤ δ ≤ 4 ⇒ 12− 5/4 ≤ b2 ≤ 12 + 4 ⇒ 1034≤ b2 ≤ 16

∆b =

00δ

⇒ δ

0−11

+

12/75/71

≥ 0 ⇒

−δ + 5/7 ≥ 0 ⇒ δ ≤ 5/7 and δ + 1 ≥ 0 ⇒ δ ≥ −1

Thus−1 ≤ δ ≤ 5/7 ⇒ 1− 1 ≤ b3 ≤ 1 + 5/7 ⇒ 0 ≤ b3 ≤ 1

57

iii. To calculate the range of optimality for each of the coefficients in the original objectivefunction replace in turn the c values in the final tableau with α. To ensure the tableauremains optimal impose the condition on α such that the final row remains non-positive.For the c-coefficient of x1 in the objective function z the optimal table (Table A.10)becomes:

x1 x2 x3 s1 s2 s3 d da

Basic Var cj α 2 3 0 0 0 ratio

x1 α 1 0 0 16/28 −12/28 0 48/28x2 2 0 1 0 −3/7 4/7 −1 5/7x3 3 0 0 1 0 0 1 1zj α 2 3 4α/7− 6/7 −3α/7 + 8/7 1 z =∆z 0 0 0 −4α/7 + 6/7 3α/7− 8/7 −1 31+12α

7

Table A.11: The final row must remain non-positive for the table to remain optimal

From Table A.11 −4α/7 + 6/7 ≤ 0 and 3α/7 − 8/7 ≤ 0 must be satisfied forthe table to remain optimal. Thus 3/2 ≤ α ≤ 8/3

The interval of optimality for c1, the c-coefficient of x1, is [32 , 83 ].

Repeating the above with, in turn, α replacing the c-coefficient of x2 and then x3 gives:

Range of optimality for c2 is [32 , 83 ] and for c3 is [2, ∞).

2. (a) Introducing s1, s2 ≥ 0 the inequalities become:

x1 + x2 + s1 = 2 (i) x1 + 3x2 − s2 = 3 (ii) x1, x2 ≥ 0

which can be written in matrix form:(

1 1 1 01 3 0 −1

)x =

(23

)x ≥ 0

Page 174: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 169

where x = (x1, x2, s1, s2)T and the objective function z = 2x1 + x2 + 0s1 + 0s2.

The simplex method tries to starts with s1 and s2 as basic variables by setting x1 = x2 = 0.However (ii) implies that s2 = −3 < 0, thus this is not a valid starting point as it is not inthe feasible region.

(b) The problem of finding a feasible starting value is overcome by the introduction of anartificial variable a1 ≥ 0 into (ii). (ii) becomes:

x1 + 3x2 − s2 + a1 = 3.

Thus initially the non-basic variable are taken to be x1, x2, s2 (all set equal to zero) andthe basic variables are s1 and a1, which clearly have the values 2 and 3 respectively. Thekey point is that the starting values are now in the feasible set.

(c) As a1 is an artificial variable we require it to vanish from the final solution, this can bedone by introducing M >> 0 into the objective function (relabel z′)as:

z′ = x1 + 3x2 + 0s1 + 0s2 −Ma1

Clearly the −Ma1 term will tend to suppress the value of z, thus when maximizing, thisterm will have the least affect when a1 = 0. That is to say the maximization process willtend to force a1 to zero.

To set up the first tableau order the variables so that the ’body’ of the table lookslike (D|I). That is to say the first three variables are the non-basic variables and the lasttwo are the basic variables.

x1 x2 s2 s1 a1 d da

Basic Var cj 2 1 0 0 −M ratio

s1 0 1 1 0 1 0 2 2a1 −M 1 3 −1 0 1 3 [1]zj −M −3M M 0 −M z′ =∆z 2 + M [1 + 3M ] −M 0 0 −3M

Table A.12: For sufficiently large M maximum positive value in the last row is [1 + 3M ], thus add x2

to the basic set. Smallest non-negative term in the final column corresponds to a1, hence remove a1

from the basic set.

To bring in x2 and take out a1 row reduce to make the x2 column equal to the old a1

column, namely e2. (See Table A.13)

To bring in x1 and take out s1 row reduce to make the x1 column equal to the old s1

column, namely e1. (See Table A.14)

From Table A.14 the maximum value of z = 3 12 with x1 = 3/2 and x2 = 1/2.

Page 175: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 170

x1 x2 s2 s1 a1 d da

Basic Var cj 2 1 0 0 −M ratio

s1 0 2/3 0 1/3 1 −1/3 1 [3/2]x2 1 1/3 1 −1/3 0 1/3 1 3zj 1/3 1 −1/3 0 1/3 z′ =∆z [5/3] 0 1/3 0 −M − 1/3 1

Table A.13: The next step is to bring in x1 and remove s1

x1 x2 s2 s1 a1 d da

Basic Var cj 2 1 0 0 −M ratio

x1 2 1 0 1/2 3/2 −1/2 3/2x2 1 0 1 −1/2 −1/2 1/2 1/2zj 2 1 1/2 (5/2) (−1/2) z′ =∆z 0 0 −1/2 −5/2 −M + 1/2 3 1

2

Table A.14: Since the final row (corresponding to the variables) contains no positive terms the tableauis optimal

(d) The shadow or dual variables are denoted by ( ) in Table A.14. Thus corresponding tothe constraint containing s1 the shadow variable is 5/2 and corresponding to the constraintcontaining the artificial variable a1 the shadow variable is −1/2.

(e) In Figure A.6(a) the objective function has been drawn with z = 2 and is shown dotted.Clearly the maximum value of z is at P. Solving x1 + 3x2 = 3 and x1 + x2 = 2 givesP(3/2,1/2) and z = 3 1

2 . The same solution as above.

The order in which the simplex method evaluates the problem is given by looking at eachtable.

Table A.12 at O; Table A.13 at A; Table A.14 at P.

In Figure A.6(b) the maximum is now at Q(3,0) with z = 6. The dual variable for thisconstraint was 2.5 thus in changing the righthand side from 2 to 3 we would expect anincrease in z by 2.5. This is clearly the case as z increases from 3.5 to 6. (note this assumesthat an increase of 1 is within the feasible range for this particular constraint)

Page 176: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 171

......................................................

x1

x2

P

O

A

B

2 3

z = 2 = 2x1 + x2x1 + x2 = 2

x1 + 3x2 = 3

1

2

C

......................................................

x1

x2

z = 4 = 2x1 + x2x1 + x2 = 3

x1 + 3x2 = 3

Q

3

O

A

2 3

1

C

(a) (b)

Figure A.6: Feasible region shown hashed

Page 177: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 172

A.9 Worksheet 5

1. Use Prim’s algorithm to obtain the minimum spanning tree for the following undirected networkin Fig. A.7 together with its value. The edges are numbered with the distances between nodes.

1

2

3

4

5

6

7

8

9

10

1

2

3

5

3

1

2

3

5

4

5

2

4

Figure A.7:

2. Repeat question 1 using Kruskal’s algorithm.

3. The network in Fig. A.8 is a directed graph with distances between nodes along each edge.

Use Dijkstra’s Algorithm to find the shortest route from node(a) to all the other nodes. In eachcase give the shortest path and its length.

a

b

c

d

e

g

h

f

µ- -

- -U

3-

:

3

q

3

2 3

31

2

19

6

9

2

Figure A.8:

Page 178: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 173

4. The network in Fig. A.9 is a mixed graph with edges numbered with the distance between thenodes. Use Floyd’s algorithm to find the shortest routes between all pairs of the nodes givingthe routes and distances.

1

2

3

4

>

w-

2

3

1

4

3

6

Figure A.9:

5. Use the min cut max flow theorem to construct by inspection a possible maximum flow inthe following mixed network Fig. A.10(a); numbers refer to capacities. Give the value of themaximum flow.

S

a

c

d

b

d

f

T

µ

-

R+-

s-R

>

-

}

3

3

6

2

4

7

2

3

1

9 6

2 5

Fig (a)

S

a

b

c

d eT

1

-

z

?

*

-

6:q ?

:q

3

1 6

33

2

5

7

24

4 3

Fig (b)

Figure A.10:

6. Use the Ford-Fulkerson algorithm to find a maximum flow from source S to sink T for thedirected network in Fig. A.10(b); numbers refer to capacities.

Page 179: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 174

A.10 Worksheet 5 - Solutions

1. Figure A.11 shows the minimal spanning tree formed using Prim’s algorithm. The length of thetree is 22.

1

2

1

2

3

1

2

3

4

1

2

3

4

5

1

2

3

4

5

6

1 1 1

11 11

2 2

2 2 2

3

3 3

1

2

3

4

5

6

1 1

2 23

73

1

2

3

4

5

6

1 1

2 23

73

84

1

2

3

4

5

6

1 1

2 23

73

84 9

2

1

2

3

4

5

6

1 1

2 23

73

84 9

2

10

4

Figure A.11: Prim’s Algorithm adding the closest node at each stage

2. Figure A.12 shows the construction of the minimal spanning tree for the same network as Q1but using Kruskal’s algorithm.

This process has given the same spanning tree, however minimum spanning trees are not neces-

Page 180: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 175

1

2

4

51 1

1

2

4

51 1

3 6

7

9

2 2

2

1

2

4

51 1

3 6

7

9

2 2

2

3

3

1

2

4

51 1

3 6

7

9

2 2

2

3

3

8

10

4

4

Figure A.12: Kruskal’s Algorithm adding links (with node) in ascending order 1,2...

sary unique, the same network can give rise to different trees. The important point is that thesize of the minimum spanning tree is unique for the given network. All minimum spanning treesfor this problem will be of size 22.

3. The notation in Figure A.13 is [distance from a, predecessor node] for a temporary label and[distance from a, predecessor node] for a permanent node. The initial node(a) is labelled [0,a]and then made permanent since at this point in the process it is the only temporary node, andhence is the smallest. At each stage the nodes adjacent to the last created permanent node arelabelled with a temporary label if not already labelled. However if the adjacent node alreadyhas a temporary label it is replaced with the new label provided the new label has a smallerdistance value. Finally if the adjacent node has a permanent label it is not relabelled. Thuswith reference to Figure A.13:

(a) node(b), node(c) and node(e) are given temporary labels. Node(c) is made permanent sinceit is the smallest temporary label.

(b) Since node(c) is the last permanent label, node(e) and node(f) are given temporary labels.Note that the label on node(e) replaces the already existing label since it is of a shorterdistance value. Node(b) is made permanent since it is the smallest temporary label.

(c) Since node(b) is the last permanent label, node(d) is given a temporary label. Node(d) ismade permanent since it is the smallest temporary label.

(d) Since node(d) is the last permanent label, node(g) is given a temporary label. Node(e) ornode(g) can now be made permanent since they are equally nearest to node(a) (distance=8). Make node(e) permanent.

Page 181: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 176

a

b

c

d

e

g

h

f

µ- -

- -U

3-

:

3

q

3

2 3

31

2

1

9

6

9

2

a

b

c

d

e

g

h

f

µ- -

- -U

3-

:

3

q

3

2 3

31

2

1

9

6

9

2[0,a] [0,a]

[3,a]

[9,a]

[2,a]

[3,a]

[2,a]

[9,a]

[8,c]

[11,c]

(a) (b)

a

b

c

d

e

g

h

f

µ- -

- -U

3-

:

3

q

3

2 3

31

2

1

9

6

9

2

[3,a]

[2,a]

[9,a]

[8,c]

[11,c]

(c)

[0,a]

[5,b]

a

a

b

c

d

e

g

h

f

µ- -

- -U

3-

:

3

q

3

2 3

31

2

1

9

6

9

2

[3,a]

[2,a]

[9,a]

[8,c]

[11,c]

(d)

[0,a]

[5,b] [8,d]

b

c

d

e

g

h

f

µ- -

- -U

3-

:

3

q

3

2 3

31

2

1

9

6

9

2

[3,a]

[2,a]

[9,a]

[8,c]

[11,c]

(e)

[0,a]

[5,b] [8,d]

[10,e]

a

b

c

d

e

g

h

f

µ- -

- -U

3-

:

3

q

3

2 3

31

2

1

9

6

9

2

[3,a]

[2,a]

[9,a]

[8,c]

[11,c]

(f)

[0,a]

[5,b] [8,d]

[10,e]

Figure A.13:

(e) Since node(e) is the last permanent label, node(h) is given a temporary label. Node(g) ismade permanent since it is the smallest temporary label.

(f) Since node(g) is the last permanent label we look to give node(h) a label. Since thetemporary label on node(h) is less than the incoming label no relabelling takes place.Node(h) is made permanent since it is the smallest temporary label.

Finally since node(h) is the last permanent label we look to give node(f) a label. Since theincoming label is the same value as the temporary label already on node(f) no change is made.Node(f) is then made permanent.

The process terminates since all nodes are now permanent.

The labels can be used to trace back the path from each node to node(a) to give:

a → b : 3, a → b → d : 5, a → b → d → g : 8, a → c → e : 8,

Page 182: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 177

a → c : 2, a → c → f : 11, a → c → e → h : 10.

4. Floyd’s method requires two matrices, one representing the state of the current network (Di)and one monitoring the changes made (Mi).

Start at node(1):

If di,1 + d1,j < di,j , that is to say if there a shorter path via node(1), then make a replacementpath.

D0 =

∗ 2 3 6∞ ∗ 3 13 3 ∗ 4∞ ∞ 4 ∗

M0 =

1 2 3 41 2 3 41 2 3 41 2 3 4

For node(1) no replacement necessary.

Move to node(2).

If di,2 + d2,j < di,j , that is to say if there is a shorter path via node(2), then make a replacementpath.

D1 =

∗ 2 3 −6−3

∞ ∗ 3 13 3 ∗ 4∞ ∞ 4 ∗

M1 =

1 2 3 −4−2

1 2 3 41 2 3 41 2 3 4

Move to node(3):

If di,3 + d3,j < di,j , that is to say if there is a shorter path via node(3), then make a replacementpath.

D2 =

∗ 2 3 3−∞−6 ∗ 3 1

3 3 ∗ 4−∞−7 −∞−7 4 ∗

M2 =

1 2 3 2−1−3 2 3 41 2 3 4−1−3 −2−3 3 4

Move to node(4):

If di,4 + d4,j < di,j , that is to say if there is a shorter path via node(4), then make a replacementpath.

D3 =

∗ 2 3 36 ∗ 3 13 3 ∗ 47 7 4 ∗

M3 =

1 2 3 23 2 3 41 2 3 43 3 3 4

For node(4) no replacement necessary.

Thus D3 gives the matrix of shortest distances between nodes and M3 gives us the route for thispath from node to node.

Page 183: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 178

1 → 2 = 2, 2 → 3 → 1 = 6, 1 → 3 = 3, 3 → 1 = 3, 1 → 2 → 4 = 3, 4 → 3 → 1 = 7

2 → 3 = 3, 3 → 2 = 3, 2 → 4 = 1, 4 → 3 → 2 = 7, 3 → 4 = 4, 4 → 3 = 4

5. Figure A.14 shows a flow of 9 and a cut of 9, thus by the max-flow min-cut theorem the networkis at its maximum.

S

a

c

e

b

d

f

T

µ

-

R+-

s-R

>

-

}

3

[3,3]

[3,6]

[2,2]

[3,4]

[0,7]

[1,2]

[3,3]

[1,1]

[4,9] [4,6]

[2,2] [3,5]

cut=9

Figure A.14:

6. With reference to Figure A.15:

(a) The network starts with zero flow in each arc, notation [flow, capacity]. A flow augmentingpath is then constructed using the algorithm, with the nodes being labelled (predecessornode, max possible additional flow). In this diagram the augmenting path is S → b → T

and has value 2. The flow in the network is them increased along this path by 2.

The network is then redrawn with the updated flows and the process repeated until no flowaugmenting path can be found.

(b) The flow augmenting path is S → c → T with value 3. The path is shown updated.

(c) The flow augmenting path is S → a → b → T with value 1. The path is shown updated.

(d) The flow augmenting path is S → d → e → T with value 2. The path is shown updated.

(e) In this final network the algorithm stops before reaching T . As seen it is not possible toaugment from node(b) to node(T) or node(c) to node(T) since the links are saturated.Additionally it is not possible to get to node(e) and on to node(T) since the path fromnode(d) to node(e) is saturated and the reverse path from node(c) to node(e) has zero flow.

Page 184: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 179

S

a

b

c

d e

T

1

-z

?

*

-

6:q ?

:q

[0,3]

[0,1] [0,6]

[0,3][0,3]

[0,2]

[0,5]

[0,7]

[0,2][0,4]

[0,4][0,3]

(S,∞)

(S,1)

(S,2)

(b,2)

(S,5)

(S,3)

[2,2]

[2,3]

(a)

S

a

b

c

d e

T

1

-z

?

*

-

6:q ?

:q

[0,3]

[0,1] [0,6]

[2,3][0,3]

[2,2]

[0,5]

[0,7]

[0,2][0,4]

[0,4][0,3]

(S,∞)

(S,1)

(a,1)

(c,3)

(S,5)

(S,3)

[3,3]

[3,5]

(b)

[0,1] [0,6]

S

a

b

c

d e

T

1

-z

?

*

-

6:q ?

:q

[0,3]

(d,2)

(c,2)

[3,3][0,3]

[2,2]

[0,7]

[0,2][0,4]

[0,4]

[3,5]

[3,3]

(a,1)

(b,1)

(S,2)

(S,3)

S

[1,6] a

(c)

[1,1]

b

(S,∞)

c

d e

T

1

-z

?

*

-

6:q ?

:q

[0,3]

(d,2)

[3,3]

[0,3]

[2,2]

[0,7]

[0,2][0,4]

[0,4]

[3,5]

[3,3][2,3]

(e,2)

(S,2)

(S,3)

[1,6]

(d)

[1,1](S,∞)

[2,2][2,4]

S

a

b

c

d e

T

1

-z

?

*

-

6:q ?

:q

[2,2]

(c,2)

[2,4]

[3,3]

[0,3]

[2,2]

[2,3]

[0,7][0,4]

[3,5]

[3,3]

(e,2)

(S,2)

(S,1)

[1,6]

(e)

[1,1](S,∞)

cut = 8

(S,1)

[2,3]

Figure A.15:

Hence the final network with maximum flow of 8 is seen in Figure A.15(d).

Just for interest I have included a cut in Figure A.15(e) with value 8. This is therefore a minimumcut since we know the max flow is also 8. Note that the flow from node(e) to node(c) does notcontribute to the value of the cut as it is in the reverse direction, that is to say it is leaving andnot entering the cut region containing T .

Page 185: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 180

A.11 Worksheet 6 - Class Example

Class Example - Worksheet 6

1. Using the methodology of dynamic programming we are required to find for the network below:

(i) The shortest path from node(1) to node(10).

(ii) The longest path from node(1) to node(10).

(iii) The path from node(1) to node (10) containing the shortest legs.

Before carrying out the calculations identify the following;

• Suitable stages for the process.

• The decision set Di at each stage.

• The state variables xi at each stage.

• The optimization function for each of (i), (ii) and (iii) above.

Carry out the calculations for (i), (ii) and (iii) by annotating Figures A.16 to A.18.

1

2

3

4 7

10

96

5 8

7

- -

R

w- -

µ

~

^

s- -

s

3

73

9

8

7

9

6

4

6

12

10

4

8

7

10

5

812

9

Figure A.16: Use for (i)

Page 186: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX A. WORKSHEETS 181

1

2

3

4 7

10

96

5 8

7

- -

R

w- -

µ

~

^

s- -

s

3

73

9

8

7

9

6

4

6

12

10

4

8

7

10

5

812

9

Figure A.17: Use for (ii)

1

2

3

4 7

10

96

5 8

7

- -

R

w- -

µ

~

^

s- -

s

3

73

9

8

7

9

6

4

6

12

10

4

8

7

10

5

812

9

Figure A.18: Use for (iii)

Page 187: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Appendix B

Past Exam - May 2007

B.1 Question Paper

Full marks for correct solutions to any FOUR or the SIX questions - 214 hours

Question 1

A company sells two types of multivitamin tablets, each type containing a combination of vita-mins A and C. The Regular tablets contain 0.1 milligrams of vitamin A and 0.2 milligrams ofvitamin C, whereas the Extra tablets contain 0.3 milligrams of vitamin A and 0.2 milligrams ofvitamin C. The average cost of the tablets to the customer is 0.5p for a Regular tablet and 1.2pfor an Extra tablet. In a given week the minimum recommended amounts of each vitamin is 1.7milligrams of vitamin A and 1.8 milligrams of vitamin C.

(i) Set up a Linear Programming problem to calculate the amounts of each tablet the customershould consume per week to minimize the cost whilst at the same time consuming at leastthe recommended dose of each vitamin. [5 marks ]

(ii) Use graphical means to solve the Linear Programming problem, stating how many types ofeach tablet the customer should consume per week and the total cost of the tablets.

[5 marks ]

(iii) State the Dual problem of the above and discuss how this corresponds to a rival companywishing to set the price of marketing single vitamin tablets that contain 1 milligram ofeither vitamin A or vitamin C. [5 marks ]

(iv) By expressing both the primal and dual problem in matrix and vector form, show that thecost of a week’s supply of multivitamins is never less than the revenue collected by the rivalcompany selling a week’s supply of the single vitamin tablets. [5 marks ]

(v) Solve the dual problem graphically and use the results to decide if the consumer wouldfinancially benefit more by a small decrease in the recommended weekly dose of vitamin Aor vitamin C. [5 marks ]

[25 marks in total ]

182

Page 188: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 183

Question 2

(a) (i) If A is an m× n, m ≤ n, matrix with m independent rows, define what is meant by abasic solution of Ax = b. [2 marks ]

(ii) Given(

1 0 20 1 1

)

x1

x2

x3

=

(11

)

write down a basic solution. Calculate two other basic solutions. [3 marks ]

(iii) What is the maximum possible number of basic solutions for the general problemdescribed in (i) above? Comment on the relevance of this result in the Simplex Method.

[2 marks ]

(b) Consider the following problem:

Maximize z = 2x1 + x2 + 2x3 subject to the constraints:

x1 + x2 + x3 = 1, 4x1 + 2x2 + x3 ≤ 3, x1 + x2 + 2x3 ≤ 2 x1, x2 , x3 ≥ 0.

(i) Introduce an artificial variable a1, two slack variables s1 and s2 and a large constantM to write the problem in the matrix form:

Maximize z = cT x, subject to Ax = b, x ≥ 0.

State clearly the values of c, x, b and A. [2 marks ]

(ii) Write down the first Simplex Tableau. [4 marks ]

(iii) Find the optimal solution to the problem using the Simplex Method. [7 marks ]

(iv) From your final tableau find the range of optimality for the coefficient of x1 in theobjective function. [5 marks ]

[25 marks in total ]

Question 3

(a) For a graph G define the terms:

Tree Spanning Tree Minimal Spanning Tree

A TV cable company wishes to connect seven housing estates, 1 . . . 7, with lines runningeither directly from the Company’s centre C or indirectly via the relay/boosting equip-ment that is installed on each estate. The graph in Fig.E.1 indicates the estimated costsof making various connections. (not all logical connections are practical). By constructinga minimal spanning tree for the network using Prim’s algorithm, determine how the

Page 189: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 184

connections should be made in order to minimize the total cost. State this cost.

It turns out that it is not possible to make any direct connections between estate 1 andestate 2 or between estate 3 and estate 4. Rework the problem using Kruskal’s algorithmto determine a new strategy and new cost.

C

6 7

51 3

2 4

12 1

2

2 2

22

4

4

3

31

2

3

4

Figure B.1: The graph shows the cost in tens of thousands of pounds to establish the indicated links

[11 marks ]

(b) The graph in Fig.E.2 indicates the probability of the trains being on time when travelling ineither direction between the given nodes that represent the five cities London, Birmingham,Peterborough, Nottingham and Leeds. By first transforming the network using logarithms,demonstrate the use of Dijkstra’s algorithm to calculate the most punctual routes fromLondon to each of the other cities. Give the probability in each case of having a journeywithout delay. [14 marks ]

L

B

P

N

Lds0.95

0.9

0.85

0.8

0.75

0.8

0.9

0.75

Figure B.2: The graph shows the probability of the trains being on time when travelling between thefive cities represented by the five nodes

[25 marks in total ]

Page 190: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 185

Question 4

(a) For a flow problem define the term basic network.

For a basic network:

(i) Write down the conditions that must be satisfied by the flow fi,j from node(i) to node(j).

(ii) With explanation, give an expression for the flow in the network.

[6 marks ]

(b) State the Max-Flow Min-Cut theorem and hence for the network in Fig.C.7 construct bytrial a cut and a flow to establish the maximum flow in the network.

[7 marks ]

A

B E

C

D

F

G

-

-

>

>

~? ?

3

R

~

= R3

3

2

2

2

2

1

1

6

5

7

4

Figure B.3: The numbers indicate the capacities of each arc. The arrows indicate the direction of flowin each arc.

(c) The graph in Fig. C.8 represents a one-way road network taking traffic from point S topoint T in the directions indicated by the arrows and passing through the four roundaboutsR1, R2, R3 and R4. The average maximum capacity of each road is shown on the diagramin terms of vehicles per minute and with the exception of R4 the roundabouts can dealwith all possible flows of traffic. Although the roundabout R4 is scheduled to be updated,at present it can only deal with 20 vehicles per minute.

S

R1 R2

R3

~R4

T

-

-

>

3

~

>

~60

50

50

100

40

30

30

50

Figure B.4: Arrows indicate the direction of traffic flow; numbers indicate the maximum flow invehicles/min for each road.

(i) Redraw the network so that it consist entirely of unrestricted nodes.

Page 191: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 186

(ii) Demonstrate the application of the Ford-Fulkerson algorithm to the amended graphto establish the maximum flow. Hence determine the maximum flow and the associatedflows on each road.

[12 marks ]

[25 marks in total ]

Question 5

A company has an equipments policy that stipulates that no office computers should be morethan five years old. The value to the company of an individual machine is dependent on itsage; the older machines requiring more hardware and software maintenance and hence slowlybecoming less efficient. The company sets up a temporary office several miles from its base withthe intention of closing it down after three years, at which time all the office equipment will besold off. The computers in this office are initially all three years old and you are asked, usingdynamical programming techniques, to formulate an optimal replacement policy over the nextthree years. Although you should assume that all the computers are replaced at the same timeit may not be the best solution to wait until the computers are five years old before making thereplacement. The following table indicates the annual dependency of the revenue, maintenancecost and resale value in pounds sterling of a computer with respect to time. Additionally thecost of a new computer is £3000.

Age Revenue Maintenance Resalein years cost value

t r(t) c(t) s(t)0 2500 25 −1 2300 40 20002 2200 80 15003 1900 120 12504 1500 180 10005 − − 600

Table B.1: The annual revenue and operating cost relate to a computer which is t years old at thestart of the year. The resale value relates to a computer of t years old.

(i) In the context of a dynamical programming approach using backward recursion, identifythe following:

(a) The four decision stages, i = 1 . . . 4.

(b) The state variable xi at each stage.

(c) The decisions at each stage.

(d) An optimization functional fi(xi) and a defining recursion relation.

[7 marks ]

Page 192: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 187

(ii) Draw a suitable network to illustrate the above problem, indicating clearly the four stages.Hence use your network, by making suitable annotations at each node, to obtain the optimalstrategy and return for the problem. (Show all your working.)

[18 marks ]

[25 marks in total ]

Question 6

Polycrock is a company making various items of crockery and cutlery out of plastic and polystyrene.Next week the polystyrene cup department is to make exactly 125,000 small sized cups, 80,000medium sized cups and 100,000 large sized cups. The cup department has three machines, M1,M2 and M3, on which to produce the cups. Each machine is capable of producing any size of cupbut can only produce one cup size at any one time. The amount of waste produced in makingeach cup varies from cup size to cup size and machine to machine. Table B.2 gives the amountof waste measured in milligrams per cup for all possible modes of production. The time for

Machine Small Medium Largecup cup cup

M1 25 10 30M2 25 30 10M3 30 35 30

Table B.2: The amount of waste per cup measured in milligrams

each type of machine to produce each type of cup also varies with respect to machine and cup.Table B.3 gives the number of items produced on each machine per minute. The availability

Machine Small Medium Largecup cup cup

M1 40 30 25M2 50 30 20M3 60 50 40

Table B.3: Production rates measured in items per minute

of machine time during the week is 40 hours for machine M1, 40 hours for machine M2 and 45hours for machine M3.

Polycrock wish to know how to schedule the work across the three machines during the comingweek in order to minimize the amount of waste.

For the coming week denote the number of small cups produced on machine Mi by xS,i, thenumber of medium cups produced on machine Mi by xM,i and the number of large cups producedon machine Mi by xL,i where in each case i = 1, 2, 3.

Page 193: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 188

(a) Formulate the linear programming problem in terms of these nine variables to determinethe optimal production strategy for the coming week. Show clearly the derivation of theconstraints and the objective function.

[9 marks ]

(b) The data in Table B.4 is the computer output from solving the problem. Use this data toanswer the following questions:

(i) What is the optimal strategy and how much waste, expressed in kilograms, is produced?[4 marks ]

(ii) State which constraints are binding and which are not. [2 marks ]

(iii) Three of the shadow prices are positive and three are negative, explain in terms of theproblem why this should be so. [2 marks ]

(iv) If it is possible to increase the available time on just one machine by 30 minutes, whichmachine should this be? Hence calculate the improvement in the objective function inthis case. [2 marks ]

(v) If it is required to produce 1000 more small cups how much more waste is produced?[2 marks ]

(vi) Calculate the feasible range for the number of small cups produced. [2 marks ]

(vii) From the table no small cups are produced on M3. By making the production of smallcups on M3 less wasteful is it possible, within the optimum strategy, to start makingsmall cups on M3? Comment similarly on the production of medium and large cupson M2. [2 marks ]

Page 194: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 189

Variables

Final Reduced Objective Allowable Allowable

Value Cost Coefficient Increase Decrease

xS,1 5000 0 25 36.25 105.75

xS,2 120000 0 25 105.75 1E+30

xS,3 0 36.25 30 1E+30 36.25

xM,1 26250 0 10 23.81 1E+30

xM,2 0 176.25 30 1E+30 176.25

xM,3 53750 0 35 1E+30 23.81

xL,1 35000 0 30 1E+30 21.75

xL,2 0 401.87 10 1E+30 401.87

xL,3 65000 0 30 21.75 1E+30

Constraints

Final Shadow Constraint Allowable Allowable

Value Price R.H. Side Increase Decrease

Small 125000 493.75 125000 1400.00 2333.33

Med 80000 635.00 80000 1093.75 1750.00

Large 100000 780.00 100000 875.00 1400.00

M1 2400 -18750.00 2400 58.33 35.00

M2 2400 -23437.50 2400 46.67 28.00

M3 2700 -30000.00 2700 35.00 21.88

Objective function

Waste Value

z 8268750

Name

Name

Table B.4: Output from computer solution of Q6. The constraints Small, Med and Large relate to therequirements that a fixed number of different types of cup are to be produced. The constraints M1, M2and M3 relate to the availability of the different types of machine.

[25 marks in total ]

Page 195: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 190

B.2 Solutions

Solutions May 2007

1. (i) Let y1 denote the number of Regular tablets per week and y2 the number of Extra tabletsper week.Therefore the amount of Vit A/week = 0.1y1 + 0.3y2

and the amount of Vit C/week = 0.2y1 + 0.2y2. Thus to meet the recommended amounts:

0.1y1 + 0.3y2 ≥ 1.7 0.2y1 + 0.2y2 ≥ 1.8 ⇒(

0.1 0.30.2 0.2

)(y1

y2

)≥

(1.71.8

)= c

The total cost of the tablets is given by z = 0.5y1 + 1.2y2 = bT y [5 marks ]

y1

y2

0.1y1 + 0.3y2 = 1.7

0.2y1 + 0.2y2 = 1.8 z = 6 = 0.5y1 + 1.2y2

(5, 4)

0.1x1 + 0.2x2 = 0.5

x1

x2

0.3x1 + 0.2x2 = 1.2

z = 4 = 1.7x1 + 1.8x2

( 72, 3

4)

(a)(b)

Figure B.5: (a): primal minimization problem [3 marks ] (b): Dual maximization problem [3 marks ]

(ii) From Fig.B.5(a) the objective function is minimum at (5, 4). Thus we should buy 5 Regtablets and 4 Extra tablets at a cost of 7.3p/wk. [2 marks ]

(iii) The dual problem is maximize z = cT x = 1.7x1 + 1.8x2 subject to :(

0.1 0.20.3 0.2

)x ≤

(0.51.2

)= b

[2 marks ]In terms of the problem let x1 denote the price in pence per mg of vitamin A and x2 theprice in pence per mg of vitamin C. The manufacturer will try and maximize the cost ofthe recommended weekly supply of vitamins, namely z = 1.7x1 + 1.8x2

Page 196: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 191

Supplied separately the cost of the vitamins in the Regular tablet is given by 0.1x1 + 0.2x2

which to be competitive with the Regular tablet must cost no more than a Regular tablet.Thus 0.1x1 + 0.2x2 ≤ 0.5

Similarly arguing for the Extra tablet 0.3x1 + 0.2x2 ≤ 1.2 [3 marks ]

(iv) It is required to prove that cT x ≤ bT y, given x ≥ 0, y ≥ 0, c ≤ AT y and Ax ≤ b.

c ≤ AT y ⇒ cT ≤ yT A which, since x ≥ 0 ⇒ cT x ≤ yT Ax ≤ yT b = bT y

[5 marks ]

(v) From FigB.5(b) the maximum is at (72 , 3

4). Since the dual variable x1 is the greater it ismore advantageous for the consumer if the recommended amount of vitamin A is reduced.

[2 marks ]

2. (a) (i) A basic solution is obtained by selecting m independent columns of A, setting all othernon-associated variables equal to zero and solving the m equations in m unknowns.

[2 marks ]

(ii) By inspection col(1) and col(2) independent thus x1 = x2 = 1 and x3 = 0 basic solution.Select the final two columns, set x1 = 0 solve to get x2 = x3 = 1/2Select the first and last columns, set x2 = 0 solve to get x1 = −1, x3 = 1

[3 marks ]

(iii) At most nCm basic solutions. In the simplex method the optimal value occurs at afeasible basic solution thus there are only a finite number of steps to reach the solution.

[2 marks ]

(b) (i) In matrix form:

z = (2, 1, 2,−M, 0, 0)

x1

x2

x3

a1

s1

s2

= cT x Ax =

1 1 1 1 0 04 2 1 0 1 01 1 2 0 0 1

x =

132

= b

[2 marks ]

Page 197: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 192

(ii)

x1 x2 x3 a1 s1 s2 d rBasic cj 2 1 2 −M 0 0

a1 −M 1 1 1 1 0 0 1 1s1 0 4 2 1 0 1 0 3 [3/4]s2 0 1 1 2 0 0 1 2 2zj −M −M −M −M 0 0 z =

∆zj [2 + M ] 1 + M 2 + M 0 0 0 −M

Table B.5: 2 + M max in final row hence bring in x1 (or x3); 3/4 smallest in final col thus take outs1.

[4 marks ]

(iii)

x1 x2 x3 a1 s1 s2 d rBasic cj 2 1 2 −M 0 0

a1 −M 0 1/2 3/4 1 −1/4 0 1/4 [1/3]x1 2 1 1/2 1/4 0 1/4 0 3/4 3s2 0 0 1/2 7/4 0 −1/4 1 5/4 5/7

zj 2 1− M2 −3M

4 + 12 −M M

4 + 12 0 z =

∆zj 0 M2 [32 + 3M

4 ] 0 −M4 − 1

2 0 −M4 + 3

2

[32 + 3M4 ] max in final row hence bring in x3; [1/3] smallest in final col thus take out s1.

[3 marks ]

x1 x2 x3 a1 s1 s2 d rBasic cj 2 1 2 −M 0 0x3 2 0 2/3 1 4/3 −1/3 0 1/3x1 2 1 1/3 0 −1/3 1/3 0 2/3s2 0 0 −2/3 0 −7/3 1/3 0 2/3zj 2 2 2 2 0 0 z =

∆zj 0 −1 0 −M − 2 0 0 2Final row ≤ 0 thus optimal. [3 marks ]

The optimal solution is x1 = 2/3, x3 = 1/3, x2 = 0 and zmax = 2. [1 mark ]

(iv) To obtain the range of optimality recalculate the last tableau with the x1 coefficientreplaced by α, this only affects the final two rows.

Page 198: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 193

x1 x2 x3 a1 s1 s2 d rBasic cj α 1 2 −M 0 0x3 2 0 2/3 1 4/3 −1/3 0 1/3x1 α 1 1/3 0 −1/3 1/3 0 2/3s2 0 0 −2/3 0 −7/3 1/3 0 2/3

zj α 43 + α

3 2 83 − α

3 −23 + α

3 0 z =

∆zj 0 −13 − α

3 0 −M − 83 + α

323 − α

3 0 2

To remain optimal α must be such that the final row ≤ 0. [3 marks ]Since −M − 8

3 + α3 is always less than zero, require α such that:

−13− α

3≤ 0,

23− α

3≤ 0 ⇒ 2 ≤ α ⇒ range optimality [2,∞)

[2 marks ]

Page 199: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 194

3. (a) A tree is a simply connected graph with no cycles. [1 mark ]A spanning tree for a connected graph G is a subgraph of G that is a tree containing allnodes of G. [1 mark ]A minimum spanning tree for G is a spanning tree for G such that the sum of the valuesof its edges is a minimum. [1 mark ]Fig.B.6(a) show the minimum tree of 11. [4 marks ]Fig.B.6(b) shows that with two fewer links the minimum distance is 13. [4 marks ]

C

2

C

2

3

2 2 1

C

2

3

2 1

51

C

2

3

2 1

51

1

C

2

3

2 1

51

12 4

1

C

2

3

2 1

51

12 4

1

7

6

22

(a)

4

2 3 51 1

2 3 51 1

C 1 6

7

2

22

2

2 3 51 1

C 1 6

7

2

22

2

4

3

(b)

Figure B.6: (a): the diagram shows the addition of one node at a time using Primm’s Algorithm; inthe final diagram two nodes were added (b): the three diagram shows the addition of edges value 1, 2and 3 using Kruscal’s Algorithm.

(b) Let the components of any path from L have respectively probabilities p1, p2 . . . pk of beingon time. The probability of the journey being on time is given by P = p1 × p2 . . . pk ⇒

Page 200: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 195

ln(P ) = ln(p1)+ln(p2)+ . . . ln(pk). Since ln pi ≤ 0 consider minimizing − lnP . Hence drawa graph with edge lengths − ln pi. [3 marks ]

Fig.B.7 shows the application of Dijkstra’s method to find the shortest path from L to eachof the other nodes. This enables us to write down the most reliable paths.

London - Birmingham L → B Probability = 0.85

London - Peterborough L → P Probability = 0.95

London - Nottingham L → P → N Probability = 0.95× 0.8 = 0.76

London - Leeds L → P → Lds Probability = 0.95× 0.9 = 0.855 [3 marks ]

L

B

P

N

Lds

0.1625

0.0513

0.2231

0.1054

0.2877

0.1054

0.2231

0.2877

[0, L]

[0.1625, L] [0.4444, Lds]

[0.3856, B]

[0.0513, L]

[0.2744, P ]

[0.1567, P ]

[0.2621, Lds]

[0.3390, P ]

Figure B.7: Nodes labelled [d, n ], where n is the previous node and d is the distance from S. Underlineindicates label is permanent. [8 marks ]

Page 201: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 196

4. (a) Definition Basic Network: directed graph with at most a single edge between nodes; to eachedge from node(i) to node(j) associate ci,j ≥ 0.; Two special nodes S with no incoming andT with no out going arcs. [2 marks ]

(i) fi,j ≥ 0; fi,j ≤ ci,j ; except for S and T flow into a node = flow out of a node.

[2 marks ]

(ii) The above implies that the total out of S equals the total into T . This amount iscalled the flow of the network and is equal to

∑i fS,i or

∑i fi,T [2 marks ]

(b) Maximum flow in a network is equal to the value of a minimum cut. [1 mark ]

A

B

C

E

F

DG

[1,3]

[1,1]

[1,2]

[6,7]

[5,5]

[0,2]

[0,4]

[1,1]

[0,2]

[1,2]

[0,3]

[6,6]

Figure B.8: Notation [flow, capacity]; value of cut = 7 [3 marks ]; value of flow = 7 [3 marks ]; thusoptimal flow.

(c) The node at R4 is split into two nodes R′4 and R′′

4 with a single link with capacity 20between them. See Fig.B.9(a). [2 marks ]

From Fig.B.9(d) the maximum flow is 110. In terms of the problem the flow from R4 to T

is 20. [2 marks ]

Page 202: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 197

R1

R3

R2

R′4

T

R′′4

6

-

~

(a)

-

(R2,50)[0, 100]

[0, 40]

-

>

[0, 30]

[60, 60]

[0, 50]

[0.20]

(S,60)

[0, 30]

(R1,50)

-[0, 50]

S

*

~

(S,50)

[0, 50]

[50, 100]

[50, 60]

[50, 50]

R1

R3

R2

R′4

T

R′′4

6

-

~

(b)

-

(R2,40)

[90, 100]

[0, 40]

-

>

[0, 30][0, 50]

[0.20]

(S,10)

[0, 30]

(R3,40)

-[50, 50]

S

*

~

(S,50)

[0, 50]

[50, 100][50, 60]

R1

R3

[40, 50]

[40, 40]

R2

R′4

T

R′′4

6

-

~

(c)

-

(R′′4 ,10)[90, 100]

[40, 40]

-

>

[0, 30][0, 50]

[0.20]

(S,10)

[0, 30]

[40, 50]

-[50, 50]

S

*

~

(S,10)

[50, 60]

[10, 30]

[60, 60]

(R1,10) [10.20] (R′4,10)

[10, 50]

R1

R3

R2

R′4

T

R′′4

6

-

~

(d)

-

(R′′4 ,10)[90, 100]

[40, 40]

-

>

[10, 30][10, 50]

[10.20][0, 30]

[40, 50]

-[50, 50]

S

*

~

(S,10)

[60, 60]

[10, 30]

[50, 50]

(R3,10) [20.20] (R′4,10)

[20, 50]

Figure B.9: Notation: [flow,capacity]; (previous node, max possible increase) [8 marks ]

5. (i) (a) Let i be the start of the ith year [1 mark ]

(b) xi is the age of the machine at the start of ith year. [1 mark ]

(c) Decisions are to Keep or Replace. [1 mark ]

(d) Let fi(xi) be the total revenue from stage i in state xi to the final salvage, i = 1 . . . 4.

fi(xi) = Max{

r(xi)− c(xi) + fi+1(xi + 1) Keepr(0)− c(0) + s(xi)− 3000 + fi+1(1) Replace

}i = 1, 2, 3 f4(x4) = s(x4),

[4 marks ]

(ii) Stage 35−R− 1 2500− 25 + 600− 3000 + 2000 = [2075]

2−R− 1 2500− 25 + 1500− 3000 + 2000 = 29752−K − 3 2200− 80 + 1250 = [3370]

1−K − 2 2300− 40 + 1500 = [3760]1−R− 1 2500− 25 + 2000− 3000 + 2000 = 3475

[4 marks ]

Stage 2

Page 203: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 198

1−R− 1 2500− 25 + 2000− 3000 + 3760 = 52351−K − 2 2300− 40 + 3370 = [5630]

4−R− 1 2500− 25 + 1000− 3000 + 3760 = [4235]4−K − 5 1500− 180 + 2075 = 3395

[3 marks ]

Stage 13−R− 1 2500− 25 + 1250− 3000 + 5630 = [6355]3−K − 4 1900− 120 + 4235 = 6015

[2 marks ]

In the above the optimal option (max value) is indicated using [] for each decision. Thesevalues are then placed on the relevant node in Fig.B.10.

3

1

4

1

2

5

2

3

1

T

3

j

- -

-

--

*

s-q

3

q~

R

R

R

R

R

K

K

K

K

R

K

(stage 1) (stage 2) (stage 3) (stage 4)x1 x2 x3 x4

[1500,T]

[1250,T]

[2000,T][2075,1]

[3370,3]

[3760,2][5630,2]

[4235,1][6355,1]

Figure B.10: Notation: [fi(xi),next node] [8 marks ]

The return is £6355 per machine with the strategy of Replace, Keep, Keep, Salvage.

[1 mark ]

6. (a) Small cups = 125000 = xs,1 + xs,2 + xs,3 (i)

Medium cups = 80000 = xm,1 + xm,2 + xm,3 (ii)

Small cups = 100000 = xL,1 + xL,2 + xL,3 (iii)

Available time:

M1: 2400 ≥ 140xs,1 + 1

30xm,1 + 125xL,1 (iv)

M2: 2400 ≥ 150xs,2 + 1

30xm,2 + 120xL,2 (v)

M3: 2700 ≥ 160xs,3 + 1

50xm,3 + 140xL,3 (vi)

The constraints are given by (i)− (vi) plus the non-negative condition on all variables.

[7 marks ]

The amount of waste is given by:

z = 25xs,1 + 25xs,2 + 30xs,3 + 10xm,1 + 30xm,2 + 35xm,3 + 30xL,1 + 10xL,2 + 30xL,3

The problem is to minimize this subject to the given constraints. [2 marks ]

(b) (i) Final values of variables give optimal strategy:Small cups: 5000 on M1; 120000 on M2; 0 on M3

Page 204: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX B. PAST EXAM - MAY 2007 199

Medium cups: 26250 on M1; 0 on M2; 53750 on M3Large cups: 350000 on M1; 0 on M2; 65000 on M3Waste = 8.269 kg [4 marks ]

(ii) All constraints are binding since RH side=Final Value. [2 marks ]

(iii) If more time is available on a given machine then reschedule to reduce waste - nopoint in changing otherwise - thus expect shadow prices to be negative for the timeconstraints.If we increase the number of cups then we are bound to produce more waste, thus theshadow price for the number of cups expected to be positive. [2 marks ]

(iv) Most negative shadow price for available time is -3000 for M3 thus waste reduced by:30× 3000 = 900g. [2 marks ]

(v) 1000 more small cups increases z by 1000× 493.75 = 493.75g. [2 marks ]

(vi) Feasible range for number of small cups:= [125000− 2333.33, 125000 + 1400] = [122667, 126400]. [2 marks ]

(vii) Waste in producing a small cup on M3 is 30mg. Since the reduced cost for this item is36.25 it is not possible to reduce the amount of waste by this amount.Similarly the reduced costs of the other two processes are greater than the actualamounts of waste already being produced. [2 marks ]

Page 205: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Appendix C

Past Exam - May 2006

C.1 Question Paper

Full marks for correct solutions to any FOUR or the SIX questions - 214 hours

Question 1

(a) A university wishes to install a computer network on its campus, connecting several build-ings to the main server in the computer centre. Links do not necessarily have to be direct,a building is able to tap into a nearby building. The following network gives the distance ofthe routes between the buildings along which it is possible to make links. As the required

C

1

2

3

4

5

63

2

2

5

4

31

21

1

2

Figure C.1: Computer centre C; Departments numbered 1 . . . 6; distances given in km.

underground cabling will be expensive the university wishes to minimize the total amountof trenching needed.

(i) Explain why a minimum spanning tree will give the solution to the problem.

(ii) Using Prim’s or Kruskal algorithm construct such a tree and report your findings.

(b) A company wishes to deliver orders to its clients across town. The delivery of each orderwill consist of a single journey to the client with no other client being serviced during thetrip. There are several routes available to the company, however on each leg of the routethere is a possibility of delay. The company decides that the routes that maximize the

200

Page 206: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 201

chance of no delay are the ones that should be selected, even if not the shortest. Thefollowing network shows the various routes from the supplier to the clients with each arcbeing labelled with the probability of not being delayed.

S

1

2

3

4

0.4

0.50.2

0.4

0.20.7

0.3

0.5

Figure C.2: Supplier S; Clients numbered 1 . . . 4; Probabilities of no delays given.

(i) Using logarithms construct a suitable network such that the company’s problem canbe solved by using a minimum path algorithm. Explain you reasoning.

(ii) Apply Dijkstra’s algorithm to your network to find the minimum paths from S to theother nodes. Write down the optimal paths and their probabilities.

(25 marks in total)

Question 2

The following network represents the pumping of oil from two sources, S1 and S2, to a singleterminal T, via intermediate pumping stations P1, P2, P3 and P4. The direction of flow throughthe network and the capacities of each link are given in the diagram.

S1

S2

P1

P2

P3

P4

T

-

~

-

-

3

j>

-

>

46

4

5

3

4

2

3

2

Figure C.3: Sources S1 and S2, sink T ; Direction of flow and capacities indicated on arcs.

(i) Show how the network can be converted into a standard network with a single source andsingle sink. Draw the new network.

(ii) Construct an example of a non-zero flow in your standard network in (i).

(iii) Starting with zero flow in the standard network use the Ford-Fulkerson algorithm to findthe maximal flow.

Page 207: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 202

State the Max-Flow Min-Cut theorem and hence by inspection obtain a cut that establishes thatthe maximum flow given by (iii) satisfies the theorem.

(25 marks in total)

Question 3

The following network represents the available times of flights between centres when travellingfrom London to Sydney, additional time has been included in the numbers to take account ofthe average amount of time spent changing at each centre.

1

2

3

4

5

6

7

8

10

9

>-

j

-

3

j

-

-

7>

4 s-

R

-

1

2

3

12 11

4

Rz

9

5

14

13

12

10

13

15

3

Figure C.4: Node(1) - London, Node(10) - Sydney; Times of flights include an amount for changes.

(i) State Bellman’s Principle of Optimality. Interpret this principle in terms of a networkproblem such as the one above.

(ii) Split the above problem into stages suitable for analysis using Dynamical Programming.Identify the input state variables xi associated with each stage i. For each stage list the setof possible decisions.

(iii) For each of the following define in words a functional fi(xi) suitable for use in the DynamicalProgramming approach to the problem.

(a) To compute the route of shortest time

(b) To compute the route of longest time

(iv) Denoting the time of the direct link from the kth node to the jth node by dk,j , write downthe recurrence relations defining fi(xi) for each of (a) and (b) in (iii) above.

(v) Using the Dynamical Programming approach find the shortest and longest routes fromLondon to Sydney along with their times.

(25 marks in total)

Page 208: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 203

Question 4

A surveyor visits two types of property, commercial and domestic. Commercial properties takelonger to inspect due to their size and the increased number of health and safety regulations.On average a domestic property takes 10 minutes and a commercial property 40 minutes. Ina given working day the surveyor is not prepared to spend more than five hours per day oninspections and one hour per day in the evenings carrying out the paper work generated by theday’s activities. On average the time to process the paperwork for a domestic property is 3minutes and for a commercial property 7 minutes. Although the surveyor is paid a salary thereis a bonus scheme which pays an extra £3 for each domestic property inspected and £10 foreach commercial property inspected.

Given that there are always properties of each type to inspect and based only on the times tocarry out the inspections and the times to process the paperwork set up the Linear Programmingproblem to calculate how the surveyor should proceed in order to maximize the bonus.

Use graphical means to solve the Linear Programming problem, stating how many types of eachproperty the surveyor should inspect per day and the value of the bonus generated.

Write down the dual problem for the above and hence interpret from the point of view of thesurveyor’s employer.

Solve the dual problem using graphical means.

Use your solution to the dual problem to decide whether or not the surveyor would be betteroff, from the point of view of increasing the bonus, by increasing the number of hours per dayinspecting or by increasing the number of hours per evening doing paperwork.

(25 marks in total)

Question 5

Consider the following problem:

Maximize z = 2x1 + x2 + x3 subject to the constraints:

x1 + x2 ≥ 1, x1 + x2 + 2x3 ≤ 4, x1, x2 , x3 ≥ 0.

(i) Introduce a surplus variable s1, an artificial variable a1, a slack variable s2, and a largeconstant M to write the problem in the augmented matrix form:

Maximize z = cT x, subject to Ax = b, x ≥ 0.

State clearly the values of c, x, b and A.

(ii) Why does the Simplex Method require the extra artificial variable?

(iii) Write down the first Simplex Tableau.

(iv) Find the optimal solution to the problem using the Simplex Method.

Page 209: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 204

(v) From your final tableau:

(a) Write down the values of the dual variables.

(b) Obtain the feasible range for each component of b.

(c) Find the range of optimality for the coefficient of x1 in the objective function.

(25 marks in total)

Page 210: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 205

Question 6

An investment advisor has the following model for investing a client’s funds. The portfolio willcontain shares, unit trusts and cash, with the risk indices and assumed (estimated) annual returnrates given by the following table. The risk index for the portfolio is given by forming the sum

Investment Annual % RiskReturn Rate Index

Shares 12 0.8Unit Trusts 4 0.3

Cash 3 0

Table C.1: Assumed annual returns; Risk indices

of the products of the proportion of each type of investment in the portfolio with its risk index.Thus a portfolio containing 50% shares, 20% unit trusts and 30% cash would have a risk indexof 0.5(0.8)+0.2(0.3)+0.3(0.0)=0.46.

The advisor’s rules for the investment portfolio are:

Rule 1: The portfolio may contain no more than 50% shares.

Rule 2: The amount of investment in unit trusts must be at least half that investedin shares.

Rule 3: The amount of cash must be at least 10% of the total fund.

Rule 4: The amount of cash must be no more than 25% of the total fund.

Let x1 be the proportion of shares, x2 the proportion of unit trusts and x3 the proportion of cashin the portfolio. If the advisor decides to construct a portfolio with risk index of 0.4 write downfour constraining inequalities corresponding to the four rules, one constraint corresponding to thegiven risk index and one final constraint corresponding to the fact that the sum of proportion ofthe products in the portfolio must be one. Express all the constraints with constant non-negativerighthand side.

The objective of the advisor is to maximize the total annual rate of return subject to theconstraints, hence write down the objective function for the problem.

The computer output from the linear programming software is given in Table C.2. Using thisoutput answer the following:

(i) What is the optimal portfolio and its annual return?

(ii) Calculate the feasible range for the righthand side of the constraint for rule 4.

(iii) Is it more beneficial for the advisor to increase the risk by 0.05 or to raise the proportion ofcash invested by ten percentage points? In each case state clearly what the annual returnwould be.

(iv) Explain what is meant by reduced cost and say why in this case they are all zero.

(v) Write down the ranges of optimality for the three objective function coefficients.

Page 211: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 206

(vi) If the annual rate of return on the unit trusts is taken to be 7% calculate the new optimumannual return on the portfolio. Why is it not possible to carry out this calculation withoutre-running the software if the rate of return is increased to 8%.

Variables

Final Reduced Objective Allowable Allowable

Name Value Cost Coefficient Increase Decrease

x1 0.250 0.000 0.12 1E+30 0.07

x2 0.500 0.000 0.04 0.035 1E+30

x3 0.250 0.000 0.03 1E+30 0.07

Constarints

Final Dual Constraint Allowable Allowable

Name Value Price R.H. Side Increase Decrease Status Slack

Rule 1 0.25 0 0.5 1E+30 0.25 Not Binding 0.25

Rule 2 -0.375 0 0 1E+30 0.375 Not Binding 0.375

Rule 3 0.25 0 0.1 0.15 1E+30 Not Binding 0.15

Rule 4 0.25 0.07 0.25 0.15 0.15 Binding 0

Risk 0.4 0.2 0.4 0.1 0.1 0

Prop 1 -0.04 1 0.25 0.15 0

Value

0.0575

Objective function

Optimal Values

z

Annual Rate

Table C.2: Computer output for Question 6

(25 marks in total)

Page 212: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 207

C.2 Solutions

Solutions May 2006

Question 1

(a) (i) Need to minimize the total length, connect all nodes, have no redundant loops.[2 marks]

(ii) Use either algorithm to produce Fig. E.1. [4 marks]Total length =10, make the connections as per the diagram. [1 mark]

C 1 2

3 5 4

6

3 2

2

11 1

Figure C.5:

(b) (i) The probability of no delay along a path of length k is given by

P = p1 × p2 × . . . pk

Maximizing P ∼ Maximizing lnP ∼ Maximizing ln p1 + ln p2 + . . . ln pk ∼Minimizing (− ln p1) + (− ln p2) · · ·+ (− ln pk). [3 marks]Thus redraw the network for − ln pi. Fig. E.2 [2 marks]

S

1

2

3

4

0.92

0.69

0.92

0.69

1.61

1.61

1.20

0.36

[S, ∗]

[S, 0.92][2, 1.89]

[2, 2.3][S, 0.69]

[1, 1.84]

[1, 1.61]

Figure C.6: Nodes labelled [n, d ], where n is the previous node and d is the distance from S. Underlineindicates label is permanent.

(ii) · Label S with the permanent label [S, ∗].

Page 213: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 208

· Label 1 as [S, 0.92] and 2 as [S, 0.69]

· Since label on 2 is temporary and less than label 1 make 2 permanent and label as[S, 0.69]

· Label nodes adjacent to 2 that are unlabelled, or not permanent or have greatertemporary node. Thus Label 3 as [2, 1.89] and 4 as [2, 2.30]. Make 1 permanent,since smallest temporary node and label as [S, 0.92].

· Label nodes adjacent to node 1 the are unlabelled, or not permanent or have greatertemporary node. Thus label 3 as [1, 1.84] and change label 4 to [1, 1.61]. Make thesmallest temporary label permanent, thus label 4 as [1, 1.61].

· Look at nodes adjacent to 4, no more changes

· make the last temporary label permanent, thus change the label on 3 to [1, 1.84].

[9 marks]Recover paths and probabilities:S → 1 prob= 0.4, S → 2 prob= 0.5S → 1 → 3 prob= 0.16, S → 1 → 4 prob= 0.2 [4 marks - (2 paths, 2 values) ]

Page 214: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 209

Question 2

(i) Introduce a source S and two edges of capacity 5 and 6, as shown in Fig. C.7. The newnetwork should be as in Fig. C.8. [3 marks]

S

S1

S2

*

j

5

6

Figure C.7: Insert artificial source node S with capacities 5 and 6.

(ii) A flow of 2 is given in Fig. C.8. The points to note are that no capacity is exceeded and con-servation of flow at each node is maintained. The diagram uses the notation [flow, capacity]for non-zero flows or just shows the capacity on a link with zero flow. [3 marks]

S1

S2

P1

P2

P3

P4

T

-

~

-

-

3

j>

-

>

[2, 4][2, 6]

45

3

4

2

3

[2, 2]

S

*

~

[2, 5]

6

Figure C.8:

(iii) The arcs in the network are labelled [flow, capacity] and the nodes (previous node, sparecapacity). In each diagram the round node brackets are added according to the algorithmuntil T is reached. The path so found is then updated and the respective square bracketsshown as being replaced.

Page 215: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 210

S1

S2

P1

P2

P3

P4

T

-

~

-

-

3

j>

-

>

[0, 4][0, 6]

[0, 4]

[0.5]

[0, 3]

[0, 4]

[0, 2]

[0, 3]

[0, 2]

S

*

~

[0, 5]

[0, 6]

[2, 5][2, 2] [2, 4]

[2, 6]

(S,∞)

(S, 5) (S1, 2) (P1, 2)

(P3, 2)

(S, 6) (S1, 3) (P2, 3)

(a)

S1

S2

P1

P2

P3

P4

T

-

~

-

-

3

j>

-

>

[2, 4][2, 6]

[0, 4]

[0.5]

[0, 3]

[0, 4]

[0, 2]

[0, 3]

[2, 2]

S

*

~

[2, 5]

[0, 6]

[4, 6][4, 4] [4, 5]

[4, 4]

(S, 3) (S2, 2) (P2, 3)

(P4, 4)

(S, 6) (S2, 4) (P2, 4)

(S,∞)

(b)

Figure C.9: (a) Shows the initial zero flow and the creation of the flow augmenting path S → S1 →P1 → P3 → T which is then updated by 2 units (b) Show the creation of the flow augmenting pathS → S2 → P2 → P4 → T which is augmented by 4 units

Page 216: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 211

S1

S2

P1

P2

P3

P4

T

-

~

-

-

3

j>

-

>

[2, 4][2, 6]

[4, 4]

[4, 5]

[0, 3]

[4, 4]

[0, 2]

[0, 3]

[2, 2]

S

*

~

[2, 5]

[6, 6]

[4, 6]

[4, 4]

[4, 6](S, 3) (S2, 2) (P1, 2)

(P3, 2)

(S, 2) (S1, 3) (P2, 1)

(S,∞)

(c)

[2, 2]

S1

S2

P1

P2

P3

P4

T

-

~

-

-

3

j>

-

>

[4, 4]

[6, 6]

[4, 4]

[4, 5]

[0, 3]

[4, 4]

[2, 2]

[0, 3]

[2, 2]

S

*

~

[2, 5]

[6, 6]

[2, 3] [2, 3]

[4, 6][4, 5]

(S, 3) (P2, 3)

(P3, 2)

(S, 2) (S1, 3) (P2, 1)

(S,∞)

(d)

cut = 10

Figure C.10:

In Fig. C.10(d) the process is terminated as there are no more flow augmenting paths tocreate.

[12 marks - 3/diagram]

As can be seen the maximal flow is 10. [2 marks]

The maximal flow theorem states that in a standard network the maximal flow is equal to theminimum cut. As can be seen a cut of 10 has been constructed in Fig. C.10(d) which is equalto the flow from the Ford-Fulkerson method; confirming that the flow found by the algorithm isindeed max.

[5 marks - (2 cut, 3 Thrm) ]

Page 217: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 212

Question 3

(i) A optimal policy has the property that whatever the initial state and initial decision are, theremaining decisions must constitute an optimal policy with regards to the state resultingfrom the first decision. [2 marks]

In this problem if node(i) is on the optimal path for the problem then using the samecriteria of optimality all the nodes after i are on the optimal path. [3 marks]

(ii) Stage 4 with input {1} and output {2, 3, 4}Stage 3 with input {2, 3, 4} and output {5, 6, 7}Stage 2 with input {5, 6, 7} and output {8, 9}Stage 1 with input {8, 9} and output {10}The state variable xi is the input to stage i [2 marks]

At each stage i choose for input xi one of the elements of Di of the form (xi, ∗) where thedecision sets are given by:

D4 = {(1, 2), (1, 3), (1, 4)} D3 = {(2, 5), (2, 6), (3, 6), (3, 7), (4, 7)}D2 = {(5, 8), (5, 9), (6, 8), (6, 9), (7, 8), (7, 9)} D3 = {(8, 10), (9, 10)} [2 marks]

(iii) (a) Let fi(xi) stand for the shortest distance of the input node xi at stage i to node(10).

(b) Let fi(xi) stand for the longest distance of the input node xi at stage i to node(10).[2 marks]

(iv) (a) fi(xi) = minxi links

{di,i−1 + fi−1(xi−1)} i = 1, . . . 4 x0 = 10, f0(x0) = 0

(b) fi(xi) = maxxi links

{di,i−1 + fi−1(xi−1)} i = 1, . . . 4 x0 = 10, f0(x0) = 0 [4 marks]

(v) Using the notation [total min distance to 10, next node in path] and (total max distanceto 10, next node in path) Fig. C.11 shows the completed network starting from node(10)and working back to node(1).

Shortest path 1 → 2 → 6 → 8 → 10 min distance = 22 [5 marks]

Longest path 1 → 3 → 7 → 8 → 10 max distance = 34 [5 marks ]

Page 218: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 213

1

2

3

4

5

6

7

8

10

9

>-

j

-

3

j

-

-

7>

4 s-

R

-

1

2

3

12 11

4

Rz

9

5

14

13

12

1013

15

3

(27,5) (15,8) (4,10)

(5,10)

(16,8)(29,7)

(34,3)(31,7) (18,8)

[21,6] [14,9] [4,10]

[5,10]

[28,7] [15,9]

[22,2] [22,6] [18,8]

Figure C.11:

Question 4

Linear Programming Problem [5 marks ]

Let x1 ≥ 0 be the number of domestic dwellings inspected and x2 ≥ 0 the number ofdomestic dwelling inspected per day.

The constraint for the time to inspect is 10x1 + 40x2 ≤ 300

The constraint for the time to do the associated paperwork is 3x1 + 7x2 ≤ 60

Bonus for doing the inspections z = 3x1 + 10x2

Solution

Diagram Fig. C.12(a) [2 marks ]

Verify that the max is at P with x1 = x2 = 6 and z = £78. [2 marks ]

Dual Problem

Minimize z = 300y1 + 60y2 subject to:

10y1 + 3y2 ≥ 3 40y1 + 7y2 ≥ 10, y1, y2 ≥ 0 [5 marks ]

Interpretation of Dual

y1 is the amount of bonus paid per minute for carrying out inspections.

y2 is the amount of bonus paid per minute for doing the paperwork

Page 219: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 214

B

P

A20 30

7.5

x1 + 4x2 = 30

3x1 + 7x2 = 60

x1

x2

Oy1

y2

(a) (b)

A

B

P

0.30.25

110y1 + 3y2 = 3

40y1 + 7y2 = 10

O

Figure C.12: (a) Primal problem (b) Dual problem

Company would like to minimize the amount of bonus earned in a day, that is to sayminimize z = 300y + 60y2.However they will still need to pay at least £3 per domestic inspection and £10 percommercial inspection. Thus:

domestic 10y1 + 3y2 ≥ 3 commercial 40y1 + 7y2 ≥ 10

[5 marks ]

Solution of Dual

The solution to the dual problem is given in Fig. C.12(b) [2 marks ]

Verify that the min is at P with: y1 = 950 , y2 = 2

5 and z = £78. [2 marks ]

The dual solutions are the shadow or dual prices of the primal problem. Since y2 > y1

it is therefore more beneficial for the surveyor to allocate more time to paperwork.[2 marks ]

Question 5

(i) Introducing the extra variables:

x1 + x2 − s1 + a1 = 1 x1 + x2 + 2x3 + s2 = 4 z = 2x1 + x2 + x3 −Ma1

Thus:

A =(

1 1 0 −1 1 01 1 2 0 0 1

)b =

(14

)cT = (2, 1, 1, 0,−M, 0) xT = (x1, x2, x3, s1, a1, s2)

[3 marks ]

Page 220: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 215

(ii) To start the simplex method at the x-space origin would, without a1, imply that s1 negative,thus not feasible. [1 mark ]

(iii)

x1 x2 x3 s1 a1 s2 d rBasic cj 2 1 1 0 −M 0

a1 −M 1 1 0 −1 1 0 1 (1)s2 0 1 1 2 0 0 1 4 4zj −M −M 0 M −M 0 z =

∆zj [2 + M ] 1 + M 1 −M 0 0 −M

Table C.3: [4 marks ]

(iv) In Table D.2 since [2 + M ] is the largest value on the bottom row and (1) is the smallestvalue in the end column bring x1 into the basic solution and take a1 out.

x1 x2 x3 s1 a1 s2 d rBasic cj 2 1 1 0 −M 0x1 2 1 1 0 −1 1 0 1 −1s2 0 0 0 2 1 −1 1 3 (3)zj 2 2 0 −2 2 0 z =

∆zj 0 −1 1 [2] −M − 2 0 2

Table C.4: [2 marks ]

Since the [2] is the largest element in the last row and (3) the smallest non-negative valuein the last column bing s1 into the basic solution and take s2 out.

x1 x2 x3 s1 a1 s2 d rBasic cj 2 1 1 0 −M 0x1 2 1 1 2 0 0 1 4s1 0 0 0 2 1 −1 1 3zj 2 2 4 0 [0] [2] z =

∆zj 0 −1 −3 0 −M −2 8

Table C.5: [2 marks ]

All the values in the final row of Table D.4 are non-positive thus an optimum solution hasbeen reached with:

x1 = 4, x2 = x3 = 0 and z = 8 [2 marks ]

(v) (a) Dual variables y0 = 0 and y1 = 2 respectively for constraints; terms in [ ] in Table D.4[2 marks ]

Page 221: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 216

(b) For b1:(

43

)+ δ

(0−1

)≥ 0 ⇒ δ ≤ 3 ⇒ b1 ∈ (−∞, 4] [2 marks ]

For b2:(

43

)+ δ

(11

)≥ 0 ⇒ δ ≥ −3 ⇒ b2 ∈ [1,∞) [2 marks ]

(c) To investigate the range of optimality for x1 replace the coefficient of x1 in the objectivefunction with α in the final tableau. This gives Table D.5 from which:

x1 x2 x3 s1 a1 s2 d rBasic cj α 1 1 0 −M 0x1 α 1 1 2 0 0 1 4s1 0 0 0 2 1 −1 1 3zj α α 2α 0 0 α z =

∆zj 0 1− α 1− 2α 0 −M −α 4α

Table C.6: [3 marks ]

For the solution to remain optimal the final row must remain non-positive, thus:

1− α ≤ 0 1− 2α ≤ 0 − α ≤ 0 ⇒ 1 ≤ α

Thus the range of optimality is [1,∞). [2 marks ]

Question 6

The inequality constraints are:

x1 ≤ 0.5 x2 − x1

2≥ 0 x3 ≥ 0.1 x3 ≤ 0.25

The equation constraints are:

(risk) 0.8x1 + 0.3x2 = 0.4 (sum=1) x1 + x2 + x3 = 1

Objective function to maximize the rate of return

z = 0.12x1 + 0.04x2 + 0.03x3

Variables non-negative. [7 marks ]

(i) From the data x1 = x3 = 0.25 and x2 = 0.5.

Thus investment is: 50% unit trust 25% cash and 25% shares

Annual return is 5.75% [3 marks ]

Page 222: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX C. PAST EXAM - MAY 2006 217

(ii) From the data the change in rhs rule4 is ±0.15 Thus the feasible range for the righthandside of rule4 is given by:

0.25− 0.15 ≤ rhs ≤ 0.25 + 0.15 ⇒ [0.1, 0.4]

[2 marks ]

(iii) Dual price for Risk = 0.2 thus increase in z due to an increase of 0.05 is = 0.2 × 0.05 =0.01 ⇒ Return = 6.75%.

Dual price of investing cash = 0.07 thus the increase in z due to an increase of 10% points,that is to say 0.1, is 0.007 ⇒ Return = 6.45%

Thus increase the level of risk. [4 marks ]

(iv) Reduced cost of a particular variable is the change in the corresponding coefficient in theobjective function such that there exists an optimal solution with the value of this variablenon-zero. If the variables are already non-zero at the optimal solution, as in this examplethen no changes are needed and hence all the reduced costs are zero. [2 marks ]

(v) If z = 0.12x1 + 0.04x2 + 0.03x3 = c1x1 + c2x2 + c3x3 then the data gives the possibleincreases and decreases of ci.

c1 : 0.12− 0.07 ≤ c1 < ∞ ⇒ [0.05,∞)

c2 : −∞ < c2 ≤ 0.04 + 0.035 ⇒ (−∞, 0.075]

c3 : 0.03− 0.07 ≤ c3 < ∞ ⇒ [−0.04,∞) [3 marks ]

(vi) 7%=0.07 is inside the range of optimality for c2 thus the solution is still valid and thus thenew value of z given by:

z = 0.25× 0.12 + 0.5.07 + 0.25× 0.03 = 0.0725 = 7.25% [3 marks ]

8%=0.08 is outside the optimal range for c2 thus the problem would need to be resolved.[1 mark ]

Page 223: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Appendix D

Specimen Exam Type Questions andSolutions

D.1 Specimen Questions

The following questions are intended to give you an idea of the type of problem I will expect you tobe able to solve. In the exam the the problems are balanced to be all about the same length, in thefollowing this is not the case. That is to say some of the following problems will be shorter and somelonger than those found in the exam

D.1.1 Minimal spanning tree problem

A spanning tree links all nodes in a network and has no cycles. Associating a positive value with eachedge of the network gives the idea of a minimum spanning tree. Such a tree is therefore the mosteconomical arrangement, in terms of the associated edge values, for connecting all nodes.

E

1 2 3 4

5 6 7 8

9 10

2

1 6 2

3

41

2

3

5

1

4

12

3

Figure D.1:

1. Figure D.1 gives the layout of all possible routes for telephone links between the main exchangeE and local substations (distances in km). All substations need to be linked to E either directlyor via another substation.

218

Page 224: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 219

Since the links are to be underground find the layout that involves the least amount of tunnelling.(That is find the minimum spanning tree for the network).

(a) Using Prim’s algorithm

(b) Using Kruskal’s algorithm

Give the value of the minimum spanning tree.

2. Using either method find the minimum spanning trees for each of the networks in Figure D.2.

(a) (b)

1

2

3

4

5

6

2

14 5

214

3

11

2

3

4 5

6

7

1

1 14

42

2

2

35

Figure D.2:

In each case try and produce two minimum spanning trees, hence verifying that the minimumvalue is unique.

D.1.2 Shortest distance problem

Given a network, to which a positive value is assigned to each edge, we considered two algorithmsthat found the shortest path through the network. In the case of Dijkstra’s algorithm the shortestpaths from a given node to all the other nodes is calculated whereas Floyd’s algorithm calculatesthe shortest path between each pair of nodes. The choice of algorithm depends on the problem athand, if indeed we do only require the shortest path from a given node then Dijkstra’s algorithmis the obvious choice. Floyd’s algorithm is longer but much shorter than applying Dijkstra’salgorithm to each node in turn. In our examples the networks were either mixed or directed,this will tend to be the case in these problems.

3. DijkstraFor each of the networks in Figure D.3 find the shortest paths and their values from the node S

to each of the other nodes. Note that (a) is a directed network whereas (b) is a mixed network.This does not affect the algorithm but you need to keep this in mind when, in the algorithm,you are looking at the nodes directly connected to the last permanent node created.

Page 225: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 220

(a) (b)

S

1

3 4

5 6

2

^

R7

-

-

^

-µ4

5

2

14

31

1

23 4

1

52

2

2

3

72

S -

^-

°

Figure D.3:

4. Most Reliable Route ProblemClassically we are given a directed network and each edge value corresponds to a probability ofsuccess in traversing the edge. The the probability of total success in traversing a path in thenetwork is the product of these probabilities. (typically these probabilities could be the probabil-ities of not being delayed). The problem is to find the paths from a given node to all the othernodes such that the probability of total success along each path is a maximum. This is achievedby considering an auxiliary network where the edge value are −logarithm of the original edgevalues. The problem is then reduced to a minimum path problem.

Given the network in Figure D.4 the numbers represent the probability of some form of suc-cess when traversing the arcs.

• Construct an auxiliary network where the edge values are −logarithm of the original values.

• Hence find the paths of maximum success in traversing the network from H to each of theother nodes. (use Dijkstra)

1 2

34

H

*-:3

º

-w ^

0.40.2

0.3

0.1

0.40.2

0.6 0.5

Figure D.4:

5. Floyd’s algorithmUsing Floyd’s algorithm find the routes and values of the minimal paths between each pair of

Page 226: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 221

nodes for the network in Figure D.5.

1

2

3

4

4

4

2

11

1

Figure D.5:

D.1.3 Maximum Flow - Minimum Cut - Ford-Fulkerson

These problems concern directed networks in which associated with each edge is a positivecapacity and a non-negative flow. In its simplest form this problem is best visualizes as oil orgas flowing down a pipe in a given direction. The problem is to discover the maximum possibleflow through a network. Ford and Fulkerson developed an algorithm to calculate the maximumflow. Alternatively the idea of a cut was introduced and the Max-Flow Min-Cut theorem tellus that the value of the maximum flow is equal to that of the minimum cut. It does not tell ushow the max flow can be achieved.

6. The numbers on the edges of the directed network in Figure D.6 represent the capacities of eachedge.

(a) The network is shown to have a single source S, redraw the network to also have a singlesink T . That is to say redraw it as a basic network

(b) In general nodes in a basic network have no restriction of flow through them. However ifnode(1) has a restricted capacity of 5 redraw your network in (a) using only unrestrictednodes and edges with capacities.

(c) In your network in (b) construct a flow of 6 units. (this may be done in several ways)

(d) For your network in (c) construct two cuts of different value. What can you say about themaximum flow in the network?

(e) Use the Ford-Fulkerson algorithm to find the maximum flow in the network, stating howthis maximum flow can be achieved.

7. For the network in Figure D.7, with source S and sink T , the arcs are labelled [flow, capacity].By inspection identify a ’flow augmenting path’. Increase the flow along this path to the pointof saturation. Continue to identify flow augmenting paths and increase to saturation until noneexist. Hence write down the maximal flow for the network.

Page 227: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 222

1

2

3

4-

-3

jS

34

7

3

2

5s4

Figure D.6:

1

2

3

4-

-

+ jS

3[1,4]

[2,4]

[1,3]

T[1,3]

[2,4]s[0.5]

~

3

[1,3]

[0,3]

Figure D.7:

8. Apply the Ford-Fulkerson algorithm to the network in Figure D.8 to find the maximal flow andshow how it is achieved.

1

2

3

4-

-

+ j

S

3

[0,5]

[0,7]

[0,9]

T[0,3]

s[0.6]

5

6

[0,5]

ª -R

-

s

>

[0,4]

[0,6]

[0,5][0,3]

[0,8]

[0.6]

Figure D.8:

D.1.4 Dynamic Programming

The methodology of Dynamic Programming requires that the problem is split into stages witheach stage having input and output. The input and output variables are called the state variablesfor the system. At each stage a decision is made using an optimal policy. Bellman’s principle

Page 228: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 223

is used to create a sequence of decisions that usually involves maximizing or minimizing anoptimization functional which is defined via a recurrence relation.

9. The network in Figure D.9 represents possible routes between towns for a journey from town S

to town T . Using the methodology of Dynamic Programming find:

(i) The shortest path from S to T

(ii) The path from S to T that minimizes the longest leg on the route. (Such a path wouldbe of interest if for some reason a person did not wish to travel in a single step more thannecessary even at the expense of a longer journey.)

First however carry out the following:

• Identify suitable stages for the dynamic programming process

• The decision sets Di at each stage.

• The state variables for each stage.

• The recurrence relation for the optimization functional for each of (i) and (ii)

S

2

1

3

4

5

6

8

7

9

10

11

T

µ

1

z

R

s-

-3

*

j

Á

q

j

*

q:

:

q

j*

34

2

4

2

2

12

4

3

6

65

5

2

6

5

3

2

4

Figure D.9:

10. PhotoShop is to develop an equipment replacement policy over the next three years for its supercolour printer. The cost of a new printer is £ 25,000 and the companies policy is to not run aprinter that is more than five years old.

As the printer ages its ability to generate revenue decreases (due mainly from it being downfor repair and the clearing of paper jams ) and the cost of the maintenance contract increases.Table D.4gives the annual revenue r(t) and maintenance cost c(t) for a machine that is t yearsold at the start of the year. Also the table gives the trade in value s(t) of a machine that is t

years old.

Page 229: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 224

Age of Machine Revenue Operating Cost Trade in Valuet years r(t) c(t) s(t)

0 15 1 −1 14 1.2 192 12 1.4 143 9 1.7 114 5 2.1 95 − − 7

Table D.1: Costs in thousands of pounds sterling.

Using the ideas of Dynamical Programming:

• Construct a network to define the problem. Identify the stages, state variables and decisions.Define a suitable optimization functional fi and hence write out the recurrence relationdefining each fi.

• Assuming the shop starts with a three year old printer, obtain the optimal policy for thisproblem over the three year period. The trade in value at the end of the period should beconsidered as a contribution to the total revenue.

11. Simple Knapsack ProblemA cargo ship can carry up to 6 tons of cargo and is to be loaded with one or more of three typesof cargo. The weights in tons and return in thousands of pounds on one item of each cargo typeis given in Table D.2.

cargo weight returntype i tons wi per item ri

1 3 302 4 503 1 15

Table D.2: Weight in tons per item for each type of cargo; profit per item of each type.

Using the knapsack problem from dynamic programming find how best to load the ship in orderto maximize return. That is to say how many items of each type should be loaded to give amaximum return; what is this return.

Page 230: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 225

D.1.5 Linear Programming

The following problems illustrate the types of problem we have covered. The two dimensionalproblems can be solved using a graph. For problems with more than two dimensions the questionmay ask you to derive the constraints and objective function and then give you the solution inthe form of an Excel report, as seen in the class problems and coursework. Finally the solutionusing the simplex method and the use of the final tableau to investigate the problem will betested, as seen in the final coursework and notes.

12. Using graphical means solve the following linear programming problem.

Maximize z = 3x1 + 2x2 subject to:

x1 + x2 ≤ 3 (i) x1 + 2x2 ≤ 4, 2x1 + x2 ≤ 4 x1, x2 ≥ 0

• Which constraints are binding

• If (i) is replaced with x1 + x2 ≤ 3 + δ with δ ≥ 0 such that the same constraints remainbinding, calculate ∆z

δ , where ∆z is the change in z due to the introduction of δ. In thetheory of linear programming what is this quantity referred to.

13. Using graphical means solve the following linear programming problem.

Maximize z = 3x1 + 2x2 subject to:

x1 + x2 ≤ 3 2x1 + x2 ≤ 4 x1, x2 ≥ 0

• Write down the dual of the problem.

• Use graphical means to solve the dual problem

14. City University pay me separately to work in each of the two departments, Mathematics andActuarial Science. For every one hour lecture I give in the Mathematics Department I am paid£5 and for every one hour lecture I give in the Department of Actuarial Science I am paid £7.Unfortunately each lecture generates extra preparatory work, those in mathematics taking anextra 1hr per lecture and those in Actuarial Science an extra 11

2hrs per lecture. In any given weekI am not prepared to give more than 15hrs lectures or spend more than 19hrs on preparation.How should I best arrange my time between the two departments in order to maximize myreturn. (Solve using a graph)

Write down the dual problem and solve graphically. Interpret the dual problem from the pointof view of City University as an employer.

15. Given

x1

(12

)+ x2

( −11

)+ x3

(21

)=

(41

)

obtain all three sets of basic solutions to the problem. Which, if any, of these sets would be afeasible basic solution for a standardized linear programming problem?

Page 231: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 226

It is not necessary to use row reduction. You can see that any pair of columns on the left handside are independent, hence in turn, set the other variable equal to zero and solve the simplesimultaneous equations in two variables

16. Use the Simplex Method to Maximize z = 2x1 + x2 + x3 subject to

x1 + x2 + x3 ≤ 4, x1 − 2x2 + x3 ≤ 3 x1, x2, x3 ≥ 0

From the optimal table:

• Write down the dual variables.

• Calculate the range of optimality for the coefficients in the objective function.

• Calculate the feasible range for the righthand sides of the two constraints.

• Write down the dual problem and hence write down its optimal solution.

• Verify your result by solving the dual problem graphically.

17. Consider the problem: Maximize z = 2x1 + x2 subject to

x1 + x2 ≤ 4, x1 + 2x2 ≥ 6 x1, x2 ≥ 0

• Introduce a slack, surplus and artificial variable to write the constraints in a form suitablefor solution by the Simplex Method.

• Introducing a large positive constant M write down a suitable objective function for use inthe Simplex Method

• Solve the problem using the Simplex Method

• Write down the dual variables.

• Calculate the range of optimality for the coefficients in the objective function.

• Calculate the feasible range for the righthand sides of the two constraints.

18. A firm makes three different types of confectionary, milk chocolate, plain chocolate and toffee.The production line consists of five departments (a) - (e). The amount of time taken to processone tonne (1000 kg) of each of the three types in each of the five departments is given inTable D.3. Additionally the total number of hours available in each department during the nextweek is given in the final column of the table. The profit on 1kg of milk chocolate is £1.25, theprofit on 1kg of plain chocolate is £1.50 and on 1kg of toffee is £0.75.

Write down the constraints in this problem for production over the next week and the objectivefunction used to maximize the profit.

The output from solving this problem using Solver is given at the end of this question, use thisdata to:

• Write down the optimum production plan and the maximum profit obtained.

• In which department is it most advantageous to increase the available time by a smallamount. What is the maximum amount by which this department could be expanded.

Page 232: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 227

Dept Milk Plain Toffee AvailableChoc Choc Time

(a) 2 1 1 35(b) 3 1 4 40(c) 1 1 1 30(d) 2 3 1 60(e) 3 1 0 20

Table D.3: Processing times in hrs for 1000kg of each type of confectionary in the five departments;Availability of time in each department in hrs for the next production period

• Explain what is meant by reduced cost an why are all these zero.

• Write down the dual problem.

• Use the output to write down the solution to the dual problem.

Page 233: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 228

Name Original Value Final Value

z 3500 31429

Adjustable Cells

Name Original Value Final Value

Milk 1.000 0.714

Plain 1.000 17.857Toffee 1.000 5.000

Constraints

Name Cell Value Formula Status Slack

(a) 24.29 $C$3<=$B$3 Not Binding 10.714

(b) 40.00 $C$4<=$B$4 Binding 0.000

( c) 23.57 $C$5<=$B$5 Not Binding 6.429

(d) 60.00 $C$6<=$B$6 Binding 0.000(e) 20.00 $C$7<=$B$7 Binding 0.000

Adjustable Cells

Final Reduced Objective Allowable Allowable

Name Value Cost Coefficient Increase Decrease

Milk 0.71 0.000 1250 3250.00 90.909

Plain 17.86 0.000 1500 200.00 1083.333Toffee 5.00 0.000 750 142.86 285.714

Constraints

Final Shadow Constraint Allowable Allowable

Name Value Price R.H. Side Increase Decrease

(a) 24.29 0.000 35 1E+30 10.714

(b) 40.00 71.429 40 36 20.000

( c) 23.57 0.000 30 1E+30 6.429

(d) 60.00 464.286 60 5 41.667(e) 20.00 35.714 20 20 1.818

Page 234: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 229

D.2 Solutions

1. The following two trees in Fig. D.10 are possible minimum spanning trees, (a) using Prim’smethod and (b) using Kruskal’s. They are not unique however the value of each and indeed anyother minimum spanning tree is unique and equal to 18.

E

1 2 3 4

5 6 7 8

9 10

2

1 2

3

1

2

31

12

2

1

E

9 10

6

7

3 4

8

5

1

2

2

1

33

1

2

1

2

(a) (b)

Figure D.10: (a) Using Prim’s algorithm. (b) Using Kruskals algorithm. Value = 18

2. For (a) there is only one minimum spanning tree as seen in Fig. D.11(i). For (b) there are twoas shown in Fig. D.11(ii)(iii). In (i) the value is 9 and in (ii) and (iii) the values are both 12.

(i)

(ii)

1

2

3

4

5

6

1

1

2

3

2

14

4 5

1

6

7

1

1 1

2 2

5

(iii)

1

2

3

4 5

6

7

1

1 12

2

5

Figure D.11:

3. In Fig. D.12 are the two final networks with their permanent labels.

• For (a) the paths are:S → 1 length = 2, S → 1 → 2 length = 7, S → 3 length = 4S → 1 → 5 length = 3, S → 3 → 4 length = 6S → 1 → 5 → 6 length = 7,

Page 235: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 230

• For (b):S → 1 length = 1, S → 1 → 4 → 2 length = 6,S → 3 length = 2, S → 1 → 4 length = 3,

(a) (b)

S

1

3 4

5 6

2

^

R7

-

-

^

-µ4

5

2

14

31

1

23 4

1

52

2

2

3

7

2S -

^-

°

[0, S]

[2, S] [7, 1]

[7, 5]

[6, 3][4, S]

[3, 1]

[0, S] [1, S]

[6, 4]

[3, 1][2, S]

Figure D.12:

4. Fig. D.13 shows the auxiliary network, that is the one with − ln(p) on each arc, and the finalpermanent labels obtained by Dijkstra’s method. The paths of max probabilities are given as:H → 1 P = 0.4, H → 2 P = 0.6, H → 1 → 3 P = 0.2, H → 4 P = 0.2.

The probabilities can either be retrieved from the value in the label, exp(−value), or by looking atthe actual route on the original network and forming the appropriate product of the probabilitieson the arcs.

12

34

H

*-:3

º

-w ^

0.916

1.609

1.204

2.303

0.9161.609

0.511

0.693

[0,H]

[0.916,H] [0.511,H]

[1.609, 1][1.609,H]

Figure D.13:

5. This network is so simple there are no changes in the D or M matrix until D4 and M4. The

Page 236: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 231

final matrices are given in Eq(E.1).

D4 =

∗ 3 2 13 ∗ 1 22 1 ∗ 11 2 1 ∗

M4 =

1 4 4 44 2 3 44 2 3 41 2 3 4

(D.1)

The routes are:

1 → 4 → 2 = 2 → 4 → 1 = 3, 1 → 4 → 3 = 3 → 4 → 1 = 2

1 → 4 = 4 → 1 = 1, 2 → 3 = 3 → 2 = 1

2 → 4 = 4 → 2 = 2, 3 → 4 = 4 → 3 = 1

6. (a) In Fig. D.14(a) an artificial sink has been introduced, the capacities on the arcs being thesum of the respective ingoing arcs to nodes 3 and 4.

(b) The restricted node has been replaced with a two free nodes 1’ and 1” and an arc withcapacity 5, the same value as the restriction in node 1.

(c) In Fig. D.14(a) a flow of 6 is shown, you may have a different flow of 6.

(d) The cuts have value 9 and 10. The Max-Flow Min-Cut theorem tells us that the max flowmust be less than or equal to 9.

1”

2

3

4-

-3

jS

*[4, 4][4, 5]

[2, 5]

[0, 2]

z[2, 4]

1’ - [4, 9]

Ts

*[0, 5]

[2, 3]

artificial sink

replacement nodesand arc capacity 5

[4, 7]

cut=9 cut=10

(a)

1”

2

3

4-

-3

jS

*[4, 4][5, 5]

[1, 5]

[1, 2](b)

z[4, 4]

1’ - [8, 9]

Ts

*[4, 5]

[0, 3]

[5, 7]

Figure D.14:

(e) Fig. D.14(b) shows the final network in the Ford-Fulkerson method. The max flow is 9 andis achieved as indicated.

Page 237: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 232

7. The following paths are flow augmenting paths and can be increased by the amount shown.The final network is in Fig. D.15 where a cut has been inserted in order to verify that the flowobtained was indeed a max.

S → 1 → 3 → T , increase by 2

S → 2 → 4 → T , increase by 2

S → 2 → 3 → T , increase forward arcs by 1 and reduce backward arcs by 1

Flow is now 7, which as the given cut shows is in fact the maximum flow for the network.

1

2

3

4-

-

+ j

S

3

[3,4]

[4,4]

[3,3]

T[1,3]

[4,4]s[3.5]

~

3

[0,3]

[3,3]

cut=7

Figure D.15:

8. The final flow is shown in Fig. D.16. You will find that the algorithm will come to an end becauseit cannot find a path from S to T that is flow augmenting.

1

2

3

4-

-

+ j

S

3

[4,5]

[4,7]

[6,9]

T[0,3]

s[6.6]

5

6

[0,5]

ª -R

-

s

>

[4,4]

[6,6]

[0,5][0,3]

[4,8]

[6.6]

cut = 10

Figure D.16:

I have added a cut to the diagram just to show that the flow of 10, which is found by the F-Falgorithm is indeed a max flow. ********************************************************9-18

Page 238: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 233

9. Define the following sets:

S6 = {T}, S5 = {10, 11}, S4 = {7, 8, 9}, S3 = {5, 6}, S2 = {1, 2, 3, 4}, S1 = {S}Stage i is defined to have input Si and output Si+1 i = 1 . . . 5.

The decisions at each stage are ’which arc is chosen’ thus the decision sets are:

D5 = {(10, T ), (11, T )}, D4 = {(7, 10), (8, 10), (8, 11), (9, 11)}, D3 = {(5, 8), (6, 7), (6, 8), (6, 9)}D2 = {(1, 5), (2, 5), (2, 6), (3, 5), (3, 6), (4, 6)}, D1 = {(S, 1), (S, 2), (S, 3), (S, 4)}

The state variables at stage i are the elements of the set Si, that is to say the input nodes ateach stage.

Optimization functional:

(i) fi(xi) is the value of the shortest path from stage i with input xi to T . This is defined by:

fi(xi) = minarcs(xi,xi+1)

{fi+1(xi+1) + dist(xi, xi+1)} f6(x6) = 0

(ii) fi(xi) is the value of longest arc on the path from stage i with input xi to T that has thesmallest longest link. This is defined by:

fi(xi) = minarcs(xi,xi+1)

{max[fi+1(xi+1), dist(xi, xi+1)]} f6(x6) = 0

S

2

1

3

4

5

6

8

7

9

10

11

T

µ

1

z

R

s-

-3

*

j

Á

q

j

*

q:

:q

j*

34

2

4

2

2

1

2

4

3

6

6

5

5

2

6

5

3

2

4

(5,T)

[6,T]

[8,10]

[7,10]

[8,11]

[13,8]

[12,8]

[17,5]

[13,6]

[15,5]

[15,6]

[15,2]

[5,T]

(6,T)

(6,11)

(5,10)

(5,10)

(6,8)

(5,7)(5,6)

(5,6)

(6,5)

(5,6)

(5,4)

Figure D.17:

For (i) I have used the notation [fi(xi), xi+1] with square brackets and for (ii) the notation(fi(xi), xi+1) with round brackets. With this type of problem, that it to say a small network,you can put the labels straight on the diagram, as seen in Fig. D.17, starting at nodes 11 and10 and working back to S.

Whenever there is a tie for a choice of arc then randomly select one. Thus the two solutions are:

Page 239: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 234

(i) S → 2 → 6 → 8 → 10 → T is the shortest path and is equal to 15.

(ii) S → 4 → 6 → 7 → 10 → T is a path that minimizes the longest link; which is 5. Had wemade any other choices that satisfied the optimality criteria then a different path may havebeen obtained but the value 5 would have been the same.

10. Let each stage represent a year in the three year period.

Let xi be the age of the machine at the start of the ith stage (ie the ith year)

The only decision is to Keep or Replace, except at the end when a trade in value is considered.

Let fi(xi) be the net return, including the final trade in value, from state xi to the final tradein.

The following network represents this problem.

3

1

4

1

2

5

1

2

3

µ-

j

s -

z

R

R

Á*µ

R

R

R

R

R

R

State Variables. x1 x2 x3 x4Age of machine

K

K

K

KK

stage 1 stage 2

at start of stage i.

stage 3year 1 year 2 year 3

[19,T]

T

~-3

trade in

[14,T]

[11,T][15, R]

[22, R]

[27, R][35, R]

[35, R]

[25, R]

Figure D.18: The decisions are Replace, Keep. The states are shown inside the nodes; Optimal pathshown in bold.

The optimization functional is given by:

fi(xi) = Max{

fi+1(1) + r(0)− c(0) + s(xi)− 25 Replacefi+1(xi + 1) + r(xi)− c(xi) Keep

}i = 1 . . . 3, f4(x4) = s(x4)

Initially label the nodes x4 as [s(x4),T]

Stage 3

f3(1) = Max{19+15−1+19−25 = 27, Replace; 14+14−1.2 = 26.8, Keep} label = [27,R]

f3(2) = Max{19+15−1+14−25 = 22, Replace; 11+12−1.4 = 21.6, Keep} label = [22,R]

f3(5) = {19 + 15− 1 + 7− 25 = 15} label = [15,R]

Page 240: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 235

Stage 2

f2(1) = Max{27+15−1+19−25 = 35, Replace; 22+14−1.2 = 34.8, Keep} label = [35,R]

f2(4) = Max{27+15−1+9−25 = 25, Replace; 15+5−2.1 = 17.9, Keep} label = [25,R]

Stage 1

f1(3) = Max{35+15−1+11−25 = 35, Replace; 25+9−1.7 = 32.3, Keep} label = [35,R]

Thus the best strategy is to replace the machine every year, this give a net return over the threeyear period, including the final trade in , of £35,000.

11. Define the stage to be the process of allocating the amount of type i cargo to the ship. Letthe state variable xi be the number of tonnes available just before allocating type i cargo. Thedecision variable, di is the number of units allocated consistent with the optimization criteria.The functional fi(xi) is the largest overall possible return from stages i to completion, for inputxi at stage i.

The network in Fig. D.19 represents the allocation of the loads bearing in mind the weight ofeach type of load and the overall maximum load that can be carried.

6

6

3

0

6

2

3

0

0

µ

1

z

--

~-

3-j

R

stage 1

load type 1

stage 2 stage 3

load type 2 load type 3

State Variables. x1 x2 x3 x4Available space

0

1

2

0

1

0

0

6

2

3

0

at start of stage i.

[90,0]

[30,0]

[45,0]

[0,0]

[0,0]

[90,6]

[0,0]

[45,3]

[90,6]

Figure D.19: The decisions di are shown on each arc of the network.

Label the final node [0,0] and then label backwards with [fi(xi), xi+1] i = 3 . . . 1.

At stage 3:

At this stage there is only one possible label for each x3

x3 = 6 : load with 6 units of type 3 to give return 90 label = [90,0]

x3 = 2 : load with 2 units of type 3 to give return 30 label = [30,0]

x3 = 3 : load with 3 units of type 3 to give return 45 label = [45,0]

Page 241: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 236

x3 = 0 : load with 0 units of type 3 to give zero return label = [0,0]

At stage 2:

x2 = 6, f2(6) = Max{d2 = 0, 90 + 0 = 90 : d2 = 1, 30 + 50 = 80} = 90 label = [90,6]

x2 = 3, f2(6) = Max{d2 = 0, 45 + 0 = 90} = 45 label = [45,3]

x2 = 0, f2(6) = Max{d2 = 0, 0 + 0 = 0} = 0 label = [0,0]

At stage 1:

x1 = 6, f1(6) = Max{d1 = 0, 90 + 0 = 90 : d1 = 1, 45 + 30 = 75 : d1 = 2, 0 + 60 = 60} = 90label = [90,6]

Thus from the last label the max return is 90 and the loading should be, zero tonnes of type 2,zero tonnes of type 2 and 6 tonnes of type 3. The path in the network is indicated in bold.

Finally, though not specifically asked for, the optimization functional fi is given by the recurrencerelation:

fi(xi) = max(xi,xi+1)

{fi+1(xi+1) + di × ri} i = 1 . . . 3 f4(x4) = 0

12. In Fig. D.20 the feasible region is OAPB. The maximal value of z is at one of the vertices ofthis polygon. The coordinates of P are given by:

2x1 + x2 = 4, x1 + 2x2 = 4 ⇒ x1 = x2 =43

and the coordinates of A and B are (0, 2) and (2, 0) respectively. By direct evaluation or bydrawing a test line for the objective function with some value of z, shown as z = 3 in Fig. D.20,the maximum value of z is at P . Thus the maximum value of z = 3× 4

3 + 2× 43 = 20

3 and isattained at x1 = x2 = 4

3 .

• The second and third constraints are binding. (used to find P above)

• If x1 and x2 are in the feasible region then x1 + x2 ≤ 3, thus for δ ≥ 0, x1 + x2 ≤ 3 + δ.Thus P is still the maximal point and hence ∆z = 0. The ratio ∆z

δ = 0 is the dual orshadow price corresponding to constraint (i). This is always zero if the constraint is notbinding.

Page 242: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 237

4

4

3

3

2

2

x1

x2

O

A

P

B

....................................

x1 + x2 = 32x1 + x2 = 4

x1 + 2x2 = 4

z = 3 = 3x1 + 2x2

Figure D.20: P has coordinates (43 , 4

3).

13. From Fig. D.21(a) the maximum value of z is at P . The coordinates of P and correspondingvalue of z are given by:

x1 + x2 = 3, 2x1 + x2 = 4 ⇒ x1 = 1, x2 = 2 ⇒ z = 7

The dual problem is:

Minimize z = 3y1 + 4y2 subject to y1 + 2y2 ≥ 3, y1 + y2 ≥ 2

Note: You must be able to obtain the dual problem from the primal

From Fig. D.21(b) the minimum value of z is at P . The coordinates of P and correspondingvalue of z are given by:

y1 + 2y2 = 3, y1 + y2 = 2 ⇒ y1 = 1, y2 = 1 ⇒ z = 7

The optimum value in the dual and primal problems are the same.

Page 243: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 238

3

3

4

P

A

2

x1 + x2 = 3

x1

x2

O

............................................

z = 4 = 3x1 + 2x2

B

2x1 + x2 = 4

(a)

y1

y2

y1 + y2 = 2

y1 + 2y2 = 3

B

P

A

3

32

2

2

(b)

......................................................................................................z = 10 = 3y1 + 4y2

Figure D.21: Feasible region shown hashed in each case. (a) P has coordinates (43 , 4

3). Dotted testobjective line with z = 3 (b) P has coordinates (1, 1). Dotted test objective line with z = 10

14.With x1 equal to the number of lectures given for the Maths Dept and x2 the number for the

15

15

A

P

B

x1 + x2 = 15

x1

x2

O

x1 + 1.5x2 = 19

19

12 23

(a)

5

5

A

P

B

y1 + y2 = 5

y1

y2

O

y1 + 1.5y2 = 7

19

4 23

(b)

Figure D.22: Feasible region shown hashed in each case. (a) P has coordinates (43 , 4

3). Dotted testobjective line with z = 3 (b) P has coordinates (1, 1). Dotted test objective line with z = 10

Act Sci Dept the primal problem is:

Maximize z = 5x1 + 7x2 subject to x1 + x2 ≤ 15, x1 + 1.5x2 ≤ 19 x1, x2,≥ 0

In Fig. D.22(a) the maximum value of z is at P (check by evaluating z at A,P and B or bydrawing a test line). Thus the solution is:

x1 + x2 = 15, x1 + 1.5x2 = 19 ⇒ x1 = 7, x2 = 8 ⇒ z = 5× 7 + 7× 8= 91

Page 244: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 239

Thus in any one week I should lecture 7hours for Maths and 8hours for Act Sci in order to giveme a return of £91.

The dual problem is given by;

Minimize z = 15y1 + 19y2 such that y1 + y2 ≥ 5, y1 + 1.5y2 ≥ 7 y1, y2 ≥ 0

In Fig. D.22(b) the minimum value of z is at P (check by evaluating z at A,P and B or bydrawing a test line). Thus the solution is:

y1 + y2 = 5, y1 + 1.5y2 = 7 ⇒ y1 = 1, y2 = 4 ⇒ z = 15× 1 + 19× 4= 91

Thus we see that the optimal values are the same for both the primal and dual problems.

The interpretation of the dual is important. From the point of view of the employer theywish to cost out the lecturer’s job by paying so much an hour for an actual lecture (denote asy1) and so much for preparation (denote as y2), irrespective of in which department the workis undertaken. That is to say they wish to have a single policy for the whole institution. Sincethe lecturer has agreed to work in a given week a total of 15hrs actual lecture contact and 19hrspreparation the cost to the institution in a given week is z = 15y1 + 19y2; the new objectivefunction for the dual problem, an amount the institution would like to minimize. In order to atleast maintain the levels of payment to the lecturer the rates must be such that the payment forthe work carried out in the Math Dept to deliver 1 lecture must be at least £5. Thus y1 +y2 ≥ 5.Similarly a single lecture in Act Sci department must generate at least £7, thus y1 + 1.5y2 ≥ 7.These are the two dual constraints.

The solution is a little unrealistic in the sense that the rate for giving the lecture is only £1 /hrand for preparation it is £4/hr.

15. Set x1 = 0, this will yield a basic solution since the other two columns, namely( −1

1

)and

(21

)are independent.

Thus solve:

x2

( −11

)+x3

(21

)=

(41

)⇒ x3 = 5/3, x2 = −2/3, x1 = 0 not feasible since not all ≥ 0

Similarly x2 = 0 gives:

x1

(12

)+x3

(21

)=

(41

)⇒ x3 = 7/3, x1 = −2/3, x2 = 0 not feasible since not all ≥ 0

and x3 = 0 gives:

x1

(12

)+x2

( −11

)=

(41

)⇒ x2 = −7/3, x1 = 5/3, x3 = 0 not feasible since not all ≥ 0

Page 245: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 240

16. Introduce non-negative slack variables s1 and s2 to write the constraints in the form:

x1 + x2 + x3 + s1 = 4 x1 − 2x2 + x3 + s2 = 3 x1, x2, x3 ≥ 0

The final tableau is given in Table D.4.

From the table the optimum solution is x1 = 323 , x2 = 1

3 , x3 = 0 and the maximum value of

Basic x1 x2 x3 s1 s2 dVariables CB 2 1 1 0 0

x2 1 0 1 0 13 −1

313

x1 2 1 0 1 23

13 32

3

2 1 2 [53 ] [1

3 ] z =

0 0 −1 −53 −1

3 723

Table D.4:

z = 723 .

The dual variables are shown in Table D.4 in the penultimate row of the table highlightedin square brackets. They are the entries corresponding to the slack, and if present artificial,variables; dual variables = 5

3 , 13 .

Each of the coefficients in the objective function has a range of optimality, even if the vari-able is zero. Range of optimality for x1 is [1,∞), for x2 it is [−4, 2] and for x3 it is (−∞, 2].

The feasible ranges for the righthand sides (b1 and b2) of the first two constraints are:

∆b1 ≥ −1 thus b1 ∈ [3,∞) and − 11 ≤ ∆b2 ≤ 1 thus b2 ∈ [−8, 4]

The dual problem is given by:

Minimize z = 4y1 + 3y2 subject to y1 + y2 ≥ 2, y1 − 2y2 ≥ 1, y1 + y2 ≥ 1 y1, y2, ≥ 0

The solution to this is as above, that is to say y1 = 53 and y2 = 1

3 and the minimum value of z

is 723 . In Fig. D.23 the optimal point can be shown to be at P by either calculating z at A and

P and selecting the one that gives the smaller value of z or plot a test z line and see that as itmoves parallel to itself it will first/last cut the feasible region at P.

17. Introducing non-negative, slack variable s1, surplus variable s2 and artificial variable a1 theinequalities become:

x1 + 2x2 − s1 + a1 = 6 (i) x1 + x2 + s2 = 4 (ii)

Page 246: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 241

2

A

2y1 + y2 = 1

P

1

y1 + y2 = 2

y1

y2

O 1

y1 − 2y2 = 1

...............................................................................z = 6 = 4y1 + 3y2

Figure D.23: Feasible region shown hashed. Optimal point at P which has coordinates (53 , 1

3) givingz = 71

3 . Dotted test objective line shown with z = 6

I have reordered the equations so that the slack and artificial variables appear last and thus thebody of the first Simplex tableau will be of the form (D I).

The objective function is z = 2x1 + x2 + 0s1 + 0s2 −Ma1, the −M ensures that the artificialvariable is forced to zero when maximizing.

The optimal tableau is:

Basic x1 x2 s1 a1 s2 dVariables CB 2 1 0 −M 0

x2 1 0 1 -1 1 −1 2

x1 2 1 0 1 −1 2 2

2 1 1 [−1] [3] z =

0 0 −1 −M + 1 −3 6

Table D.5:

The optimal solution is that the minimum value of z is 6 with x1 = x2 = 2.

The dual variables are given in the penultimate row in the columns corresponding to theartificial and slack variables, not to the surplus variable. Corresponding to equation (i) thedual variable is −1 and to equation (ii) it is +3.

Range of optimality for the x1 coefficient is [0.5,∞) and for x2 it is (−∞, 2].

The feasible range for the righthand side of (i) is [4, 8] and for (ii) it is [3, 6].

Page 247: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX D. SPECIMEN EXAM TYPE QUESTIONS AND SOLUTIONS 242

18. The five inequalities and objective function, with the xi non-negative, are:

2x1 + x2 + x3 ≤ 35, 3x1 + x2 + 4x3 ≤ 40 x1 + x2 + x3 ≤ 30

2x1 + 3x2 + x3 ≤ 60, 3x1 + x2 ≤ 20 and z = 1250x1 + 1500x2 + 750x3

From the given data the optimum production is: Max z = £31, 429 attained by producing 0.714tonnes of Milk Chocolate, 17.857 tonnes of Plain chocolate and 5 tonnes of Toffee.

Shadow (dual) price is max for constraint (d) thus a small increase in this resource will yieldthe most profit. The maximum increase in this department consistent with this basic solutionis 5units to 65.

If xi = 0 in the optimal solution then the reduced cost corresponding to xi is the amount thecoefficient of xi in the objective function needs to be changed so that there exists an optimalsolution with xi 6= 0. In this problem all variables are non-zero thus no increase is needed, hencethe reduced costs are all zero.

The dual problem, with the yi non-negative, is to minimize:

z = 35y1 + 40y2 + 30y3 + 60y4 + 20y5

subject to:

2y1 + 3y2 + y3 + 2y4 + 3y5 ≥ 1250, y1 + y2 + y3 + 3y4 + y5 ≥ 1500, y1 + 4y2 + y3 + y4 ≥ 750

The shadow variables (prices) are the solutions to the dual problem, thus:

y1 = 0, y2 = 71.43, y3 = 0, y4 = 464.29, y5 = 35.71

The minimum value of z is of course the same as before, namely z = 31, 429

Page 248: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Appendix E

Specimen Courseworks

E.1 Coursework 1 - 2007

You should carefully define your variables and explain how you obtain relationships between them basedon the information given. Although you will need to use Excel to carry out the linear programmingI do not expect you to submit any of the work sheet, though you should submit a copy of any of thereports you use.

1. An investment advisor at Cash Services (CS) wants to develop a model that can be used toallocate investment funds among four alternatives: shares, bonds, mutual funds and cash. Forthe coming investment period, the company developed estimates of the annual rate of returnand the associated risk for each alternative. Risk is measured using an index between 0 and1, with higher risk values denoting more volatility and thus more uncertainty. Because cash isheld in a money market fund, the annual return is lower, but it carries essentially no risk. Theobjective is to determine the portion of funds allocated to each investment alternative in orderto maximize the total annual return for the portfolio subject to the risk level that the client iswilling to tolerate.

Investment Annual Rate Riskof Return (%)

Shares 12 0.75Bonds 3 0.1

Mutual funds 5 0.25Cash 2 0.0

Table E.1: Annual returns and risk factor per investment

Total risk is the sum of risk for all investment alternatives. For instance, if 40% of a client’sfunds are invested in shares, 30% in bonds, 20% in mutual funds and 10% in cash, the total riskfor the portfolio would be 0.40(0.75) + 0.30(0.1) + 0.20(0.25) + 0.1(0.0) = 0.38.

The investment advisor will meet with each client to discuss the client’s investment objectivesand to determine a maximum total risk value for the client. A maximum total risk value of lessthan 0.3 would be assigned to a moderate tolerance to risk; and a maximum total risk valuegreater than 0.5 to a more aggressive investor.

243

Page 249: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 244

CS specifies additional guidelines that must be applied to all clients. Namely:

• No more than 65% of the total investment may be in shares

• The amount invested in mutual funds must be at least as much as invested in bonds.

• The amount of cash must be at least 15%, but no more than 40% of the total investmentfunds.

(a) Suppose the maximum risk value for a particular client is 0.3. What is the optimal allocationof investment funds among shares, bonds, mutual funds and cash? What is the annual rateof return and the total risk for the optimal portfolio?

(b) Suppose the maximum risk value of a more conservative client is 0.15. What is the optimalallocation of investment funds for this client? What is the annual rate of return and thetotal risk for the optimal portfolio.

(c) Another more aggressive client has a maximum risk value of 0.8. What is the optimalallocation of investment funds for this client? What is the annual rate of return and thetotal risk for the optimal portfolio.

(d) Refer to the solution for the more aggressive client in part (c). Would this client beinterested in having the investment advisor increase the maximum percentage allowed inshares or decrease the requirement that the amount of cash must be at least 15% of thefunds invested?

2. Soft Things is a company making objects out of polystyrene. Next weeks schedule calls for theproduction of 80,000 small sandwich containers, 80,000 large sandwich containers and 65,000meal containers. With the exception of the meal container, all these products can be processedon any one of three machines available. However the amount of waste produced varies fromitem to item and machine to machine. The amounts of waste are given in the following table;measured in milligrams per item.

Machine Small LargeType Sandwich Sandwich MealM1 20 15 −M2 24 28 18M3 32 35 36

Table E.2: The amount of waste per item measured in milligrams

The time for each type of machine to produce each item also varies with machine and item; thefollowing table gives the number of items produced on each machine per minute:

The availability of each machine in the following week is 35 hours for machine M1, 35 hours formachine M2 and 40 hours for machine M3.

(a) Costs reprocessing the waste have risen, thus Soft Things would like to minimize the totalamount of waste produce. Formulate the linear programming model to determine the bestproduction schedule.

Page 250: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 245

Machine Small LargeType Sandwich Sandwich MealM1 30 25 −M2 45 40 30M3 60 52 44

Table E.3: Production rates measured in items per minute

(b) Solve the linear programming problem formulated in part (a). How much waste is produced?Which machines, if any, have idle production capacity? If you could increase the availabletime of production of any machine which would it be?

E.2 Solution to CW1

1. Define the decision variables to be the proportions of each product in the portfolio as:

x1 proportion of shares:⇒ x1 ≤ 0.65 (E.1)

x2 proportion of bonds; x3 proportion of mutual funds:

⇒ x3 ≥ x2 ⇒ x2 − x3 ≤ 0 (E.2)

x4 proportion of cash:

⇒ 0.15 ≤ x4 ≤ 0.4

0.15 ≤ x4 (E.3)

x4 ≤ 0.4 (E.4)

The total risk constraint is given by:

0.75x1 + 0.1x2 + 0.25x3 ≤ 0.3 (E.5)

and the fact that the variables are proportion and thus must sum to one:

x1 + x2 + x3 + x3 = 1 (E.6)

The objective function, which is the return on the investment is given by;

z = 0.12x1 + 0.03x2 + 0.05x3 + 0.02x4

[7 marks ]

(a) Running Solver for the above problem to maximize z gives, with rounding:Allocation of Funds: Shares 34% Bonds 13% Mutual 13% Cash 40%Return: 5.9% and Total risk: 0.3 [3marks ]

Page 251: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 246

(b) Changing the risk constraint in Eq(E.5) from 0.3 to 0.15 gives:Allocation of Funds: Shares 8% Bonds 26% Mutual 26% Cash 40%Return: 3.8% and Total risk: 0.15 [3 marks ]

(c) Again changing the Risk in Eq(E.5), now from 0.3 to 0.8 gives:Allocation of Funds: Shares 65% Bonds 0% Mutual 20% Cash 15%Return: 9.1% and Total risk: 0.5375 [3 marks ]

(d) For the data in (c) Fig. E.1 shows the spreadsheet and the Sensitivity and Answer Reportfrom Excel.With reference to the constraints section note that the shadow price for constraint (1),which corresponds to shares, is 0.07 and the shadow price for constraint (3), correspondingto the lower limit on cash, is -0.03.Thus an increase in the level of allowed shares purchased gives an increase of 0.07 in thereturn. In terms of the units an increase of 0.1 in the allowed proportion of shares is anincrease of 10% points which corresponds to an increase in the return of 0.7% points.Since the amount of cash is decreased then an increase of 0.03 is reflected in the return.Again in the units of the question if the lower limit is reduced by 0.1, that is to say 10%points, then the return is increased by 0.3% points.Thus the client may well be more interested in increasing the maximum percentage of sharesin the portfolio rather than decreasing the lower restriction on the amount of cash. [5marks ]

[4 marks ]

[Total 25 marks ]

Page 252: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 247

Constraints of the form Ax<=>b Objective function z=cTx

Objective z c1 c2 c3 c4 c5 c6

Function 0.091 0.12 0.03 0.05 0.02

x1 x2 x3 x4 x5 x6

0.65 0 0.2 0.15

row Value of

i (Ax)i a1 a2 a3 a4 a5 a6

Shares0.65 0.65 1 0 0 0

Bonds/MF-0.2 0 0 1 -1 0

Cash0.15 0.15 0 0 0 1

Cash0.15 0.4 0 0 0 1

Risk0.5375 0.8 0.75 0.1 0.25 0

Prop=11 1 1 1 1 1

Adjustable Cells

Final Reduced Objective Allowable Allowable

Cell Name Value Cost Coefficient Increase Decrease

$D$9 x1 0.65 0 0.12 1E+30 0.07

$E$9 x2 0 -0.02 0.03 0.02 1E+30

$F$9 x3 0.2 0 0.05 0.07 0.02$G$9 x4 0.15 0 0.02 0.03 1E+30

Constraints

Final Shadow Constraint Allowable Allowable

Cell Name Value Price R.H. Side Increase Decrease

$B$14 Shares 0.65 0.07 0.65 0.2 0.65

$B$16 Bonds/MF -0.2 0 0 1E+30 0.2

$B$18 Cash 0.15 -0.03 0.15 0.2 0.15

$B$20 Cash 0.15 0 0.4 1E+30 0.25

$B$22 Risk 0.5375 0 0.8 1E+30 0.2625$B$24 Prop=1 1 0.05 1 1.05 0.2

6

2

3

4

5

columns of Abi

Variables

1

Figure E.1: Output form Solver for Question 1 with Risk set equal to 0.8

2. This problem needs a variable for the production of each type of box on each machine. In totalthis is eight variables, since the large meal box can not be produced on machine M1.

The machines are already labelled 1 to 3, thus labelling the boxes, 1 - small, 2 - large and 3 -meal, introduce the variables xi,j for the number of type i boxes produced on machine j. Thatis to say the labelling is xbox,machine.

The requirement that 80,000 small boxes, 80,000 large boxes and 65,000 meal boxes are to beproduce gives the following equations:

x1,1 + x1,2 + x1,3 = 80000 (E.7)

x2,1 + x2,2 + x2,3 = 80000 (E.8)

x3,2 + x3,3 = 65000 (E.9)

(E.10)

Page 253: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 248

From the time limitations of 2100 mins on machine 1, 2100 mins on machine 2 and 2400 minson machine 3 and using the production data gives:

x1,1

30+

x2,1

25≤ 2100 (E.11)

x1,2

45+

x2,2

40+

x3,2

30≤ 2100 (E.12)

x1,3

60+

x2,3

52+

x3,3

44≤ 2400 (E.13)

Using the waste details gives the objective function z, which is to be minimized, is given as:

z = 20x1,1 + 24x1,2 + 32x1,3

+15x2,1 + 28x2,2 + 35x2,3

+18x3,2 + 36x3,3

(E.14)

[7 marks ]

Fig. E.2 shows the spreadsheet and the reports. The results are:

80,000 small boxes on machine 352,500 large boxes on machine 1, and 27,500 large boxes on machine 363,000 meal boxes on machine 2 and 2000 meal boxes on machine 3.

The total waste is 5,516,000mg ≈ 5.5kg

[6 marks ]

From the output the constraints on Machine 3 is not binding. [1 mark ]

Looking at the shadow prices for M1 and M2, if the available time on M2 is increased by 1 theamount of waste is decreased by 540, which is more than the 500 for a similar increase in theavailable time on M1.

Hence make more time available on M2. [3 marks ]

Page 254: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 249

constraints Availability Use X11 X12 X13 X21 X22 X23 X32 X33

M1 2100 2100 0.0333333 0 0 0.04 0 0 0 0

M2 2100 2100 0 0.0222222 0 0 0.03 0 0.03 0

M3 2400 1907.634033 0 0 0.0166667 0 0 0.02 0 0.02

Demand 1 80000 80000 1 1 1 0 0 0 0 0

Demand 1 80000 80000 0 0 0 1 1 1 0 0

Demand 3 65000 65000 0 0 0 0 0 0 1 1

x11 x12 x13 x21 x22 x23 x32 x33

0.000 0.000 80000.000 52500.000 0 27500 63000 2000

z c1 c2 c3 c4 c5 c6 c8 c9

5516000 20 24 32 15 28 35 18 36

Final Reduced Obj Max Max

Cell Name Value Cost Coft Increase Decrease

$A$12 x11 0.000 4.667 20 1E+30 4.666667

$B$12 x12 0.000 4.000 24 1E+30 4

$C$12 x13 80000.000 0.000 32 4 1E+30

$D$12 x21 52500.000 0.000 15 5.6 1E+30

$E$12 x22 0 6.5 28 1E+30 6.5

$F$12 x23 27500 0 35 6.5 5.6

$G$12 x32 63000 0 18 6 1E+30$H$12 x33 2000.000005 0 36 1E+30 6

Final Shadow Max Max

Cell Name Value Price R.H. S Increase Decrease

$C$3 M1 Use 2100 -500 2100 1100 1024.121

$C$4 M2 Use 2100 -540 2100 66.666667 722.1368

$C$5 M3 Use 1907.634033 0 2400 1E+30 492.366

$C$6 Demand 1 80000 32 80000 29541.958 80000

$C$7 Demand 1 80000 35 80000 25603.03 27500$C$8 Demand 3 65000 36 65000 21664.103 2000

Cell Name Orig Value Fin Value

$A$16 z 6862363.636 5516000

Cell Name Orig Value Fin Value

$A$12 x11 20136.364 0.000

$B$12 x12 4500.000 0.000

$C$12 x13 55363.636 80000.000

$D$12 x21 0.000 52500.000

$E$12 x22 80000 0

$F$12 x23 0 27500

$G$12 x32 0 63000$H$12 x33 65000 2000

Cell Name Cell Value Formula Status Slack

$C$3 M1 Use 2100 $C$3<=$B$3 Binding 0

$C$4 M2 Use 2100 $C$4<=$B$4 Binding 0

$C$5 M3 Use 1907.634033 $C$5<=$B$5Not Binding 492.36597

$C$6 Demand 1 80000 $C$6=$B$6 Not Binding 0

$C$7 Demand 1 80000 $C$7=$B$7 Not Binding 4.657E-06$C$8 Demand 3 65000 $C$8=$B$8 Not Binding 0

Objective Function

Variables

Figure E.2: Output form Solver for Question 2

[3 marks ]

[Total 20 marks ]

Page 255: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 250

E.3 Coursework 2 - 2007

1. Obtain all feasible basic solutions for the equations

−x1 + x2 + x3 + x4 = 1

x1 − x2 + x3 + x4 = 1

x1 + x2 − x3 + x4 = 1

The following two questions must be done using the Simplex Tableau method with the relevanttableaus at each stage being submitted.

2. Using the Simplex Method maximize z = 3x1 + x2 + 2x3 subject to

x1 + x2 + 2x3 ≤ 4 (i) 2x1 + x2 − x3 ≤ 2 (ii)

From your final tableau:

(a) Find the dual prices of (i) and (ii)

(b) Find the feasible range for the righthand sides of (i).

(c) Find the optimal ranges for the coefficient of x1 in z.

3. Using the Simplex Method find the maximum value of z = x1 + 3x2 subject to

x1 + x2 ≥ 3 (i) x1 + 2x2 ≤ 4 (ii)

As in question 2 find the dual prices, feasible range for constraint (i) and range of optimality forthe x1 objective function coefficient.

E.4 Solution to CW2

1. To form a basic solution select in turn 3 independent columns and solve with the fourth variableequal to zero. In this example it is possible to do this in exactly 4 ways. The number of waysmay be less than this if one selection of columns is not independent - this can happen, but nothere.

Select the first three columns and row reduce to make the first three columns become the identity.(If this had turned out not to be possible then the three columns would not have been independentand thus would not have yielded a basic solution. Remedy - try a different combination of threecolumns.)

−1 1 1 1 1

1 −1 1 1 11 1 −1 1 1

1 0 0 1 10 1 0 1 10 0 1 1 1

⇒ x4 = 0, and x1 = x2 = x3 = 1

Page 256: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 251

Next select columns 2,3 and 4. Thus continue to row reduce to make col4 into the old column 1to give:

1 0 0 1 1

−1 1 0 0 0−1 0 1 0 0

⇒ x1 = 0, and x2 = x3 = 0, x4 = 1

Next select columns 1,2 and 4. Continue to row reduce to make col1 into the old column 3 togive:

0 0 1 1 10 1 −1 0 01 0 −1 0 0

⇒ x3 = 0, and x1 = x2 = 0, x4 = 1

Finally select columns 1,3 and 4. Continue to row reduce to make col 3 into the old column 2to give:

0 1 0 1 10 −1 1 0 01 −1 0 0 0

⇒ x2 = 0, and x1 = x3 = 0, x4 = 1

In each case the solution underlined is the variable that is set equal to zero, the non-basicvariable.

With regard to Linear Programming all solutions are feasible since greater or equal to zero,however with the exception of the first they are all degenerate since in each case at least one ofthe basic variables is zero.

2. Write asx1 + x2 + 2x3 + s1 = 4 2x1 + x2 − x3 + s2 = 2

with slack variables s1, s2 ≥ 0.

The objective function is now z = 3x1 + x2 + 2x3 + 0s1 + 0s2

To form the simplex tableau always order your variables with the slack and artificial variablelast. This then gives the standard form (D I) in the body of the table. Since this is a maxi-

x1 x2 x3 s1 s2 d da

Basic Var cj 3 1 2 0 0s1 0 1 1 2 1 0 4 4s2 0 2 1 -1 0 1 2 1zj 0 0 0 0 0 z =∆z 3 1 2 0 0 0

Table E.4:

mization problem keep row reducing etc until the final row is non-positive. In the final row 3 isthe largest value so bring in x1 into the basic set. Form the ratio of the d column with column1 and place in the last column. Since 1 is the smallest non-negative value in the final columntake s2 out of the basic set.

Page 257: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 252

x1 x2 x3 s1 s2 d da

Basic Var cj 3 1 2 0 0

s1 0 0 12

52 1 −1

2 3 65

x1 3 1 12 −1

2 0 12 1 −2

zj 3 32 −3

2 0 32 z =

∆z 0 −12

72 0 −3

2 3

Table E.5:

x1 x2 x3 s1 s2 d da

Basic Var cj 3 1 2 0 0

x3 2 0 15 1 2

5 −15

65

x1 3 1 35 0 1

525

85

zj 3 115 2 7

545 z =

∆z 0 −65 0 −7

5 −45 71

5

Table E.6:

Since the final row in Table E.6 is all non-positive the optimum is reached.At the optimum: x1 = 8

5 , x2 = 0, x3 = 65

Maximum value of objective function z = 715

Dual prices 75 for the first constraint and 4

5 for the second.

For a change of δ in the righthand side of (i) the feasible range is obtained by solving:(

6585

)+ δ

(2515

)≥ ⇒ δ ≥ −3

Thus the feasible range for the rhs of (i) is [1,∞).

To find the range of optimality of the cj coefficient in the objective function replace in turnin the optimal table their numerical values with α. Recalculate the final table with α and findthe range of values of α that ensure the final row remains non-positive.

For the x1 coefficient the final row becomes:

∆z 0 −3α5 + 3

5 0 −α5 − 4

5 −2α5 + 2

5125 + 8α

5

Thus to remain optimal entries ≤ 0 thus:

1 ≤ α, −4 ≤ α, α ≥ 1 ⇒ 1 ≤ α

3. Since the constraints are not all ’less than’ it is necessary to introduce surplus variables as wellas slack variables into the problem. This enables the constraints to be written as equations.

Page 258: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 253

Additionally since we are to solve using the Simplex method, which starts at the origin, it willbe necessary to introduce an artificial variable a1 to help provide an initial feasible solution.

The final solution should not contain the artificial variable (ie it should be zero), in order toforce this variable to zero an extra term is introduced into the objective function. Since this isa maximization problem we introduce −Ma1 into z, where M is arbitrarily large and positive.

Thus the problem becomes:

x1 + 2x2 + s2 = 4, x1 + x2 − s1 + a1 = 3, z = x1 + 3x2 −Ma1

Where s2, s1, a1 are all ≥ 0. Note s2 is the slack variable, s1 the surplus variable and a1 theartificial variable.

When forming the tableau order the variables so that the slack and artificial variables are last,this gives a standard display of the form (D I). As M is large and positive, 3 + M is the maxi-

x1 x2 s1 s2 a1 d da

Basic Var cj 1 3 0 0 −M

s2 0 1 2 0 1 0 4 2a1 −M 1 1 −1 0 1 3 3

zj −M −M M 0 −M z =∆z 1 + M 3 + M −M 0 0 −3M

Table E.7:

mum value in the final row, thus bring x2 into the basic set. Form the ratio of the d with the x2

column and select the smallest non-negative value to take out of the basic set.(these value are inthe final column) In this case s2. Since M is positive and large, −1

2 + M is the largest positive

x1 x2 s1 s2 a1 d da

Basic Var cj 1 3 0 0 −M

x2 3 12 1 0 1

2 0 2 4a1 −M 1

2 0 −1 −12 1 1 2

zj32 − M

2 3 M 32 + M

2 −M z =∆z −1

2 + M2 0 −M −3

2 − M2 0 6−M

Table E.8:

value in the final row, thus bring x1 into the basic set.

Page 259: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

APPENDIX E. SPECIMEN COURSEWORKS 254

In Table E.9 the final row is ≤ 0 thus the problem is optimal:

x1 x2 s1 s2 a1 d da

Basic Var cj 1 3 0 0 −M

x2 3 0 1 1 1 −1 1x1 1 1 0 −2 −1 2 2

zj 1 3 1 2 −1 z =∆z 0 0 −1 −2 −M + 1 5

Table E.9:

Optimal solution; x1 = 2, x2 = 1, z = 5.

Dual prices are 2 and −1 for (ii) and (i) respectively.

The calculation of the feasible ranges of the rhs of the first constraint equation and the rangeof optimality for the x1 coefficient in the objective function are calculated as before. RememberM can be as large as you like so doesn’t restrict any of the inequalities.

Range for the rhs of (i) is [2, 4]

Range of optimality for the x1 coefficient is (−∞, 32 ].

Page 260: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Index

ε-neighbourhood, 51

Adjacent vertices, 101Artificial variables, 86

Bellman’s priciple..., 131Binding constraints, 19Boundary point of a set, 51

Capacity, 118Cauch-Schwarz inequality, 48Closed set, 51Complement, 11Convex set, 51Cut, 127Cycle, 102

Decision variable, 2, 16Degenerate solution, 68, 70, 79Dual price, 26Dual problem, 94Dual theorem, 96Dual variables, 97Dynamic Programming, 13Dynamic programming, 130

Euclidean space, 47Excel-Solver, 31

Feasible range of bi, 84Feasible region, 4, 17Feasible set, 17Feasible solution, 17Flow, 118Flow augmenting path, 121

Graph, 10adjacent, 101connected, 102

definition, 101directed, 103incident, 101mixed, 103path, 101spanning tree, 102tree, 102undirected, 103

Incidence matrix, 114Inner product, 48Interior point of a set, 51

Kruskal’s algorithm, 107

Lineequation of, 48segment, 48

Mathematical modelling, 2Maximal flow, 118Modulus of a vector, 48Multiple solutions, 19

Neighbourhood, 51Network

Ex(1.3), 10Normal to hyperplane, 49

Objective function, 2, 16Open set, 51Optimal range, 22optimization functional, 135Orthogonal vectors, 48

Parallel hyperplanes, 49Prim’s algorithm, 105

Range of optimality, 22

255

Page 261: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

INDEX 256

Reduced cost, 24Redundant constraint, 27

Saturated arc, 121Scalar product, 48Shadow price, 26Simplex multiplier, 26Sink, 118Slack, 19Solver, 31Source, 118Surplus, 19

Page 262: Operational Research - City, University of · PDF fileCHAPTER 1. INITIAL OVERVIEW OF COURSE 2 1.2 Modelling The process of modelling a particular real life situation will vary from

Bibliography

[1] A.V. Aho, J.E. Hopcroft, and J.D. Ullman. Data Structures and Algorithms. Addison and Wesley,1983.

[2] D.R. Anderson, D.J. Sweeny, and T.A. Williams. An Introduction to Management Science, Quan-tative Approach to Decision Making, 11th Edition. Thomson, 2005.

[3] I Anderson. A First Course in Discrete Mathematics. Springer London, 2001.

[4] R. Bellman. Dynamic Programming. Princeton, 1957.

[5] R. Bronson and G. Naadimuthu. Operational Research, 2nd Edition. Schaum’s Outline Series -McGraw-Hill, 1982.

[6] D. Gale. The Theory of Linear Economic Models. University of Chicargo Press, 1989.

[7] G Hadley. Linear Algebra. Addison Wesley, 1961.

[8] G Hadley. Linear Programming. Addison Wesley, 1962.

[9] E.D. Nering. Linear Algebra and Matrix Theory, 2nd Edition. Wiley International, 1970.

[10] J M Norman. Elementary Dynamic Programming. Edward Arnold, 1975.

[11] Open University. Linear Mathematics M201 Unit 18 - Linear Programming. Open UniversityPress, 1972.

[12] Open University. Graphs, Networks and Designs TM361 Unit 3 - Network Flows. Open UniversityPress, 1980.

[13] D Pierre. Optimization Theory with Applications. Dover, 1986.

[14] G. Strang. Linear Algebra and its Applications, 3rd Edition. Harcourt Brace Jovanovich, 1988.

[15] H.A. Taha. Operational Research, an Introduction, 7th Edition. Prentice Hall, 2003.

[16] S. Vajda. Readings in Linear Programming. Pitman, 1958.

[17] G.R. Walsh. Methods of Optimization. John Wiley and Sons, 1975.

257