Professional Documents
Culture Documents
Note
In some cases there can be more than 1 optimal
solution
A constraint whose removal does not change the
feasible region is called redundant constraint
Assumptions in LP
Certainity - contribution of the decision variable to the
objective function has to be known.
Additivity Value of the objective function and the total
amount of each of the resources used must be equal to
the sum of the respective individual contribution. Total
profit=sum of the individual profits.
Linearity : There has to be proportionality
Divisibility.
Simplex Method
Advantages
Gives improving answers
Should not solve infeasible solutions
Terminate when optimum is reached
Points to remember
Inequalities are converted into equalities by adding
slack variables
We assume that there is a solution and start the
problem
The slack variables dont affect the objective function
Even the slack variables take up a value greater than or
equal to zero value.
Initially we will start with a basic feasible solution and
after iterations get the optimum value.
Step 1
Convert the in equalities to equalities
X1
X2
X3
X4
Coefficients
correspondi
ng to
variables in
Obj. Fn.
variables
STEP 2
Coefficients
of Basic
Variables in
Objective
function
X1
X2
X3
X4
RHS
X3
X4
12
Basic
Variables
Coefficients
of Variables
in the
constraints
Right hand
side in the
constraints
Correspondi
ng to the
basic
variables
we have a
identity
X1
X2
X3
X4
RHS
X3
X4
12
Cj-Zj
Calculate Cj-Zj
{C1Z1}
{C2-Z2
}
{ C3-Z3
}
{C4-Z4
}
{Zj }
Step 3
6
X1
X2
X3
X4
RHS
X3
X4
12
Cj-Zj
{C1Z1}
{C2-Z2
}
{ C3-Z3
}
{C4-Z4
}
{Zj }
Z1 = [(0*1)+(0*3] hence C -Z = 6 1
[(0*1)+(0*3]= 6
Similarly calculate the other values of the cells
X1
X2
X3
X4
RHS
X3
X4
12
Cj-Zj
Step 4
Entering Variable
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
Step 4
Entering Variable
Leaving Variable
6
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
5
0
Pivot
Element
Among Cj-Zj identify the greatest positive value. The
variable corresponding to that variable is the entering
variable
Pivot Row
Step 5
Replace the variable X4 by X1 and change the
coefficients. The table after modification looks like the
following
6
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
X1
Next step is to fill the values for the Variable X1 in the Table
Step 6
Divide the Pivot row by the Pivot element
6
X1
X2
X3
X4
RHS
X3
X4
12
2/3
1/3
CJ-ZJ
X3
X1
Step 6
Divide the Pivot row by the Pivot element
6
X1
X2
X3
X4
RHS
X3
1 (B)
X4
12
2/3
1/3
CJ-ZJ
X3
X1
A
1 (C)
Step 6 continued
6
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
X1
2/3
1/3
Step 6 continued
6
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
1/3
-1/3
X1
2/3
1/3
CJ-ZJ
Now calculate Cj-Zj and value
Step 6 continued
6
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
1/3
-1/3
X1
2/3
1/3
-2
24
CJ-ZJ
Step 7
6
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
1/3
-1/3
X1
2/3
1/3
CJ-ZJ
0
1
0
Among Cj-Zj identify
the greatest positive value. The
variable corresponding to that variable is the entering
variable
-2
24
Step 8
6
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
1/3
-1/3
X1
2/3
1/3
CJ-ZJ
-2
24
Step 9
Replace the variable X3 by X2 and change the
coefficients. The table after modification looks like the
following
6
5
0
0
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
1/3
-1/3
X1
2/3
1/3
CJ-ZJ
X2
X1
-2
Next step is to fill the values for the Variable X2 in the Table
24
Step 10
Divide the Pivot row by the
Pivot element
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
1/3
-1/3
X1
2/3
1/3
CJ-ZJ
X2
X1
1
0
0
1
-2
3
24
-1
Step 10
6
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
1/3
-1/3
X1
2/3 (B)
1/3
CJ-ZJ
5
X2
-2
24
1 (C)
-1
6
X1
(A )
We have to get the identity matrix corresponding to the basic
variable so operate the row corresponding the variable X2 using the
elements in the row corresponding to X1. Let us assume the
element is A then A = [ B-(2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25
35
0
3
4
7
56
5/7
20/7
45/7
480/7
5
5
5
70
10
25/3
7
15/4
20/7
35
5
-45/2
Solution
Algorithm terminates with
X1=5
X2=5
Z=70
Avariablethatleavescanre-enter
Everyiterationhasuniquevariables
Wedontcomputewhendividingnumberisnegativeor0
Dontwritethecellvaluesindecimalform,writeonlyinfractionalform.
Minimization Problems
Problem 1
Minimize Z = 3x1 + 4x2
subject to:
2x1 + 3x2 8
5x1 + 2x2 12
x1, x2 0
2x1 + 3x2 x3 = 8
5x1 + 2x2 x4 = 12
x1, x2,x3,x4 0
x3,x4 are called surplus variables.
2x1 + 3x2 x3 = 8
5x1 + 2x2 x4 = 12
x1, x2,x3,x4 0
-3
-4
-M
-M
X1
X2
X3
X4
a1
a2
RHS
-M
a1
-M
a2
-3
-4
-M
-M
X1
X2
X3
X4
a1
a2
RHS
-M
a1
-1
-M
a2
-1
12
Cj-Zj
-3
-4
-M
-M
X1
X2
X3
X4
a1
a2
RHS
-M
a1
-1
-M
a2
-1
12
7M-3
5M-4
-M
-M
Cj-Zj
-3
-4
-M
-M
X1
X2
X3
X4
a1
a2
RHS
-M
a1
-1
-M
a2
-1
12
7M-3
5M-4
-M
-M
Cj-Zj
-3
-4
-M
-M
X1
X2
X3
X4
a1
a2
RHS
-M
a1
-1
-M
a2
-1
12
12/5
7M-3
5M-4
-M
-M
Cj-Zj
*We dont calculate Z because we still have the artificial variable in the
solution
-3
-4
-M
-M
RHS
-M
a1
-M
a2
Cj-Zj
-M
a1
-3
X1
X1
X2
X3
X4
a1
a2
-1
-1
12
7M-3
5M-4
-M
-M
4
12/5
-3
-4
-M
-M
RHS
-M
a1
-M
a2
Cj-Zj
X1
X2
X3
X4
a1
a2
-1
-1
12
7M-3
5M-4
-M
-M
-M
a1
11/5
-1
2/5
-2/5
16/5
-3
X1
2/5
-1/5
1/5
12/5
Cj-Zj
4
12/5
-3
-4
-M
-M
RHS
-M
a1
-M
a2
Cj-Zj
X1
X2
X3
X4
a1
a2
-1
-1
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11
16/11
-3
X1
2/11
-3/11
20/11
Cj-Zj
-3
-4
0
RHS
X1
X2
X3
X4
-4
X2
-5/11
2/11
16/11
-3
X1
2/11
-3/11
20/11
-14/11
-1/11
-124/11
Cj-Zj
Solution is
X1=20/11
X2=16/11
Z=124/11
Why 2 phase method? It eliminates the Big M and it is easy for computer programming.
Example 1
Complete Linear Programming Model:
MaximizeZ = 4x1 + 3x2
subject to:
2x1 + 3x2 8
3x1 + 2x2 12
x1, x2 0
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
Assuming there is no tie breaking rule, let us arbitrarily leave one of the
variable
There is
a tie
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
5/3
-2
X1
2/3
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
5/3
-2
X1
2/3
1/3
-4
16
CJ-ZJ
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
5/3
-2/3
X1
2/3
1/3
1/3
-4
16
CJ-ZJ
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
5/3
-2
X1
2/3
1/3
-4
16
CJ-ZJ
3
X2
X1
CJ-ZJ
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
5/3
-2/3
X1
2/3
1/3
1/3
-4
16
CJ-ZJ
3
X2
3/5
-2/5
X1
-2/5
3/5
CJ-ZJ
X1
X2
X3
X4
RHS
X3
X4
12
CJ-ZJ
X3
5/3
-2
X1
2/3
1/3
-4
16
CJ-ZJ
3
X2
3/5
-6/5
X1
-2/5
9/5
-1/5
-18/5
16
CJ-ZJ
Comparison of solution
Solution 1
X1=4,X2=X3=X4=0 and Z=16
Solution 2
X1=4,X2=X3=X4=0 and Z=16
When you end up doing more than the required number of iterations then the condition
is called degeneracy.
When there is tie condition in the theta value then degeneracy will occur.
Degeneracy can happen in the middle of the iterations also.
Degeneracy do not prevent you from getting a optimal solution
In case of Tie we can use the minimum subscript rule, but it is not necessary that you
will avoid degeneracy.
Degeneracy is a Limitation of the Simplex method.
X1
X2
X3
X4
RHS
X3
25
X4
15
CJ-ZJ
X1
X2
X3
X4
RHS
X3
25
X4
15
CJ-ZJ
X1
X2
X3
X4
RHS
X3
25
25/8
X4
15
15/3
CJ-ZJ
X1
X2
X3
X4
RHS
X3
25
25/8
X4
15
15/3
CJ-ZJ
X1
3/4
1/8
25/8
X4
7/4
-3/8
45/8
X1
X2
X3
X4
RHS
X3
25
25/8
X4
15
15/3
CJ-ZJ
X1
3/4
1/8
25/8
X4
7/4
-3/8
45/8
CJ-ZJ
X1
X2
X3
X4
RHS
X3
25
25/8
X4
15
15/3
CJ-ZJ
X1
3/4
1/8
25/8
X4
7/4
-3/8
45/8
-1/2
100/8
CJ-ZJ
X1
X2
X3
X4
RHS
X3
25
25/8
X4
15
15/3
CJ-ZJ
X1
3/4
1/8
25/8
25/6
X4
7/4
-3/8
45/8
45/14
-1/2
100/8
CJ-ZJ
X1
X2
X3
X4
RHS
X3
25
25/8
X4
15
15/3
CJ-ZJ
X1
3/4
1/8
25/8
25/6
X4
7/4
-3/8
45/8
45/14
-1/2
100/8
CJ-ZJ
4
X1
X2
CJ-ZJ
X1
X2
X3
X4
RHS
X3
25
25/8
X4
15
15/3
CJ-ZJ
X1
3/4
1/8
25/8
25/6
X4
7/4
-3/8
45/8
45/14
-1/2
100/8
CJ-ZJ
4
X1
2/7
-3/7
5/7
X2
-3/14
4/7
45/14
CJ-ZJ
X1
X2
X3
X4
RHS
X3
25
25/8
X4
15
15/3
CJ-ZJ
X1
3/4
1/8
25/8
25/6
X4
7/4
-3/8
45/8
45/14
-1/2
100/8
CJ-ZJ
4
X1
2/7
-3/7
5/7
X2
-3/14
4/7
45/14
-1/2
25/2
CJ-ZJ
Comparison of solution
Solution 1
X1=25/8,X2=X3=0,X4=45/8 and Z=16
Solution 2
X1=5/7,X2=45/14, X3=X4=0 and Z=16
There is an alternative solution.
When maximum Cj-Zj value is 0 then it indicates that there is an alternative solution.
This happens when the objective function is parallel to one of the constraint and it is
binding.
This can be better explained with the help of a graph
In fact there are more than 2 solutions. But Simplex switches between the corner
points.
X1
X2
X3
X4
RHS
X3
-6
X4
11
CJ-ZJ
X1
X2
X3
X4
RHS
X3
-6
X4
11
CJ-ZJ
X1
X2
X3
X4
RHS
X3
-6
X4
11
CJ-ZJ
5
11/3
X1
X2
X3
X4
RHS
X3
-6
X4
11
CJ-ZJ
X3
X1
5
11/3
X1
X2
X3
X4
RHS
X3
-6
X4
11
CJ-ZJ
X3
-6
-1/3
4/3
X1
1/3
11/3
11/3
X1
X2
X3
X4
RHS
X3
-6
X4
11
CJ-ZJ
5
11/3
X3
-6
-1/3
4/3
--
X1
1/3
11/3
--
-4/3
CJ-ZJ
-M
X1
X2
X3
X4
a1
RHS
X3
a1
-1
12
CJ-ZJ
-M
X1
X2
X3
X4
a1
RHS
X3
a1
-1
12
3M+4
M+3
-M
CJ-ZJ
-M
X1
X2
X3
X4
a1
RHS
X3
a1
-1
12
3M+4
M+3
-M
CJ-ZJ
-M
X1
X2
X3
X4
a1
RHS
X3
a1
-1
12
3M+4
M+3
-M
CJ-ZJ
X3
-M
a1
-11
-3
-1
-11-13
-3M-4
-M
Cj-Zj
Problem is infeasible
Termination condition
All non basic variables have a negative value for Cj-Zj
All the basic variables have a Cj-Zj=0
At least one basic variable has Cj-Zj=0 indicates
alternate solution.
Algorith finds a entering variable but not a leaving
variable, then it is unboundedness.
All the non basic variable has a value less than 0 for
Cj-Zj, also artificial variable exists then it is infeasible
If simples algorithm fails to terminate then it is called
cycling- very rare condition.
Example
MaximizeZ = 4x1 + 5x2
subject to:
2x1 + 3x2 8
x1 + 4x2 10
x1 is unrestricted, x2 0
-4
0
RHS
X5
X6
Cj-Zj
X2
X3
X4
X5
X6
-2
-1
10
-4
0
RHS
X5
X6
Cj-Zj
X2
X3
X4
X5
X6
-2
-1
10
-4
-4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