Chapter 10 · Iterative Improvement
The Simplex Method
A Linear Programming (LP) problem in two variables: see its feasible region, slide the objective line to the best corner, and watch the simplex tableau walk from corner to adjacent corner — each step better than the last.
Objective
x +
y
Use ≤ / <=, ≥ / >=, or =. Fractions and decimals work:
1/2x + y <= 3.5.
feasible region
constraint line
objective line / simplex path
current basic solution
not yet feasible (Phase I)
Objective lineor drag on the plot
Simplex tableau
pivot column (entering)
pivot row (departing)
negative objective entry
How to read this
- Green region = every point (x, y) that satisfies all constraints. Its corners are the extreme points; the table lists each with its objective value.
- Blue lines are the constraint boundaries. A dashed green edge means the region keeps going forever in that direction.
- The orange dashed line is a level line c₁x + c₂y = z. Sliding it shows the geometric solution: the last corner it touches is optimal.
- The tableau is the same problem in algebra. Each row's basic variable equals that row's right-hand side (RHS); all other variables are 0. That basic feasible solution is the blue ring on the plot.
- Each pivot swaps one basic variable for one nonbasic one — on the plot, a hop along an edge to an adjacent corner (orange arrows).
- Minimizing f is done as maximizing z = −f. If the origin breaks a ≥ or = constraint, Phase I first drives artificial variables a₁, a₂, … to 0; the ring is dashed red until the point is feasible.
Try this
- Default problem: predict the path before pressing play. Simplex goes O → C → B (z = 0 → 10 → 14) and never visits A, even though A (z = 12) is also a corner.
- Change the objective to
1x + 1y. Now the level line is parallel to x + y ≤ 4: every point on edge A–B is optimal. Which corner does simplex report? - Load Unbounded. Watch the step where the entering column has no positive entry — no θ-ratio exists, so nothing stops the growth.
- Load Infeasible. Phase I ends with W < 0: the artificial variables can't all reach 0, so no point satisfies both constraints.
- Add
x <= 3.5to the default problem. Does the optimum change? (It shouldn't: B = (3, 1) already satisfies it — the new constraint is not binding.)
Go deeper
📖 Lesson 10: Iterative Improvement
🏟️ Arena · Chapter 10
🧩 Problem: simplex-max-2var
🎮 Max-flow (an LP with special structure)
🎮 Bipartite matching
🎮 Stable marriage
Reference: Levitin §10.1. Simplex takes about m to 3m pivots on typical inputs (m = number of constraints) but is exponential in the worst case; interior-point methods such as Karmarkar's algorithm are polynomial.