The tableau convention maximizes and stops when all objective row coefficients are ≥0. Minimizing z means maximizing −z, so the objective is max−z−Ma1−Ma2. The natural starting basis is (a1,a2,s3)=(3,6,4), read straight off (2).
1 /
entering columnleaving rowpivot elementupdated this step
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
z
4
1
0
0
M
M
0
a1
3
1
0
0
1
0
3
a2
4
3
−1
0
0
1
6
s3
1
2
0
1
0
0
4
Basis (a1,a2,s3)=(3,6,4). But a1,a2 are basic with a
nonzero coefficient M in the objective row, so it isn’t canonical yet:
subtract M×(a1 row) and M×(a2 row)
from the objective row to zero them out.
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
z
4−7M
1−4M
M
0
0
0
−9M
a1
3
1
0
0
1
0
3
a2
4
3
−1
0
0
1
6
s3
1
2
0
1
0
0
4
Objective row after eliminating a1,a2. Its RHS is the value of the
maximand −z; negate it for z. For large M the coefficients 4−7M and
1−4M are both negative, so not optimal.
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
z
4−7M
1−4M
M
0
0
0
−9M
a1
3
1
0
0
1
0
3
3/3 = 1
a2
4
3
−1
0
0
1
6
6/4 = 1.5
s3
1
2
0
1
0
0
4
4/1 = 4
Most negative coefficient is 4−7M, so x1 enters. Minimum ratio is 1
in row a1, so a1 leaves. Pivot element is 3.
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
z
0
(−1−5M)/3
M
0
(7M−4)/3
0
−2M−4
x1
1
1/3
0
0
1/3
0
1
1 / (1/3) = 3
a2
0
5/3
−1
0
−4/3
1
2
2 / (5/3) = 1.2
s3
0
5/3
0
1
−1/3
0
3
3 / (5/3) = 1.8
Coefficient (−1−5M)/3 is the most negative, so x2 enters. Minimum ratio
is 1.2 in row a2, so a2 leaves. Pivot element is 5/3.
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
z
0
0
−1/5
0
M−8/5
1/5+M
−18/5
x1
1
0
1/5
0
3/5
−1/5
3/5
(3/5) / (1/5) = 3
x2
0
1
−3/5
0
−4/5
3/5
6/5
skip (-3/5)
s3
0
0
1
1
1
−1
1
1/1 = 1
Both artificials are non-basic. Only −1/5 (column s2) is negative, so
s2 enters. Minimum ratio is 1 in row s3, so s3 leaves. Pivot
element is 1.
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
z
0
0
0
1/5
M−7/5
M
−17/5
x1
1
0
0
−1/5
2/5
0
2/5
x2
0
1
0
3/5
−1/5
0
9/5
s2
0
0
1
1
1
−1
1
All objective coefficients are non-negative and no artificial is basic.
Optimal at x1=2/5, x2=9/5, maximand −z=−17/5, so
z=17/5=3.4.
Two-Phase Method
Uses 2 separate simplex runs, avoiding the arbitrary constant M.
Phase 1
Replace the original objective with minimizing the sum of all artificial variables. This is the same regardless of whether the original problem maximizes or minimizes; the original objective’s direction plays no role in phase 1.
Run the simplex algorithm.
If the minimum is 0, a basic feasible solution to the original problem was found; proceed to phase 2.
If the minimum is positive, the original problem is infeasible. Stop.
Phase 2
Drop the artificial variables and restore the original objective. The original direction only matters here: convert a minimization to max−z to fit the tableau convention, or use a maximization objective as is.
Use the phase 1 optimal basis as the starting basic feasible solution: keep the same basic variables and the same rows (with the artificial columns dropped) from the phase 1 final tableau, and only replace the objective row with the restored objective, priced out against those same rows.
Run the simplex algorithm to optimize the original objective.
Unbounded and alternate/infinite optimal solutions are detected in phase 2 the same way as in the ordinary simplex algorithm.
Worked Example
Same LP (1) and standard form (2) as the Big-M example.
Phase 1
Objective becomes mina1+a2, i.e. maxw with w=−a1−a2. The natural starting basis is again (a1,a2,s3)=(3,6,4).
1 /
entering columnleaving rowpivot elementupdated this step
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
w
0
0
0
0
1
1
0
a1
3
1
0
0
1
0
3
a2
4
3
−1
0
0
1
6
s3
1
2
0
1
0
0
4
Basis (a1,a2,s3)=(3,6,4). But a1,a2 are basic with
coefficient 1 in the w row, so it isn’t canonical yet: subtract the
a1 row and the a2 row from the w row to zero them out.
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
w
−7
−4
1
0
0
0
−9
a1
3
1
0
0
1
0
3
a2
4
3
−1
0
0
1
6
s3
1
2
0
1
0
0
4
w row after eliminating a1,a2: w=−9. Coefficients −7 and −4 are
negative, so not optimal.
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
w
−7
−4
1
0
0
0
−9
a1
3
1
0
0
1
0
3
3/3 = 1
a2
4
3
−1
0
0
1
6
6/4 = 1.5
s3
1
2
0
1
0
0
4
4/1 = 4
Most negative is −7, so x1 enters. Minimum ratio is 1 in row a1, so
a1 leaves. Pivot element is 3.
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
w
0
−5/3
1
0
7/3
0
−2
x1
1
1/3
0
0
1/3
0
1
1 / (1/3) = 3
a2
0
5/3
−1
0
−4/3
1
2
2 / (5/3) = 1.2
s3
0
5/3
0
1
−1/3
0
3
3 / (5/3) = 1.8
Coefficient −5/3 is negative, so x2 enters. Minimum ratio is 1.2 in row
a2, so a2 leaves. Pivot element is 5/3.
Basic
x1
x2
s2
s3
a1
a2
RHS
Ratio
w
0
0
0
0
1
1
0
x1
1
0
1/5
0
3/5
−1/5
3/5
x2
0
1
−3/5
0
−4/5
3/5
6/5
s3
0
0
1
1
1
−1
1
w=0 and all coefficients are non-negative. Both artificials are
non-basic, so (x1,x2,s3)=(3/5,6/5,1) is a basic feasible solution
of the original problem.
Phase 2
Drop columns a1,a2. Restore max−z with −z=−4x1−x2. Carry over the phase 1 final basis (x1,x2,s3)=(3/5,6/5,1), columns x1,x2,s2,s3 only.
1 /
entering columnleaving rowpivot elementupdated this step
Basic
x1
x2
s2
s3
RHS
Ratio
z
4
1
0
0
0
x1
1
0
1/5
0
3/5
x2
0
1
−3/5
0
6/5
s3
0
0
1
1
1
Basis (x1,x2,s3)=(3/5,6/5,1), carried over from the phase 1
final tableau. But x1,x2 are basic with nonzero coefficients 4 and
1 in the objective row, so it isn’t canonical yet: subtract
4×(x1 row) and 1×(x2 row) to zero
them out.
Basic
x1
x2
s2
s3
RHS
Ratio
z
0
0
−1/5
0
−18/5
x1
1
0
1/5
0
3/5
x2
0
1
−3/5
0
6/5
s3
0
0
1
1
1
Objective row after eliminating x1,x2. Coefficient −1/5 in column s2
is negative, so not optimal.
Basic
x1
x2
s2
s3
RHS
Ratio
z
0
0
−1/5
0
−18/5
x1
1
0
1/5
0
3/5
(3/5) / (1/5) = 3
x2
0
1
−3/5
0
6/5
skip (-3/5)
s3
0
0
1
1
1
1/1 = 1
s2 enters. Minimum ratio is 1 in row s3, so s3 leaves. Pivot
element is 1.
Basic
x1
x2
s2
s3
RHS
Ratio
z
0
0
0
1/5
−17/5
x1
1
0
0
−1/5
2/5
x2
0
1
0
3/5
9/5
s2
0
0
1
1
1
All objective coefficients are non-negative. Optimal at x1=2/5,
x2=9/5, so z=17/5=3.4, matching the Big-M result.