Sunteți pe pagina 1din 69

Lecture

on
Linear Programming

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.

(1) Tie in selecting key column/Key row


(A) Tie in selecting key column
Decision variable and slack or surplus
variable Select Decision variable
column
Decision variable and Decision variable
Select any one column
Slack/Surplus variable and Slack/Surplus
variable Select any one column

(B) Tie in selecting key row


aik are elements in key column.
Compare the ratio of aij to aik for tied
rows first in identity from L to R and then
in body.
Key row Min. Positive ratio.

Max Z 2 x1 x 2

Simplex Method
s / t 4 x1 3x 2 12 ( I ) -A Case for Tie
4 x1 x 2 8 ( II ) in selecting key
row
4 x1 x 2 8
x1, x 2 0

( III )

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

Tableau-I
1
0
0 0
w1 w2 w3
3
1
0
0

Ratio

cj
2
bxii x1 x2
4
w1 12
4
w2 8

w3 8

-1

Ij

Z=0

-2

-1

ci
0

Ij = (Zj-cj) = (aij.ci) - cj

3
Tie

Tableau-I
1
0
0 0
w1 w2 w3
3
1
0
0

Ratio

cj
2
bxii x1 x2
4
w1 12
4
w2 8

w3 8

-1

Ij

Z=0

-2

-1

ci
0

3
Tie

Tableau-I : Rewritten in required form


cj
0 0
0
w1 w2 w3 x1

2
x2

ci

bxii

w1 12
w2 8

w3 8

-1

2 Tie
2

Ij

Z=0

-2

-1

Ratio :

Ratio

0/4 1/4 = 0.25 - R2


0/4 0/4 = 0

- R3 Key

Row

(2) Constraints with inequality


greater than or equal to kind

3 x1 2 x 2 18
3 x1 2 x 2 s1 A1 18
Max. Z ... 0 s1 ( M ) A1 ....

(3) Equality Constraints.


n

a x
j 1

ij

bi

a x
j 1

ij

bi &

aij x j bi
j 1

OR

(a x
j 1

ij

Ai ) bi

(4) Negative R.H.S.


n

a x
j 1

ij

bi ( aij x j ) bi
j 1

(5) Unrestricted Variables.


If x is unrestricted then x is changed
to
(x - x), where x & x are positive.

(6) Restricted Variables.

(i ) 0 x 5

(ii ) 5 x 10
x x'5, 0 x' 5
(iii ) 5 x 5
x x'5 0 x' 10

(7) Minimization
Problem

Methods to Solve
Minimization Problem
A. Maximization Method
B. Minimization Method
C. Two Phase Method
D. Dual Simplex Method

(A) Maximization Method :


Convert Minimization Problem into
Maximization Problem & solve
n

j 1

j 1

Min. Z c j x j Max.( Z ) (c j ) x j

(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

(C) Two Phase Method:


In Phase- I : For a Maximization Problem
Consider Cj = -1 for only A, else Cj = 0
and Get Final Usual Tableau

In Phase- II : Consider
All Cj = Original values in Final
Tableau of Phase I and
Get Optimal Solution

(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

(A) Maximization Method


Min Z 3 x1 5 x 2
s / t 3 x1 2 x 2 18 ( I )
x1 4
( II )
x2 6
x1, x 2 0

( III )

Convert this into maximization problem.

Max( Z ) 3 x1 5 x 2
s / t 3 x1 2 x 2 18 ( I )
x1 4

( II )

x2 6
x1, x 2 0

( III )

Convert this into Standard form.

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

Tableau - I

cj
bi

-3
x1

-5 0 -M 0
0
x2 s1 A1 w1 w2

-1 1

0
1 0 0
Z= -18M -3M -2M M 0
+3 +5

0
0

1
0

ci xi
-M A1 18
0 w1 4
0
Ij

w2

Ij = (Zj-cj) = (aij.ci) - cj

Tableau - II

-3

x1 4

w2 6

-3 -5 0 -M 0
0
x1 x2 s1 A1 w1 w2
2 -1 1 -3 0
0
0 1
1 0 0
0
0 0
0 1 0
1

Ij

Z= -6M

ci

xi

cj
bi

-M A1 6

-12

-2M M
+5

0 3M
-3

Tableau - III
cj
bi

ci

xi

-5

x2 3

-3

x1 4

w2 3

-3 -5 0 -M 0
0
x1 x2 s1 A1 w1 w2

0 5/2 M 9/2 0
-5/2
Hence, Optimal Solution is

Ij

Z= -27

x1=4, x2=3 giving Zmax = -27 ,


Zmin=27.

(B) Minimization Method

Min Z 3 x1 5 x 2
s / t 3 x1 2 x 2 18 ( I )
x1 4
( II )
x2 6
x1, x 2 0

( III )

Convert this into Standard form.

Standard Form:
Min Z = 3x1+5x2+0s1+MA1+0w1+0w2
3x1+2x2-s1+A1+0w1+0w2 = 18
1x1+0x2-0s1+0A1+1w1+0w2 = 4
0x1+1x2-0s1+0A1+0w1+1w2 = 6

Tableau - I

cj
bi

3
5
0
x1 x2 s1

M 0
0
A1 w1 w2Ratio

ci

xi

A1 18

-1

w1 4

w2 6

Ij

Z= 18M 3M 2M -M

-3 -5
Key Column Max Ij

Tableau - II
cj
bi

ci

xi

A1 6

-1

M 0
0
A1 w1 w2Ratio
1 -0 0 3

3
0

x1 4
w2 6

1
0

0
1

0
0

0
0

Ij

Z= 6M

2M -M 0

-3M 0

-5

+3

+12

3
5
0
x1 x2 s1

1
0

0
1

Tableau - III
cj
ci
5

xi bi
x2 3

x1 4

w2 3

x1 x2

s1

A1 w1 w2

Ij
Z = 27 0
0
-1 -M -3M 0
Hence, Optimal Solution is +1 +3
x1=4, x2=3 giving Z = 27.

(C) Two Phase Method

Min Z 3 x1 5 x 2
s / t 3 x1 2 x 2 18 ( I )
x1 4
( II )
x2 6
x1, x 2 0

( III )

Convert this into maximization problem.

Max( Z ) 3 x1 5 x 2
s / t 3 x1 2 x 2 18 ( I )
x1 4

( II )

x2 6
x1, x 2 0

( III )

Convert this into Standard form.

Standard Form:
cj = -1 for only A, else cj = 0

(Phase- I)

Max (-Z) = 0x1+0x2+0s1-1A1+0w1+0w2


3x1+2x2-s1+A1+0w1+0w2 = 18
1x1+0x2 -0s1+0A1 +w1+0w2 = 4
0x1+1x2- 0s1+0A1+0w1+w2 = 6

Phase I : Tableau - I
ci
-1

cj
bi

xi
A1 18
w1 4

w2 6

Ij

Z= -18

0
0
0
x1 x2 s1

-1 0
0
A1 w1 w2

-1 1

-3

-2

0
1 0

0
0

1
0

Ij = (Zj-cj) = (aij.ci)-cj

Phase I : Tableau - II
ci
-1
0
0
Ij

cj
0
0 0 -1 0
xi bi x1 x2 s1 A w1
A1 6
0 2 -1 1 -3
0 0 1
x1 4
1 0
0 0 0
0 1
w2 6
Z= -6

-2

1 0

0
w2
0
0
1
0

Phase I : Tableau - III


cj
bi

0
x1

ci

xi

x2 3

0 0 -1 0
0
x2 s1 A1 w1 w2
1 -1/2 1/2 -3/2 0

x1 4

w2 3

Ij

Z= 0

1 0
1/2 -1/2 3/2 1
0

Phase II : Tableau - I

-5 x2 3

-3 -5 0 -M 0
0
x1 x2 s1 A1 w1 w2
0 1 -1/2 1/2 -3/2 0

-3 x1 4

w2 3

ci

0
Ij

xi

cj
bi

1 0
1/2 -1/2 3/2 1
0

5/2 -5/2 9/2 0


+M
Hence, Optimal Solution is
Z= -27

x1=4, x2=3 giving Zmax = -27 , Zmin=27

(D) Dual Simplex Method

Min Z 3 x1 5 x 2
s / t 3 x1 2 x 2 18 ( I )
x1 4
( II )
x2 6
x1, x 2 0

( III )

Convert this into maximization problem.

Max( Z ) 3 x1 5 x 2
s / t 3 x1 2 x 2 18 ( I )
x1 4

( II )

x2 6
x1, x 2 0

( III )

Convert this into Standard format.

Max( Z ) 3 x1 5 x 2
s / t 3 x1 2 x 2 18 ( I )
x1 4
x2 6
x1, x 2 0
Convert this into Standard form.

( II )
( III )

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

To prepare initial Tableau:


Tableau - I

0
0 0
w2 w3
1
0
0

cj -3 -5
bxii x1 x2 w1
w1 -18 -3 -2
1
0
w2 4

w3 6

Ij

Z=0

ci
0

Ratio:

1
5

0
0
3/-3 5/-2 Key Column
Max Ratio
=-1 =-2.5

Tableau - II
ci
-3
0
0
Ij

cj -3 -5 0 0
xi bi x1 x2 w1 w2
1 2/3 -1/3 0
x1 6
0 -2/3 1/3 1
w2 -2
0 1 0 0
w3 6
1 0
0 3
Z =-18

Ratio:

3/(-2/3)
=-9/2

0
w3
0
0
1
0

Tableau - III
cj

ci

xi bi

-3
0

x1 4
x2 3
w3 3

Ij

Z = -27

-5

-3
x1

-5

x2 w1 w2

0 3/2

1/2

0
w3

Hence, Optimal Solution is


x1=4, x2=3 giving Zmax= -27 and Zmin =

Cases for
Alternative Optimal Solution
Unbounded Solution,
Infeasible Solution and
Unrestricted Variable through
Simplex.

Max Z 6 x1 4 x 2
Case for
s / t 2 x1 3x 2 30 ( I ) Alternative

Optimal
Solution
3x1 2 x 2 24 ( II )
x1 x 2 8
x1, x 2 0

( III )

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 = 8

cj
bi

6
4
0
0 0 -M
x1 x2 w1 w2 s1 A1Ratio

ci

xi

w1 14

5/3

-2/3 0

s1

-1/3 0

1/3 1

0 8.4
-1 -

x1

2/3

1/3 0

0 12

Ij

Z= 48

Final Tableau

Optimal Solution is
x1=8, x2=0 giving Z = 48.

cj
bi

ci

xi

x2 42/5

s1 39/5

x1 12/5

Ij

Z= 48

6
4
0
0 0 -M
x1 x2 w1 w2 s1 A1

Alternative Optimal Solution is


x1=12/5 , x2= 42/5 giving Z =48.

Max Z 3x1 5 x 2
s / t x1 2 x 2 6
x1 10
x2 1
x1, x 2 0

Case for
( I ) Unbounded
Solution
( II )
( III )

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

cj
bi

3
5
0
0 0 -M
x1 x2 w1 w2 s1 A1Ratio

ci

xi

w1 6

-2

w2 10

-M A1 1

-1 1

Ij

-3

-M

Z= -M

-5

Tableau-I

ci xi

cj
bi

0 w1

-2 -2

0 w2

10 1

5 x2

-1

Z= 5 -3

-5

2M

Ij

6
4
0
0 0 -M
x1 x2 w1 w2 s1 A1

All aij<= 0 w.r.t. key column. Hence,


Solution is unbounded.

+5

Max Z 6 x1 4 x 2
s / t x1 x 2 5
x2 8

(I )
( II )

Case for
Infeasible
Solution

x1, x 2 0

Standard Form:
Max Z = 6x1+4x2+0w1+0s1+(-M)A1
x1+x2+w1+0s1+0A1 = 5
0x1+x2+0w1- s1+A1 = 8

ci

xi

cj
bi

6
4
0
0 -M
x1 x2 w1 s1 A1

x2

-M A1 3

-1

-1

-1

Ij

Z= -3M
+20

+6

Final Tableau As A1 = 3 in final tableu,


Solution is infeasible.

Min Z x1 4 x 2
s / t x1 2 x 2 1

Case for
Unrestricte
( Id) Variable

3 x1 5 x 2 8 ( II )
x1 0, x 2 unrestrict ed
As x2 is unrestricted
x2 = x2 - x2
Hence the problem is converted to

Min Z x1 4 x 2'4 x 2"

Case for
Unrestricte
( Id) Variable

s / t x1 2 x 2'2 x 2" 1
3 x1 5 x 2'5 x 2" 8 ( II )
x1, x 2' , x 2" 0

Convert Minimization Problem into


Maximization Problem

Case for
Max ( Z ) x1 4 x 2'4 x 2"
Unrestricte
s / t x1 2 x 2'2 x 2" 1 ( Id) Variable
3 x1 5 x 2'5 x 2" 8 ( II )
x1, x 2' , x 2" 0
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 for Unrestricted Variable


Tableau - I
cj -1 -4
ci bxii x1 x2 x2
1
2
-M A1 1
3
-5
0
w1 8
Ij

4
0 -M 0
s1 A1 w1
-2 -1 1
0
5

Z = -M -M -2M 2M M

+1 +4
Ij = (Zj-cj) = (aij.ci)-cj

-4

0
0

1
0

Case for Unrestricted Variable


Tableau - II
cj -1 -4
ci xbi i x1 x2 x2
-4 x2 1/2 1/2 1
0 w1 21/2 11/2 0

4
s1

0 -M 0
A1 w1

-1

-1/2 1/2 0

-5/2 5/2 1

Ij

Z=2

-1

-2
+M

Case for Unrestricted Variable


Tableau - III
ci xbi i
-1
0
Ij

x1
w1

cj -1 -4 4
0 -M 0
x1 x2 x2 s1 A1 w1
1
1 2
-2 -1
1
0
5

Z = -1

0
0

-11 11
2

-2

3
1

-3
-1 0
+M

Case for Unrestricted Variable


Tableau - IV

cj -1 -4 4
0 -M 0
ci xbii x1 x2 x2 s1 A1 w1
-1 x1 1.9
4 x2 0.4
5
Ij
Z=1
0
0 0 +ve +ve +ve
Hence Optimal Solution is
x1=1.9, x2=0.45, x2=0
x1 = 1.9, x2 = x2 - x2= 0.45 giving Zmin

Duality and
Primal Dual Relationship

Duality:Data for LPP (Primal) Formulation.


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.

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


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

Final Tableau of Primal


ci
6
8

xi
x1
x2

cj 6
bi X1

8
X2

0
w1

4
9

1
0

0
1

1/20 -1/10
-1/40 3/20

1/10

Zp = 96

0
w2

6/10

The Optimal Solution of Primal is


X1 = 4, X2 = 9 giving Zp = 96
The Optimal Solution of Dual from Primal
solution is
Y1 = 1/10, Y2 = 6/10 giving Zd = 96

Primal - Dual Relationship


Primal (Max.) ( )
Dual (Min.) ( )
----------------------------------------------------------No. of Variables
No. of Constraints
No. of Constraints
No. of Variables
Obj. 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 =

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 , X2 unrestricted
To convert into Dual write in standard

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 , X2 unrestricted

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