Module 1 - LPP
Module 1 - LPP
Example
A rectangular box open at the top is to have volume of 32 cubic feet. Find the dimensions of the box
requiring least material for its construction.
Mathematical model
Let x ft , y ft & z ft be the dimensions of the box and S be the surface area of the box.
where x1 , x2 , x3 ,..., xn are the decision variables and c j , aij , bi values are constants, called parameters or
coefficients.
contributions from each variable. i.e. If we use t1 hours of time on Machine A to make product 1 and t2
hours to make product 2, the total time required to make products 1 & 2 on Machine A is t1 + t2 hours.
Some processes may not behave in this way. For example, when several liquids of different chemical
compositions are mixed, the resulting volume may not be equal to the sum of the volumes of the
individual liquids.
3. Divisibility
The decision variables can take fractional values. It means that the companies manufacture products in
fractional units. For example, company manufacture 2.5 tables each day, 3.2 barrels of oil etc. This is
referred too as the assumption of divisibility.
4.Non-negativity
All variables are restricted to non-negative values (i.e., their numerical value will be ≥ 0).
5.Certainty
The parameters of the model are certainly and precisely known.
Applications of LPP: Linear programming techniques are widely used in various contexts. Some of them are
➢ Industrial Applications
• Product Mix Problems
• Blending Problems
• Production Scheduling Problems
• Assembly Line Problems
➢ Management Applications
• Media Selection Problems
• Portfolio Selection Problems
A 1 3 Rs 6
B 1 2 Rs 5
Total 5 12
which means we have to maximize Z . The company will try to produce as many units of A and B to
maximize the profit. However, the resources Milk and Choco are available in a limited amount.
Also, each unit of A and B requires 3 units & 2 units of Choco respectively. The total amount of Choco
available is 12 units. To represent this mathematically,
3 x + 2 y 12
X Y
A 2 4 40
D 3 2 50
Solution:
Let the patient purchases x units of X and y units of Y
Minimize Z= 45 x1 + 40 x2 + 85 x3 + 65x4
Constraints are on the fulfilment of the daily requirement of the various constituents.
for proteins : 3x1 + 4 x2 + 8 x3 + 6 x4 800
for fats : 2 x1 + 2 x2 + 7 x3 + 5 x4 200
i.e.
for carbohydrates : 6 x1 + 4 x2 + 7 x3 + 4 x4 700
where x1 , x2 , x3 , x4 0
Ex-4: A manufacturer produces two types of models M1 and M2. Each model of the type M1 requires 4
hours of grinding and 2 hours of polishing; whereas each model of the type M2 requires 2 hours of
grinding and 5 hours of polishing. The manufacturer has 2 grinders and 3 polishers. Each grinder works 40
hours a week and each polisher work for 60 hours a week. Profit on M1 model is Rs. 3.00 and on model
M2 is Rs. 4.00. Whatever is produced in a week is sold in the market. How should the manufacturer
allocate his production capacity to the two types of models so that he may make the maximum profit in a
week?
Solution:
Decision variables: Let x1 and x2 be the number of units of M1 and M2 models.
2x1 + 2x2 12
x1 + 4x2 12
2x1 + 2x2 12
x1 + 4x2 12
x1, x2 0.
Example 7 A paper mill produces two grades of paper namely X and Y. Owing to raw material restrictions, it cannot
produce more than 400 tons of grade X and 300 tons of grade Y in a week. There are 160 production hours in a week.
Since the profit for the two grades of paper X and Y are given, the objectivefunction is to
maximize the profit.
Max Z = 200x1 + 500x2
Constraints: There are 2 constraints, one referring to the raw material, and the other to the production hours.
Max Z = 200x1 + 500x2
x2 300
The profit after selling these two products is given by the objective function,
Max Z = 2x1 + 4x2
Since the company can produce at the most 2000 units of the product in a day and type B requires twice as much
time as that of type A, production restriction is given by
x1 + 2x2 2000
Since the raw materials are sufficient to produce 1500 units per day, if both A and B are combined, we have
x1 + x2 1500
As B requires special ingredients, there can be a maximum of 600 units from B so we have x2 600. Also, since the
x1 + x2 1500
x1, x2 0.
Ex-9: A firm manufacturers 3 products A, B and C. The profits are Rs. 3, Rs. 2 and Rs. 4 respectively. The firm has 2
machines and given below is the required processing time in minutes for each machine on each product
Product-wise processing time (min)
Machines A B C
M1 4 3 5
M2 3 2 4
Machines M1 and M2 have 2000 and 2500 machine minutes respectively. The firm must manufacture 100 units of A’s,
200 units of B’s and 50 units of C’s but not more than 150 units of A’s. Set up an LPP to maximize the profit.
Solution Let x1, x2, x3 be the number of units of the products A, B, C respectively.
Since the profits are Rs. 3, Rs. 2 and Rs. 4 respectively, the total profit gained by the firm after selling these three
products is given by,
Z = 3x1 + 2x2 + 4x3
The total number of minutes required in producing these three products at machine M1 is given by
4x1 + 3x2 + 5x3 and at machine M2, it is given by 3x1 + 2x2 + 4x3.
The restrictions on the machine M1 and M2 are given by 2000 minutes and 2500 minutes.
Also, since the firm manufactures 100 units of A’s, 200 units of B’s and 50 units of C’s but not more than 150 units of
A’s the further restriction becomes
100 x1 150
200 x2 0
50 x3 0
Hence the allocation problem of the firm can be finally put in the form: Find the value of x1, x2, x3 so as to maximize
Z = 3x1 + 2x2 + 4x3
Ex-10: A farmer has a 100 acre farm. He can sell all tomatoes, lettuce or radishes and can get a price of Rs. 1.00 per kg
for tomatoes, Rs. 0.75 a heap for lettuce and Rs. 2.00 per kg for radishes. The average yield per acre is 2,000 kg of
Hence, the farmers allocation problem can be finally put in the form.
Find the value of x1, x2 and x3 so as to maximize
Z = 1850x1 + 2080x2 + 1875x3
Subject to,
x1 + x2 + x3 1005
Step-3: a. Decide the extreme points (corner points) of the feasible region.
b. Calculate the objective function value at each extreme points.
c. Find out min or max value (optimal value) of the objective function.
Note
The optimum value of the objective function occurs at one of the extreme/corner points of the feasible
region (closed polygon)
Hence, the optimal solution to the given LP problem is : x1 = 9, x2 = 10 and Max Z = 1160 .
Since all the constraints are inequalities, so convert them into equalities.
Thus,
(1) x + 2 y = 14
x + 2(3x) = 14 ( y = 3x from (2))
7 x = 14
x=2
(1) x + 2 y = 14
x + 2( x − 2) = 14 (x − 2 = y from (3))
3x − 4 = 14
x=6
As there is no non-negativity constraint involved in the given problem, the decision variables are allowed to
take negative values.
On plotting the straight lines (1), (2) and (3), we have the following graph.
Clearly, the maximum value of the objective function Z = 42 occurs at the extreme point B(6, 4).
Hence, the optimal solution to the given LP problem is : x = 6, y = 4 and Max Z = 42 .
Similarly, the minimum value of the objective function Z = −14 occurs at the extreme point A(−1, −3).
Hence, the optimal solution to the given LP problem is : x = −1, y = −3 and Max Z = −14 .
Solution
Given
Maximize Z = 100 x1 + 80 x2
Subject to
5 x1 + 10 x2 50
8 x1 + 2 x2 16
3x1 − 2 x2 6
x1 , x2 0
Since all the constraints are inequalities, so convert them into equalities.
Thus,
(1) 5 x1 + 10 x2 = 50
5 x1 + 10(8 − 4 x1 ) = 50 (8 x1 + 2 x2 = 16 x2 = 8 − 4 x1 from (2))
− 35 x1 = −30
x1 = 6 / 7
6 32
Thus, , be one of the corner point.
7 7
Solving (1) & (3) we have
(1) 5 x1 + 10 x2 = 50
1 1
5 x1 + 10( (3x1 − 6) ) = 50 (3x1 − 2 x2 = 6 x2 = (3x1 − 6) from (2))
2 2
20 x1 = 80
x1 = 4
(2) 3x1 − 2 x2 = 6
3x1 − 2(8 − 4 x1 ) = 6 (8 x1 + 2 x2 = 16 x2 = 8 − 4 x1 from (3))
11x1 = 22
x1 = 2
Clearly, the maximum value of the objective function Z = 10 occurs at the two extreme points
A(3,1) & B(0, 2.5)
Note:
This situation can never occur if all the
constraints are of the type.
Models
Process A B Availability of Labour hours
Fabricating 9 12 180
Finishing 1 3 30
Profit per unit Rs 8000 Rs 12000
Suppose x is the number of pieces of Model A and y is the number of pieces of Model B. Then
, the complete LPP model for the problem can be written as
Coordinates
( x, y)
Clearly, the maximum value of the objective function Z = 168000 occurs at the extreme point B(12, 6)
Hence, the optimal solution to the given LP problem is : x = 12, y = 6 and Max Z = 168000 .
Hence, the company should produce 12 pieces of Model A and 6 pieces of Model B to realise maximum
profit and maximum profit then will be Rs 1,68,000.
The inequalities and equations for the above data will be as follows.
Coordinates ( x1 , x2 ) Z = 3x1 + 4 x2
Clearly, the maximum value of the objective function Z = 80 occurs at the extreme point A(0, 20)
Hence, the optimal solution to the given LP problem is : x1 = 0, x2 = 20 and Max Z = 80 . Hence, the
Max Z = 6 x + 8 y
Subject to
x + y = 50
5 x + 10 y + s1 = 60
4 x + 4 y − s2 = 40
x, y, s1 , s2 0
2. Observe whether all bi' s (R.H.S of the constraints) are positive or not. If not, they can be made positive
by multiplying bi' s of the constraint by -1, by doing so direction of the inequality will also change.
3. Objective function must be in Maximization type. If not, change into maximization type as follows:
Min Z = −( Max(− Z )) = − Max Z * , where Z = Z *
Basic Variable
A variable is said to be to basic variable, if it has unit coefficient in one of the constraints and zero
coefficient in the remaining constraints.
Simplex Method
Simplex method is the method to solve ( LPP ) models which contain two or more decision variables.
The step-by-step procedure of Simplex algorithm is given as follows:
1.Write the standard form for the given LPP and prepare the initial simplex table
2.Compute the value of Z j using the following formula
Z j = CBi aij
i
If all the C j − Z j are equals to zero then the optimality is reached. Otherwise the select the variable with
For Minimization problem, if all the C j − Z j 0 then the optimality is reached. Otherwise the select the
4. C j − Z j is maximum for any variable is known as entering variable and the corresponding column is
Max Z = x1 + 1.5 x2 + 0 S1 + 0 S2
subject to
3 x1 + 2 x2 + S2 = 240
and x1,x2,S1,S2≥0
Iteration-4:
Ex-3: A company makes two kinds of leather belts, belt A and belt B. Belt A is a high quality belt and belt
B is of lower quality. The respective profits are Rs 4 and Rs 3 per belt. The production of each of type A
requires twice as much time as a belt of type B, and if all belts were of type B, the company could make
1,000 belts per day. The supply of leather is sufficient for only 800 belts per day (both A and B
combined). Belt A requires a fancy buckle and only 400 of these are available per day. There are only 700
Iteration-3:
Artificial Variable
In a LPP if the constraints have sign = (or ) , we may not get unit matrix in the basis. To avoid this
difficulty, we introduce another variable called Artificial variable.
Note: Such type of LPP can be solved by using Big-M method or Two Phase method
where S1 is slack variables and S 2 is surplus variables which are introduced to balance constraints
The canonical form of the above model presented below after introducing necessary artificial variables
M A1 3 4 0 −1 1 4 4
(Pivot Element) = 1 (min)
4
→ Leaving variable
Zj 3M 4M 0 −M M
Cj − Z j −3 − 3M −2 − 4M 0 M 0
Entering variable
variable y and the leaving variable is A1 and row 2 is the key row. Thus, the pivot element is 4.
Iteration 2:
In this table the Artificial variable A1 of the previous table is replaced by y .
Zj −3 −2 0 1 1
−
2 2 2
Cj − Z j −3 0 0 1 1
− M+
2 2 2
Entering variable
5
variable x and the leaving variable is S1 and row 1 is the key row. Thus, the pivot element is .
4
Iteration 3:
In this table the basic variable S1 of the previous table is replaced by x .
The canonical form of the above model presented below after introducing necessary artificial variables
Min Z = 5 x + 6 y + 0S1 + 0S 2 + MA1 + MA2
Subject to
2 x + 5 y − S1 + A1 = 1500
3 x + y − S 2 + A2 = 400
x, y, S1 , S 2 , A1 , A2 0
Basic x y S1 S2 A1 A2
variable
s
( Bi )
Zj 5M 6M −M −M M M
Cj − Z j 5 − 5M 6 − 6M M M 0 0
Entering variable
variable y and the leaving variable is A1 and row 1 is the key row. Thus, the pivot element is 5.
Iteration 2:
In this table the basic variable S1 of the previous table is replaced by x .
Basic x y S1 S2 A1 A2
variable
s
( Bi )
6 y 2 1 0 1 0 30 750
−
5 1 5 5 0
Zj 12 + 7 M 6 −6 + M −M 6−M M
5 5 5
Cj − Z j 13 − 7 M 0 6−M M 6M − 6 0
5 5 5
Entering variable
Since all the C j − Z j 0 , the optimality is not yet reached. For large M , C j − Z j is maximum for the
13
variable x and the leaving variable is A2 and row 2 is the key row. Thus, the pivot element is .
5
Iteration 3:
In this table the basic variable A2 of the previous table is replaced by x .
Basic x y S1 S2 A1 A2
variables
( Bi )
6 y 0 3 2 3 2 3700
− −
1 13 13 13 13 13
5 x 1 0 1 5 1 5 500
− −
7 7 7 7 13
Zj 5 6 29 13 29 13 1900
− −
35 7 35 7
Cj − Z j 0 0 29 13 35M − 29 7 M − 13
35 7 35 13
500 3700
The corresponding optimal solution is Min Z = 1900, x = , y=
13 13
Ex-3: ABC Printing Company is facing a tight financial squeeze and is attempting to cut costs
wherever possible. At present it has only one printing contract, and luckily, the book is selling well in both
the hardcover and the paperback editions. It has just received a request to print more copies of this book in
either the hardcover or the paperback form. The printing cost for the hardcover books is Rs 600 per 100
books while that for paperback is only Rs 500 per 100. Although the company is attempting to economize,
it does not wish to lay off any employee. Therefore, it feels obliged to run its two printing presses – I and
II, at least 80 and 60 hours per week, respectively. Press I can produce 100 hardcover books in 2 hours or
100 paperback books in 1 hour. Press II can produce 100 hardcover books in 1 hour or 100 paperbacks
books in 2 hours. Determine how many books of each type should be printed in order to minimize costs.
(Home work)
6.Carry out further iterations till the optimality is reached and then stop.
Phase 1
The model for phase-1 with its revised objective function is shown below.
Min Z = A1 + A2
Subject to
4 x + 8 y + 6 z − S1 + A1 = 64
3x + 6 y + 12 z − S 2 + A2 = 96
x, y, z , S1 A1 , S 2 A2 0
The corresponding initial table is given below
B.V x y z S1 S2 A1 A2
( Bi )
1 A1 4 8 6 −1 0 1 0 64 64
= 10.8
6
1 A2 3 6 12 0 −1 0 1 96 96
=8
(Pivot element) 12
→ Leaving variable
Zj 7 14 18 −1 −1 1 1
Cj − Z j −7 −14 −18 1 1 −1 −1
Entering variable
B.V x y z S1 S2 A1 A2
( Bi )
1 A1 5 5 0 −1 1 1 1 16 16
− = 3.2
2 2 2 5
→ Leaving variable
0 z 1 1 1 0
−
1 0 1 8 16
4 2 12 12
(Pivot element)
Zj 5 5 0 −1 1 1 1
−
2 2 2
Cj − Z j 5 −5 0 1 1 0 3
− −
2 2 2
Entering variable
B.V x y z S1 S2 A1 A2
( Bi )
0 y 1 1 0 1 1 1 1 16 16
− − = 3.2
2 5 10 5 10 5 5
→ Leaving variable
0 z 0 0 1 1
−
2
−
1 2 32 16
(Pivot 10 15 10 15 5
element)
Zj 0 0 0 0 0 0 0
Cj − Z j 0 0 0 0 0 1 1
The set of basic variables in the optimal table of Phase-1 does not contain artificial variables. So the given
problem has a feasible solution.
B.V x y z S1 S2
( Bi )
18 y 1 1 0 1 1 16
−
2 5 10 5
15 z 0 0 1 1
−
2 32
10 15 5
Zj 9 18 15 21 1 768
− −
10 5 5
Cj − Z j 3 0 0 21 1
10 5
768 16 32
The corresponding optimal solution is Min Z = , x = 0, y = , z =
5 5 5