Linear Programming and the Simplex Method

⚡ Key Takeaways

Linear Programming (LP) optimizes a linear objective function subject to linear equality and inequality constraints. Key result: the optimum, if it exists, occurs at a vertex of the feasible polytope; the Simplex Method (Dantzig, 1947) finds it by walking vertex-to-vertex along edges of improving objective value. Applies to resource allocation, logistics, diet, scheduling, network flow, and game theory. Developed by George Dantzig at the U.S. Air Force; theoretical foundations by Kantorovich, von Neumann, and others.

💡 The Core Insight

The feasible region of an LP is a convex polyhedron. A linear objective attains its extreme value on a vertex (extreme point) of that polyhedron. Since there are finitely many vertices, optimization reduces to searching among them — and the Simplex Method does this intelligently, never moving to a worse vertex, by exploiting the algebraic correspondence between vertices and basic feasible solutions.

Formal Statement

DefinitionStandard Form Linear Program

A linear program in standard form is written

1
max⁡x  cTxsubject toAx=b,  x≥0\quad \max_{x} \; c^Tx \quad \text{subject to} \quad Ax = b,\; x \ge 0

Derivation hint: any inequality Ax≤bAx \le b becomes equality by adding a nonnegative slack variable ss: Ax+s=bAx + s = b, s≥0s \ge 0. Symbols:

  • x∈Rnx \in \mathbb{R}^n — the decision variables (quantities to choose).
  • c∈Rnc \in \mathbb{R}^n — the cost/profit vector; cTxc^Tx is the objective.
  • A∈Rm×nA \in \mathbb{R}^{m\times n} — the constraint matrix (mm constraints, nn variables).
  • b∈Rmb \in \mathbb{R}^m — the right-hand side (resource availabilities).
  • x≥0x \ge 0 — componentwise nonnegativity.

The feasible region is P={x∈Rn:Ax=b,  x≥0}\mathcal{P} = \{x \in \mathbb{R}^n : Ax = b,\; x \ge 0\}, a convex polyhedron.

DefinitionBasic Feasible Solution

Assume AA has full row rank mm with m<nm < n. Partition columns into a basis BB (an invertible m×mm \times m submatrix) and nonbasis NN. Setting nonbasic variables xN=0x_N = 0 gives the basic solution

2
xB=B−1b,xN=0\quad x_B = B^{-1}b, \qquad x_N = 0

Derivation hint: Ax=bAx = b splits as BxB+NxN=bBx_B + Nx_N = b; set xN=0x_N=0 and invert BB. If xB=B−1b≥0x_B = B^{-1}b \ge 0, it is a basic feasible solution (BFS). BFSs correspond exactly to vertices of P\mathcal{P}.

TheoremFundamental Theorem of Linear Programming

For an LP in standard form with nonempty feasible region P\mathcal{P}: 1. If P≠∅\mathcal{P} \neq \emptyset, there exists at least one basic feasible solution (vertex). 2. If an optimal solution exists, then there exists an optimal solution that is a basic feasible solution. Consequently, optimizing a linear objective reduces to searching a finite set of vertices.

TheoremReduced Costs and Optimality

Given a BFS with basis BB, define the reduced cost vector for nonbasic variables

3
cˉN=cN−NT(B−1)TcB=cN−NTy,y=(B−1)TcB\quad \bar{c}_N = c_N - N^T (B^{-1})^T c_B = c_N - N^T y, \quad y = (B^{-1})^T c_B

Derivation hint: substitute xB=B−1(b−NxN)x_B = B^{-1}(b - Nx_N) into cTxc^Tx to express the objective in terms of nonbasic variables. For a maximization problem, the current BFS is optimal iff cˉN≤0\bar{c}_N \le 0 (no nonbasic variable can be increased to improve the objective). The vector yy is the vector of dual variables.

Why It Holds / Derivation

ProofThe Simplex Method Improves at Every Step

Setup. Start at a BFS with basis BB. The objective written in nonbasic variables is

4
z=cBTB−1b+cˉNTxN\quad z = c_B^T B^{-1} b + \bar{c}_N^T x_N

Derivation hint: substitute xB=B−1b−B−1NxNx_B = B^{-1}b - B^{-1}N x_N into z=cBTxB+cNTxNz = c_B^Tx_B + c_N^Tx_N.

Step 1 — Pricing. Compute cˉN\bar{c}_N via [3]. If all cˉj≤0\bar{c}_j \le 0, equation [4] shows increasing any xj≥0x_j \ge 0 cannot raise zz, so we are optimal. Stop.

Step 2 — Entering variable. Otherwise choose jj with cˉj>0\bar{c}_j > 0. Increasing xjx_j from 00 increases zz at rate cˉj\bar{c}_j.

Step 3 — Ratio test. As xjx_j increases by t≥0t \ge 0, the basic variables change:

5
xB(t)=B−1b−t B−1Aj=bˉ−t d\quad x_B(t) = B^{-1}b - t\,B^{-1}A_j = \bar{b} - t\,d

Derivation hint: only column AjA_j enters, so the perturbation direction is d=B−1Ajd = B^{-1}A_j. To keep xB≥0x_B \ge 0, the maximum step is

6
t∗=min⁡i: di>0bˉidi\quad t^* = \min_{i:\, d_i > 0} \frac{\bar{b}_i}{d_i}

Derivation hint: the first basic variable to hit zero determines the binding ratio.

Step 4 — Pivot. The variable achieving the minimum leaves the basis; xjx_j enters. This yields a new BFS (adjacent vertex) with objective increased by t∗cˉj≥0t^*\bar{c}_j \ge 0.

Step 5 — Termination. If d≤0d \le 0 (no positive component) in Step 3, xjx_j can increase without bound and z→+∞z \to +\infty: the LP is unbounded. Otherwise, since there are finitely many bases and (under nondegeneracy) the objective strictly increases, no basis repeats, so the algorithm terminates at an optimum. ■\blacksquare

∎
⚠️ Degeneracy and Cycling

When some basic variable equals zero (bˉi=0\bar{b}_i = 0), the ratio test may give t∗=0t^* = 0: a pivot changes the basis but not the vertex or objective. Repeated zero-step pivots can cycle forever. Anti-cycling rules — Bland's rule (choose smallest-index entering/leaving variable) or the lexicographic method — guarantee termination.

GD
George Dantzig
1914–2005

George Bernard Dantzig formulated the Simplex Method in 1947 while working for the U.S. Air Force on planning and logistics (Project SCOOP). He recognized that the "programming" of interdependent military activities could be cast as linear optimization, and devised the vertex-walking algorithm to solve it. A famous anecdote: as a graduate student he arrived late to a statistics class, copied two problems from the board thinking they were homework, and solved them — only later learning they were two famous unsolved problems. Dantzig also championed LP duality and contributed to large-scale decomposition methods. He is widely regarded as the father of linear programming.

Building Intuition

🧠 Intuition

Picture the feasible region as a many-faceted gemstone (a convex polytope) sitting in space. The objective cTxc^Tx defines a direction; imagine pushing a flat plane (a level set cTx=zc^Tx = z) in that direction as far as it will go while still touching the gem. The last point of contact is a vertex (or, in ties, an edge or face). The Simplex Method doesn't search the interior — it crawls along the edges of the gem, from corner to corner, always moving so the plane advances. Each pivot is one edge-walk. Because there are finitely many corners and we never go backward, we must reach the highest one.

Figure
Simplex walking along vertices of a 2-D feasible polygon toward the optimum
x₁ x₂ cᵀx ↑ start optimum feasible region

Worked Examples

ExampleCarpenter's Production Mix

A carpenter makes tables (x1x_1) and chairs (x2x_2). Profit: $30/table, $20/chair. Constraints:

  • Wood: 6x1+3x2≤966x_1 + 3x_2 \le 96 board-feet
  • Labor: 2x1+4x2≤602x_1 + 4x_2 \le 60 hours
  • x1,x2≥0x_1, x_2 \ge 0

Objective: maximize z=30x1+20x2z = 30x_1 + 20x_2.

Standard form (add slacks s1,s2s_1,s_2): 6x1+3x2+s1=966x_1+3x_2+s_1=96, 2x1+4x2+s2=602x_1+4x_2+s_2=60.

Iteration 0. Basis {s1,s2}\{s_1,s_2\}, x=(0,0)x=(0,0), z=0z=0. Reduced costs cˉx1=30>0\bar c_{x_1}=30>0, cˉx2=20>0\bar c_{x_2}=20>0. Choose x1x_1 (largest). Ratio test: 96/6=1696/6=16, 60/2=3060/2=30. Min is 1616 → s1s_1 leaves. New x1=16x_1=16.

Iteration 1. Pivot on row 1. New objective row gives cˉx2=20−30(36)=5>0\bar c_{x_2}=20-30(\tfrac{3}{6})=5>0. Enter x2x_2. Updated column and RHS: ratio test yields x2x_2 enters, s2s_2 leaves. Solving the 2×22\times2 system at the vertex 6x1+3x2=966x_1+3x_2=96, 2x1+4x2=602x_1+4x_2=60: x1=14x_1 = 14, x2=4x_2 = 4.

Check optimality: all reduced costs ≤0\le 0. Profit:

z=30(14)+20(4)=420+80z = 30(14)+20(4) = 420+80

Boxed answer: x1=14 tables,  x2=4 chairs,  z=$500\boxed{x_1 = 14 \text{ tables}, \; x_2 = 4 \text{ chairs}, \; z = \$500}

ExampleDiet Problem (Minimization)

Minimize cost of a diet meeting nutrient minimums using Food A (x1x_1, $2/unit) and Food B (x2x_2, $3/unit):

  • Protein: x1+2x2≥10x_1 + 2x_2 \ge 10
  • Vitamins: 3x1+x2≥123x_1 + x_2 \ge 12
  • x1,x2≥0x_1, x_2 \ge 0

Objective: minimize z=2x1+3x2z = 2x_1 + 3x_2. Convert ≥\ge to ≤\le for Simplex by subtracting surplus variables (or use the dual / Big-M). Geometrically the optimum lies at the intersection of the two binding constraints:

x1+2x2=10,3x1+x2=12x_1 + 2x_2 = 10, \qquad 3x_1 + x_2 = 12

Solving: from the second, x2=12−3x1x_2 = 12 - 3x_1. Substitute: x1+2(12−3x1)=10⇒x1−6x1+24=10⇒−5x1=−14⇒x1=2.8x_1 + 2(12-3x_1)=10 \Rightarrow x_1 - 6x_1 + 24 = 10 \Rightarrow -5x_1 = -14 \Rightarrow x_1 = 2.8. Then x2=12−8.4=3.6x_2 = 12 - 8.4 = 3.6. Cost: z=2(2.8)+3(3.6)=5.6+10.8z = 2(2.8) + 3(3.6) = 5.6 + 10.8

Boxed answer: x1=2.8,  x2=3.6,  z=$16.40\boxed{x_1 = 2.8, \; x_2 = 3.6, \; z = \$16.40} (both constraints binding; check other vertices give higher cost).

Common Misconceptions

⚠️ Pitfalls
  • "The optimum is unique." Not necessarily — if the objective is parallel to a binding constraint, an entire edge or face is optimal (alternative optima).
  • "Simplex is polynomial-time." No. Klee–Minty (1972) constructed cubes where Simplex with Dantzig's pivot rule visits all 2n2^n vertices. Worst-case behavior is exponential, though typical behavior is excellent.
  • "More constraints means harder." Adding redundant constraints doesn't change the optimum; complexity scales with the geometry, not raw count.
  • "Integer answers come for free." LP allows fractional xx. Requiring integers makes it Integer Programming, which is NP-hard.
CounterexampleKlee–Minty Cube

Consider the LP over the perturbed unit cube in Rn\mathbb{R}^n:

7
max⁡  xns.t.0≤x1≤1,  εxk−1≤xk≤1−εxk−1  (2≤k≤n)\quad \max\; x_n \quad \text{s.t.}\quad 0 \le x_1 \le 1,\; \varepsilon x_{k-1} \le x_k \le 1 - \varepsilon x_{k-1}\;(2\le k\le n)

Derivation hint: the small ε\varepsilon-skew distorts a cube so the objective direction threads through every one of the 2n2^n corners. Starting at the origin, Simplex with the steepest-ascent (Dantzig) pivot rule visits all 2n2^n vertices before reaching the optimum. This proves the method has exponential worst-case complexity, motivating polynomial alternatives like the ellipsoid and interior-point methods.

Connections

connection

LP sits at a crossroads of several fields. The Simplex Method is fundamentally an exercise in Convex Geometry — walking the vertices of a polytope. Every LP has a paired dual LP, and Linear Programming Duality gives the powerful strong duality theorem: primal and dual optima coincide, and the dual variables yy are exactly the shadow prices (marginal values of resources). LP generalizes to Convex Optimization and specializes to Network Flow Problems (where Simplex becomes the highly efficient network Simplex). Game theory connects deeply: von Neumann's minimax theorem for Zero-Sum Games is equivalent to LP duality. Modern competitors are Interior-Point Methods, which traverse the polytope's interior rather than its edges.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1939 — Leonid Kantorovich formulates LP-type problems for Soviet production planning; later shares the 1975 Nobel in Economics.
- 1941 — Frank Hitchcock poses the transportation problem.
- 1945 — George Stigler poses and approximately solves the diet problem by hand.
- 1947 — George Dantzig develops the Simplex Method for U.S. Air Force planning (Project SCOOP).
- 1947 — John von Neumann conjectures and outlines LP duality in a conversation with Dantzig.
- 1951 — Tjalling Koopmans advances activity analysis; shares 1975 Nobel with Kantorovich.
- 1972 — Klee & Minty publish the cube showing Simplex's exponential worst case.
- 1979 — Leonid Khachiyan proves LP solvable in polynomial time via the ellipsoid method.
- 1984 — Narendra Karmarkar introduces a practical polynomial-time interior-point method, sparking the modern era.

Subtleties & Limits

open-problem

A famous gap remains between LP theory and practice. Is there a pivot rule for the Simplex Method that runs in polynomial time? Despite decades of effort, no such rule is known, and many natural rules (Dantzig, steepest-edge, Bland) have superpolynomial or exponential worst cases (the Hirsch conjecture on polytope diameters, long thought to bound this, was disproved by Santos in 2010). Relatedly, whether LP can be solved in strongly polynomial time — a number of arithmetic operations bounded by a polynomial in m,nm,n alone, independent of the bit-size of the data — is one of Smale's 18 open problems for the 21st century. Interior-point methods are weakly polynomial; a strongly polynomial algorithm remains undiscovered.

See Also

Linear Programming Duality · Integer Programming · Interior-Point Methods · Network Flow Problems · Convex Optimization · Zero-Sum Games · Convex Geometry