Sie sind auf Seite 1von 32

BITS Pilani

Hyderabad Campus
Optimization Lecture 6
BITS Pilani, Hyderabad Campus
Formulation of Linear Programming Problem (LPP) from
the real world problem
Solving LPP using Graphical method
Solving maximization LPP using Simplex method with
less than or equal to constraints
Solving minimization LPP using Simplex method with
less than or equal to constraints
Solving maximization and minimization with greater than
or equal to constraints and equal to constraints Big-M
Method
Topics we have discussed so
far
BITS Pilani, Hyderabad Campus
Solving maximization and minimization with greater than or
equal to constraints and equal to constraints Two Phase
Method

Todays Topic
Second method for handling artificial variables within
simplex
Has two phases
Phase I : finds a basic feasible solution for the original
problem, if one exists
Phase II : finds an optimal solution for original problem

BITS Pilani, Hyderabad Campus
Consider a linear programming problem consisting of
artificial variables
Objective: to set all artificial variables to zero at optimality
Hence, solve a linear programming problem by replacing
original objective function by sum of artificial variables with
a minimization objective
Observe: due to non-negativity constraint, sum of artificial
variables cannot be negative, i.e., smallest possible
feasible value of sum is zero
If optimal value of modified objective function is not zero
(i.e., strictly positive), conclude that problem is not feasible

Two-Phase Method

BITS Pilani, Hyderabad Campus
maximize z = -3x
1
+ x
3

subject to

x
1
+ x
2
+

x
3
+ x
4
= 4...........(1)
-2x
1
+ x
2
-

x
3
= 1...........(2)
3x
2
+ x
3
+

3x
4
= 10..............(3)
x
1
, x
2
, x
3
, x
4
0...........(4)
Observe: not in canonical form

Two-Phase Method

BITS Pilani, Hyderabad Campus
maximize z = -3x
1
+ x
3
subject to

x
1
+ x
2
+

x
3
+ x
4
+ x
5
= 4...........(1)
-2x
1
+ x
2
-

x
3
+ x
6
= 1...........(2)
3x
2
+ x
3
+

3x
4
+ x
7
= 10............(3)
x
1
, x
2
, x
3
, x
4
, x
5
, x
6
, x
7
0...(4)

Two-Phase Method

BITS Pilani, Hyderabad Campus
minimize r = x
5
+ x
6
+ x
7
i.e., maximize w = -x
5
- x
6
- x
7

subject to

x
1
+ x
2
+

x
3
+ x
4
+ x
5
= 4...........(1)
-2x
1
+ x
2
-

x
3
+ x
6
= 1...........(2)
3x
2
+ x
3
+

3x
4
+ x
7
= 10............(3)
x
1
, x
2
, x
3
, x
4
, x
5
, x
6
, x
7
0...(5)

Two-Phase Method

BITS Pilani, Hyderabad Campus
Basic
Vars
x
1
x
2
x
3
x
4
x
5
x
6
x
7
RHS
w
0 0 0 0 1 1 1 0
x
5

1 1 1 1 1 0 0 4
x
6

-2 1 -1 0 0 1 0 1
x
7
0 3 1 3 0 0 1 10
Two-Phase Method
BITS Pilani, Hyderabad Campus
Basic
Vars
x
1
x
2
x
3
x
4
x
5
x
6
x
7
RHS
w
1 -5 -1 -4 0 0 0 -15
x
5

1 1 1 1 1 0 0 4
x
6

-2 1 -1 0 0 1 0 1
x
7
0 3 1 3 0 0 1 10
Perform the elementary row operation R
1
= R
1
- (R
2
+ R
3
+ R
4
) to
make the table in canonical form
Two-Phase Method
BITS Pilani, Hyderabad Campus
Basic
Vars
x
1
x
2
x
3
x
4
x
5
x
6
x
7
RHS Ratio
w 1 -5 -1 -4 0 0 0 -15
x
5
1 1 1 1 1 0 0 4
4/1=4
x
6
-2 1 -1 0 0 1 0 1
1/1=1
x
7
0 3 1 3 0 0 1 10
10/3=3.33
Two-Phase Method
BITS Pilani, Hyderabad Campus
Basi
c
Vars
x
1
x
2
x
3
x
4
x
5
x
6
x
7
RHS Ratio
w -9 0 -6 -4 0 5 0 -10
x
5
3 0 2 1 1 -1 0 3
3/3=1
x
2
-2 1 -1 0 0 1 0 1
-----
x
7
6 0 4 3 0 -3 1 7
7/6=
1.3
Two-Phase Method
BITS Pilani, Hyderabad Campus
Basi
c
Vars
x
1
x
2
x
3
x
4
x
5
x
6
x
7
RHS Ratio
w 0 0 0 -1 3 2 0 -1
x
1
1 0 2/3 1/3 1/3
-1/3
0 1
1/1/3=3
x
2
0 1 1/3 2/3 2/3 1/3 0 3
9/2=
4.5
x
7
0 0 0 1 -2 -1 1 1
1/1=1
Two-Phase Method
BITS Pilani, Hyderabad Campus
Basic
Vars
x
1
x
2
x
3
x
4
x
5
x
6
x
7
RHS
w 0 0 0 0 1 1 1 0
x
1
1 0 2/3 0 1 0
-1/3
2/3
x
2
0 1 1/3 0 2 1
-2/3
7/3
x
4
0 0 0 1 -2 -1 1 1
Observe: all artificial variables are now non-basic, i.e.,
problem is feasible
Hence x
5
= x
6
= x
7
= 0
Initial basic feasible solution: x
1
=2/3, x
2
=7/3, x
4
=1
End of Phase I
Two-Phase Method
BITS Pilani, Hyderabad Campus
In Phase 2 we solve the original problem
Maximize z = -3x
1
+ x
3

Subject to
x
1
+ ()x
3
=
x
2
+ () x
3
=
x
4
= 1
x
1
, x
2
, x
3
0
with initial basic variables as x
1
, x
2
, x
4


Two-Phase Method

BITS Pilani, Hyderabad Campus
Basi
c
Vars
x
1
x
2
x
3
x
4
RHS
z 3 0 -1 0 0
x
1
1 0 2/3 0 2/3
x
2
0 1 1/3 0 7/3
x
4
0 0 0 1 1
Drop w row
Drop all artificial variable columns
Two-Phase Method
Not in canonical form Hence perform ERO : R
1
= R
1
3R
2

BITS Pilani, Hyderabad Campus
Basi
c
Vars
x
1
x
2
x
3
x
4
RHS Ratio
z 0 0 -3 0 -2
x
1
1 0 2/3 0 2/3 1
x
2
0 1 1/3 0 7/3 7
x
4
0 0 0 1 1 ---
Two-Phase Method
BITS Pilani, Hyderabad Campus
Basic
Vars
x
1
x
2
x
3
x
4
RHS
z
9/2
0 0 0 1
x
3
3/2 0 1 0 1
x
2
-1/2
0 0 0 2
x
4
0 0 0 1 1
Coefficients of all non-basic variables in the first row 0
Hence we have optimal solution
z=1, x
2
=2, x
3
=1, x
4
=1, x
1
= 0
Two-Phase Method
BITS Pilani, Hyderabad Campus
Infeasible Solution
Infeasibility is detected in the simplex method when an
artificial variable remains positive in the final tableau.
For Example consider the LPP
MAX z = 2x
1
+ 6x
2

s. t. 4x
1
+ 3x
2
< 12

2x
1
+ x
2
> 8

x
1
, x
2
> 0
BITS Pilani, Hyderabad Campus
Infeasible Solution
MAX z = 2x
1
+ 6x
2

s. t. 4x
1
+ 3x
2
+ S
1
= 12

2x
1
+ x
2
- S
2
+ A
1
= 8

x
1
, x
2
, S
1,
S
2
, A
1
> 0
BITS Pilani, Hyderabad Campus
Basic
Vars
x
1
x
2
S
1
S
2
A
1
RHS
z -2 1 0 0 M 0
S
1
4 3 1 0 0 12
A
1
2 1 0 -1 1 8
Basic
Vars
x
1
x
2
S
1
S
2
A
1
RHS Ratio
z -2-2M 1-M 0 M 0 -8M
S
1
4 3 1 0 0 12 3
A
1
2 1 0 -1 1 8 4
Infeasible Solution
BITS Pilani, Hyderabad Campus
Infeasible Solution
Basic
Vars
x
1
x
2
S
1
S
2
A
1
RHS
z 0 (5+M)/2 (1+M)/2 M 0 6-2M
x
1

1 3/4 1/4 0 0 3
A
1
0 -3/4 -1/4 0 0 3/2
BITS Pilani, Hyderabad Campus
Infeasible Solution

Basic
Vars
x
1
x
2
S
1
S
2
A
1
RHS
r 0 0 0 0 1 0
S
1

4 3 1 0 0 12
A
1
2 1 0 -1 1 8
Min r = A
1
s. t. 4x
1
+ 3x
2
+ S
1
= 12

2x
1
+ x
2
- S
2
+ A
1
= 8
x
1
, x
2
, S
1,
S
2
, A
1
> 0

BITS Pilani, Hyderabad Campus
Infeasible Solution
Basic
Vars
x
1
x
2
S
1
S
2
A
1
RHS
r -2 -1 0 1 0 8
S
1

4 3 1 0 0 12
A
1
2 1 0 -1 1 8
BITS Pilani, Hyderabad Campus
Solve the following linear programming problem by using the
simplex method:
Min Z =2 X
1
+ 3 X
2
S.t.
X
1
+ X
2
4
X
1
+ 3X
2
20
X
1
+ X
2
= 10
X
1
, X
2
0
BITS Pilani, Hyderabad Campus
Solution
Step 1: standard form
Min Z,
s.t.
Z 2 X
1
3 X
2
- M A
1
-M A
2
= 0
X
1
+ X
2
+ S
1
= 4
X
1
+ 3X
2
- S
2
+ A
1
= 20
X
1
+ X
2
+ A
2
= 10
X
1
, X
2
,S
1
, S
2
, A
1
, A
2
0
Where: M is a very large number
BITS Pilani, Hyderabad Campus

M, a very large number, is used to ensure that the values of A
1
and A
2
, ,
and A
n
will be zero in the final (optimal) tableau as follows:
1. If the objective function is Minimization, then A
1
, A
2
, , and A
n
must be
added

to the RHS of the objective function multiplied by a very large
number (M).
Example: if the objective function is Min Z = X
1
+2X
2
, then the obj. function
should be Min Z = X
1
+ X
2
+ MA
1
+ MA
2
+ + MA
n

OR
Z X
1
- X
2
- MA
1
- MA
2
- - MA
n
= 0

2. If the objective function is Maximization, then A
1
, A
2
, , and A
n
must be
subtracted from the RHS of the objective function multiplied by a
very large number (M).
Example: if the objective function is Max Z = X
1
+2X
2
, then the obj. function
should be Max Z = X
1
+ X
2
- MA
1
- MA
2
- - MA
n

OR
Z - X
1
- X
2
+ MA
1
+ MA
2
+ + MA
n
= 0

N.B.: When the Z is transformed to a zero equation, the signs are chang
BITS Pilani, Hyderabad Campus
Basic
variables
X
1
2
X
2
3
S
1
0
S
2
0
A
1
M
A
2
M
RHS
S
1
1 0 0 0 4
A
1
1 3 0 -1 1 0 20
A
2
1 1 0 0 0 1 10
Z -2 -3 0 0 -M -M 0
BITS Pilani, Hyderabad Campus
To correct this violation before starting the simplex algorithm,
the elementary row operations are used as follows:
New (Z row) = old (z row) M (A
1
row) M (A
2
row)
In our case, it will be positive since M is negative in the Z row,
as following:
Old (Z row): -2 -3 0 0 -M -M 0
M (A1 row): M 3M 0 -M M o 20M
M (A2 row): M M 0 0 0 M 10M
New (Z row):2M-2 4M-3 0 -M 0 0 30M
BITS Pilani, Hyderabad Campus
Basic
variables
X
1
2
X
2
3
S
1
0
S
2
0
A
1
M
A
2
M
RHS
S
1
1/2 1/4 1 0 0 0 4
A
1
1 3 0 -1 1 0 20
A
2
1 1 0 0 0 1 10
Z
2M-2 4M-3 0 -M 0 0 30M
BITS Pilani, Hyderabad Campus
Basic
variables
X
1
2
X
2
3
S
1
0
S
2
0
A
1
M
A
2
M
RHS
S
1
5/12 0 1 1/12 -1/12 0 7/3
X
2
1/3 1 0 -1/3 1/3 0 20/3
A
2
2/3 0 0 1/3 -1/3 1 10/3
Z
2/3M-1 0 0 1/3M-1 1-4/3M 0 20+10/3M
BITS Pilani, Hyderabad Campus
Basic
variables
X
1
X
2
S
1
S
2
A
1
A
2
RHS
S
1
0 0 1 -1/8 1/8 -5/8 1/4
X
2
0 1 0 -1/2 1/2 -1/2 5
X
1
1 0 0 1/2 -1/2 3/2 5
Z
0 0 0 -1/2 -M 3/2-M 25
BITS Pilani, Hyderabad Campus
In the final tableau, if one or more artificial variables (A
1
, A
2
, ) still
basic and has a nonzero value, then the problem has an infeasible
solution
If there is a zero under one or more nonbasic variables in the last
tableau (optimal solution tableau), then there is a multiple optimal
solution.
When determining the leaving variable of any tableau, if there is no
positive ratio (all the entries in the pivot column are negative and
zeroes), then the solution is unbounded.

Das könnte Ihnen auch gefallen