Module 1 of 6 · Lesson 6 of 7

Transforming the Variables

Variables that are unrestricted, nonpositive, or bounded below by something other than zero.

What you will be able to do

Given a linear program whose variables carry sign restrictions other than simple nonnegativity, the learner can select and apply the appropriate substitution for each, carry it through the objective and every constraint, account for any constant it produces, and state how an original solution is recovered from the converted one.

Orientation

A variable bounded below by 4, or free to go negative, cannot enter a method that assumes every variable starts at zero. Each awkward case has a substitution that fixes it, and each substitution has to be carried everywhere the variable appears, including into the answer you eventually report back.

The conversion unit introduced the splitting substitution as one step among four. This unit is about the substitutions themselves: which one each restriction calls for, what each leaves behind in the objective, and how to read a converted solution back to the problem you started with.

The reason it warrants separate treatment is the non-uniqueness. A split variable can be represented in infinitely many ways, and the consequence, that a converted program has infinitely many optimal solutions where the original had one, surprises people and is regularly misreported as a discovery about the problem.

This unit assumes you can convert a program to standard form and know why standard form demands nonnegative variables.

Intuition

Slack variables against variable substitution

Two different operations are both called part of conversion, and running them together is the first thing to avoid.

Slack and surplus variables change the shape of a constraint. An inequality becomes an equality by absorbing the difference between the two sides. The original variables are untouched; something new sits alongside them.

These substitutions change the variables themselves. The original variable vanishes from the program and something else stands in its place everywhere it occurred. Nothing is added to any constraint. A symbol is replaced.

The splitting substitution deserves the most attention. Any real number is a difference of two nonnegative numbers: 5 = 5 − 0 , and − 3 = 0 − 3 . That is the substitution. But 5 is also 9 − 4 , and 100 − 95 , and nothing in the program prefers the tidy version. The representation is genuinely not unique.

So convert a program with one optimal solution and a split variable, and the converted program has a whole ray of optimal solutions. Every one of them encoding the same original answer. Reporting them as distinct plans means reporting one plan repeatedly.

The shifting substitution works differently, as a change of origin rather than an addition. Measure a variable from its lower bound instead of from zero, and the bound becomes automatic: the constraint stating it can be discarded because the new variable cannot violate it. What survives is a constant in the objective, and that constant is the thing most often dropped.

Definition

Three substitutions

The canonical statement gives the three substitutions. In practice the difference is what each one costs and what has to be undone afterwards.

A free variable doubles into two columns, and the split is not unique. x j = x j + − x j − admits infinitely many representations of the same value: 3 = 5 − 2 = 100 − 97 . Every one is feasible and every one gives the same objective, so a solver may return any of them. Reading x j back means taking the difference, never either component alone.

A nonzero lower bound leaves a constant behind. Substituting x j = u j + ℓ removes the constraint entirely, which is the point, but it puts c j ℓ into the objective. That constant does not affect which point is optimal and does affect the reported value, so it must be carried and added back. Dropping it is the commonest error in the conversion, and it is invisible: the solution is right and the number beside it is wrong.

Every substitution has to be reversed in the report. The solver answers in u j , v j , x j + and x j − , which are artefacts of the form rather than quantities anybody asked about. The model was written in the original variables and the answer has to arrive in them.

Procedure

Applying the substitutions

Classify every variable by its restriction. Go through the variable list and record, for each, whether it is already nonnegative, unrestricted in sign, nonpositive, or bounded below by a nonzero constant. Do this before substituting anything, because the choice of substitution follows from the classification.

Leave the already-nonnegative variables alone. A variable with x j ≥ 0 needs nothing. Substituting anyway adds variables and columns for no reason.

Substitute each restricted variable according to its class. Unrestricted: x j = x j + − x j − . Nonpositive: x j = − v j . Lower-bounded: x j = u j + ℓ .

Carry each substitution through the objective and every constraint. Work systematically along the program rather than by eye. A variable appearing in four constraints must be replaced in all four, and its appearance in the objective is the one most often overlooked.

Collect the constants a shift produces. Substituting x j = u j + ℓ into a constraint changes its right-hand side; substituting into the objective leaves an additive constant. Move the constraint constants into the right-hand sides and hold the objective constant aside. It does not affect which point is optimal, and it does affect the reported value.

Discard the restrictions the substitutions absorbed. The row x j ≥ ℓ is gone, as is the declaration that x j is unrestricted. What remains is the nonnegativity of the new variables.

Confirm every variable is nonnegative. Original untouched variables, slack and surplus variables, split pairs, shifted variables, negated variables. Every one must carry a nonnegativity restriction, or the program is not in standard form.

Write down how to read the answer back. Record x j = x j + − x j − , or x j = u j + ℓ , or x j = − v j , together with the objective constant. Without this the converted solution cannot be reported in the original problem's terms.

Example

One variable of each kind

Unrestricted. x free, appearing as 3 x in the objective and x ≤ 7 in a constraint. Substitute x = x + − x − :

Objective term becomes 3 x + − 3 x − ; the constraint becomes x + − x − ≤ 7 , which then takes a slack variable like any inequality. Two new variables, both nonnegative.

Nonpositive. y ≤ 0 , appearing as − 4 y in the objective and 2 y ≥ − 10 in a constraint. Substitute y = − v with v ≥ 0 :

Objective term becomes − 4 ( − v ) = 4 v ; the constraint becomes − 2 v ≥ − 10 , equivalently v ≤ 5 . One new variable, and every sign involving it has flipped.

Lower-bounded. z ≥ 3 , appearing as 6 z in the objective and z + w ≤ 20 in a constraint. Substitute z = u + 3 with u ≥ 0 :

Objective term becomes 6 ( u + 3 ) = 6 u + 18 , so 6 u enters the program and the constant 18 is set aside. The constraint becomes u + 3 + w ≤ 20 , that is u + w ≤ 17 . The restriction z ≥ 3 is discarded, having been absorbed.

Reading back. x = x + − x − , y = − v , z = u + 3 , and the reported optimal value must have 18 added to it before it is comparable with the original objective.

Worked example

A program with all three restrictions

Problem. Convert to standard form:

max 4 p + 3 q − 2 r subject to p + q + r ≤ 30 , 2 p − q ≥ 5 , p ≥ 2 , q  free , r ≤ 0.

Goal. A standard-form program, plus the rule for reading its answer back.

Relevant principle. Classify first, substitute everywhere, and hold the objective constant aside.

Step 1: classify. p is bounded below by 2 ; q is unrestricted; r is nonpositive.

Step 2: choose the substitutions. p = u + 2 with u ≥ 0 . q = q + − q − with q ± ≥ 0 . r = − v with v ≥ 0 .

Step 3: the objective.

4 ( u + 2 ) + 3 ( q + − q − ) − 2 ( − v ) = 4 u + 8 + 3 q + − 3 q − + 2 v .

Maximising this is maximising 4 u + 3 q + − 3 q − + 2 v , with the constant 8 held aside. Negating for a minimisation:

min − 4 u − 3 q + + 3 q − − 2 v .

Step 4: the first constraint. ( u + 2 ) + ( q + − q − ) + ( − v ) ≤ 30 , so u + q + − q − − v ≤ 28 . Adding a slack: u + q + − q − − v + s 1 = 28 , s 1 ≥ 0 .

Step 5: the second constraint. 2 ( u + 2 ) − ( q + − q − ) ≥ 5 , so 2 u + 4 − q + + q − ≥ 5 , that is 2 u − q + + q − ≥ 1 . Subtracting a surplus: 2 u − q + + q − − e 1 = 1 , e 1 ≥ 0 .

Step 6: discard the absorbed restrictions. p ≥ 2 is gone, absorbed into u ≥ 0 . The declarations that q is free and r nonpositive are gone, replaced by nonnegativity on their substitutes.

Result.

min − 4 u − 3 q + + 3 q − − 2 v

subject to

u + q + − q − − v + s 1 = 28 , 2 u − q + + q − − e 1 = 1 , u , q + , q − , v , s 1 , e 1 ≥ 0.

Check. Minimisation, two equalities, six variables all nonnegative. Standard form holds.

Reading back. If the minimum is w , the original maximum is − w + 8 . The original variables are p = u + 2 , q = q + − q − , and r = − v .

What is easiest to lose here. The constant 8 , and the + 4 that the shift pushed into the second constraint's right-hand side. Both come from the same substitution, and dropping either gives an answer that is internally consistent and wrong.

Non-example

Substitutions that do not do what they appear to

Not a variable transformation: an upper bound. x ≤ 12 is a constraint. It takes a slack variable and becomes x + s = 12 . Substituting x = 12 − w to 'make it nonnegative' also removes the restriction that x ≥ 0 , which was a genuine part of the problem, and produces a different feasible set.

Not sufficient: substituting in the constraints only. Replacing q by q + − q − in every constraint while leaving 3 q in the objective produces a program whose objective refers to a variable that no longer exists. Where a solver tolerates it, the objective is silently wrong.

Not equivalent: dropping the shift constant. Converting z ≥ 3 by z = u + 3 and forgetting the 18 in the objective gives the correct optimal u , hence the correct z , and an optimal value short by 18 . The solution is right and the number reported for it is wrong. A failure mode that survives every check on the point itself.

Not a valid simplification: forcing one of a split pair to zero. Writing 'take q − = 0 since only one is needed' converts a sign-unrestricted variable into a nonnegative one. That is a different problem, and it will be infeasible whenever the original optimum requires q < 0 .

Not two solutions: two split pairs giving one value. The pairs ( 5 , 0 ) and ( 9 , 4 ) both represent q = 5 . A solver reporting them at two iterations has not found two plans.

Contrast

Non-uniqueness of the sign-unrestricted split

The substitution x = x + − x − looks like a definition, and it is natural to read it as assigning each x a specific pair. It does not.

The arithmetic. For any t ≥ 0 ,

( x + + t ) − ( x − + t ) = x + − x − = x .

Adding the same amount to both members leaves the difference unchanged and both members nonnegative. So x = 5 is represented by ( 5 , 0 ) , by ( 9 , 4 ) , by ( 1000 , 995 ) , and by infinitely many other pairs, all feasible.

What that does to the converted program. Suppose the original has a unique optimal solution with x = 5 . The converted program has infinitely many optimal solutions, the entire ray { ( 5 + t , t ) : t ≥ 0 } in those two coordinates, every one with the same objective value, because the objective contains c ( x + − x − ) and the t cancels there too.

How this is misread. A solver is run twice, or a log is examined across iterations, and different values of x + and x − appear. The natural conclusion is that the problem has several optimal plans. It does not: it has one, reported in a representation that admits many spellings. Reporting ( 5 , 0 ) and ( 9 , 4 ) as two answers means reporting x = 5 twice.

What is genuinely multiple. Multiple optima in the original problem means several distinct values of x attaining the optimum, which comes from the objective being parallel to a binding constraint. The test is to read the pairs back: if x + − x − differs between two reported solutions, the optima are genuinely distinct; if it is the same, they are one solution written differently.

The habit. Always report the recovered original variables, never the converted ones. The recovery rule is part of the conversion, not an afterthought, which is why it belongs in the written record alongside the transformed program.

Exercise

1. Convert max 2 a + 5 b subject to a + b ≤ 9 , a ≥ 4 , b free, to standard form. Give the recovery rule and the objective constant.

2. A variable x satisfies x ≤ 0 and appears as − 3 x in the objective and x + y ≥ − 6 in a constraint. Substitute and give both rewritten expressions.

3. Show that ( 7 , 2 ) and ( 12 , 7 ) represent the same value of a split variable, and state what that value is.

4. A colleague converts z ≥ 5 by substituting z = u + 5 and reports an optimal value of 40 . What must be done to that number before it is comparable with the original objective, and why does the optimal point need no correction?

5. Explain why x ≤ 12 is not handled by a variable substitution, and give the correct treatment.

What to carry forward

Three substitutions make variables nonnegative, and each replaces a variable rather than adding to a constraint. Unrestricted: x = x + − x − . Nonpositive: x = − v . Bounded below by ℓ : x = u + ℓ .

An upper bound belongs to the other family: it is a constraint and takes a slack variable.

Every substitution must be carried through the objective and every constraint. The objective is where an omission is easiest and least visible.

A shift leaves a constant in the objective and changes the right-hand sides of the constraints the variable appears in. The constant does not affect which point is optimal and does affect the value reported for it.

The split of a sign-unrestricted variable is not unique: adding the same amount to both members represents the same original value. So a converted program has infinitely many optimal solutions wherever a split variable appears, and they are one original solution written many ways rather than several plans.

Record the recovery rule when you record the converted program. A solution expressed in substituted variables is not an answer to the question that was asked.

Next step

Practice Transforming the Variables

Practice records what support you used, so the evidence reflects how you actually performed.

Practice this lessonSkip to The Transportation Model

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.