LP 2
LP 2
4.1 Introduction
So far during the finding of an optimal solution to a maximization problem using the primal
simplex method the assumption that there exists m basis vectors has been used. suppose we
have less than m vectors then we introduce another variable to make them m.
Definition 4.1.1 A technique for solving linear programming problems in which artificial
variables are assigned cost coefficients which are a very large number M , say, M = 1035 .
subject to Ax = b
and x ≥ 0
With
(i) Basic variables not feasible (RHS=-ve), which results into
(ii) less than m basic variables in an m constraint problem (since with a negative in a standard
form, not feasible, multiply by a negative-when already have the equal sign- makes what
had been a basic variable no longer, since coefficient 1 will now be −1).
Let the problem be transformed to,
Max z = cx − M S (4.2)
subject to Ax + S ≤ b
and x, S ≥ 0
We add artificial variables si to have more Basic variables, and subtract them from the objective
but all with coefficient −M on each. e.g
Max z = cx − M s1 − M s2 − M s3
73
4.2. THE METHOD
(a) all s = 0 in the solution then an optimal solution to problem (12) is found.
(b) atleast one sj > 0 in the final solution then no solution exists to the original problem (12)
ie the solution space is undefined.
Definition 4.2.1 The variable introduced in the Lp problem (13) is called the Artificial
variable.
Note 4.2.1 M is relatively large so that it will be larger than any number it will be compared
with during the carrying out of the simplex algorithm computations.
Example 4.2.1
Solution
(a) Convert the LP problem into canonical form by supplying slack variables.
(b) Convert the LP problem into standard form by supplying slack variables.
(d) Now that one of the equations has no basic variable, we introduce an artificial variable
x5 .
cj 2 5 0 0 -M 0
cBj xB x1 x2 x3 x4 x5 x̄B
0 x3 2 -1 1 0 0 8
-M x5 6 -4 0 -1 1 24
zj − cj -6M - 2 4M - 5 0 M 0 -24M
The last (and third) tableau will generate the optimal solution is
x?1 = 4, x?2 = 0, x?3 = 0, x?4 = 0, x?5 = 0 and z = 8
Solve the following Lp problems using the Big - M method that’s by the use of artificial variables.
Exercise 4.1
max z = 3x1 − x2
subject to x1 + x2 ≥ 1
x1 + 2x2 ≤ 8
x1 ≤ 2
x1 , x2 ≥ 0
Exercise 4.2
Example 4.2.2
Not in standard form because there is no basic variable in the fourth equation. Therefore we
add an artificial variable to that equation (s1 ) and give it a larger negative coefficient in the
objective function, to penalize it:
cj 3 4 0 0 0 0 -M 0
cBj xB x1 x2 x3 x4 x5 x6 s1 x̄B
0 x3 2 1 1 0 0 0 0 600
0 x4 1 1 0 1 0 0 0 225
0 x5 5 4 0 0 1 0 0 1000
−M s1 1 2? 0 0 0 -1 1 150
zj − cj −3 − M −4 − 2M 0 0 0 M 0 -150M
The minimum in zj − cj is −4 − 2M : Then 600 3
= 200, 125
1
= 125, 1000
4
= 250, 150
2
= 75
The minimum is the last, thus 2 is our pivot.
cj 3 4 0 0 0 0 -M 0
cBj xB x1 x2 x3 x4 x5 x6 s1 x̄B
0 x3 1.5 0 1 0 0 0.5 -0.5 525
0 x4 0.5 0 0 1 0 0.5? -0.5 150
0 x5 3 0 0 0 1 2 -2 700
4 x2 0.5 1 0 0 0 -0.5 0.5 75
zj − cj -1 0 0 0 0 -2 ? 300
Note 4.2.2 If the artificial variable si = 0 after solving, then the LP has a solution since
would be similar to the original problem before introducing the M in the objective. If si 6= 0
for any i, then solution does not exist, so Big M method fails.
Note 4.2.3 Minimizing with Big M is complicated, need to first put into maximize.
Example 4.2.3 Maximize the Objective Function (P)
subject to
Class 4.2.1
min z = 4x1 + x2
subject to 3x1 + x2 = 3
4x1 + 3x2 ≥ 6
x1 + 2x2 ≤ 4
x1 , x2 ≥ 0
max π = −4x1 − x2
subject to 3x1 + x2 = 3
4x1 + 3x2 ≥ 6
x1 + 2x2 ≤ 4
x1 , x2 ≥ 0
max π = −4x1 − x2
subject to 3x1 + x2 = 3
−4x1 − 3x2 ≤ −6
x1 + 2x2 ≤ 4
x1 , x2 ≥ 0
max π = −4x1 − x2
subject to 3x1 + x2 = 3
−4x1 − 3x2 + s1 = −6
x1 + 2x2 + s2 = 4
x1 , x2 ≥ 0
max π = −4x1 − x2
subject to 3x1 + x2 = 3
4x1 + 3x2 − s1 = 6
x1 + 2x2 +s2 = 4
x1 , x2 ≥ 0
max π = −4x1 − x2 − M R1 − M R2
subject to 3x1 + x2 +R1 = 3
4x1 + 3x2 − s1 +R2 = 6
x1 + 2x2 +s2 = 4
x1 , x2 ≥ 0
cj -4 -1 0 -M -M 0 0
cBj xB x1 x2 s1 R1 R2 s2 x̄B
-M R1 3? 1 0 1 0 0 3
-M R2 4 3 -1 0 1 0 6
0 s2 1 2 0 0 0 1 4
zj − cj -7M+4 -4M+1 M 0 0 0 -9M
1 1
-4 x1 1 3
0 3
0 0 1
5? −4
-M R2 0 3
-1 3
1 0 2
5 −1
0 s2 0 3
0 3
0 1 3
−5M −1 7M −4
zj − cj 0 3
M 3
0 0 -2M-4
1 3
-4 x1 1 0 5 5
−3 −4 3 6
-1 x2 0 1 5 5 5
0 5
?
0 s2 0 0 1 -1 1 1
−1 −18
zj − cj 0 0 5
∗ ∗ 0 5
2
-4 x1 5
9
-1 x2 5
0 s1 1
1 −17
zj − cj 0 0 0 ∗ ∗ 5 5
2 9 −17
Which gives x1 , x2 , s1 , s2 , R1 , R2 ; maxπ = 5
, 5
, 1, 0, 0, 0; 5
:
17
minz =
5
Example 4.2.4
Max p = 2x1 + x2
subject to 3x1 − x2 ≥ 6
2x1 + 3x2 ≤ 12
x1 , x2 ≥ 0
Max p = 2x1 + x2
subject to −3x1 + x2 ≤ −6
2x1 + 3x2 ≤ 12
x1 , x2 ≥ 0
Max p = 2x1 + x2
subject to −3x1 + x2 + x3 = −6
2x1 + 3x2 + x4 = 12
x1 , x2 , x3 , x4 ≥ 0
Max p = 2x1 + x2
subject to 3x1 − x2 − x3 = 6
2x1 + 3x2 +x4 = 12
x1 , x2 , x3 , x4 ≥ 0
Max p = 2x1 + x2 − M s1
subject to 3x1 − x2 − x3 +s1 = 6
2x1 + 3x2 +x4 = 12
x1 , x2 , x3 , x4 ≥ 0
cj 2 1 0 0 -M 0
cBj xB x1 x2 x3 x4 s1 x̄B
-M s1 3? -1 -1 0 1 6
0 x4 2 3 0 1 0 12
zj − cj -3M-2 M-1 M 0 0 -6M
−1 −1 1
2 x1 1 3 3
0 3
2
11 ? 2 −2
0 x4 0 3 3
1 3
8
−5 −2 2
zj − cj 0 3 3
0 3
+M 4
−3 1 3 30
2 x1 1 0 11 11 11 11
2 ? 3 −2 24
1 x2 0 1 11 11 11 11
−4 5 4 84
zj − cj 0 0 11 11 11
+M 11
3 1
2 x1 1 2
0 2
0 6
11 3
0 x3 0 2
1 2
-1 12
zj − cj 0 2 0 1 M 12
Which gives x1 x2 x3 x4 s 1 p = 6 0 12 0 0 12 :
Example 4.2.5
A construction site requires a minimum of 10, 000cu meters of sand and gravel mixture. The
mixture must contain no less than 5, 000cu meters of sand and no more than 6, 000cu meters
of gravel. Materials may be obtained from two sites: 30% of sand and 70% of gravel from site
1, at a delivery cost of $5 per cu meter, and 60% of sand and 40% of gravel from site 2, at a
delivery cost of $7.00 per cu meter.
(3), we force in other variables, (the artificial variables), which cause a penalty M, as you
are sinking in more money in the business, not planned for.
Example 4.2.6
33 9 −90
x 1 x 2 x3 z = 0 7 7 7
Example 4.2.7
x1 x2 min z = 5 5 25
Example 4.2.8
max w = x1 + 5x2
subject to 3x1 + 4x2 ≤ 6
x1 + 3x2 ≥ 2
x1 , x2 ≥ 0
3 15
x1 x2 max w = 0 2 2
Example 4.2.9
Example 4.2.10
max z = 3x1 + x2 − x3
subject to x1 + x2 + x3 = 10
2x1 − x2 ≥ 2
x1 − 2x2 + x3 ≤ 6
x1 , x2 , x3 ≥ 0
max z = 3x1 + x2 − x3 − M s1 − M s2
subject to x1 + x2 + x3 +s1 = 10
2x1 − x2 − x4 +s2 = 2
x1 − 2x2 + x3 +x5 = 6
x1 , x2 , x3 ≥ 0
cj 3 1 -1 0 0 -M -M 0
cBj xB x1 x2 x3 x4 x5 s1 s2 x̄B
-M s1 1 1 1 0 0 1 0 10
-M s2 2? -1 0 -1 0 0 1 2
0 x5 1 -2 1 0 1 0 0 6
zj − cj -3M-3 -1 -M+1 M 0 0 0 -12M
3? 1 −1
-M s1 0 2
1 2
0 1 2
9
−1 −1 1
3 x1 1 2
0 2
0 0 2
1
−3 1 −1
0 x5 0 2
1 2
1 0 2
5
−3M −5 −M −3 M +2
zj − cj 0 2
-M+1 2
0 0 2
-9M+3
2 1 2 −1
1 x2 0 1 3 3
0 3 3
6
1 −1 1
3 x1 1 0 3 3
0 3
∗ 4
?
0 x5 0 0 2 1 1 ∗ ∗ 14
8 −2
zj − cj 0 0 3 3
0 ∗ ∗ 18
−1 41
1 x2 0 1 0 0 3
* * 3
1 26
3 x1 1 0 1 0 3
* * 3
0 x4 0 0 2 1 1 * ∗ 14
2 82
zj − cj 0 0 4 0 3
∗ ∗ 3
26 41
0 14 0 82
Which gives x1 x2 x3 x4 x5 p = 3 3 3
:
Note 4.2.4 : If an artificial variable leaves(exits) the basis vector, it will never come back
Example 4.2.11
min z = 3x1 + x2 − x3
subject to x1 + x2 + x3 = 10
2x1 − x2 ≥ 2
x1 − 2x2 + x3 ≤ 6
x1 , x2 , x3 ≥ 0
4 5
x1 , x 2 , x 3 , z = 3
, 3
, 7, −0.66667
(a) Apply a suitable simplex method (Big M) to show that the optimal value is 33, and give
values of the variables at which this is attained. Describe briefly the reasoning behind
each step. [When you have a free choice of the pivots, you are recommended to choose
the one furthest to the left].
(b) Give the optimal value for the dual, and explain your reasoning:[You are not expected to
solve the dual problem]
Exercise 4.3
3
x1 x2 x3 s 1 s 2 = 6 6 10
0 0
Why do you think primal-simplex could not solve the problem? Use the geometrical method
to solve the problem.
Example 4.2.13
max π = 3x1 + x3
subject to x1 + 2x2 + x3 = 10
x1 − 2x2 + 2x3 = 6
x1 , x2 , x3 ≥ 0
Realize that already in standard form, RHS=+ves, but fewer basic variables, thus Primal-
simplex cant solve this, may be Big M, by adding in some artificial variables to have the
required number of basic variables.
max π = 3x1 + x3 − M s1 − M s2
subject to x1 + 2x2 + x3 + s1 = 10
x1 − 2x2 + 2x3 + s2 = 6
x1 , x2 , x3 , s1 , s2 ≥ 0
cj 3 0 1 -M -M 0
cBj xB x1 x2 x3 s1 s2 x̄B
-M s1 1 2 1 1 0 10
?
-M s2 1 -2 2 0 1 6
zj − cj -2M-3 0 -3M-1 0 0 -16M
1 −1
-M s1 2
3? 0 1 2
7
1 1
1 x3 2
-1 1 0 2
3
1 1 1
zj − cj 2
(−M − 5) 2
(−6M − 1) 0 0 2
(3M + 1) -7M+3
1 1 −1 7
0 x2 6
1 0 3 6 3
2 1 1 1
1 x3 3
0 1 3 3 6
16
zj − cj 0 0 0 1 1 3
x1 0
x2 7
3
x3 = 16
3
16
max 3
Example 4.2.14
min z = 2x1 + x2
subject to 3x1 + x2 ≥ 9
x1 + x2 ≥ 6
x1 , x2 ≥ 0
3
x1 2
x2 = 9
2
15
min z 2
It is illuminating to look at the graphical solution too.
Example 4.2.15
max z = 2x1 + 3x2 − 5x3
subject to x1 + x2 + x3 = 7
2x1 − 5x2 + x3 ≥ 10
x1 , x2 , x3 ≥ 0
45 4 102
(x1 , x2 , x3 , max z) = , , 0,
7 7 7
Remark 4.2.1
(a) If in any iteration, there is a tie for entering variable between an artificial variable and
other variable (decision, surplus or slack), we must prefer the non-artificial variable to
enter the basis.
(b) If in any iteration, there is a tie for leaving variable between an artificial variable and
other variable (decision, surplus or slack), we must prefer the artificial variable to leave
the basis.
(c) If in the final optimal tableau, an artificial variable is present in the basis at a non-zero
level, this means our original problem has no feasible solution.
Example 4.2.16
max z = 5x1 + 6x2
subject to −2x1 + 3x2 = 3
x1 + 2x2 ≤ 5
6x1 + 7x2 ≤ 3
x1 , x2 ≥ 0
Tableau #1
cj 5 6 -M 0 0 0
cBj xB x1 x2 s1 s2 s3 x̄B
-M s1 -2 3 1 0 0 3
0 s2 1 2 0 1 0 5
?
0 s3 6 7 0 0 1 3
zj − cj -5+2M -6-3M 0 0 0 -3M
Tableau #2
cj 5 6 -M 0 0 0
cBj xB x1 x2 s1 s2 s3 x̄B
−32 −3 12
-M s1 7
0 1 0 7 7
⇐=
−5 −2 29
0 s2 7
0 0 1 7 7
−32 −3 3
6 x2 7
0 0 0 7 7
1 32M 6 3M 18 12M
zj − cj 7
+ 7
0 0 0 7
+ 7 7
− 7
15 16 126
(x1 , x2 , max z) = , ,
22 11 11
Example 4.2.18
Normally, when there are equality constraints, we add artificial variables and use either Big
M method or two phase method or primal-dual. But in this problem we already have a 2 × 2
identity submatrix in the coefficient matrix of the constraint equations. Hence there is no
need to add artificial variables. We can start the primal simplex algorithm with x3 , x4 as basic
variables.
x1 = 0, x2 = 2, x3 = 2, x4 = 0 ; max w = 16
Example 4.2.19
x3 in the first constraint is already basic, we have to add an artificial variable to the second
constraint equation. And then we solve it by big M method.
cj 1 5 3 -M 0
cBj xB x1 x2 x3 s1 x̄B
3 x3 1 2 1 0 3
-M s1 2? -1 0 1 4
zj − cj -1-2M -5+M 0 0 -4M
5? −1
3 x3 0 2
1 2
1
−1 1
1 x1 1 2
0 2
2
−11 1
zj − cj 0 2
0 2
+M 2
2 −1 2
5 x2 0 1 5 5 5
1 2 11
1 x1 11 0 5 5 5
11 −3 21
zj − cj 0 0 5 5
+M 5
⇑
11 2 21
x1 = , x2 = , x3 = 0, max z =
5 5 5
Remark 4.2.2 Since M is a very big positive number say 1, 000, 000, the term − 53 + M is
Example 4.2.20 Use the big M method to show that the following problem has no feasible
solution:
Assignment 4.2.3
Maximise P = 10x + 2y
subject to −x + 2y ≤ 60
5x + 4y ≤ 260
−x + 8y ≥ 80
x, y ≥ 0
Assignment 4.2.4
Maximise P = 8x + 4y
subject to 2x + 3y ≤ 120
x + y ≤ 45
−3x + 5y ≥ 25
x, y ≥ 0
Assignment 4.2.5
Assignment 4.2.6
Assignment 4.2.7
Minimise P = −3x + 4y
subject to x + 3y ≤ 54
3x + y ≤ 34
−x + 2y ≥ 12
x, y ≥ 0
Assignment 4.2.8
Minimise P = 2x − 8y
subject to 8x + 4y ≤ 80
−3x + 4y ≥ 8
x + 4y ≥ 40
x, y ≥ 0
There is a technique for solving min problems and even max problems. Any min problem
, write its corresponding max problem (by just multiplying by a -ve) and solve that by this
method.
Dual-Simplex
Min Max
objective vector c > 0 all cs c < 0 all cs
change to max so that c < 0 all cs solve tabular
Because the zj − cj have to be positive even before starting to solve, as now we are making x̄B
to be positives not zj − cj as in Primal-simplex. But still max problems most.
Thus change (its corresponding, not dual) so that all the objective vectors c are all
negative before you start:
Although we don’t go into details here, there is another reason why duality proves valuable,
associated with the need, in real life, to modify the constraints of a problem. Supposed we have
already solved (say) a maximizing problem. We can describe the solution as feasible (every
entry in the last column is non-negative) and optimal (every entry in the bottom row is non-
negative). Adding an additional constraint is likely to render the “current” solution infeasible,
although it will remain optimal in the above sense. Applying the conventional algorithm will
first work on the (potentially) bad row, and then re-do the optimization. In contrast the dual
problem is likely to become non optimal (a bad row “duals” to a proper sign for improvement)
but feasible (an optimal objective row duals to a feasible but non optimal solution). As such,
restoring optimality is likely in practice to be quicker working on the dual.
93
5.3. DUAL METHODOLOGY
(v) The usual simplex algorithm works thereafter and back to (i).
Note 5.3.1
• Unlike in primal simplex where you had to first find the minimum zj − cj , here you have
to first find minimum of X¯B
¯
• Unlike in Primal where you had to find min XyijB with yij > 0, in dual simplex we get
z −c ¯
z −c
min kylk j = max jyij j with yij < 0 considered
Class 5.3.1 Find the optimal solution to the following LP problem using the simplex algo-
rithm,
min w = 2x1 + 3x2 + 3x3
subject to 2x1 − 3x2 + x3 ≥ 4
x1 + x2 + 2x3 ≥ 3
x1 , x2 , x3 ≥ 0
Solution
write the LP problem as a maximization problem as follows;
max w = −2x1 − 3x2 − 3x3
subject to − 2x1 + 3x2 − x3 ≤ −4
−x1 − x2 − 2x3 ≤ −3
x1 , x2 , x3 ≥ 0
Re- write the LP problem in standard form with slack variables as follows,
Transform the information into the tableau and use the dual simplex method to obtain,
cj −2 −3 -3 0 0 0
cBj xB x1 x2 x3 x4 x5 xB
0 x4 −2? 3 -1 1 0 -4
0 x5 -1 -1 -2 0 1 -3
zj − cj 2 3 3 0 0 0
−2 x1 1 − 23 1
2 ?
− 12 0 2
0 x5 0 − 25 − 32 − 12 1 -1
zj − cj 0 6 2 1 0 −4
−7 −2 1 5
−2 x1 1 3
0 3 3 3
5 1
−3 x3 0 3
1 3
− 23 2
3
8 1 4
zj − cj 0 3
0 3 3
− 16
3
The optimal solution therefore is x?1 = 53 , x?2 = 0, x?3 = 32 , x?4 = 0, x?5 = 0 and w = 16
3
Exercise 5.1 Solve the following LP problems using the Dual simplex method,
(i)
(ii)
(iii)
(iv)
max w = x1 + x2
subject to 3x1 + x2 ≥ 12
−3x1 + 5x2 ≤ 12
x1 , x2 ≥ 0
Here the objective vector is not all negatives, thus get a way to so by writing it as max.
cj −2 −15 -18 0 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x7 x̄B
?
0 x4 -1 2 -6 1 0 0 0 -10
0 x5 0 1 2 0 1 0 0 6
0 x6 2 0 11 0 0 1 0 19
0 x7 -1 1 0 0 0 0 1 -2
zj − cj 2 15 18 0 0 0 0 0
cj −2 −15 -18 0 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x7 x̄B
-2 x1 1 -2 6 -1 0 0 0 10
0 x5 0 1 2 0 1 0 0 6
?
0 x6 0 4 -1 2 0 1 0 -1
0 x7 0 -1 6 -1 0 0 1 8
zj − cj 0 19 6 2 0 0 0 -20
cj −2 −15 -18 0 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x7 x̄B
-2 x1 1 22 0 11 0 6 0 4
0 x5 0 9 0 4 1 2 0 4
-18 x3 0 -4 1 -2 0 -1 0 1
0 x7 0 23 0 11 0 6 1 2
zj − cj 0 43 0 14 0 6 0 -26
X ? = (4, 0, 1, 0, 4, 0, 2)
minimum value of z = −(−26) = 26
Class 5.3.2
cj -5 -35 -20 0 0 0
cBj xB x1 x2 x3 x4 x5 x̄B
0 x4 1 -1 -1 1 0 -2
0 x5 −1? -3 0 0 1 -3
zj − cj 5 35 20 0 0 0
0 x4 0 −4? -1 1 1 -5
-5 x1 1 3 0 0 -1 3
zj − cj 0 20 20 0 5 -15
-35 x2 0 1 0.25 -0.25 -0.25 1.25
-5 x1 1 0 −0.75? 0.75 -0.25 -0.75
zj − cj 0 0 15 5 10 -40
-35 x2 0.333 1 0 0 -0.333 1
-20 x3 -1.33 0 1 -1 0.333 1
zj − cj 20 0 0 20 5 -55
maxz = −55
Note 5.3.2 There is a problem with Big M, if the artificial variables do not go to zero, then
the problem we will a different problem. To make matters worse, you can only realize such at
the end of so many tableaus.
min 2x + 5y + 6z
subject to x + 2y + z ≥ 3
x + 3y + 4z ≥ 4
x, y, z ≥ 0
maximize −2x − 5y − 6z
subject to x + 2y + z ≥ 3
x + 3y + 4z ≥ 4
x, y, z ≥ 0
We realize all cj < 0, the best option is dual-simplex. Graphical cant, since the variables in
question exceed 2. Primal simplex will not work since we shall not have enough basic variables
with RHS +ves. Big M has a very big disadvantage that we realize it cant work unless after
solving, so it is not a good technique unless asked to do so.
maximize −2x − 5y − 6z
subject to −x − 2y − z ≤ −3
−x − 3y − 4z ≤ −4
x, y, z ≥ 0
maximize −2x − 5y − 6z
subject to −x − 2y − z + s1 = −3
−x − 3y − 4z + s2 = −4
x, y, z, s1 , s2 ≥ 0
Step(c): Omitted
cj -2 -5 -6 0 0 0
cBj xB x y z s1 s2 x̄B
0 s1 -1 -2 -1 1 0 -3
0 s2 -1 -3 −4? 0 1 -4 ⇐
zj − cj 2 5 6 0 0 0
−3 −5 ? −1
0 s1 4 4
0 1 4
-2 ⇐
1 3 −1
-6 z 4 4
1 0 4
1
1 1 3
zj − cj 2 2
0 0 2
-6
3 −4 1 8
-5 y 5
1 0 5 5 5
−1 ? 3 −2 −1
-6 z 5
0 1 5 5 5
⇐
1 2 7 −34
zj − cj 5
0 0 5 5 5
-5 y 0 1 3 1 -1 1
-2 x 1 0 -5 -3 -2 1
zj − cj 0 0 1 1 1 -7
min z = x1 + x2
subject to 2x1 + x2 ≥ 2
−x1 − x2 ≥ 1
x1 , x2 ≥ 0
max z = −x1 − x2
subject to 2x1 + x2 ≥ 2
−x1 − x2 ≥ 1
x1 , x2 ≥ 0
max z = −x1 − x2
subject to −2x1 − x2 ≤ −2
x1 + x2 ≤ −1
x1 , x2 ≥ 0
max z = −x1 − x2
subject to −2x1 − x2 + s1 = −2
x1 + x2 + s2 = −1
x1 , x2 , s1 , s2 ≥ 0
cj -1 -1 0 0 0
cBj xB x1 x2 s1 s2 x̄B
0 s1 −2? -1 1 0 -2
0 s2 1 1 0 1 -1
zj − cj 1 1 0 0 0
1 −1
0 s1 1 2 2
0 1
1 1
0 s2 0 2 2
1 -2
1 1
zj − cj 0 2 2
0 -1
Since X¯B2 is negative, mark the second row as the pivotal row, which yields s2 as the
outgoing variable. But since s2 row contains no non-negative coefficients, no other variable
enters the basis. Thus the given LPP has no feasible solution.
Exercise 5.2
Example 5.3.5 Repeat the problem above using the graphical method.
cj -2 -2 -4 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x̄B
0 x4 -2 −3? -5 1 0 0 -2
0 x5 3 1 7 0 1 0 3
0 x6 1 4 6 0 0 1 5
zj − cj 2 2 4 0 0 0 0
cj -2 -3 -4 -5 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x7 x̄B
0 x5 −1? 1 -1 1 1 0 0 -10
0 x6 -1 2 -3 4 0 1 0 -6
0 x7 -3 4 -5 6 0 0 1 -15
zj − cj 2 3 4 5 0 0 0 0
-2 x1 1 -1 1 -1 -1 0 0 10
0 x6 0 1 -2 3 -1 1 0 4
0 x7 0 1 -2 3 -3 0 1 15
zj − cj 0 5 2 7 2 0 0 -20
Now every X¯Bi for i > 0 is non-negative. So, the tableau is optimal.
Example 5.3.8 But suppose the boss adds now the new restriction:
With the dual simplex, we do not start from scratch. We simply add the new row and one
more column to our tableau. Show that
32 2
x1 = , x2 = 0, x3 = 0, x4 = , x5 = 0, x6 = 2, x7 = 13, x8 = 0
3 3
Example 5.3.9 Consider the following tableau, and solve it using the dual simplex method.
cj
cBj xB x1 x2 x3 x4 x5 x̄B
1 1 0 2 0 1
-1 0 -1 0 1 -2
zj − cj 1 0 2 1 0 -3
cj
cBj xB x1 x2 x3 x4 x5 x̄B
0 1 -1 2 1 -1
1 0 1 0 -1 2
zj − cj 0 0 1 1 0 -5
cj
cBj xB x1 x2 x3 x4 x5 x̄B
0 -1 1 -2 -1 1
1 1 0 2 0 1
zj − cj 0 1 0 3 2 -6
x1 = 1, x2 = 0, x3 = 1, x4 = 0, x5 = 0, z = −6
Example 5.3.10 Using the example below, demonstrate the dual-simplex algorithm [four
tableaus]
max −2x − 5y − 6z
subject to x + 2y + z ≥ 3
x + 3y + 4z ≥ 4
x, y, z ≥ 0
Tableau #1
cj -3 -2 0 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x̄B
0 x3 -1 -1 1 0 0 0 -1
0 x4 1 1 0 1 0 0 7
0 x5 -1 −2? 0 0 1 0 -10
0 x6 0 1 0 0 0 1 3
zj − cj 3 2 0 0 0 0 0
Tableau #2
cj -3 -2 0 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x̄B
−1 −1
0 x3 2
0 1 0 2
0 4
1 1
0 x4 2
0 0 1 2
0 2
1 −1
-2 x2 2
1 0 0 2
0 5
−1? 1
0 x6 2
0 0 0 2
1 -2
zj − cj 2 0 0 0 -1 0 -10
Tableau #3
cj -3 -2 0 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x̄B
0 x3 0 0 1 0 -1 -1 6
0 x4 0 0 0 1 1 1 0
-2 x2 0 1 0 0 0 1 3
-3 x1 1 0 0 0 -1 -2 4
zj − cj 0 0 0 0 3 4 -18
x1 = 4, x2 = 3, z = −18
Example 5.3.12
Since all cj < 0, are all negatives, its better to use dual simplex algorithm.
7 33 35
x1 = 0, x2 = , x3 = 0, x4 = ; min z =
4 4 4
Example 5.3.13 Perform pivot step and go to next iteration with new basic vector.
Original tableau
x1 x2 x 3 x4 x5 x6 x̄B
1 0 0 4 -5 7 8
0 1 0 -2 4 -2 -2
0 0 1 1 -3 2 2
0 0 0 1 3 2 0
Example 5.3.14 Perform pivot step and go to next iteration with new basic vector using the
dual simplex algorithm.
Original tableau
x1 x2 x3 x4 x5 x6 x̄B
1 1 1 1 0 0 1
-1 -2 -1 0 1 0 -8
1 3 2 0 0 1 5
8 24 15 0 0 0 0
State the initial basic variables.
Note 5.3.3 As before, pivot step is:
(i) nondegenerate if min ratio is > 0
(ii) degenerate if min ratio is 0
Remark 5.3.1 Usefulness of Dual Simplex Algorithm:
Not used to solve new LPs, because the dual simplex min ratio test needs O(n) comparisons
in every pivot step (primal simplex min ratio test needs only O(m) comparisons in each step,
and in most real world models n >> m).
However, dual simplex Algorithm. very useful in sensitivity analysis. After problem solved, if
changes occur in RHS constants vector, dual simplex iterations are used to get new opt.
Remark 5.3.2 Dual Simplex Method:
If an initial dual feasible basis not available, an artificial dual feasible basis can be constructed
by getting an arbitrary basis, and then adding one artificial constraint.
Though mathematically well specified, this method not used much in practice.
Remark 5.3.3 The idea behind the dual simplex method is to start with a legitimate, optimal
tableau and move toward a feasible tableau without losing legitimacy or optimality. A single
iteration of the Dual Simplex Method consists of the following:
(1.) Choose the departing row (basic variable) to be any row where the RHS is ¡ 0.
(2.) The candidates for the entering variable are the non basic variables which have negative
entries in the departing row. If there are no candidates for entering the problem is
infeasible.
(3.) If there are candidates for entering, choose one which maintains optimality. The first row
operation in the pivot process can be adding a positive multiple of the departing row to
the objective row. The entering variable will be one with the smallest possible multiple.
(4.) Pivot. Repeat step 1 until an optimal solution is found or until the problem is shown
to be infeasible. After adding slack variables, the initial tableau for the following simple
problem is optimal and legitimate, but it is not feasible. We use the DSM to obtain
feasibility without losing optimality or legitimacy.
Example 5.3.15
M AXW = −X1 − 2X2
SUBJECT TO −X1 + 2X2 − X3 ≤ −4
−2X1 − X2 + X3 ≤ −6
(BASIS) X1 X2 X3 X4 X5
X4 -1.000 2.000 -1.000 1.000 0.000 -4.000
X5 -2.000 -1.000 1.000 0.000 1.000 -6.000
Z-C 1.000 2.000 0.000 0.000 0.000 0.000
X1 ENTERS AT VALUE 3.0000 IN ROW 2 OBJ. VALUE = −3.0000
Question : If X4 departed rather than X5, which variable would have entered?
(BASIS) X1 X2 X3 X4 X5
X4 0.000 2.500 -1.500 1.000 -0.500 -1.000
X1 1.000 0.500 -0.500 0.000 -0.500 3.000
Z-C 0.000 1.500 0.500 0.000 0.500 -3.000
(BASIS) X1 X2 X3 X4 X5
X3 0.000 -1.667 1.000 -0.667 0.333 0.667
X1 1.000 -0.333 0.000 -0.333 -0.333 3.333
Z-C 0.000 2.333 0.000 0.333 0.333 -3.333
This tableau is now optimal, feasible and legitimate. The optimal solution is: