5 Linear Programming: Objectives
5 Linear Programming: Objectives
com
5 LINEAR
PROGRAMMING
Objectives
After studying this chapter you should
• be able to formulate linear programming problems from
contextual problems;
• be able to identify feasible regions for linear programming
problems;
• be able to find solutions to linear programming problems using
graphical means;
• be able to apply the simplex method using slack variables;
• understand the simplex tableau procedure.
5.0 Introduction
The methods of linear programming were originally developed
between 1945 and 1955 by American mathematicians to solve
problems arising in industry and economic planning. Many such
problems involve constraints on the size of the workforce, the
quantities of raw materials available, the number of machines
available and so on. The problems that will be solved usually
have two variables in them and can be solved graphically, but
problems occurring in industry have many more variables and have
to be solved by computer. For example, in oil refineries, problems
arise with hundreds of variables and tens of thousands of
constraints.
83
www.vagupu.com
You will not actually solve this problem yet, but show how it can be
formulated as a linear programming problem. There are three vital
stages in the formulation, namely
(a) What are the unknowns?
(b) What are the constraints?
(c) What is the profit/cost to be maximised/minimised?
84
www.vagupu.com
Transistors Similarly
10x + 20y ≤ 120
Capacitors Similarly
10x + 30y ≤ 150
In this particular example you should be aware that x and y can only
be integers since it is not sensible to consider fractions of a printed
circuit. In all linear programming problems you need to consider if
the variables are integers.
Find the associated profit for this solution, and compare this profit
with other possible solutions.
At this stage, you will not continue with finding the actual solutions
but will concentrate on further practice in formulating problems of
this type.
The key stage is the first one, namely that of identifying the
unknowns; so you must carefully read the problem through in order
to identify the basic unknowns. Once you have done this
successfully, it should be straight forward to express both the
constraints and the profit function in terms of the unknowns.
85
www.vagupu.com
Example
A small firm builds two types of garden shed.
Solution
(a) Unknowns
Define
(b) Constraints
Machine time: 2x + 3y ≤ 30
Craftsman time: 5x + 5y ≤ 60
and x ≥ 0, y ≥ 0
(c) Profit
P = 60x + 84y
subject to 2x + 3y ≤ 30
x+y ≤ 12
x ≥0
y ≥0
86
www.vagupu.com
Chapter 5 Linear Programming
Exercise 5A
1. Ann and Margaret run a small business in which 3. A firm manufactures wood screws and metal
they work together making blouses and skirts. screws. All the screws have to pass through a
Each blouse takes 1 hour of Ann's time together threading machine and a slotting machine. A
with 1 hour of Margaret's time. Each skirt box of wood screws requires 3 minutes on the
involves Ann for 1 hour and Margaret for half an slotting machine and 2 minutes on the threading
hour. Ann has 7 hours available each day and machine. A box of metal screws requires 2
Margaret has 5 hours each day. minutes on the slotting machine and 8 minutes
on the threading machine. In a week, each
They could just make blouses or they could just machine is available for 60 hours.
make skirts or they could make some of each.
There is a profit of £10 per box on wood screws
Their first thought was to make the same number and £17 per box on metal screws.
of each. But they get £8 profit on a blouse and
only £6 on a skirt. Formulate this problem as a linear programming
problem given that the objective is to maximise
(a) Formulate the problem as a linear profit.
programming problem.
4. A factory employs unskilled workers earning
(b) Find three solutions which satisfy the £135 per week and skilled workers earning £270
constraints. per week. It is required to keep the weekly wage
bill below £24 300.
2. A distribution firm has to transport 1200
packages using large vans which can take 200 The machines require a minimum of 110
packages each and small vans which can take 80 operators, of whom at least 40 must be skilled.
packages each. The cost of running each large Union regulations require that the number of
van is £40 and of each small van is £20. Not skilled workers should be at least half the
more than £300 is to be spent on the job. The number of unskilled workers.
number of large vans must not exceed the If x is the number of unskilled workers and y the
number of small vans. number of skilled workers, write down all the
Formulate this problem as a linear programming constraints to be satisfied by x and y.
problem given that the objective is to minimise
costs.
maximise P = 5x + 12y
87
www.vagupu.com
12
0 x
0 4 8 12 16 20
The figure shows, for example, the lines defined by C = 15 Feasible region
Activity 2
Check that the points
x = 1, y = 25
12
x = 2, y = 5
3
x = 4, y = 5
6
each lie on the line defined by C = 30. What profit does each of
these points give?
88
www.vagupu.com
As the profit line moves to the right, the profit increases and so the
maximum profit corresponds to the last point touched as the profit line
moves out of the feasible region. This is the point B, the intersection
of
P = 5 × 6 + 12 × 3 = 66 .
Example
A farmer has 20 hectares for growing barley and swedes. The farmer
has to decide how much of each to grow. The cost per hectare for
barley is £30 and for swedes is £20. The farmer has budgeted £480.
The profit on barley is £100 per hectare and on swedes is £120 per
hectare.
Find the number of hectares of each crop the farmer should sow to
maximise profits.
Solution
The problem is formulated as a linear programming problem:
(a) Unknowns
x = number of hectares of barley
y = number of hectares of swedes
(b) Constraints
Land x + y ≤ 20
Cost 30x + 20y ≤ 480
Manpower x + 2y ≤ 36
(c) Profit
P = 100x + 120y
89
www.vagupu.com
C = 100x + 120y
and again you can see that C increases as the line (shown dotted)
moves to the right. Continuing in this way, the maximum profit
will occur at the intersection of
x + 2y = 36 and x + y = 20
y
24
x=0
30x + 20y = 480
20
16
c = 1800
x + 2y = 36
12
c = 1200
8
feasible
c = 600 region
4
x + y = 20
0 x
0 4 8 12 16 20 24 28 32 36
y=0
The farmer should sow 4 hectares with barley and 16 with swedes.
Exercise 5B
1. Solve the linear programming problem defined in At least 200 m 2 must be available for each
Question 1 of Exercise 5A. caravan and 90 m 2 for each tent.
2. Solve the linear programming problem defined in The nightly charges are £2 for a caravan and £1
Question 2 of Exercise 5A. for a tent.
3. A camp site for caravans and tents has an area of Find the greatest possible nightly takings.
1800m 2 and is subject to the following regulations: How many caravans and tents should be admitted
The number of caravans must not exceed 6. if the site owner wants to make the maximum
profit and have
Reckoning on 4 persons per caravan and 3 per
tent, the total number of persons must not (a) as many caravans as possible,
exceed 48. (b) as many tents as possible?
90
www.vagupu.com
Chapter 5 Linear Programming
4. The annual subscription for a tennis club is £20 for 5. The numbers of units of vitamins A, B and C in a
adults and £8 for juniors. The club needs to raise at kilogram of foods X and Y are as follows:
least £800 in subscriptions to cover its expenses.
The total number of members is restricted to 50. Food Vitamin A Vitamin B Vitamin C
The number of junior members is to be between one X 5 2 6
quarter and one third of the number of adult
members. Y 4 6 2
Represent the information graphically and find the A mixture of the two foods is made which has to
numbers of adult and junior members which will contain at least 20 units of vitamin A, at least 24
bring in the largest amount of money in units of vitamin B and at least 12 units of
subscriptions. vitamin C.
Find also the least total membership which will Find the smallest total amount of X and Y to
satisfy the conditions. satisfy these constraints.
Food Y is three times as expensive as Food X.
Find the amounts of each to minimise the cost
and satisfy the constraints.
Looking back at the second example in Section 5.2, the slope of the
profit line was 65 . (The slope is actually negative but it is sufficient
to just consider the magnitude of the slopes of the lines.) This is
more than the slope of the line x + 2y = 36 (namely 1
2
), but less
than the slope of the other two lines, x + y = 20 (i.e. 1) and
30x + 20y = 480 (i.e. 3
2 ).
So the solution will occur at the intersection of the two lines with
1
slopes 2
and 1.
Activity 3
Check the slopes of the constraints and profit function in the first
example in the text in Section 5.2.
91
www.vagupu.com
You can see how this method works with the second example in
Section 5.2. The vertices are given by
(a) 0 (0, 0)
(b) A (0, 18)
(c) B (4, 16)
(d) C (8, 12)
(e) D (16, 0)
and the corresponding profits in £ are
Point Profit y
22
0 0 20 A p = 2160 increasing
18 B p = 2320 profit
A 2160 16
14 C
B 2320 12 p = 2240
10
C 2240 8
6
D 1600 4 1600
p = 2320
2 0
p = 2320
D x
As you can see, as you move round the feasible region, the 0
0 2 4 6 8 10 12 14 16 18
profit increases from 0 to A to B, but then decreases to C to D
and back to 0.
x + y ≤ 20
30x + 20y ≤ 480
x + 2y ≤ 36
r = 20 − x − y
s = 480 − 30x − 20y
t = 36 − x − 2y
r ≥ 0, s ≥ 0, t ≥ 0
x = t = 0.
92
www.vagupu.com
Activity 4
Complete the table below, defining each vertex
0 x=y=0
A t=x=0
B ................
C ................
D ................
P = 100x + 120y = 0 at x = y = 0
x = r = 0 ⇒ y = 20
x = s = 0 ⇒ y = 24
x = t = 0 ⇒ y = 18 ← smallest
P = 100x + 120y
(36 − x − t )
= 100x + 120
2
= 40x − 60t + 2160
93
www.vagupu.com
t=s=0⇒x=6
t = r = 0 ⇒ x = 4 ← smallest
t = y = 0 ⇒ x = 36
Exercise 5C
1. (a) Solve the linear programming problem 2. (a) Determine the vertices of the feasible region
maximise P = 2 x + 4 y for the linear programming problem
maximise P = x + y
subject to x + 5y ≤ 10
4x + y ≤8 subject to x + 4 y ≤8
x ≥0 2 x + 3y ≤ 12
y ≥0 3x + y ≤9
x ≥0
by a graphical method.
y ≥0
(b) Introduce slack variables r and s, and solve
the problem by the simplex method. Hence find the solution.
(b) Verify this solution by using the simplex method.
94
www.vagupu.com
subject to 4y +10x ≤ 40
10y + 3x ≤ 30
5y + 4x ≤ 20
x ≥0
y ≥0
Maximise P = x + 2y
subject to x + 4y ≤ 20
x+y ≤8
5x + y ≤ 32
x ≥0
y ≥0
x + 4y + r = 20
x+y+s =8
5x + y + t = 32
P − x − 2y =0
x + 4y +r = 20
x + y +s =8
5x + y +t = 32
1 −1 −2 0 0 0 P 0
⇒
0 1 4 1 0 0 x 20
y =
0 1 1 0 1 0 8
1 r 32
0 5 1 0 0
s
t
95
www.vagupu.com
The augmented matrix with the extra right hand column will be used.
P x y r s t Comments
1 −1 −2 0 0 0 0
0 1 4 1 0 0 20
0 1 1 0 1 0 8
0 1 1
5
0 0 1
5
32
5
← R4 / 5
1 0 − 95 0 0 1
5
32
5
← R1 + R 4 From the first row express P in terms of y and
t, with a positive coefficient of y. Increase y
− ← R2 − R4
19 1 68 and compare the values obtained from the
0 0 5
1 0 5 5 figures in the R.H. column divided by the
corresponding coefficients of y, namely
0 0 4
5
0 1 − 1
5
8
5
← R3 − R 4 ( 68 / 5 ) / (19 / 5 ), ( 8 / 5 ) / ( 4 / 5 )*,
0 1 1 0 0 1 32 ( 32 / 5 ) / (1 / 5 ) .
5 5 5 (*This term has the smallest positive value
(where s = t = 0 ) so now manipulate the matrix
to express P in terms of s and t)
1 0 − 95 0 0 1
5
32
5
0 0 19
5
1 0 − 15 68
5
0 0 1 0 5
4 − 14 2 ← R 3 / ( 4 5)
1 1 32
0 1 5
0 0 5 5
1 0 0 0 9
4 − 14 10 ← R1 + 95 R 3 From the first row P could now be expressed
0 0 0 1 − 19
4
3
4 6 ← R 2 − 19 R
5 3
in terms of s and t, with a positive coefficient
of t. So now increase t and compare the
values 6 / ( 3 / 4 ) *, 2 / ( −1 / 4 ), 6 / (1 / 4 )
0 0 1 0 5
4 − 14 2 (*This term has the smallest positive value so
now manipulate the matrix to express P in
0 1 0 0 − 14 1
4 6 ← R 4 − 15 R 3 terms of r and s)
9
1 0 0 0 4 − 14 10
0 0 0 4 − 3
19
1 8 ← R 2 / ( 43 )
3
0 0 1 0 5
4 − 14 2
0 1 0 0 − 14 1
4 6
1 0 0 1
3
2
3 0 12 ← R1 + 14 R 2 From the first row P could now be expressed
in terms of r and s, with a negative coefficient
0 0 0 4
3 − 19
3 1 8 of each, so now stop; i.e. since the top row
has all positive coefficients you can see that
0 0 1 1
3 −3 1 0 4 ← R 3 + 14 R 2 the maximum value of P is 12 and that it is
reached when r = s = 0 (which happens when
0 1 0 − 13 4
3 0 4 ← R 4 − 14 R 2 x = 4 and y = 4 ).
96
www.vagupu.com
Example
Maximise P = 4x + 5y + 3z
subject to 8x + 5y + 2z ≤ 3
3x + 6y + 9z ≤ 2
x, y, z ≥ 0
Solution
As usual slack variables r and s are introduced;
8x + 5y + 2z + r = 3
3x + 6y + 9z + s = 2
P x y z r s Comments
1 −4 −5 −3 0 0 0
0 1 5
8
2
8
1
8 0 3
8 ← R2 / 8
0 3 6 9 0 1 2
1 0 − 25 −2 1
2 0 3
2 ← R1 + 4R 2 Increase y and compare ( 3 / 8 ) / ( 5 / 8 ),
5 2 1 3 ( 7 / 8 ) / ( 33 / 8 ) * . This smaller positive value
0 1 8 8 8 0 8 occurs when z = r = s=0 and so express P
0 0 33
8
33
4 − 83 1 7
8 ← R 3 − 3R 2 in terms of z, r and s.
1 0 − 25 −2 1
2 0 3
2
5 2 1 3
0 1 8 8 8 0 8
0 0 1 2 − 11
1 8
33
7
33 ← R3 / ( 338 )
1 0 0 3 3
11
20
33
67
33 ← R1 + 25 R 3 The first row now has positive coefficients,
showing that there is a maximum of 67 / 33
0 1 0 −1 2
11 − 5
33
8
33 ← R 2 − 85 R 3 when z = r = s = 0 (which happens when
x = 8 / 33, y = 7 / 33 and z = 0 ).
0 0 1 2 − 11
1 8
33
7
33
97
www.vagupu.com
Exercise 5D
Use the simplex algorithm to solve the following 3. Maximise P = 3x + 8y − 5z
problems.
subject to 2 x − 3y + z ≤ 3
1. Maximise P = 4 x + 6 y
2 x + 5y + 6z ≤5
subject to x + y ≤ 8 x ≥0
7x + 4 y ≤ 14 y ≥0
x ≥0 z ≥0
y ≥0 4. Maximise 3x + 6 y + 2z
2. Maximise P = 10 x + 12 y + 8z subject to 3x + 4 y + 2z ≤ 2
subject to 2 x + 2 y ≤ 5 x + 3y + 2z ≤ 1
5x + 3y + 4z ≤ 15 x ≥0
x ≥0 y ≥0
y ≥0 z ≥0
z ≥0
98
www.vagupu.com
If he plants 30 shrubs what is the maximum (a) By taking x tablets of Xtravit and y tablets of
number of trees he can plant? Yeastalife the person expects to receive at
least 18 milligrams of iron, 21 milligrams of
If he plants 3 shrubs for every tree, what is the
calcium and 16 milligrams of vitamins.
maximum number of trees he can plant?
Write these conditions down as three
7. A small mine works two coal seams and inequalities in x and y.
produces three grades of coal. It costs £10 an
hour to work the upper seam, obtaining in that (b) In a coordinate plane illustrate the region of
time 1 tonne of anthracite, 5 tonnes of best those points (x,y) which simultaneously
quality coal and 2 tonnes of ordinary coal. The satisfy x ≥ 0, y ≥ 0, and the three inequalities
lower seam is more expensive to work, at a cost in (a).
of £15 per hour, but it yields in that time
4 tonnes of anthracite, 6 tonnes of best coal and (c) If the Xtravit tablets cost 10p each and the
1 tonne of ordinary coal. Faced with just one Yeastalife tablets cost 5p each, how many
order, for 8 tonnes of anthracite, 30 tonnes of tablets of each should the person take in
best coal and 8 tonnes of ordinary coal, how order to satisfy the above requirements at the
many hours should each seam be worked so as to minimum cost? (AEB)
fill this order as cheaply as possible? 10. A maker of wooden furniture can produce three
8. A cycle manufacturer produces two types of different types of furniture: sideboards, tables
mountain-bike: a basic Model X and a Super and chairs. Two machines are used in the
Model Y. Model X takes 6 man-hours to make production - a jigsaw and a lathe.
per unit, while Model Y takes 10 man-hours per The manufacture of a sideboard requires 1 hour
unit. There is a total of 450 man-hours available on the jigsaw and 2 hours on the lathe; a table
per week for the manufacture of the two models. requires 4 hours on the jigsaw and none on the
Due to the difference in demand for the two lathe; a chair requires 2 hours on the jigsaw and
models, handling and marketing costs are £20 8 hours on the lathe.
per unit for Model X, but only £10 per unit for The jigsaw can only operate 100 hours per week
Model Y. The total funds available for these and the lathe for 40 hours per week. The profit
purposes are £800 per week. made on a sideboard is £100, £40 on a table and
Profits per unit for Models X and Y are £20 and £10 on a chair. In order to determine how best
£30 respectively. The objective is to maximise to use the two machines so as to maximise
weekly profits by optimising the numbers of profits, formulate the problem as a linear
each model produced. programming problem, and solve it using the
simplex tableau.
(a) The weekly profit is £P. The numbers of
units of Model X and Model Y produced each 11. A diet-conscious housewife wishes to ensure her
week are x and y. Express P in terms of x family's daily intake of vitamins A, B and C
and y. Also write down inequalities does not fall below certain levels, say 24 units,
representing the constraints on production. 30 units and 18 units, respectively. For this she
relies on two fresh foods which, respectively,
(b) By graphical means or by the simplex provide 8, 5 and 2 units of vitamins per ounce of
method, find the maximum obtainable profit foodstuff and 3, 6 and 9 units per ounce. If the
and the numbers of each model manufactured first foodstuff costs 3p per ounce and the second
which give this profit. only 2p per ounce, use a graphical method to
(c) If competition forces the manufacturer to find how many ounces of each foodstuff should
give a £5 discount on the price of Model X, be bought by the housewife daily in order to
resulting in a £5 reduction in profit, how are keep her food bill as low as possible.
weekly profits now maximised? (AEB)
9. In order to supplement his daily diet someone
wishes to take some Xtravit and some Yeastalife
tablets. Their contents of iron, calcium and
vitamins (in milligrams per tablet) are shown in
the table.
99
www.vagupu.com
100