Linear Programming
Linear Programming
J E Beasley
OR-Notes are a series of introductory notes on topics that fall under the broad heading
of the field of operations research (OR). They were originally used by me in an
introductory OR course I give at Imperial College. They are now available for use by
any students and teachers interested in OR subject to the following conditions.
A full list of the topics available in OR-Notes can be found here.
Solving simultaneously, rather than by reading values off the graph, we have that
x=45 and y=6.25 with the value of the objective function being 1.25
Demand - product 1
Demand - product 2
Week
1 2 3 4
23 27 34 40
11 13 15 14
The forecast for week five is just the average for week 4 = M 4 = 37.46 = 31 (as we
cannot have fractional demand).
For product 2 applying exponential smoothing with a smoothing constant of 0.7 we
get:
M1 = Y1 = 11
M2 = 0.7Y2 + 0.3M1 = 0.7(13) + 0.3(11) = 12.40
M3 = 0.7Y3 + 0.3M2 = 0.7(15) + 0.3(12.40) = 14.22
M4 = 0.7Y4 + 0.3M3 = 0.7(14) + 0.3(14.22) = 14.07
The forecast for week five is just the average for week 4 = M 4 = 14.07 = 14 (as we
cannot have fractional demand).
We can now formulate the LP for week 5 using the two demand figures (37 for
product 1 and 14 for product 2) derived above.
Let
x1 be the number of units of product 1 produced
x2 be the number of units of product 2 produced
where x1, x2>=0
The constraints are:
15x1 + 7x2 <= 20(60) machine X
25x1 + 45x2 <= 15(60) machine Y
x1 <= 37 demand for product 1
x2 <= 14 demand for product 2
The objective is to maximise profit, i.e.
maximise 10x1 + 4x2 - 3(37- x1) - 1(14-x2)
i.e. maximise 13x1 + 5x2 - 125
The graph is shown below, from the graph we have that the solution occurs on the
horizontal axis (x2=0) at x1=36 at which point the maximum profit is 13(36) + 5(0) 125 = 343
The company has 40 hours of machine time available in the next working week but
only 35 hours of craftsman time. Machine time is costed at 10 per hour worked and
craftsman time is costed at 2 per hour worked. Both machine and craftsman idle
times incur no costs. The revenue received for each item produced (all production is
sold) is 20 for X and 30 for Y. The company has a specific contract to produce 10
items of X per week for a particular customer.
Formulate the problem of deciding how much to produce per week as a linear
program.
Solve this linear program graphically.
Solution
Let
x be the number of items of X
y be the number of items of Y
then the LP is:
maximise
20x + 30y - 10(machine time worked) - 2(craftsman time worked)
subject to:
13x + 19y <= 40(60) machine time
20x + 29y <= 35(60) craftsman time
x >= 10 contract
x,y >= 0
so that the objective function becomes
maximise
20x + 30y - 10(13x + 19y)/60 - 2(20x + 29y)/60
i.e. maximise
17.1667x + 25.8667y
subject to:
13x + 19y <= 2400
20x + 29y <= 2100
x >= 10
x,y >= 0
It is plain from the diagram below that the maximum occurs at the intersection of
x=10 and 20x + 29y <= 2100
Solving simultaneously, rather than by reading values off the graph, we have that
x=10 and y=65.52 with the value of the objective function being 1866.5
It is plain from the diagram below that the maximum occurs at the intersection of
12xA + 25xB = 1800 and xB - 0.4xA = 0
Solving simultaneously, rather than by reading values off the graph, we have that:
xA= (1800/22) = 81.8
xB= 0.4xA = 32.7
with the value of the objective function being 408.9
Doubling the assembly time available means that the assembly time constraint
(currently 12xA + 25xB <= 1800) becomes 12xA + 25xB <= 2(1800) This new
constraint will be parallel to the existing assembly time constraint so that the new
optimal solution will lie at the intersection of 12x A + 25xB = 3600 and xB - 0.4xA = 0
i.e. at xA = (3600/22) = 163.6
a + b >= 11
a - b <= 5
7a + 12b >= 35
a >= 0 b >= 0
From the diagram below the minimum occurs at the intersection of a - b = 5 and a + b
= 11
i.e. a = 8 and b = 3 with c (= a + b) = 11 and the value of the objective function 10a +
11b = 80 + 33 = 113.