Part 2 · Chapter 8

The Simplex Method

The graphical method runs out of dimensions at two variables; real problems have thousands. The simplex method — George Dantzig's 1947 masterpiece — solves them all with the same geometric idea made algebraic: start at a corner of the feasible region, then hop to an adjacent corner that improves the objective, and repeat until no neighbour is better. This chapter builds the tableau that carries out that walk, the optimality test that says when to stop, and the pivot that takes each step, all traced through a full example.

Optimization Techniques Prof. Mithun Mondal Reading time ≈ 55 min
i What you'll learn
  • Why the simplex method scales where the graphical method cannot, and its vertex-hopping idea.
  • How to reach standard form with slack variables and read off the initial basic feasible solution.
  • The anatomy of the simplex tableau and the meaning of the \(z\)-row (reduced costs).
  • The optimality test and how to choose the entering variable.
  • The minimum-ratio test for the leaving variable and the pivot operation.
  • How to read the final tableau — solution, slacks, shadow prices — and recognise degeneracy.
Section 8-1

Why an Algebraic Method?

Chapter 6 proved that an LP optimum sits at a vertex, and Chapter 7 exploited that for two variables by drawing the corners. But a problem with \(n\) variables and \(m\) constraints can have up to \(\binom{n}{m}\) corners — an astronomical number even for modest sizes. Checking them all is hopeless.

The simplex method is the intelligent alternative. Rather than enumerate every vertex, it starts at one, then moves only to an adjacent vertex that improves the objective, ignoring the rest. Because each move strictly improves (or the problem is degenerate), it never revisits a corner and terminates after a modest number of steps in practice. Everything is done in a table of numbers — the tableau — so it needs no picture and no bound on dimension.

x₁ x₂ start (0,0) z=0 (0,6) z=30 (2,6) z=36
The simplex path: hop along improving edges from corner to corner until no better neighbour exists
Section 8-2

Standard Form and the Initial Basis

The simplex method requires standard form — equalities and non-negative variables — reached by adding a slack to every "\(\le\)" constraint. We will carry the running example through the whole chapter:

Running example → standard form
\[ \max\ z = 3x_1 + 5x_2 \ \longrightarrow\ \begin{aligned} x_1 &+ s_1 = 4\\ 2x_2 &+ s_2 = 12\\ 3x_1 + 2x_2 &+ s_3 = 18 \end{aligned}\quad x_1,x_2,s_1,s_2,s_3 \ge 0 \]

The three slack variables hand us a free starting corner. Set the "real" variables \(x_1 = x_2 = 0\) (non-basic); then \(s_1 = 4,\ s_2 = 12,\ s_3 = 18\) (basic), and \(z = 0\). This is the origin \((0,0)\) — an obvious basic feasible solution because each slack appears in exactly one equation with coefficient \(+1\), forming a ready-made identity basis. The simplex method begins here and improves.

Section 8-3

The Simplex Tableau

The tableau arranges the coefficients so each iteration is pure bookkeeping. Rows hold the constraint equations (one per basic variable); the bottom \(z\)-row holds the objective, written \(z - 3x_1 - 5x_2 = 0\) so its entries start as \(-c_j\). The last column is the right-hand side (the current values of the basic variables and of \(z\)).

pivot z-row basis RHS entering (pivot) column leaving row
Anatomy of the tableau: entering column, leaving row, and the pivot element at their crossing
Basisx₁x₂s₁s₂s₃RHSRatio
s₁101004
s₂02010126 ←
s₃32001189
z−3−50000
Section 8-4

The Optimality Test

The \(z\)-row entries are the reduced costs — how much \(z\) would change per unit increase of each non-basic variable. With the objective written as \(z - \sum c_j x_j = 0\), a negative entry means bringing that variable into the basis would still raise \(z\), so we are not yet optimal.

🔑
Optimality test (maximization)
\[ \text{optimal} \iff \text{every } z\text{-row entry} \ge 0 \]

If any \(z\)-row entry is negative, the current corner can be improved — pick one to enter the basis. If all are \(\ge 0\), no non-basic variable can raise \(z\) and the current basic feasible solution is optimal. (For minimization the test flips: stop when all \(z\)-row entries are \(\le 0\).)

Section 8-5

The Simplex Iteration

Each iteration performs three actions: choose which variable enters the basis, choose which leaves, and pivot to update the tableau.

StepRulePurpose
Entering variableMost negative \(z\)-row entry → its column is the pivot columnSteepest improvement of \(z\)
Leaving variableMinimum ratio \(\dfrac{\text{RHS}}{\text{pivot-column entry}}\) over positive entries → pivot rowStay feasible (no variable goes negative)
PivotGauss–Jordan on the pivot element to make its column a unit vectorMove to the adjacent vertex
🔑
The minimum-ratio test
\[ \text{leaving row} = \arg\min_i \left\{ \frac{b_i}{a_{ik}} : a_{ik} > 0 \right\} \]

Only positive pivot-column entries \(a_{ik}\) are considered; a zero or negative entry places no limit on the entering variable. If no entry is positive, the entering variable can grow without bound — the problem is unbounded.

Section 8-6

A Full Worked Solution

Iteration 1. In the initial tableau (Section 8-3) the most negative \(z\)-row entry is \(-5\) under \(x_2\) — so \(x_2\) enters. The ratios are \(12/2 = 6\) (row \(s_2\)) and \(18/2 = 9\) (row \(s_3\)); row \(s_1\) is skipped (zero entry). The minimum \(6\) makes \(s_2\) leave, with pivot element \(2\). Dividing the \(s_2\) row by \(2\) and clearing the \(x_2\) column gives:

Basisx₁x₂s₁s₂s₃RHSRatio
s₁1010044
x₂0101/206
s₃300−1162 ←
z−3005/2030

Now \(z = 30\) at the corner \((0,6)\). Iteration 2. The only negative \(z\)-row entry is \(-3\) under \(x_1\) — \(x_1\) enters. Ratios: \(4/1 = 4\) (row \(s_1\)) and \(6/3 = 2\) (row \(s_3\)); the minimum \(2\) makes \(s_3\) leave, pivot element \(3\). Dividing the \(s_3\) row by \(3\) and clearing the \(x_1\) column:

Basisx₁x₂s₁s₂s₃RHS
s₁0011/3−1/32
x₂0101/206
x₁100−1/31/32
z0003/2136
🔑
Optimal — read the final tableau
\[ x_1 = 2,\quad x_2 = 6,\quad z^\star = 36,\quad s_1 = 2,\ s_2 = s_3 = 0 \]

Every \(z\)-row entry is now \(\ge 0\), so we stop. The solution \((2,6)\) with \(z = 36\) matches the graphical answer of Chapter 7 exactly. As a bonus, the \(z\)-row entries under the slacks are the shadow prices of the constraints: \(0\) for constraint 1 (it had slack), \(3/2\) for constraint 2, and \(1\) for constraint 3 — the same marginal values Chapter 5 defined with multipliers.

Section 8-7

Degeneracy, Cycling, and Practical Notes

A tie in the minimum-ratio test produces a degenerate basic feasible solution — one where a basic variable equals zero. Geometrically, more than the minimum number of constraints pass through the same vertex. Degeneracy is harmless in itself, but in rare theoretical cases it can cause cycling: the algorithm pivots among bases of equal objective value without progressing. Simple anti-cycling rules — most famously Bland's rule (always choose the lowest-indexed eligible variable) — guarantee termination.

What the tableau tells you beyond the answer. A zero reduced cost for a non-basic variable at optimality signals alternative optima — that variable could enter with no change in \(z\), sweeping out an optimal edge. A pivot column with no positive entry signals an unbounded objective. And the slack values reveal which resources are bottlenecks (zero slack) and which have room to spare. The simplex tableau is not just a solver; it is a complete diagnostic of the LP.
Section 8-8

Worked Examples

1 Setting up the initial tableau

Problem. Put \(\max\ z = 5x_1 + 4x_2\) s.t. \(6x_1 + 4x_2 \le 24,\ x_1 + 2x_2 \le 6,\ x \ge 0\) into a starting tableau.

Solution. Add slacks: \(6x_1 + 4x_2 + s_1 = 24,\ x_1 + 2x_2 + s_2 = 6\). Initial basis \(s_1 = 24,\ s_2 = 6\), \(z\)-row \([-5, -4, 0, 0\ |\ 0]\). The most negative entry \(-5\) means \(x_1\) enters first; ratios \(24/6 = 4\) and \(6/1 = 6\) make \(s_1\) leave (pivot element \(6\)).

2 Choosing entering and leaving variables

Problem. A \(z\)-row reads \([-2, 0, -6, 0\ |\ 40]\) and the \(x_3\) column (over the two constraint rows) is \([4, 2]^{\mathsf T}\) with RHS \([16, 18]^{\mathsf T}\). Which variable enters, and which leaves?

Solution. The most negative reduced cost is \(-6\) under \(x_3\), so \(x_3\) enters. Ratios: \(16/4 = 4\) and \(18/2 = 9\); the minimum \(4\) selects the first row to leave. The pivot element is \(4\).

3 One pivot operation

Problem. With pivot element \(2\) in the \(x_2\) column, \(s_2\) row \([0, 2, 0, 1, 0\ |\ 12]\), perform the pivot on the \(s_3\) row \([3, 2, 0, 0, 1\ |\ 18]\).

Solution. Normalize the pivot row: \(x_2\) row \(= [0, 1, 0, 1/2, 0\ |\ 6]\). Then subtract \(2 \times\) it from the \(s_3\) row:

Working
\[ [3,2,0,0,1\,|\,18] - 2[0,1,0,\tfrac12,0\,|\,6] = [3,0,0,-1,1\,|\,6] \]

which is exactly the updated \(s_3\) row from Iteration 1.

4 Reading the optimal solution

Problem. A final tableau has basic variables \(x_1 = 3,\ x_2 = 1.5\), non-basic \(s_1 = s_2 = 0\), and \(z\)-row \([0, 0, 0.5, 1.5\ |\ 21]\). State the solution and the shadow prices.

Solution. All \(z\)-row entries are \(\ge 0\), so it is optimal: \(x_1 = 3,\ x_2 = 1.5,\ z^\star = 21\). Both slacks are zero, so both constraints are binding. Their shadow prices are the \(z\)-row entries under the slacks: \(0.5\) for constraint 1 and \(1.5\) for constraint 2.

5 Detecting an unbounded LP

Problem. During an iteration, the entering variable's column is \([-2, -1]^{\mathsf T}\) with RHS \([5, 8]^{\mathsf T}\). What happens?

Solution. No pivot-column entry is positive, so the minimum-ratio test has no eligible row. The entering variable can increase indefinitely without any basic variable turning negative — the objective grows without bound and the LP is unbounded. The algorithm stops and reports this.

6 Recognising alternative optima

Problem. An optimal tableau has all \(z\)-row entries \(\ge 0\), but the reduced cost of the non-basic variable \(x_2\) is exactly \(0\). What does this mean?

Solution. Bringing \(x_2\) into the basis would leave \(z\) unchanged, so there is a second optimal basic feasible solution — and the whole edge between the two is optimal. The LP has alternative optima, the algebraic signature of the parallel-objective case seen graphically in Chapter 7.

Review

Chapter Summary

Vertex hopping

Simplex moves from corner to improving adjacent corner — never enumerating them all.

Start

Add slacks for standard form; the slacks give the initial BFS at the origin.

Optimality test

Stop when every \(z\)-row entry is \(\ge 0\) (maximization).

Entering / leaving

Most negative reduced cost enters; minimum ratio test picks the leaving row.

Pivot

Gauss–Jordan on the pivot element moves to the next vertex; repeat.

Diagnostics

Zero reduced cost → alternative optima; no positive ratio → unbounded; slacks → bottlenecks.

Practice

Problems

Set up each tableau carefully and carry out every pivot; check your final answer against a quick sketch where possible. Difficulty rises down the list.

  1. Convert to standard form and write the initial tableau: \(\max\ 4x_1 + 3x_2\) s.t. \(2x_1 + x_2 \le 10,\ x_1 + 3x_2 \le 15,\ x \ge 0\).
  2. For Problem 1, identify the first entering and leaving variables and the pivot element.
  3. Solve \(\max\ 5x_1 + 4x_2\) s.t. \(6x_1 + 4x_2 \le 24,\ x_1 + 2x_2 \le 6,\ x \ge 0\) by simplex; report \(x^\star\), \(z^\star\), and all slacks.
  4. Solve \(\max\ 2x_1 + 3x_2\) s.t. \(x_1 + x_2 \le 4,\ x_1 + 3x_2 \le 6,\ x \ge 0\) and confirm the answer graphically.
  5. In a tableau, the entering column is \([3, -2, 1]^{\mathsf T}\) with RHS \([9, 5, 4]^{\mathsf T}\). Determine the leaving row.
  6. Explain why only positive pivot-column entries are used in the ratio test.
  7. Perform a single pivot: pivot element \(4\) at row 1, column \(x_1\); row 1 is \([4, 1, 1, 0\ |\ 12]\), row 2 is \([2, 3, 0, 1\ |\ 10]\). Update both rows.
  8. Given a final \(z\)-row \([0, 0, 2, 0, 5\ |\ 48]\), state the optimal objective value and the shadow prices of the constraints.
  9. How can you tell from a tableau that an LP is unbounded? Give a small example.
  10. How does a zero reduced cost for a non-basic variable at optimality reveal alternative optima?
  11. Define a degenerate basic feasible solution and explain how it can arise from a tie in the ratio test.
  12. A firm maximizes \(z = 6x_1 + 5x_2\) subject to \(x_1 + x_2 \le 5,\ 3x_1 + 2x_2 \le 12,\ x \ge 0\). Solve by the simplex method, showing every tableau; then state \(x^\star\), \(z^\star\), which constraints are binding, the shadow price of each, and whether the optimum is unique.
Tip: keep the tableau tidy and check invariants after each pivot — the pivot column should become a unit vector, the basic variables should read directly off the RHS, and \(z\) should never decrease (for a maximization). If a basic variable turns negative, you chose the wrong leaving row; if \(z\) drops, you pivoted on the wrong column. And remember the final \(z\)-row is a gift: its slack entries hand you the shadow prices for free, connecting straight to the duality theory of Chapter 10.