Standard Form

The graphical method only works for 2 (or 3) decision variables. An algebraic method is needed beyond that, and it starts by rewriting the linear program in a fixed form.

Given an LP in nn variables and mm constraints, with x∈Rnx \in \mathbb{R}^n, c∈Rnc \in \mathbb{R}^n, A∈Rm×nA \in \mathbb{R}^{m \times n}, b∈Rmb \in \mathbb{R}^m, standard form requires:

  • Maximization
    Replace min⁡cTx\min c^T x by max⁡(−cTx)\max (-c^T x).
  • Equality constraints
    Convert every inequality with a slack, surplus, or artificial variable, and scale each row so b≥0b \ge 0.
  • Non-negative variables
    x≥0x \ge 0.
maximizez=cTxs.t.Ax=bx≥0,b≥0\begin{aligned} \text{maximize} \quad & z = c^T x \\ \text{s.t.} \quad & Ax = b \\ & x \ge 0, \quad b \ge 0 \end{aligned}

where nn counts the original variables plus the added ones.

Variable

Assume AA has full row rank mm with n≥mn \ge m. Pick mm linearly independent columns forming an invertible basis matrix B∈Rm×mB \in \mathbb{R}^{m \times m}; the remaining columns form NN. Partition x=(xB,xN)x = (x_B, x_N) accordingly.

Basic Variable

A component of xBx_B. Setting xN=0x_N = 0 gives xB=B−1bx_B = B^{-1} b. The solution is a basic feasible solution when B−1b≥0B^{-1} b \ge 0.

Non-Basic Variable

A component of xNx_N, fixed at 00 while xBx_B is solved for.

Slack Variable

For a constraint aiTx≤bia_i^T x \le b_i, add si≥0s_i \ge 0 to get aiTx+si=bia_i^T x + s_i = b_i. Absorbs unused capacity.

Surplus Variable

For a constraint aiTx≥bia_i^T x \ge b_i, subtract si≥0s_i \ge 0 to get aiTx−si=bia_i^T x - s_i = b_i. Absorbs excess over the minimum.

Artificial Variable

A variable ai≥0a_i \ge 0 added to row ii with coefficient +1+1 purely to supply a starting basic variable, with no meaning in the original problem.

When It Is Required

After the RHS of every constraint is made non-negative (multiply the row by −1-1 if needed), each constraint must contribute one variable that appears with coefficient +1+1 in that row and 00 in all others (a unit column). That variable becomes basic in the starting solution.

  • ≤\le constraint
    The slack variable is already such a unit column. No artificial variable.
  • ≥\ge constraint
    The surplus variable has coefficient −1-1, not a unit column. Add an artificial variable.
  • == constraint
    No slack or surplus at all. Add an artificial variable.

So the number of artificial variables equals the number of ≥\ge constraints plus the number of == constraints (after fixing signs).

Handling Them

A valid final solution must have every artificial variable equal to 00 (non-basic, or basic at value 00). If one stays positive, the original problem is infeasible. 2 methods drive them out:

  • Big-M method
  • Two-phase method

Worked Example

Minimize z=2x1+3x2z = 2x_1 + 3x_2 subject to

x1+x2≤4(1)x1+3x2≥6(2)x1−x2=1(3)x1,x2≥0\begin{aligned} x_1 + x_2 &\le 4 && \quad (1) \\ x_1 + 3x_2 &\ge 6 && \quad (2) \\ x_1 - x_2 &= 1 && \quad (3) \\ x_1, x_2 &\ge 0 \end{aligned}
Solution Reveal Hide

Convert each requirement:

  • Objective
    Minimizing zz becomes maximizing z′=−2x1−3x2z' = -2x_1 - 3x_2.
  • Constraint (1)(1) is ≤\le, so add slack s1s_1.
  • Constraint (2)(2) is ≥\ge, so subtract surplus s2s_2, then add artificial a1a_1.
  • Constraint (3)(3) is ==, so add artificial a2a_2.

Standard form:

maximize z′=−2x1−3x2\text{maximize } z' = -2x_1 - 3x_2x1+x2+s1=4(1′)x1+3x2−s2+a1=6(2′)x1−x2+a2=1(3′)x1,x2,s1,s2,a1,a2≥0\begin{aligned} x_1 + x_2 + s_1 &= 4 && \quad (1') \\ x_1 + 3x_2 - s_2 + a_1 &= 6 && \quad (2') \\ x_1 - x_2 + a_2 &= 1 && \quad (3') \\ x_1, x_2, s_1, s_2, a_1, a_2 &\ge 0 \end{aligned}

With x=(x1,x2,s1,s2,a1,a2)Tx = (x_1, x_2, s_1, s_2, a_1, a_2)^T:

A=[111000130−1101−10001],b=[461],c=[−2−30000]TA = \begin{bmatrix} 1 & 1 & 1 & 0 & 0 & 0 \\ 1 & 3 & 0 & -1 & 1 & 0 \\ 1 & -1 & 0 & 0 & 0 & 1 \end{bmatrix}, \quad b = \begin{bmatrix} 4 \\ 6 \\ 1 \end{bmatrix}, \quad c = \begin{bmatrix} -2 & -3 & 0 & 0 & 0 & 0 \end{bmatrix}^T

Starting basis BB = columns of s1,a1,a2s_1, a_1, a_2 = I3I_3, so xB=B−1b=(s1,a1,a2)T=(4,6,1)T≥0x_B = B^{-1} b = (s_1, a_1, a_2)^T = (4, 6, 1)^T \ge 0 and xN=(x1,x2,s2)T=0x_N = (x_1, x_2, s_2)^T = 0.

Wolfram Mathematica notebooks

A companion notebook for this note. Open it in Mathematica and evaluate the cells to reproduce the worked example.

The summary notebook defines every function used in this module, with documentation and no examples, as a starting point for your own problems.

Written by October 24, 2026 3 min read
Was this helpful?