Notes
Notes
Notes
Example 1 : The following is a data for the Readymade Garment Production Unit.
Formulate the LPP from the data :
Solution :
➢ Objective Function
➢ Constraints :
A 12 0.8
B 20 1.7
C 45 2.5
The company has a daily order commitment for 20 units of product A and a total
of 15 units of products B and C.
Solution :
Transportation Problem
Diet Problem
• Diet is a very important aspect for the health of an individual. Specially for
the patients, diet plan has great importance. Suppose a doctor advises a
patient to have minimum of 3500 units of vitamins, 2800 units of calories
and 175 units of minerals. Suppose a person has three foods options having
different units of vitamins, calories and minerals, namely P, Q and R. One
unit of P, Q and R cost Rs. 55, Rs. 90 and Rs. 120 respectively. One unit of P
has 160 units of vitamins, 100 units of calories and 40 units of minerals.
One unit of Q has 125 units of vitamins, 140 units of calories and 70 units of
minerals. One unit of R has 180 units of vitamins, 50 units of calories and
100 units of minerals. Formulate the diet model to have the minimum
expenses.
• Diet is very important aspect for the health of an individual. Specially for
the patients, diet plan has great importance. Suppose a doctor advises a
patient to have minimum of 3500 units of vitamins, 2800 units of calories
and 175 units of minerals. Suppose a person has three foods options having
different units of vitamins, calories and minerals, namely P, Q and R. One
unit of P, Q and R cost Rs. 55, Rs. 90 and Rs. 120 respectively. One unit of P
has 160 units of vitamins, 100 units of calories and 40 units of minerals.
One unit of Q has 125 units of vitamins, 140 units of calories and 70 units of
minerals. One unit of R has 180 units of vitamins, 50 units of calories and
100 units of minerals. Formulate the diet model to have the minimum
expenses.
Defining Variables :
Let
Objective Function
Minimize Z = 55 x1 + 90 x2 + 120 x3
Constraints :
• Vitamins :
Constraints :
• Vitamins : 160 x1 + 125 x2 + 180 x3 3500
Non-negativity Conditions
x1, x2, x3 0
• The cost of affording a super unit is Rs 1800 per hour while that of a
medium unit is Rs 1200 per hour. Every defective item costs the company a
loss of Rs 300. There is an availability of only ten super units and fifteen
medium units. The company plans to assign work to the available units so
as to minimize the total daily cost of production. Formulation this problem
as an LP model.
Defining Variables :
Let
• Cost per hour = Rs. 1800 + Cost of loss occurred due to defective items
• Cost per hour = Rs. 1200 + Cost of loss occurred due to defective items
Objective Function
Minimize Z = 17600 x1 + 19200 x2
Constraints :
• Super units : x1 10
• Medium units : x2 15
Non-negativity Conditions
x1, x2 0
• Solve :
x1 + x2 30
x1 20
x2 12
Where x1, x2 0.
Solution :
Consider x1 + x2 = 30
X1 30 0 15
X2 0 30 15
• Consider x1 = 20 :
X1 20 20 20
X2 15 0 30
• Consider x2 = 12 :
X1 30 0 15
X2 12 12 12
Calculation of Z at the vertices :
x1 = 18 x2 = 12 & Maximum Z = 72
x2 40 Where x1, x2 0.
Solution :
• Consider x1 = 60 :
• Consider x2 = 40 :
• Solve :
• Minimize Z = - x1 + 2x2
- x1 + 3x2 10
x1 + x2 6
x1 - x2 2 Where x1, x2 0.
Optimal Feasible Solution is :
x1 = 2
x2 = 0
& Minimum Z = - 2
• Solve :
• Maximize Z = 2 x1 + x2
x1 + 2x2 10
x1 + x2 6
x1 - x2 2
One solution is : x1 = 0, x2 = 2
Other solution is : x1 = 2, x2 = 3
& Minimum Z = - 2
In fact, every point on the line - 0.5 x1 + x2 = 2 which lie in the first quadrant is
optimal feasible solution.
• Solve :
• Maximize Z = 10 x1 + 6x2
5 x1 + 3 x2 30
x1 + 2x2 18
Where x1, x2 0.
x1 - x2 1
x1 + x2 3
Where x1, x2 0.
• Solve :Minimize Z = 4 x1 + 3 x2
x1 + 2 x2 50
x1 + x 2 35 Where x1, x2 0.
Solve :
• Maximize Z = 4 x1 + 3 x2
-2 x1 + 3 x2 9
3 x1 - 2 x2 - 20
Where x1, x2 0.
• Example 1 : Solve :
• Maximize Z = 2 x1 + 5 x2
x1 + 4 x2 24
3 x1 + x2 21
x 1 + x2 9 Where x1, x2 0.
• Maximize Z = 4 x1 + 3 x2
x1 + 4 x2 2
3 x1 + 12 x2 15
Where x1, x2 0.
• Example 1 : Solve :
• Maximize Z = 2 x1 + 5 x2
x1 + 4 x2 24, 3 x1 + x2 21, x1 + x2 9
Where x1, x2 0.
x1 + 4 x2 2, 3 x1 + 12 x2 15
Where x1, x2 0.
Solution : Example 1:
It is useful only when the LPP has two variables. If LPP has more than two
variables, this method is not applicable.
Simplex Method
Subject to 3x1 + x2 ≤ 9
x1 + 2x2 ≤ 8
Where x1 , x2 ≥ 0
Step 2 :
3x1 + x2 + s1 =9
x1 + 2x2 + s2 = 8
Where x1 , x2 , s1 , s2 ≥ 0
Step : 3 : Table 1 :
Basis X X X s s Ratio x/x
1 2 1 2 2
s 9 3 1 1 0 9
1
s 8 1 2 0 1 4
2
∆ -40 -50 0 0
j
Step : 4 : Table 2 :
s 5 5/2 0 1 -1/2 2
1
X 4 1/2 1 0 ½ 8
2
∆ - 15 0 0 25
j
Step 5 : Table 3 :
Basis X X X s s
1 2 1 2
X 2 1 0 2/5 -1/5
1
X 3 0 1 0 3/5
2
∆ 0 0 0 175
j
Here, all ∆j ≥ 0. Hence, the present solution is an optimal feasible solution.
X1 = 2, X2 = 3
Notes :
• While selecting the ratio, we take the minimum positive ratio. We don’t
consider negative ratio or zero. However, if ratio is 0 and that 0 is obtained
by dividing 0 by a positive number, then we shall select the ratio 0 to decide
the outgoing variables from the basis.
• While selecting the ratio, if all rations are negative ratio, then the solution
is unbounded.
• If there is a tie in ∆j row while selecting a column, any one column can be
selected. However if there is tie between columns of decision variable and
slack variable, a column of decision variable should be selected.
• If there is a tie in ratios while selecting a row, any one row can be selected.
However number of iterations can be reduced by the following calculation.
s 8 1 4 1 0 2
1
s 4 1 2 0 1 2
2
∆ -40 -50 0 0
j
Take selected column and slack variable columns
Basis X s s
2 1 2
s 4 1 0
1
s 2 0 1
2
-50 0 0
Basis X s s
2 1 2
s 4 1/4 = ¼ 0/4 = 0
1
s 2 0/2 = 0 1/2 = ½
2
-50
• Here comparing ratios from left to right column-wise, the minimum ratio is
0/2 = 0. It appears in S2 row. So, variable S2 is selected to leave the basis.
Example : 2
Subject to
x1 + x2 ≤ 5
x1 + 3x2 ≤ 6
and x1, x2 ≥ 0
x1 = 5, x2 = 0
& Max Z = 15
Example : 3
MAX Z = 2 x1 + 5 x2 + 7 x3
x1 + x2 + x3 ≤ 100
x1 = 0, x2 = 50/3 , x3 = 50/3
Max Z = 200
Practice Sums :
Subject to x1 + x2 + 3x3 + 4x4 ≤ 60, x2 + 2x3 + 5x4 ≤ 50, 2x1 + 3x2 + 6x4 ≤ 72
Big - M Method :
• Used when at least one constraint has ≥ or = sign with RHS number non-
negative.
2x1 + x2 ≥ 10
Where x1 , x2 ≥ 0
Step 1 :
3x1 + 8x2 + S1 = 96
2x1 7+ x2 – S2 + A1 = 10
Where x1, x2, S1, S2, A1 ≥ 0
= (8 – 2M) x1 + (6 – M) x2 + M S2 + 10 M
Step : 2 : Table 1 :
Basis X X X s s A Ratio
1 2 1 2 1
x/?
s 96 3 8 1 0 0
1
A 10 2 1 0 -1 1
1
∆ 8-2M 6-M 0 M 0
j
Please Note :
• While Observing the last row to select the most negative, if any number is
3−8𝑀 3−8𝑀 3
of the form , then express it as = − 4𝑀 , and then compare
2 2 2
last row elements.
• If artificial variable leaves the basis ,it’s column also leaves from the table.
Step : 2 : Table 1 :
Basis X X X s s A Ratio
1 2 1 2 1
x/x
1
s 96 3 8 1 0 0 32
1
A 10 2 1 0 -1 1 5
1
∆ 8-2M 6-M 0 M 0
j
Step : 3 : Table 2 :
Basis X X X s s Ratio x/
1 2 1 2
s 81 0 13/2 1 3/2
1
x 5 1 1/2 0 -1/2
1
∆ 0 2 0 4
j
x1 = 5, x2 = 0
Minimum Z = 40
Solution :
x1 = 21/13 , x2 = 10/13
Minimum Z = 31/13
Subject to
2x1 + 3x2 ≤ 30
3x1 + 2x2 ≤ 24
x1 + x2 ≥ 3 and x1, x2 ≥ 0.
Solution :
x1 = 8 , x2 = 0
Maximum Z = 48
• Note : Look at the last table of the solution of the previous problem. Here,
we reached the optimal solution, but at the same time, we had in the last
row and x2 column, we had ‘zero’, but x2 not being in the basis. This
suggests that there are multiple solutions to this LPP. Next solution can be
obtained by selecting x2 column and proceeding from the last table.
Example 4 :
Subject to
2x1 + x2 ≤ 600
x1 + x2 ≤ 225
Solution :
x1 = 75 , x2 = 150
Maximum Z = 825
Example 1 :
Minimize Z = x1 + x2
Subject to 2x1 + x2 ≥ 4
x1 + 7x2 ≥ 7
and x1, x2 ≥ 0
Step 1 :
2 x1 + x2 - S1 + A1 =4
x1 + 7x2 – S2 + A2 =7
Minimize Z = A1
= 10 - 2x1 - x2 + S2
Step 1 :
3x1 + 8x2 + S1 = 96
2x1 + x2 – S2 + A1 = 10
Minimize Z = A1
= 10 - 2x1 - x2 + S2
Basis X X X s s A Ratio
1 2 1 2 1
x/?
s 96 3 8 1 0 0 32
1
A 10 2 1 0 -1 1 5
1
’
-2 -1 0 1 0
∆
j
∆ 8 6 0 0 0
j
Please Note :
• If artificial variable leaves the basis, it’s column also leaves from the table.
Basis X X X s s Ratio
1 2 1 2
s 81 0 13/2 1 3/2
1
x 5 1 1/2 0 -1/2
1
’
0 0 0 0
∆
j
∆ 0 2 0 4
j
Basis X X X s s Ratio
1 2 1 2
s 81 0 13/2 1 3/2
1
x 5 1 1/2 0 -1/2
1
∆ 0 2 0 4
j
x1 = 5, x2 = 0
Minimum Z = 40
Duality
in
Standard Form :
subject to: 4 y1 + 3 y2 ≥ 2, 5 y1 − 7 y2 ≥ 1, y1 ≥ 0, y2 ≥ 0.
• Subject to constraints,
Solution :
• Subject to constraints,
Example 3 :
• Subject to constraints,
• Subject to constraints,
• Subject to constraints,
Solution :
• Maximize W = 14y1+10y2+20y3+3y4+20y5
• Subject to constraints,
subject to: 1 x1 + 3 x2 ≤ 4,
1 x1 − 1 x2 = 2,
x1 ≥ 0, x2 ≥ 0.
subject to: 1 y1 + 1 y2 ≥ 2,
3 y1 − 1 y2 ≥ 1,
y1 ≥ 0, y2 is unrestricted.
• Example 1 : Maximize z = 2x1 + x2,
subject to: 1 x1 + 1 x2 ≤ 4,
3 x1 − 1 x2 ≤ 2,
x1 ≥ 0, x2 unrestricted.
subject to: 1 y1 + 3 y2 ≥ 2,
1 y1 − 1 y2 = 1,
y1 ≥ 0, y2 ≥ 0.
Advantage of Duals :
• Subject to constraints,
Solving by Big – M :
• Given variables : 5
• Surplus variables : 5
• Artificial variables : 5
• Maximize W = 14y1+10y2+20y3+3y4+20y5
• Subject to constraints,
• Maximize Z = - 3 x1 – 2x2
• Subject to constraints,
x1 + x2 ≥ 1
x1 + x2 7
x1 + 2x2 ≥ 10
x2 3, where x1, x2 ≥ 0
Step 1 :
Minimize (- Z) = 3 x1 + 2 x2
Step 2 :
- x1 - x2 - 1
x1 + x2 7
- x1 - 2x2 - 10
x2 3, where x1, x2 ≥ 0
Step 3 :
- x1 - x2 + s1 = - 01
x1 + x2 + s2 = 07
- x1 - 2x2 + s3 = - 10
x2 + s4 = 03,
Where x1 , x2 , s1 , s2 , s3 , s4 ≥ 0
Step 4 : Table : 1
Basis X X X s s s s
1 2 1 2 3 4
s -1 -1 -1 1 0 0 0
1
s 7 1 1 0 1 0 0
2
s -10 -1 -2 0 0 1 0
3
s 3 0 1 0 0 0 1
4
∆ 3 2 0 0 0 0
j
Step 4 : Table : 1
Basis X X X s s s s
1 2 1 2 3 4
s -1 -1 -1 1 0 0 0
1
s 7 1 1 0 1 0 0
2
s -10 -1 -2 0 0 1 0
3
s 3 0 1 0 0 0 1
4
∆ 3 2 0 0 0 0
j
Ratio -3 -1 - - 0 -
∆ /s
j 3
Step 5 : Table : 2
Basis X X X s s s s
1 2 1 2 3 4
s 4 -1/2 0 1 0 -1/2 0
1
s 2 1/2 0 0 1 1/2 0
2
X 5 1/2 1 0 0 -1/2 0
2
s -2 -1/2 0 0 0 1/2 1
4
∆ 2 0 0 0 1 0
j
Ratio
Step 6 : Table 3 :
Basis X X X s s s s
1 2 1 2 3 4
s 6 0 0 1 0 -1 -1
1
s 0 0 0 0 1 1 1
2
X 3 0 1 0 0 0 1
2
X 4 1 0 0 0 -1 -2
1
∆ 0 0 0 0 3 4
j
X1 = 4, X2 = 3
& Maximum Z = - 18