One Iteration of the Simplex Method

What you will be able to do

Given a standard-form minimization program and a basic feasible solution, the learner can select an entering variable from the reduced costs, apply the minimum ratio test to find the leaving variable and the step length, and report the resulting basis and basic feasible solution, without a tableau template.

Orientation

One iteration: choose a variable to bring in, find how far it can rise before something breaks, and see which variable hit zero first. Everything else in the simplex method is repetition.

The previous unit supplied the stopping rule. This one supplies the step. Together they are the whole method: test for optimality, and if the test fails, move to an adjacent corner and test again.

The step that carries the real content is the minimum ratio test, which answers a question the reduced cost cannot: not whether to move, but how far you may move before leaving the feasible region.

This unit assumes you can compute reduced costs and identify a basis and its basic feasible solution.

Intuition

Moving along an edge to the next vertex

A nonbasic variable sits at zero. Start raising it.

The constraints still have to hold, so the basic variables move in compensation. Some of them rise, some of them fall, and how fast each one moves is fixed by the arithmetic of the basis.

You are now walking along an edge of the feasible region, and the reduced cost told you this walk improves the objective. The only question left is when to stop.

The answer is: when the first falling basic variable reaches zero. One step further and it would go negative, which the nonnegativity restrictions forbid. So the walk ends exactly there, at the next corner.

Two things follow immediately.

A basic variable that is rising, or holding steady, never ends the walk. It is drifting away from zero, not toward it, so it places no limit at all. Only the falling ones matter, which is why the ratio test excludes rows with u i ≤ 0 .

And if nothing is falling, the walk never ends. The entering variable increases forever while every constraint stays satisfied, and the objective improves forever with it. That is what an unbounded program looks like from the inside.

Simulation

One simplex pivot as travel along an edge

Raising the entering variable until the first basic variable hits zero

The feasible region of the worked program, 2 x 1 + x 2 ≤ 12 and x 1 + 2 x 2 ≤ 12 . Start at the origin, the slack basis, and raise the entering variable x 1 by θ .

Move the control and the red point walks along the bottom edge. The basic variables compensate: x 3 = 12 − 2 θ and x 4 = 12 − θ , both falling. The walk must stop when the first of them reaches zero, which is θ ∗ = min ( 12 / 2 , 12 / 1 ) = 6 , attained by x 3 .

That is the minimum-ratio test, and this is what it means: not an arithmetic rule, but the question of which constraint becomes tight first as you move. One step further and x 3 would be negative, which is outside the region.

Definition

The iteration

Let B = ( B ( 1 ) , … , B ( m ) ) be a basis with basic feasible solution x , so x B ( i ) are the basic values and every other component is zero.

Entering variable. Choose a nonbasic j with c ¯ j < 0 . Each unit of x j changes the objective by c ¯ j , so raising it improves a minimization.

Direction. Raising x j to θ forces the basic variables to move. Writing

u = A B − 1 A j ,

the basic values become x B ( i ) − θ u i . The component u i is the rate at which the i -th basic variable falls per unit of x j .

Minimum ratio test. Feasibility requires x B ( i ) − θ u i ≥ 0 for every i . When u i ≤ 0 that holds for every θ ≥ 0 , so those rows impose nothing. When u i > 0 it requires θ ≤ x B ( i ) / u i . Therefore

θ ∗ = min i : u i > 0 x B ( i ) u i .

Leaving variable. A row attaining the minimum has its basic variable driven exactly to zero; that variable leaves the basis and x j takes its place.

The new point. x j = θ ∗ , each remaining basic variable becomes x B ( i ) − θ ∗ u i , and the objective falls by θ ∗ | c ¯ j | .

Unboundedness. If u i ≤ 0 for every i , the minimum is over an empty set. No variable ever reaches zero, x j increases without limit, and the program is unbounded.

Procedure

Steps of one iteration

Given a standard-form minimization program, a basis B , and its basic feasible solution:

Compute the reduced costs of the nonbasic variables. Form y T = c B T A B − 1 , then c ¯ j = c j − y T A j for each nonbasic j .

Test for optimality. If every c ¯ j ≥ 0 , stop: the current solution is optimal and no iteration is needed.

Choose an entering variable. Pick any j with c ¯ j < 0 . Taking the most negative is the common rule; any negative one is valid, and the choice affects how many iterations follow, not their correctness.

Compute the direction. u = A B − 1 A j . In practice solve A B u = A j rather than inverting.

Check for unboundedness. If no component of u is strictly positive, stop: the program is unbounded and there is no leaving variable.

Run the minimum ratio test on the positive rows only. For each i with u i > 0 , form x B ( i ) / u i . Ignore rows with u i ≤ 0 entirely: they do not constrain the step and their ratios are meaningless.

Identify the leaving variable and the step. θ ∗ is the smallest of those ratios; a row attaining it supplies the leaving variable. On a tie, either choice is valid and the new solution is degenerate.

Update. Replace the leaving index with j in the basis. Set x j = θ ∗ , set the leaving variable to zero, and replace each remaining basic value with x B ( i ) − θ ∗ u i .

Check. The new point should satisfy A x = b with every component nonnegative, and the objective should have fallen by θ ∗ | c ¯ j | .

Worked example

Two iterations to the optimum

Problem. In standard form:

min − 3 x 1 − 2 x 2 subject to 2 x 1 + x 2 + x 3 = 12 , x 1 + 2 x 2 + x 4 = 12 , x 1 , x 2 , x 3 , x 4 ≥ 0.

Start from the slack basis B = { 3 , 4 } .

Goal. Iterate to optimality, reporting each entering and leaving variable.

---

Iteration 1.

A B = I , so x 3 = 12 , x 4 = 12 , and x 1 = x 2 = 0 . The objective is 0 .

With c B = ( 0 , 0 ) T we get y T = ( 0 , 0 ) , so the reduced costs are just the cost coefficients:

c ¯ 1 = − 3 , c ¯ 2 = − 2 .

Entering: x 1 , the most negative.

Direction: u = A B − 1 A 1 = A 1 = ( 2 , 1 ) T .

Ratio test: both components are positive, so both rows count.

x 3 u 1 = 12 2 = 6 , x 4 u 2 = 12 1 = 12 .

Leaving: θ ∗ = 6 , attained in the first row, so x 3 leaves.

New point: x 1 = 6 , x 4 = 12 − 6 ( 1 ) = 6 , x 2 = x 3 = 0 . Objective − 18 , a fall of 6 × 3 as predicted.

---

Iteration 2.

Basis { 1 , 4 } with x 1 = 6 , x 4 = 6 .

Now y T = ( − 3 / 2 , 0 ) , giving

c ¯ 2 = − 1 2 , c ¯ 3 = 3 2 .

Entering: x 2 , the only negative one.

Direction: u = ( 1 / 2 , 3 / 2 ) T .

Ratio test:

6 1 / 2 = 12 , 6 3 / 2 = 4 .

Leaving: θ ∗ = 4 in the second row, so x 4 leaves.

New point: x 2 = 4 , x 1 = 6 − 4 ( 1 / 2 ) = 4 , x 3 = x 4 = 0 . Objective − 20 , a fall of 4 × 1 2 = 2 .

---

Iteration 3: the test.

Basis { 1 , 2 } with x 1 = 4 , x 2 = 4 . Here y T = ( − 4 / 3 , − 1 / 3 ) and

c ¯ 3 = 4 3 , c ¯ 4 = 1 3 .

Both are positive, so no variable improves the objective and the method stops.

Check. 2 ( 4 ) + 4 = 12 and 4 + 2 ( 4 ) = 12 : both constraints hold with equality, and all components are nonnegative.

Interpretation. The optimum is x 1 = x 2 = 4 with objective − 20 , that is a maximum of 20 for the original 3 x 1 + 2 x 2 . This is the same point and value the graphical unit reached by sliding a contour across the region. The two routes agree: the algebra reproduces what the picture showed, on problems too large to draw.

Contrast

Which rows enter the ratio test

The ratio test looks like "divide and take the smallest", and applying it to every row is the most common way an iteration goes wrong. The restriction to u i > 0 is not a convention; it is what the test means.

Take a basis with x B ( 1 ) = 8 , x B ( 2 ) = 3 , and an entering direction

u = ( 4 − 2 ) .

Incorrect. Compute both ratios: 8 / 4 = 2 and 3 / ( − 2 ) = − 1.5 . Take the smaller, − 1.5 , and let the second basic variable leave.

Correct. Only the first row qualifies, because u 2 = − 2 is negative. So θ ∗ = 8 / 4 = 2 and the first basic variable leaves.

Why the second row cannot limit anything. As the entering variable rises to θ , the second basic variable becomes

x B ( 2 ) − θ u 2 = 3 − θ ( − 2 ) = 3 + 2 θ .

It rises. It moves away from zero, never toward it, so no value of θ ever makes it negative. A row like this places no restriction on the step, and its ratio is not a step length at all. It is a negative number with no interpretation.

Taking it as the minimum would set θ ∗ = − 1.5 , moving backwards along the edge to a point that fails feasibility, and reporting a leaving variable that was never in danger.

A row with u i = 0 is excluded for the same reason. That basic variable does not move at all, so it cannot reach zero, and its ratio would require dividing by zero.

The reliable phrasing. The ratio test asks which basic variable hits zero first. Only variables that are falling can hit zero, and u i > 0 is exactly the condition for falling.

Next step

Practice One Iteration of the Simplex Method

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.