7/30/2019 LP - II Lecture
1/69
Lectureon
Linear Programming
By
Dr. D. B. Naik (Ph.D.- Mech. Engg.)Professor, Training & PlacementSardar Vallabhbhai National Institute
of Technology, Surat
7/30/2019 LP - II Lecture
2/69
Difficulties in Simplex Procedure
1. Tie in selecting key column/key row.
2. Inequality of greater than or equal to kind.
3. Equality constraints.
4. Negative RHS.
5. Unrestricted variables.
6. Restricted variables.
7. Minimization Problem.
7/30/2019 LP - II Lecture
3/69
(1) Tie in selecting key column/Key row
Decision variable and slack or surplus
variable Select Decision variablecolumn
Decision variable and Decision variable
Select any one column
Slack/Surplus variable and Slack/Surplusvariable Select any one column
(A) Tie in selecting key column
7/30/2019 LP - II Lecture
4/69
aikare elements in key column.
Compare the ratio of aij to aikfor tiedrows first in identity from L to R and thenin body.
Key row Min. Positive ratio.
(B) Tie in selecting key row
7/30/2019 LP - II Lecture
5/69
02,1
)(8214
)(4214
)(122314/
212
xx
IIIxx
IIxx
Ixxts
xxZMax
Standard Form:
Max Z = 2x1+1x2+0w1+0w2+0w3
4x1+3x2+w1+0w2+0w3 = 12
4x1+x2+0w1+w2+0w3 = 8
4x1-x2+0w1+0w2+w3 = 8
Simplex Method-A Case for Tie
in selecting keyrow
7/30/2019 LP - II Lecture
6/69
bi x1 x2 w1 w2 w3
Ij Z = 0
Ij = (Zj-cj) = (aij.ci) - cj
cj 2 1 0 0 0
Tableau-I
12 4 3 1 0 0
8 4 1 0 1 0
8 4 -1 0 0 1
ci xi
0 w1
0 w2
0 w3
0 0 0
Ratio
3
2
2
-2 -1
Tie
7/30/2019 LP - II Lecture
7/69
bi x1 x2 w1 w2 w3
Ij Z = 0
cj 2 1 0 0 0
Tableau-I
12 4 3 1 0 0
8 4 1 0 1 0
8 4 -1 0 0 1
ci xi
0 w1
0 w2
0 w3
0 0 0
Ratio
3
2
2
-2 -1
Tie
7/30/2019 LP - II Lecture
8/69
bi w1 w2 w3 x1 x2
Ij Z = 0 0 0
cj 0 0 0 2 1
Tableau-I : Rewritten in required form
12 1 0 0 4 3
8 0 1 0 4 1
8 0 0 1 4 -1
ci xi
0 w1
0 w2
0 w3
0 -2 -1
1/4 = 0.25
0/4 = 0
Tie
Ratio
3
2
2
Ratio : 0/4 - R2
0/4 - R3 Key Row
7/30/2019 LP - II Lecture
9/69
(2) Constraints with inequality
greater than or equaltokind
....1)(10....
18112213
182213
AMsZMax
Asxx
xx
7/30/2019 LP - II Lecture
10/69
(3) Equality Constraints.
n
j
ijij
n
j
ijij
n
j
ijij
bxa
bxabxa
1
11
&
n
j
iijij bAxa1
)(OR
7/30/2019 LP - II Lecture
11/69
(4) Negative R.H.S.
n
j
ijij
n
j
ijij bxabxa11
)(
If xis unrestricted then x is changedto
(x - x), where x & x are positive.
(5) Unrestricted Variables.
7/30/2019 LP - II Lecture
12/69
50)( xi
(6) Restricted Variables.
10'05'
55)(
xxx
xiii
5'0,5'
105)(
xxx
xii
7/30/2019 LP - II Lecture
13/69
(7) Minimization
Problem
7/30/2019 LP - II Lecture
14/69
Methods to Solve
Minimization Problem
A. Maximization Method
B. Minimization Method
C. Two Phase Method
D. Dual Simplex Method
7/30/2019 LP - II Lecture
15/69
(A) Maximization Method :Convert Minimization Problem into
Maximization Problem & solve
n
1jjj
n
1jjj xcZMax.xcZMin.
)()(
7/30/2019 LP - II Lecture
16/69
(B) Minimization Method:
Same methodology as Maximization
except
criterion of selecting key column &Coeff. of A changed to :
Key column Max. + ve Index Number.
Co-eff. of A in Obj. eq. = +M
7/30/2019 LP - II Lecture
17/69
(C) Two Phase Method:
Consider Cj = -1 for only A, else Cj = 0
and Get Final Usual Tableau
In Phase- I : For a Maximization Problem
All Cj = Original values in Final
Tableau of Phase I and Get
Optimal Solution
In Phase- II : Consider
7/30/2019 LP - II Lecture
18/69
(D) Dual Simplex Method
This method is applicable to any Standard
Maximizaion Problem with - Ve RHS
First Key Row is selected w.r.t. Max. Ve RHS
Key Column is selected w.r.t. Max. (I/ aij) for
-ve aij only
7/30/2019 LP - II Lecture
19/69
(A)Maximization Method
02,1
)(62
)(41
)(182213/
2513
xx
IIIx
IIx
Ixxts
xxZMin
Convert this into maximization problem.
7/30/2019 LP - II Lecture
20/69
02,1
)(62
)(41)(182213/
2513)(
xx
IIIx
IIxIxxts
xxZMax
Convert this into Standard form.
7/30/2019 LP - II Lecture
21/69
Standard Form :
Max (-Z) = -3x1-5x2+0s1+(- M)A1+0w1+0w2
3x1+2x2-s1+A1+0w1+0w2 = 18
1x1+0x2-0s1+0A1+1w1+0w2 = 4
0x1+1x2-0s1+0A1+0w1+1w2 = 6
bl
7/30/2019 LP - II Lecture
22/69
ci xi bi x1 x2 s1 A1 w1 w2
Ij Z= -18M
Ij = (Zj-cj) = (aij.ci) - cj
cj -3 -5 0 -M 0 0Tableau - I
18 3 2 -1 1 0 0
4 1 0 0 0 1 0
6 0 1 0 0 0 1
-M A1
0 w1
0 w2
0 0 0-3M -2M M
+3 +5
bl
7/30/2019 LP - II Lecture
23/69
ci xi bi x1 x2 s1 A1 w1 w2
-2M M 3M
+5 -3
cj -3 -5 0 -M 0 0Tableau - II
-M A1
-3 x1
0 w2
1
0
0
0
1
0
0
0
1
0 1
1 00
26
4
6
0
-1 -3
Ij Z= -6M
-12
0 00
T bl III
7/30/2019 LP - II Lecture
24/69
ci xi bi x1 x2 s1 A1 w1 w2
0
cj -3 -5 0 -M 0 0Tableau - III
-5 x2
-3 x1
0 w2
3
4
6
Ij Z= -27 0 0M
-5/2
9/25/2
Hence, Optimal Solution is
x1=4, x2=3 giving Zmax = -27 ,
Zmin=27.
7/30/2019 LP - II Lecture
25/69
(B)Minimization Method
02,1
)(62
)(41
)(182213/
2513
xx
IIIx
IIx
Ixxts
xxZMin
Convert this into Standard form.
7/30/2019 LP - II Lecture
26/69
Standard Form:
Min Z = 3x1+5x2+0s1+MA1+0w1+0w2
3x1+2x2-s1+MA1+0w1+0w2 = 18
1x1+0x2-0s1+0A1+1w1+0w2 = 4
0x1+1x2-0s1+0A1+0w1+1w2 = 6
T bl I
7/30/2019 LP - II Lecture
27/69
ci xi bi x1 x2 s1 A1 w1 w2
3M 2M -M
-3 -5
cj 3 5 0 M 0 0Tableau - I
3 2 -1 1 0 0
1 0 0 0 1 0
0 1 0 0 0 1
Rati6
4
Key Column Max Ij
M A1
0 w1
0 w2
Ij Z= 18M 0 0 0
18
4
6
T bl II
7/30/2019 LP - II Lecture
28/69
ci xi bi x1 x2 s1 A1 w1 w2
Ij Z= 6M 0 2M -M 0 -3M 0
+12 -5 +3
cj 3 5 0 M 0 0Tableau - II
M A1 6 0 2 -1 1 -0 0
3 x1 4 1 0 0 0 1 0
0 w2 6 0 1 0 0 0 1
Rati3
6
T bl III
7/30/2019 LP - II Lecture
29/69
ci xi bi x1 x2 s1 A1 w1 w2
0 0 -1 -M -3M 0
+1 +3
Tableau - III
Hence, Optimal Solution is
x1=4, x2=3 giving Z = 27.
cj 3 5 0 M 0 0
5 x2
3 x1
0 w2
3
4
3
Ij Z = 27
7/30/2019 LP - II Lecture
30/69
(C) Two Phase Method
02,1
)(62
)(41
)(182213/
2513
xx
IIIx
IIx
Ixxts
xxZMin
Convert this into maximization
7/30/2019 LP - II Lecture
31/69
02,1
)(62
)(41)(182213/
2513)(
xx
IIIx
IIxIxxts
xxZMax
Convert this into Standard form.
7/30/2019 LP - II Lecture
32/69
3x1+2x2-s1+A1+0w1+0w2 = 18
1x1+0x2 -0s1+0A1 +w1+0w2 = 4
0x1+1x2- 0s1+0A1+0w1+w2 = 6
cj = -1 for only A, else cj = 0
Standard Form:
(Phase- I)
Max (-Z) = 0x1+0x2+0s1-1A1+0w1+0w2
Phase I : Tableau I
7/30/2019 LP - II Lecture
33/69
ci xi bi x1 x2 s1 A1 w1 w2
Ij Z= -18
Ij = (Zj-cj) = (aij.ci)-cj
cj 0 0 0 -1 0 0Phase I : Tableau - I
18 3 2 -1 1 0 0
4 1 0 0 0 1 0
6 0 1 0 0 0 1
-1 A1
0 w1
0 w2
0 0 0-3 -2 1
Phase I : Tableau II
7/30/2019 LP - II Lecture
34/69
ci xi bi x1 x2 s1 A w1 w2
-2 1 3
cj 0 0 0 -1 0 0Phase I : Tableau - II
-1 A1
0 x1
0 w2
1
0
0
0
1
0
0
0
1
0 1
1 00
26
4
6
0
-1 -3
Ij Z= -6 0 00
Phase I : Tableau - III
7/30/2019 LP - II Lecture
35/69
ci xi bi x1 x2 s1 A1 w1 w2
cj 0 0 0 -1 0 0Phase I : Tableau - III
0 x2
0 x1
0 w2
0
1
0
0
0
1
1
3/21/2
3
4
3
0
-1/2 -3/2
Ij Z= 0 0 000 0 1
1
0
0
1/2
0
-1/2
Phase II : Tableau - I
7/30/2019 LP - II Lecture
36/69
ci xi bi x1 x2 s1 A1 w1 w2
cj -3 -5 0 -M 0 0Phase II : Tableau - I
-5 x2
-3 x1
0 w2
0
1
0
0
0
1
1
3/21/2
3
4
3
0
-1/2 -3/2
Ij Z= -27 0 000 1-1
+M
1
0
0
1/2
0
-1/2
Hence, Optimal Solution is
x1=4, x2=3 giving Zmax = -27 , Zmin=27
7/30/2019 LP - II Lecture
37/69
(D) Dual Simplex Method
02,1
)(62
)(41
)(182213/
2513
xx
IIIx
IIx
Ixxts
xxZMin
Convert this into maximization
7/30/2019 LP - II Lecture
38/69
02,1
)(62
)(41)(182213/
2513)(
xx
IIIx
IIxIxxts
xxZMax
Convert this into Standard format.
7/30/2019 LP - II Lecture
39/69
Standard Form:
Max (-Z) = -3x1-5x2+0w1+0w2+0w3
-3x1-2x2+w1+0w2+0w3 = -18
x1+0x2+0w1+w2+0w3= 4
0x1+1x2+0w1+0w2+w3 = 6
7/30/2019 LP - II Lecture
40/69
02,1
)(62)(41
)(182213/
2513)(
xx
IIIx
IIx
Ixxts
xxZMax
Convert this into Standard form.
To pre
pare initial Tableau:
7/30/2019 LP - II Lecture
41/69
bi x1 x2 w1 w2 w3
Ij Z = 0
cj -3 -5 0 0 0
To prepare initial Tableau:
Tableau - I
-18 -3 -2 1 0 0
4 1 0 0 1 0
6 0 1 0 0 1
ci xi
0 w1
0 w2
0 w3
0 0 0
Ratio: 3/-3 5/-2
=-1 =-2.5
3 5
Key Column
Max Ratio
Tableau II
7/30/2019 LP - II Lecture
42/69
Ij Z =-18
cj -3 -5 0 0 0Tableau - II
bi x1 x2 w1 w2 w3c
i
xi
-3 x1
0 w2
5 w3
0
1
06
-2
6
3 1 00 0
1
0
0
0
0
11
-2/3
-1/32/3
0
1/3
Ratio: 3/(-2/3)
=-9/2
Tableau III
7/30/2019 LP - II Lecture
43/69
Ij Z = -27
Tableau - III
bi x1 x2 w1 w2 w3ci xi-3 x1
-5 x2
0 w3
0 0 03/2 1/2
33
4
cj -3 -5 0 0 0
Hence, Optimal Solution is
x1=4, x2=3 giving Zmax= -27 and Zmin =27.
7/30/2019 LP - II Lecture
44/69
Cases forAlternative Optimal Solution
Unbounded Solution,
Infeasible Solution and
Unrestricted Variable throughSimplex.
f
7/30/2019 LP - II Lecture
45/69
02,1
)(321
)(242213
)(302312/
2416
xx
IIIxx
IIxx
Ixxts
xxZMax
Standard Form:
Max Z = 6x1+4x2+0w1+0w2+0s1+(M)A1
2x1+3x2+w1+0w2+0s1+0A1 = 30
3x1+2x2+0w1+w2+0s1+0A1 = 24
x1+x2+0w1+0w2- s1+A1 = 3
Case forAlternative
Optimal Solution
7/30/2019 LP - II Lecture
46/69
ci
xi
bi
x1 x2 w1 w2 s1 A1
Ij Z= 48 0 0 0 2 0 M
cj 6 4 0 0 0 -M
0 w1 14 0 5/3 1 -2/3 0 0
0 s1 5 0 -1/3 0 1/3 1 -1
6 x1 8 1 2/3 0 1/3 0 0
Rati8.4
-
12
Final TableauOptimal Solutionis
x1=8, x2=0
giving Z = 48.
7/30/2019 LP - II Lecture
47/69
ci
xi
bi
x1 x2 w1 w2 s1 A1
Ij Z= 48 0 0 0 2 0 M
cj 6 4 0 0 0 -M
4 x2 42/5
0 s1 39/5
6 x1 12/5
Alternative Optimal Solutionis
x1=12/5 , x2= 42/5giving Z =48.
C f
7/30/2019 LP - II Lecture
48/69
02,1
)(12
)(101
)(6221/
2513
xx
IIIx
IIx
Ixxts
xxZMax
Standard Form:
Max Z = 3x1+5x2+0w1+0w2+0s1+(M)A1
x1-2x2+w1+0w2+0s1+0A1 = 6
x1+0x2+0w1+w2+0s1+0A1 = 10
0x1+x2+0w1+0w2- s1+A1 = 1
Case forUnbounded
Solution
7/30/2019 LP - II Lecture
49/69
ci
xi
bi
x1 x2 w1 w2 s1 A1
Ij Z= -M -3 -M 0 0 M 0
-5
cj 3 5 0 0 0 -M
0 w1 6 1 -2 1 0 0 0
0 w2 10 1 0 0 1 0 0
-M A1 1 0 1 0 0 -1 1
Rati-
1
Tableau-I
7/30/2019 LP - II Lecture
50/69
b
ix1 x2 w1 w2 s1 A1
Ij Z= 5 -3 0 0 0 -5 2M
+5
cj 6 4 0 0 0 -M
ci xi
0 w1
0 w2
5 x2
8
10
1
1 0 1 0 -2 -2
1 0 0 1 0 0
0 1 0 0 -1 1
All aij
7/30/2019 LP - II Lecture
51/69
7/30/2019 LP - II Lecture
52/69
ci
xi
bi
x1 x2 w1 s1 A1
Ij Z= -3M M 2 M M 0
+20 +6
cj 6 4 0 0 -M
4 x2 5 1 1 1 0 0
-M A1 3 -1 0 -1 -1 1
Final Tableau As A1 = 3 in final tableu,Solution is infeasible.
Case for
7/30/2019 LP - II Lecture
53/69
edunrestrictxx
IIxxIxxts
xxZMin
2,01
)(82513)(1221/
241
As x2 is unrestricted
x2 = x2 - x2Hence the problem is converted to
Case forUnrestricte
d Variable
Case for
7/30/2019 LP - II Lecture
54/69
0"2,'2,1
)(8"25'2513
)(1"22'221/
"24'241
xxx
IIxxx
Ixxxts
xxxZMin
Convert Minimization Problem into
Maximization Problem
Case forUnrestricte
d Variable
Case for
7/30/2019 LP - II Lecture
55/69
0"2,'2,1
)(8"25'2513
)(1"22'221/
"24'241)(
xxx
IIxxx
Ixxxts
xxxZMax
Standard Form:
Max(-Z) = -x1-4x2+4x2+0s1+(-M)A1+0w1
x1+2x2-2x2-s1+A1+0w1 = 1
3x1-5x2+5x2+0s1+0A1+w1 = 8
Case forUnrestricte
d Variable
Case for Unrestricted Variable
7/30/2019 LP - II Lecture
56/69
bi x1 x2 x2 s1 A1 w1
Ij Z = -M
Ij = (Zj-cj) = (aij.ci)-cj
cj
-1 - 4 4 0 -M 0Tableau - I
1 1 2 -2 -1 1 0
14 3 -5 5 0 0 1
ci xi
-M A1
0 w1
2M M
-4
-M -2M
+1 +4
Case for Unrestricted Variable
0 0
Case for Unrestricted Variable
7/30/2019 LP - II Lecture
57/69
bi x1 x2 x2 s1 A1 w1
Ij Z = 2
cj
-1 -4 4 0 -M 0Tableau - II
1/2 1 -1 -1/2 1/2 0
11/2 0 0 -5/2 5/2 1
ci xi
-4 x2
0 w1
0 2 -2 0
+M
-1 0
Case for Unrestricted Variable
1/2
33/2
Case for Unrestricted Variable
7/30/2019 LP - II Lecture
58/69
bi x1 x2 x2 s1 A1 w1
Ij Z = -1
cj
-1 -4 4 0 -M 0Tableau - III
1 2 -2 -1 1 0
0 -11 11 3 -3 1
ci xi
-1 x1
0 w1 -2 1 -1 0
+M
0 2
Case for Unrestricted Variable
1
11
Case for Unrestricted Variable
7/30/2019 LP - II Lecture
59/69
bi x1 x2 x2 s1 A1 w1
Ij Z = 1
cj
-1 -4 4 0 -M 0Tableau - IV
3
1
ci xi
-1 x1
4 x2
0 +ve +ve +ve0 0
Case for Unrestricted Variable
Hence Optimal Solution isx1=3, x2=1, x2=0
x1 = 3, x2 = x2-x2= -1 giving Zmin = -1
7/30/2019 LP - II Lecture
60/69
Duality and
Primal Dual Relationship
Duality:Data for LPP (Primal) Formulation.
7/30/2019 LP - II Lecture
61/69
y ( ) .
Factory: Two products P1 & P2
Profit/piece of P1 = Rs.6/-Profit/piece of P2 = Rs.8/-.
Time Constraint:
Time required/piece of P1 on m/c A= 30 hrs.
Time required/piece of P1 on m/c B= 5 hrs
Time required/piece of P2 on m/c A= 20 hrs
Time required/piece of P2 on m/c B= 10 hrs .
Max. time available on m/c A = 300 hrs.
Max. time available on m/c B = 110 hrs.
i i
7/30/2019 LP - II Lecture
62/69
Primal Problem Formulation
X1=No. of units of P1
X2=No. of units of P2
Max.Zp = 6 X1 + 8 X2
s/t 30 X1 + 20 X2 300
5 X1 + 10 X2 110
X1 , X2 0
Dual Problem Formulation
7/30/2019 LP - II Lecture
63/69
Dual Problem Formulation
Y1=Cost of 1 hr of m/c A
Y2=Cost of 1 hr of m/c B
Min. Zd = 300 Y1 + 110 Y2
s/t 30 Y1 + 5 Y2 6
20 Y1 + 10 Y2 8
Y1 , Y2 0
7/30/2019 LP - II Lecture
64/69
Primal - Dual Relationship
7/30/2019 LP - II Lecture
65/69
p
Primal (Max.) ( ) Dual (Min.) ( )
-----------------------------------------------------------No. of Variables No. of ConstraintsNo. of Constraints No. of VariablesObj. fn. Coeff. R.H.S.
R.H.S. Obj. fn. Coeff.jth Col. Of Coeff. jth Row of Coeff.ith relation ( ) ith Variable 0
jth Variable 0 jth relation ( )ith relation = ith variable unrestricted
jth variable unrestricted j th relation =
P i l P bl
7/30/2019 LP - II Lecture
66/69
Primal Problem
Max.Zp = X1+2X2 -3X3
s/t 2 X1 + X2 +X3 10
3 X1 - X2 =2 X3 110
X1 + 2X2 - X3 = 4
X1 , X3 0 , X3 unrestricted
To convert into Dual write in standard
format
P i l P bl St d d F t
7/30/2019 LP - II Lecture
67/69
Primal Problem : Standard Format
Max.Zp = X1+2X2 -3X3
s/t 2 X1 + X2 +X3 10
-3 X1 + X2 -2 X3 - 110
X1 + 2X2 - X3 = 4
X1 , X3 0 , X3 unrestricted
D l ill b
7/30/2019 LP - II Lecture
68/69
Dual will be
Min. Zd = 10 Y1 -110 Y2 +4 Y3
s/t 2 Y1 - 3 Y2 + Y3 1
Y1 + Y2 +2 Y3 = 2
Y1 - 2 Y2 - Y3 - 3
Y1 , Y2 0 , Y3 unrestricted
Thank you
7/30/2019 LP - II Lecture
69/69
Thank youFor any Query or suggestion :
Contact :Dr. D. B. NaikProfessor, Training & Placement
Sardar Vallabhbhai National Instituteof Technology, SuratIchchhanath, Surat - 395007
Email : [email protected] No. 0261-2255225 (O)