Converting Linear Programs to Standard Form

What you will be able to do

Given a linear program stated with any mix of maximization or minimization, inequality or equality constraints, and sign-restricted or free variables, the learner can produce an equivalent standard-form program with a minimization objective, equality constraints, and all variables nonnegative, without a conversion checklist in view.

Orientation

In this course, standard form means a minimisation, with equality constraints, and every variable nonnegative. The definition can arrive immediately because the reason to want it is already familiar: the simplex method's basis, its reduced costs and its optimality test are all defined for that shape, so it is the representation in which those objects exist at all.

Other texts fix a maximisation, or admit inequalities, and call that standard form. None is more correct. A conversion is only well defined once the target is named.

Intuition

Why algorithms assume one canonical form

Standard form is a convention, not a restriction on which problems can be solved.

The simplex method is described in terms of a system of equations with nonnegative variables, because that is the setting in which a basis and a basic feasible solution are defined. Rather than restate the method for every possible arrangement of constraints, the program is rewritten once into the shape the method expects.

Nothing about the underlying problem changes. The conversion adds bookkeeping variables and may flip the sign of the reported objective value, but the feasible decisions and which of them are best are preserved.

Definition

Why the three conditions are the three conditions

The definition above names three conditions. Each earns its place by what the simplex method needs, and none is arbitrary.

Equality constraints exist so a basis exists. A basis is a choice of m columns of A whose square submatrix is invertible, and that idea needs A x = b as a system of equations. With inequalities there is nothing to invert and no basic solution to speak of. Slack and surplus variables are how an inequality becomes an equation without changing which decisions are allowed.

Nonnegativity exists so a corner exists. Basic feasible solutions are the corners of the feasible region, and a variable is "at a corner" precisely when it sits at its bound of zero. Without x ≥ 0 there is no bound to sit at, and the correspondence between bases and corners, the thing that makes a finite search possible, dissolves.

Minimization exists only for uniformity. Unlike the other two this one changes nothing structural; it means the optimality test can be stated once, with a single sign convention for reduced costs, rather than twice.

Why failing one condition is failing. The three are not a checklist where two out of three is nearly there. A program with equalities and nonnegative variables but a maximization objective will run through the algorithm and return the wrong sign. One with a minimization and equalities but a free variable has no basis at all for the simplex method to start from.

Note also what the definition does not require: it says nothing about b ≥ 0 . Many texts add that condition for the specific purpose of starting phase one with a feasible basis, and it is a separate matter from being in standard form.

Procedure

Conversion steps

Apply these four steps in order. Each addresses one of the three standard-form conditions.

Objective direction. If the objective is max c T x , replace it with min ( − c ) T x . The optimal solution set is unchanged; the optimal value changes sign, so report − min ( − c T x ) as the original maximum.

Less-than-or-equal constraints. For a i T x ≤ b i , add a slack variable s i ≥ 0 :

a i T x + s i = b i , s i ≥ 0.

The slack measures unused capacity in that constraint.

Greater-than-or-equal constraints. For a i T x ≥ b i , subtract a surplus variable e i ≥ 0 :

a i T x − e i = b i , e i ≥ 0.

The surplus measures the amount by which the requirement is exceeded.

Variables whose restriction is not simple nonnegativity. A variable unrestricted in sign, bounded below by a nonzero constant, or restricted to be nonpositive needs a substitution rather than an added variable: the unit on transforming the variables gives the substitution for each case, the constant a shift leaves in the objective, and the rule for recovering the original value afterwards.

After the substitutions, check that every variable in the program, original, slack, surplus, and substituted, carries a nonnegativity restriction.

Worked example

A program needing all four steps

Problem. Convert to standard form:

max 3 x 1 + 2 x 2 s.t. x 1 + x 2 ≤ 4 , x 1 − x 2 ≥ 1 , x 1 ≥ 0 , x 2  free .

Goal. Produce an equivalent program that is a minimization, has only equality constraints, and has only nonnegative variables.

Relevant principle. Each standard-form condition is addressed by one transformation, and each transformation must be applied everywhere the affected quantity appears.

Step 1: objective direction. The objective is a maximization, so negate it: minimize − 3 x 1 − 2 x 2 .
Reason: minimizing the negation selects the same x that maximizes the original.

Step 2: the ≤ constraint. x 1 + x 2 ≤ 4 becomes x 1 + x 2 + s 1 = 4 with s 1 ≥ 0 .
Reason: the slack absorbs the difference between the left side and the bound.

Step 3: the ≥ constraint. x 1 − x 2 ≥ 1 becomes x 1 − x 2 − e 1 = 1 with e 1 ≥ 0 .
Reason: the surplus is subtracted, because the left side is at least the bound and the excess must be removed to reach equality.

Step 4: the sign-unrestricted variable. x 2 carries no sign restriction, so substitute x 2 = x 2 + − x 2 − with x 2 + , x 2 − ≥ 0 in the objective and in both constraints. The substitution and its properties, in particular that the pair is not uniquely determined, belong to the unit on transforming the variables.

Result.

min − 3 x 1 − 2 x 2 + + 2 x 2 −

subject to

x 1 + x 2 + − x 2 − + s 1 = 4 , x 1 − x 2 + + x 2 − − e 1 = 1 , x 1 , x 2 + , x 2 − , s 1 , e 1 ≥ 0.

Check. The objective is a minimization; both constraints are equalities; all five variables are nonnegative. All three conditions hold.

Interpretation. If this program has minimum value v , the original maximization has maximum value − v . The original x 2 is recovered as x 2 + − x 2 − .

Contrast

Slack and surplus are not interchangeable

The sign on the introduced variable is determined by the direction of the inequality, and getting it wrong changes the feasible set.

Correct. x 1 − x 2 ≥ 1 becomes x 1 − x 2 − e 1 = 1 with e 1 ≥ 0 .

Incorrect. x 1 − x 2 ≥ 1 becomes x 1 − x 2 + s 1 = 1 with s 1 ≥ 0 .

Why the second fails: with s 1 ≥ 0 , the equation forces x 1 − x 2 = 1 − s 1 ≤ 1 . That is the opposite restriction from the one the original constraint states. A point such as x 1 = 5 , x 2 = 0 satisfies the original constraint but cannot satisfy the incorrect conversion for any s 1 ≥ 0 .

The reliable check is directional: a ≤ constraint has room left over, so you add the leftover; a ≥ constraint has an excess, so you subtract the excess.

Warning

Where conversions go wrong after the signs are right

The slack-and-surplus sign is the famous trap and it is treated on its own. These are the ones that survive getting that right.

A substitution applied in some places but not others. Replacing a free x j by x j + − x j − is a renaming, so it must reach the objective and every constraint containing x j , not only the constraints where its coefficient is positive, and not only the ones that looked like they needed attention. A substitution carried through three constraints out of four produces a program that is internally consistent, solves cleanly, and answers a different question.

A variable left without a nonnegativity restriction. Standard form requires it of every variable in the final program, introduced ones included. It is easy to convert all the constraints, introduce slacks and surpluses, and never state that they are nonnegative, at which point the program is not in standard form and the basis the simplex method expects does not exist.

The objective value reported without its sign flipped back. Maximizing c T x becomes minimizing ( − c ) T x , and the two have optimal values differing by a sign. The optimal solution is the same x ; the optimal value is not. Reporting the minimum of the converted program as the answer to the original maximization is a sign error that no constraint check will catch.

A shifted lower bound whose constant is dropped. Substituting x j = y j + ℓ leaves a constant c j ℓ in the objective. The converted program's optimal value omits it, so recovering the original value means adding it back. The optimal solution is unaffected, which is exactly why the omission goes unnoticed.

Each of these leaves a program that is feasible, solvable and wrong. Standard form is a claim that the converted program has the same answer as the original, and that claim is what has to be checked, not merely that the result looks like standard form.

Check your understanding

Two conversions, with less help each time

The worked conversion above showed all four steps. Here the scaffolding is removed a piece at a time.

First: the steps are named, you supply them.

min 5 x 1 + x 2 s.t. x 1 + x 2 ≥ 3 , x 1 ≤ 6 , x 1 , x 2 ≥ 0.

(a) Is the objective already a minimization? (b) Which constraint needs a surplus, and which a slack? (c) Write the converted program and confirm every variable is nonnegative.

Answer: the objective is untouched; x 1 + x 2 ≥ 3 takes a surplus, giving x 1 + x 2 − e 1 = 3 ; x 1 ≤ 6 takes a slack, giving x 1 + s 1 = 6 . The program is min 5 x 1 + x 2 subject to those two equalities with x 1 , x 2 , e 1 , s 1 ≥ 0 . Four variables, all restricted.

Then: no steps named.

max 2 x 1 − x 2 s.t. 3 x 1 + x 2 ≤ 12 , x 1 ≥ 2 , x 2  free .

Convert it, then say how the original optimal value is recovered from the converted one.

Answer: negate the objective to min − 2 x 1 + x 2 . Add a slack to the first constraint: 3 x 1 + x 2 + s 1 = 12 . The bound x 1 ≥ 2 is a shifted lower bound, so substitute x 1 = y 1 + 2 with y 1 ≥ 0 , which turns the first constraint into 3 y 1 + x 2 + s 1 = 6 and the objective into − 2 y 1 + x 2 − 4 . Split the free x 2 = x 2 + − x 2 − throughout. The converted program minimizes − 2 y 1 + x 2 + − x 2 − − 4 subject to 3 y 1 + x 2 + − x 2 − + s 1 = 6 , all variables nonnegative.

Recovering the value takes both corrections: the shift contributed − 4 , and the negation flips the sign. If the converted minimum is v , the original maximum is − v . Dropping either correction is a silent error. The program still solves.

Next step

Practice Converting Linear Programs to Standard Form

Practice this

Results update as you type. Use the up and down arrow keys to move between results, Enter to open one, and Escape to close.

Type to search.

Settings

Appearance

Interface density

Your record

Your progress is stored in this browser and nowhere else: an identifier, the answers you have given, the mastery states and review schedule derived from them, and the lesson you last opened. Clearing it makes you a new learner on this device. It cannot be undone, and it will not affect your appearance or density settings.

Focus timer

Focus--minutes remaining

Phase

Kept in this browser only, and used to label the session in your own history.

Today

Nothing recorded yet. Finish a focus session and it will appear here.

Settings

Focus sessions between long breaks.

Sessions you are aiming for in a day.

Notifications

Your history

Sessions are stored in this browser and nowhere else. They are not evidence and never reach your mastery record.