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. Written with all terms on the left, the objective row starts as
z+4x1+x2+Ma1+Ma2=0(3)
But a1,a2 are basic, so they must have coefficient 0 in the objective row. Subtract M×(a1 row) and M×(a2 row) of (2) from (3) to eliminate them:
The two subtracted coefficients in each line are the x1 (or x2, s2) entries of the a1 row and the a2 row. This gives the initial objective row below. Its RHS is the value of the maximand −z; negate it for z.
1 /
entering columnleaving rowpivot elementupdated this step
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
Basis (a1,a2,s3)=(3,6,4). 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. Pricing out the basic artificials from w+a1+a2=0 (subtract each artificial’s row) gives the initial w row.
1 /
entering columnleaving rowpivot elementupdated this step
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
Phase 1 basis (a1,a2,s3) with 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. Written with all terms on the left, the objective row starts as
(−z)+4x1+x2=0
But x1,x2 are basic (from the phase 1 final tableau), so they must have coefficient 0 in the objective row. Subtract 4×(x1 row) and 1×(x2 row) of the phase 1 final tableau (columns x1,x2,s2,s3 only, dropping a1,a2) to eliminate them: