Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
If the LPP does not have such a structure of all constraints of <= type
with all RHS values >= 0, or all variables >=0, then we need to do some addditional work.
The discussions regarding additional work we would postpone for a while.
Now, for the case of all constraints <=, all variables >=0 and all RHS values >= 0, we continue
STEP III.
Cb
x1
x2
..
.
s1
s2
..
sm
Solution
s2
s3
..
sm
zj-cj
Now we are set to start executing the Simplex Alg.
We would take an example and illustrate the mechanics of the algorithm.
Before that, the anatomy of the Simplex Table, shown above needs elaboration.
This row is for the coefficients of each
variable in the objective function.
cj
Basis
Cb
x1
x2
..
.
s1
s2
..
sm
Solution
zj-cj
The column titled as Basis lists the set of basic
variables for that particular iteration.
The next set of rows titled as x1, x2.. S1, s2.. sm are for
the coeffiient of the variables in the system of
simultaneous equations.
This row called as zj-cj (or) Networth Row (or) Outgoing Incoming gives the net of "What we loose - What we
gain" in the objective function for unit increase in the
value of each of the variables.(thus it has one cell for
each variable)
From now the term Basic Feasible Solution would be abbreviated as BFS
In the above process, it moves from one Corner Point to an adjacent Corner Point in a Geometric Sense as illustrated be
R
S
Q
If the first chosen BFS is the one corresponding to the Corner Point P then the sequence is:
P > Q > R OR
P > S > R depending on certain conditions.
(Note: It is clear from the figure with the direction of improvement, R is the optimal soln.)
You may see, as it moves from P, it goes to Q which is adjacent to P a
nd then to R which is adjacent to Q.
Now, the question is: As the algorithm has to work with algebra how is the concept of adjacent
Corner Point captured.
Result: Two adjacent Corner Points differ only in
one Basic & one Non-Basic variable.
Consider the example of Product Mix which was solved Graphically. Refer to the Graph.
A is an adjacent Corner Point to O
At O, the Basic Variables are: s1, s2 & s3: Non-Basic Variables are : x1 & x2.
At A, the Basic Variables are: x1, s2 & s3: Non-Basic Variables are: s1 & x2.
Constraint 3
3x1+2x2=18
8
7
s2=x1=0
6D
Constraint
2
2x2<=12
s2=s3=0
Constraint 1
x1<=4
4
3
s1=s2=0
Constraint 3
3x1+2x2<=18
1
A
Non-Basic:
x1=x2=0
Non-Basic:
x2=s1=0
Basic:
s1, s2, s3
Basic:
x1, s2, s3
Note: At O, As two variables are at 0 value and we have only 2 Non-Basic Variables,
it has to be true the Non-Basic Variables have got be x1 & x2.
Thus, for two adjacent Corner Points two variables swap their roles:
from Basic to Non-Basic and vice- versa.
x2,
s1,
s2,
s3
=>
cj
Basic
s1
s2
Cb
0
0
3
x1
1
0
5
x2
0
2
0
s1
1
0
0
s2
0
1
0
s3 Soln
0
4
0
12
s3
zj-cj
18
0
Reenforcement Note: For an LP with all constriants <= and all RHS >=0
with all variables Non-Negative we have the Origin ie all decision
variables x1=x2..=0. The first table or the initial table will have s1, s2
as the BASIC VARIABLES and x1, x2 as Non-Basic variables.
As teh Non-Bsic Variables by defn are zero valued tey are not
written in the table.
Pl check: In Eqn 1, we have 1s1 with 0s2 & 0s3 with s1 in the Basis Column.
In Eqn 2, we have 1 s2 with 0 s1 & 0s3 with s2 in the Basis Column
In Eqn 3, we have 0s1, 0s2 and 1s3 with s3 in teh Basis Colum.
This enables us to simply "read-off" the values of the Basic Variables directly from the
table without any need for computations.
MORAL: "Basic Variable from Basis Column = Value in Soln Column"
Thus,
1. The table gives the values of the Basic Variables.
What about theNon-Basic Variables? As they are 0s by Defn, the table explicitly does
not state this.
2. The bottom right cell gives the Objective Function Value for the BFS represented by
this table. How is this computed?
It is the dot product of the columns Cb & Soln. ie 0*4 + 0*12 + 0*18 = 0.
Why is this so? The Cb Column gives the coefficient of the Basic Variables and the
Soln Col gives the values of these Basic Variables. So the product of these two
columns gives the contribution to the Objective Function from the Basic Variables.
The contribution from the Non-Baisc variables being zer as we need to multiply the
their coefficients with os, we need not bother about them.
The contribution from the Non-Baisc variables being zer as we need to multiply the
their coefficients with os, we need not bother about them.
2. Thus, the value of the objective function is the sum of term by term product of the
columns Cb & Soln.
(For the Initial Table table which has only slack variables as Basic Variables, Obj Fun
Value = 0).
12
18
s1
2x2+
3x1+ 2x2+
s2
s3
Cb
x2
0
0
0
0
2
2
zj = 0*0+0*2+0*2 =0
cj=5
Hence, zj-cj for x2 = 0-5 = -5
For s1, zj-cj =0
Cb
0
0
0
s1
1
0
0
(It is obvious for all Basic Variables because of 1 0 0 structrere, zj-cj= 1* a value - the same value from cj row!)
Thus zj -cj becomes
-3
-5
Question to ponder: The coeffficient of the variable whose increase by 1 unit is being
considered reflects the decrease in the basic variable of that equation.
Say in the above case: For Eqn 3
3x1+2x2+s3 = 18:
If x1 is increased, LHS increases by 3. To keep the eqn balanced, s3 must decresae by
3. Thus, the decrease in s3 is same as the coefficient of x1 in that eqn.
cj
Basic
s1
Iteration 0
s2
s3
zj-cj
Cb
0
0
0
3
x1
1
0
3
-3
5
x2
0
2
2
-5
0
s1
1
0
0
0
0
s2
0
1
0
0
0
s3 Soln
0
4
0
12
1
18
0
0
Among the Non-Basic variables, we look for the one with MOST NEGATIVE
value of zj-cj the same indicates, maximum increase in teh OBj Fun for unit
increase in the non-basic variable. In this case it x2.
ie. If we increase the Non-Basic variable x1 by 1, the net of what we loose -what
we gain is- 3. Or we effectively gain 3 units increase in Obj Fun.
Similarly we gain effectively 5 units if we increase x2 by 1.
We do not consider the Basic Variables as we
have them at the max possible value.
s1
s2
s3
Now the Minimum which occurs corresponding to s2 meas s2 becoms 0 and LEAVES THE
BASIS.
Leaves
cj
Basic Cb
s1
0
s2
0
s3
0
zj-cj
3
x1
1
0
3
-3
5
x2
0
2
2
-5
0
s1
1
0
0
0
0
s2
0
1
0
0
0
s3 Soln
0
4
0
12
1
18
0
0
Ratio
6
9
Min
cj
3
5
0
0
0
Basic Cb
x1
x2
s1
s2
s3 Soln
s1
0
0
1
0
Prev Eqn 2 is
x2
5
0
1
0
1/2
0
6
divided by 2
s3
0
0
1
18
zj-cj
0
0
Question to Ponder: Why do you think the MINmum of the ratios known as MIN RATIO is same as the value of the incoming
variable in the next table? (Hint: See how these ratios are computed based on the equations involved and what the minimum mea
We need to get x2 against x2 as 1 and 0 in the other two rows
To this we need to get 1 from 2. So we divide by 2 to get 1.
Thus we get
0 1 0 1/2 0 6. We can see that x2 getting the value of 6. Now
this row what is known as PIVOT ROW is frozen. This rwo is
used to update the remaining two rows to get teh GaussJordan structure.
In 1st row, where s1 is Basic var row, what we have & what we need are shown below:
x1
x2
s1
s2
s3
This is because x2 is now a Basic
s1
1
0
1
0
0
Variable & hence coefficient of x2 in
s1
0
1
0
s1 row has to be 0.
It so happens we already have this as in the original A matrix coefficient of
x2 in row 1 was 0
Hence, no need for any row operation
In 3rd row what we have and what we need are shown below:
x1
x2
s1
s2
s3
s3
3
2
0
0
1
This is because x2 is now basic and its
s3
0
0
1
coefficinet in s3 row has to be 0.
How to get 0 where we have a 2?
Multiply the Pivot Row by -2 and add to the existing
"'what we have " to get "what we need"
x2
x1
0
x2
2
s1
0
s2
1
s3
0
Soln
12
By dividing by 2
0
s3 Soln
0
4
0
6
1
6
0 30
Ratio
=4/1 =
4
Not Applicable
=6/3
2
Vector product of Cb & Soln
4*0+6*5+6*0 =30
Note zj-zj row computed using the Vectorroduct of Cb & the respective coulmns - cj
zj-cj
-3
0 5/2
30
0*0+1/2*5+(-1)*0 = -5/2
0*0+5*0+0*3-3 = -3
Check for Optimality: Since we still have a zj-cj < 0 (correcsonding to x1)
we ned to proceed.
Now the ENTERING VARIABLE is : x1 (As zj-cj is most -ve for x1
Leaving variable: See the ratios computed.
The raios are:
4 for s1
Not applicable for x2
2 for s3
Min ratio = Min (4,2) = 2 in favour of s3.
So s3 LEAVES
Important Note: The ratios are computed for only the cases where the coefficient of the
enteringnumber in the entering variable is > 0. (ie the denomitor number). This is as a result of the
analysis done earlier. Only if this number is positive, the current Basic Variable would decrease and
we need to see it does not decrease below 0.
x1
3
1
x2
0
0
s1
0
0
s2
-1
s3
1
Soln
6
cj
Basis Cb
s1
0
x2
5
x1
3
zj-cj
3
x1
5
x2
1
-3
0
0
0
s1
0
s2
0 -1/3
0 5/2
0
s3 Soln
1/3
0
2
30
x1
1
0
x2
0
0
s1
1
1
s2
0
s3
0
Soln
4
x1
0
0
x2
1
1
s1
0
0
s2
1/2
s3
0
Soln
6
cj
Basis Cb
s1
0
x2
5
x1
3
zj-cj
3
x1
0
0
1
0
5
x2
0
1
0
0
0
s1
1
0
0
0
0
0
s2
s3 Soln
1/3 -1/3
2
1/2
0
6
-1/3 1/3
2
5/2 1/3
36
WE HAVE MOVED TO C
WHERE
x1=2 & x2 = 6.
Thus, we have illustrated once
again the movement to
ADJACENT Corner Point.
Now since zi-cj => 0 for all the variables we have reached, OPTIMAL SOLUTION !
Question to ponder: If had shown how zj-cj value gives net of what we loose - what we gain for unit increase
in the Non-Basic Variable.
Thus, in the table befor the Optimal zj-cj for x1 = -3. Or cj-zj = 3.
This implies for every unit increase in x1 Obj Fun would increae by 3.
The MIN RATIO was 2. This means we can increase x1 by 2 units only.
Therefor the incraese in the Objective function due to increase of x1 from 0 to 2 should be 3*2 =6
You may verify this : We had Obj Fun value at 30. It increased to 36.
Do you agree that from zj-cj value of entering variable and the MIN RATIO, we should be able to get the value of OBJ FU
in the next table?
Question to ponder: In the above box while stating the steps of the algorithm I have reversed the Test for Optimality.
Why do you think the MIN RATIO is unaltered?
Another way to Solve MINIMIZATION PROBLEM:
Convert the Min LPP to Max LPP by multiplying all the obj fun coefficients by
1. Solve this LPP using the alg for Maximizaton problem.
At the end multiply the Obj Fun value by -1.
This is based on the principle Min Z = -Max (-Z)
It is computed as:
Min (Soln Coln number/Entering variable's coeeficient)
(provided entering variable's ce-efficient >0)
If all the Entering variable's coefficient is <=0, then the RATIO DOES NOT EXIST or it is
INFINITY. In this case what we infer is:
The zj-cj value of a Non-Basic variable being -ve for a MAX problem means by increasing the
value of that Non-Basic variable we can increase the value of teh Obj Fun. But the existenece
of teh ratios mean we may increase teh Non-Basic variable to ANY AMOUNT, INDEFINITELY
and No Danger to Non-Negativity. Thus we have in this case the inference being the LPP
being UNBOUNDED.
This is shown as an illustration
Basis
x3
x4
x5
x6
x8
x9
Cb
x1
x2
x7
-ve
0
0
-ve
0
-ve
xn
Soln
zj-cj
-ve
Entering variable: x7
Nothing stops us from increasing x7 forever to get better values of
objective function.
How to solve any LP even if we do not have an OBVIOUS INITIAL BASIC FEASIBLE SOLN.
this is violated)
>= 0, we continue
STEP 2: To find the OPTIMAL SOLUTION, (ie the point in the feasible region at which the
OBJECTIVE FUNCTION ATTAINS its MAXIMUM VALUE, we consider the
function 3x1+5x2.
An arbitrary constant is chosen for the Right Hand Side, say 15. Now we have
3x1+5x2 = 15 (represented by (Line 1). As we draw lines parallel to this on one side of , say
towards origin we woule be reducing the value of 3x1+5x2. To illustrate we have
3x1+5x2=7.5 As you move further towards origin and you draw a line parallel to to Line 1 or
Line 2 passing through origin, you would have Line 3: 3x1+5x2=0
It can be easily infered that as we move in the direction pointed out by the arrows (away
from the origin) we would be increasing the value of 3x1+5x2 and moving towards the
origin we would have reduced values of 3x1+5x2.
STEP 3: Keep drawing parallel lines to 3x1+5x2 = 15 ie. Line 1 and ultimately you would
have a line that passes through the Corner Point C. At D we have 3x1+5x2 assuming the
MAXIMUM value.
n-Basic Variables,
and hence 0.
olumn in the
LE WITH the
plicitly does
epresented by
oduct of the
ET WORTH"
eases to 6 from 0.
LEAVES THE
is now a Basic
oefficient of x2 in
0+6*5+6*0 =30
ctive coulmns - cj
1)*0 = -5/2
coefficient of the
er). This is as a result of the
c Variable would decrease and
s1 decreases by 1. Current s1
WE HAVE MOVED TO C
WHERE
x1=2 & x2 = 6.
Thus, we have illustrated once
again the movement to
ADJACENT Corner Point.
here is no point in
cj will enter.
Note There is
of MAXIMIZATION
j fun coefficients by -
Ratio
Not Applicable
Not Applicable
Not Applicable
Not Applicable
Not Applicable
Not Applicable
uld we go about