Artificial Variable Methods

Work in progress. This note is still being written and incomplete.

10 min read Last updated Sun Sep 06 2026 13:01:26 GMT+0000 (Coordinated Universal Time)

If the starting basis needs artificial variables, either Big-M or two-phase method should be used.

Big-M Method

Solves the LP in a single simplex run by penalizing artificial variables in the objective.

  • Assign each artificial variable a coefficient M-M in the objective (maximization), where MM is an arbitrarily large positive constant.
  • Run the simplex algorithm normally. The penalty drives artificial variables out of the basis as the objective improves.

Reading the Result

  • Optimal solution
    All artificial variables are 0 in the optimal tableau.
  • Infeasible problem
    At least one artificial variable remains positive (basic with a non-zero value) in the optimal tableau.
  • Unbounded problem
    Detected by the usual minimum ratio test, same as without artificial variables.

Worked Example

minimizez=4x1+x2subject to3x1+x2=34x1+3x26x1+2x24x1,x20(1)\begin{aligned} \text{minimize} \quad & z = 4x_1 + x_2 \\ \text{subject to} \quad & 3x_1 + x_2 = 3 \\ & 4x_1 + 3x_2 \ge 6 \\ & x_1 + 2x_2 \le 4 \\ & x_1, x_2 \ge 0 \end{aligned} \tag{1}

Standard form adds a surplus s2s_2 to the \ge constraint, a slack s3s_3 to the \le constraint, and artificials a1,a2a_1, a_2 to the equality and \ge rows:

3x1+x2+a1=34x1+3x2s2+a2=6x1+2x2+s3=4(2)\begin{aligned} 3x_1 + x_2 + a_1 &= 3 \\ 4x_1 + 3x_2 - s_2 + a_2 &= 6 \\ x_1 + 2x_2 + s_3 &= 4 \end{aligned} \tag{2}

The tableau convention maximizes and stops when all objective row coefficients are 0\ge 0. Minimizing zz means maximizing z-z, so the objective is max zMa1Ma2\max\ -z - M a_1 - M a_2. Written with all terms on the left, the objective row starts as

z+4x1+x2+Ma1+Ma2=0(3)z + 4x_1 + x_2 + M a_1 + M a_2 = 0 \tag{3}

But a1,a2a_1, a_2 are basic, so they must have coefficient 00 in the objective row. Subtract M×(a1 row)M \times (a_1 \text{ row}) and M×(a2 row)M \times (a_2 \text{ row}) of (2)(2) from (3)(3) to eliminate them:

x1:43M4M=47Mx2:11M3M=14Ms2:00(M)=MRHS:03M6M=9M\begin{aligned} x_1:\quad & 4 - 3M - 4M = 4 - 7M \\ x_2:\quad & 1 - 1M - 3M = 1 - 4M \\ s_2:\quad & 0 - 0 - (-M) = M \\ \text{RHS}:\quad & 0 - 3M - 6M = -9M \end{aligned}

The two subtracted coefficients in each line are the x1x_1 (or x2x_2, s2s_2) entries of the a1a_1 row and the a2a_2 row. This gives the initial objective row below. Its RHS is the value of the maximand z-z; negate it for zz.

1 /

entering column leaving row pivot element updated this step

Basis (a1,a2,s3)=(3,6,4)(a_1, a_2, s_3) = (3, 6, 4). For large MM the coefficients 47M4 - 7M and 14M1 - 4M are both negative, so not optimal.

Most negative coefficient is 47M4 - 7M, so x1x_1 enters. Minimum ratio is 11 in row a1a_1, so a1a_1 leaves. Pivot element is 33.

Coefficient (15M)/3(-1 - 5M)/3 is the most negative, so x2x_2 enters. Minimum ratio is 1.21.2 in row a2a_2, so a2a_2 leaves. Pivot element is 5/35/3.

Both artificials are non-basic. Only 1/5-1/5 (column s2s_2) is negative, so s2s_2 enters. Minimum ratio is 11 in row s3s_3, so s3s_3 leaves. Pivot element is 11.

All objective coefficients are non-negative and no artificial is basic. Optimal at x1=2/5x_1 = 2/5, x2=9/5x_2 = 9/5, maximand z=17/5-z = -17/5, so z=17/5=3.4z = 17/5 = 3.4.

Two-Phase Method

Uses 2 separate simplex runs, avoiding the arbitrary constant MM.

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\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)(1) and standard form (2)(2) as the Big-M example.

Phase 1

Objective becomes min a1+a2\min\ a_1 + a_2, i.e. max w\max\ w with w=a1a2w = -a_1 - a_2. Pricing out the basic artificials from w+a1+a2=0w + a_1 + a_2 = 0 (subtract each artificial’s row) gives the initial ww row.

1 /

entering column leaving row pivot element updated this step

Phase 1 basis (a1,a2,s3)(a_1, a_2, s_3) with w=9w = -9. Coefficients 7-7 and 4-4 are negative, so not optimal.

Most negative is 7-7, so x1x_1 enters. Minimum ratio is 11 in row a1a_1, so a1a_1 leaves. Pivot element is 33.

Coefficient 5/3-5/3 is negative, so x2x_2 enters. Minimum ratio is 1.21.2 in row a2a_2, so a2a_2 leaves. Pivot element is 5/35/3.

w=0w = 0 and all coefficients are non-negative. Both artificials are non-basic, so (x1,x2,s3)=(3/5,6/5,1)(x_1, x_2, s_3) = (3/5, 6/5, 1) is a basic feasible solution of the original problem.

Phase 2

Drop columns a1,a2a_1, a_2. Restore max z\max\ -z with z=4x1x2-z = -4x_1 - x_2. Written with all terms on the left, the objective row starts as

(z)+4x1+x2=0(-z) + 4x_1 + x_2 = 0

But x1,x2x_1, x_2 are basic (from the phase 1 final tableau), so they must have coefficient 00 in the objective row. Subtract 4×(x1 row)4 \times (x_1 \text{ row}) and 1×(x2 row)1 \times (x_2 \text{ row}) of the phase 1 final tableau (columns x1,x2,s2,s3x_1, x_2, s_2, s_3 only, dropping a1,a2a_1, a_2) to eliminate them:

x1:44(1)1(0)=0x2:14(0)1(1)=0s2:04(1/5)1(3/5)=1/5RHS:04(3/5)1(6/5)=18/5\begin{aligned} x_1:\quad & 4 - 4(1) - 1(0) = 0 \\ x_2:\quad & 1 - 4(0) - 1(1) = 0 \\ s_2:\quad & 0 - 4(1/5) - 1(-3/5) = -1/5 \\ \text{RHS}:\quad & 0 - 4(3/5) - 1(6/5) = -18/5 \end{aligned}

This gives the initial objective row below, alongside the phase 1 final rows for x1,x2,s3x_1, x_2, s_3 with the a1,a2a_1, a_2 columns dropped.

1 /

entering column leaving row pivot element updated this step

Starts from the phase 1 basis (x1,x2,s3)(x_1, x_2, s_3). Coefficient 1/5-1/5 in column s2s_2 is negative, so not optimal.

s2s_2 enters. Minimum ratio is 11 in row s3s_3, so s3s_3 leaves. Pivot element is 11.

All objective coefficients are non-negative. Optimal at x1=2/5x_1 = 2/5, x2=9/5x_2 = 9/5, so z=17/5=3.4z = 17/5 = 3.4, matching the Big-M result.

Was this helpful?