Linear Programming

⚡ Key Takeaways

Linear Programming (LP) is the optimization of a linear objective function subject to linear equality and inequality constraints. Key result: an LP either is infeasible, is unbounded, or attains its optimum at a vertex (extreme point) of its feasible polyhedron — and this optimum is found efficiently by the simplex method or interior-point methods. Applies to: resource allocation, scheduling, transportation, network flows, game theory, and as a relaxation for integer problems. Who/when: formalized by George Dantzig (simplex method, 1947); foundations by Kantorovich (1939) and von Neumann (duality, 1947).

💡 The Core Insight

The feasible region of an LP is a convex polyhedron, and a linear objective is constant along directions and increases linearly across the region. Therefore, if an optimum exists, you can always slide to a corner (vertex) without decreasing the objective. The whole theory reduces to: (1) the geometry of polyhedra, and (2) strong duality, which says the best you can achieve equals the tightest bound the constraints can certify against you.

Formal Statement

DefinitionLinear Program — Standard Forms

A linear program in standard (canonical) inequality form is

1
max⁡x∈Rn c⊤xsubject toAx≤b,  x≥0.\quad \max_{x \in \mathbb{R}^n}\ c^\top x \quad \text{subject to} \quad Ax \le b,\ \ x \ge 0.

Derivation hint: cc is the cost/profit vector, A∈Rm×nA \in \mathbb{R}^{m\times n} the constraint matrix, b∈Rmb \in \mathbb{R}^m the resource vector; each row ai⊤x≤bia_i^\top x \le b_i is a halfspace. An equivalent standard equality form (used by the simplex method) is

2
min⁡x∈Rn c⊤xsubject toAx=b,  x≥0.\quad \min_{x \in \mathbb{R}^n}\ c^\top x \quad \text{subject to} \quad Ax = b,\ \ x \ge 0.

Derivation hint: convert ai⊤x≤bia_i^\top x \le b_i to ai⊤x+si=bi, si≥0a_i^\top x + s_i = b_i,\ s_i \ge 0 by adding a slack variable sis_i; maximize c⊤x≡c^\top x \equiv minimize −c⊤x-c^\top x.

Symbols: xx = decision variables; c∈Rnc \in \mathbb{R}^n = objective coefficients; AA = m×nm \times n constraint matrix; b∈Rmb \in \mathbb{R}^m = right-hand sides; ss = slack variables. The feasible region is P={x:Ax≤b, x≥0}P = \{x : Ax \le b,\ x \ge 0\}, a convex polyhedron.

DefinitionVertex / Extreme Point / Basic Feasible Solution

A point x∈Px \in P is a vertex (extreme point) if it cannot be written as x=12(u+v)x = \tfrac12(u+v) with u≠vu \ne v both in PP. Equivalently, in equality form with AA of rank mm, a basic feasible solution (BFS) chooses mm linearly independent columns of AA (the basis BB), sets the other (nonbasic) variables to 00, and solves

3
xB=B−1b ≥0,xN=0.\quad x_B = B^{-1} b \ \ge 0, \qquad x_N = 0.

Derivation hint: partition A=[B N]A=[B\ N], x=(xB,xN)x=(x_B,x_N); Ax=b⇒BxB+NxN=bAx=b \Rightarrow Bx_B + Nx_N = b; set xN=0x_N=0 and invert BB; feasibility requires xB≥0x_B \ge 0.

TheoremFundamental Theorem of Linear Programming

For an LP in standard form with feasible region P≠∅P \ne \varnothing: 1. If the objective is bounded on PP, an optimal solution exists and at least one optimal solution is a vertex of PP. 2. If PP has at least one vertex (e.g., when x≥0x \ge 0), then the optimum (if finite) is attained at a vertex. Consequently, optimization over an infinite set PP reduces to searching the finite set of vertices.

TheoremStrong Duality

The primal max⁡{c⊤x:Ax≤b, x≥0}\max\{c^\top x : Ax \le b,\ x \ge 0\} and its dual

4
min⁡y∈Rm b⊤ysubject toA⊤y≥c,  y≥0\quad \min_{y \in \mathbb{R}^m}\ b^\top y \quad \text{subject to} \quad A^\top y \ge c,\ \ y \ge 0

satisfy: if either has a finite optimum, so does the other and their optimal values are equal, c⊤x⋆=b⊤y⋆c^\top x^\star = b^\top y^\star. Derivation hint: dual variables yi≥0y_i \ge 0 price each primal constraint; requiring the priced combination A⊤yA^\top y to dominate cc produces an upper bound b⊤yb^\top y on c⊤xc^\top x; strong duality says the best bound is tight.

Why It Holds / Derivation

ProofWeak Duality, then the Optimality Gap

Step 1 (Weak duality). Let xx be primal-feasible (Ax≤b, x≥0Ax \le b,\ x \ge 0) and yy dual-feasible (A⊤y≥c, y≥0A^\top y \ge c,\ y \ge 0). Then

5
c⊤x ≤ (A⊤y)⊤x = y⊤(Ax) ≤ y⊤b = b⊤y.\quad c^\top x \ \le\ (A^\top y)^\top x \ =\ y^\top (A x) \ \le\ y^\top b \ =\ b^\top y.

Derivation hint: first inequality uses c≤A⊤yc \le A^\top y and x≥0x \ge 0; second uses Ax≤bAx \le b and y≥0y \ge 0.

Step 2 (Bound). Equation [5] shows every primal value ≤\le every dual value; hence max⁡c⊤x≤min⁡b⊤y\max c^\top x \le \min b^\top y. The difference b⊤y−c⊤x≥0b^\top y - c^\top x \ge 0 is the duality gap.

Step 3 (Strong duality via Farkas / separation). If the primal optimum is finite, the supporting hyperplane at the optimal vertex furnishes a y⋆y^\star that is dual-feasible and achieves b⊤y⋆=c⊤x⋆b^\top y^\star = c^\top x^\star, closing the gap to zero. The existence of y⋆y^\star follows from Farkas' Lemma, a theorem of the alternative for linear systems.

∎
TheoremFarkas' Lemma

Exactly one of the following holds for A∈Rm×nA \in \mathbb{R}^{m \times n}, b∈Rmb \in \mathbb{R}^m:

6
∃ x≥0: Ax=bXOR∃ y: A⊤y≥0, b⊤y<0.\quad \exists\, x \ge 0:\ Ax = b \qquad \textbf{XOR} \qquad \exists\, y:\ A^\top y \ge 0,\ b^\top y < 0.

Derivation hint: geometrically, either bb lies in the convex cone generated by columns of AA, or a separating hyperplane yy strictly separates bb from that cone.

ProofComplementary Slackness

At optimality, x⋆x^\star and y⋆y^\star satisfy: from Step 1 the two inequalities in [5] must be equalities. Equality of the second forces

7
yi⋆ (bi−ai⊤x⋆)=0andxj⋆ (A⊤y⋆−c)j=0  ∀i,j.\quad y_i^\star\,(b_i - a_i^\top x^\star) = 0 \quad\text{and}\quad x_j^\star\,(A^\top y^\star - c)_j = 0 \ \ \forall i,j.

Derivation hint: a sum of nonnegative terms equals zero iff each term is zero; each product pairs a primal slack with its dual variable (and vice versa).

Interpretation: if a constraint is slack (bi−ai⊤x⋆>0b_i - a_i^\top x^\star > 0), its shadow price yi⋆=0y_i^\star = 0; if a variable is used (xj⋆>0x_j^\star > 0), its dual constraint is tight. This couples primal and dual solutions exactly.

∎
mathematician · George B. Dantzig | 1914–2005

Dantzig invented the simplex method in 1947 while working for the U.S. Air Force on planning ("programming") logistics — the word "programming" here means scheduling, not coding. He famously, as a graduate student, mistook two open problems written on a blackboard for homework and solved them. Dantzig formalized LP as a discipline, recognized the role of duality (in dialogue with von Neumann), and made large-scale planning computationally feasible. His simplex method remains, decades later, one of the most-used algorithms in the world.

Building Intuition

🧠 Intuition

Picture the feasible region as a cut diamond floating in space, and the objective c⊤xc^\top x as a flat sheet you push in the direction cc. You slide the sheet as far as it can go while still touching the diamond — it will rest against a face, and the last point of contact is a corner. That is why optima live at vertices. The dual is the same picture viewed from outside: each constraint is a wall, and the dual asks for the cheapest combination of wall-pressures that pins down the objective from above. Strong duality says "the corner you reach from inside" and "the cheapest certificate from outside" meet at exactly the same number.

Figure
Feasible polyhedron with objective contours; optimum at a vertex

```svg

x₁ x₂ feasible P a₁·x ≤ b₁ a₂·x ≤ b₂ c·x increases → optimum x*

```

Worked Examples

ExampleFurniture Factory — Maximize Profit

A workshop makes tables (x1x_1) and chairs (x2x_2). Profit: $30 per table, $20 per chair. Constraints: wood 4x1+2x2≤1004x_1 + 2x_2 \le 100 (board-feet), labor 2x1+4x2≤802x_1 + 4x_2 \le 80 (hours), x1,x2≥0x_1,x_2 \ge 0.

LP: max⁡ 30x1+20x2\max\ 30x_1 + 20x_2 s.t. 4x1+2x2≤100, 2x1+4x2≤80, x≥0.4x_1+2x_2 \le 100,\ 2x_1+4x_2 \le 80,\ x \ge 0.

Step 1 — find vertices (intersections of binding constraints):

  • (0,0)(0,0): profit 00.
  • (25,0)(25,0) (wood binds, x2=0x_2=0): 30(25)=75030(25)=750.
  • (0,20)(0,20) (labor binds, x1=0x_1=0): 20(20)=40020(20)=400.
  • Intersection of both: solve 4x1+2x2=100, 2x1+4x2=804x_1+2x_2=100,\ 2x_1+4x_2=80.

From these: multiply 2nd by 2 → 4x1+8x2=1604x_1+8x_2=160; subtract 1st → 6x2=60⇒x2=106x_2=60 \Rightarrow x_2=10, then 4x1+20=100⇒x1=204x_1+20=100 \Rightarrow x_1=20. Profit =30(20)+20(10)=600+200=800= 30(20)+20(10)=600+200=800.

Step 2 — compare: {0,750,400,800}\{0,750,400,800\}; the maximum is at (20,10)(20,10).

x⋆=(20,10),max profit=$800\boxed{x^\star=(20,10),\quad \text{max profit} = \$800}

Dual check (shadow prices): solving the dual gives ywood⋆=$7, ylabor⋆=$1y^\star_{\text{wood}}=\$7,\ y^\star_{\text{labor}}=\$1 per unit; b⊤y=100(7)+80(1)=780b^\top y = 100(7)+80(1)=780... recompute correctly: dual binding gives 4y1+2y2=30, 2y1+4y2=20⇒y1=$406≈6.67, y2=$106≈1.674y_1+2y_2=30,\ 2y_1+4y_2=20 \Rightarrow y_1=\$\tfrac{40}{6}\approx 6.67,\ y_2=\$\tfrac{10}{6}\approx1.67; b⊤y=100(6.67)+80(1.67)=667+133=$800.b^\top y=100(6.67)+80(1.67)=667+133=\$800. ✓ (matches primal).

ExampleDiet Problem — Minimize Cost

Meet daily needs of ≥8\ge 8 units protein and ≥6\ge 6 units vitamin from two foods. Food A: 2 protein, 1 vitamin, $3/kg. Food B: 1 protein, 3 vitamin, $2/kg.

LP: min⁡ 3xA+2xB\min\ 3x_A + 2x_B s.t. 2xA+xB≥8, xA+3xB≥6, x≥0.2x_A + x_B \ge 8,\ x_A + 3x_B \ge 6,\ x \ge 0.

Step 1 — candidate vertices of the feasible (upper) region:

  • (xA,xB)=(4,0)(x_A,x_B)=(4,0): protein 2(4)=82(4)=8 ✓, vitamin 4≥64 \ge 6? No, 4<64<6 → infeasible.
  • (0,8)(0,8): vitamin 24≥624\ge6 ✓, protein 8≥88\ge8 ✓; cost 2(8)=162(8)=16.
  • (6,0)(6,0): protein 1212✓, vitamin 66✓; cost 3(6)=183(6)=18.
  • Intersection of both binding: 2xA+xB=8, xA+3xB=6⇒2x_A+x_B=8,\ x_A+3x_B=6 \Rightarrow from 1st xB=8−2xAx_B=8-2x_A; sub: xA+3(8−2xA)=6⇒xA+24−6xA=6⇒−5xA=−18⇒xA=3.6, xB=0.8x_A+3(8-2x_A)=6 \Rightarrow x_A+24-6x_A=6 \Rightarrow -5x_A=-18 \Rightarrow x_A=3.6,\ x_B=0.8; cost 3(3.6)+2(0.8)=10.8+1.6=12.43(3.6)+2(0.8)=10.8+1.6=12.4.

Step 2 — compare feasible vertices {16,18,12.4}\{16,18,12.4\}: minimum is 12.412.4.

x⋆=(3.6, 0.8) kg,min cost=$12.40/day\boxed{x^\star=(3.6,\ 0.8)\ \text{kg},\quad \text{min cost} = \$12.40/\text{day}}

Common Misconceptions

⚠️ Common mistake

"The optimum is always unique." False. If the objective vector cc is parallel to a face of the polyhedron, an entire edge or face of optimal points exists (infinitely many optima). Also, degenerate vertices (more than nn binding constraints in Rn\mathbb{R}^n) can stall the simplex method and require anti-cycling rules (e.g., Bland's rule). Finally, LP can be unbounded (objective →±∞\to \pm\infty) or infeasible (empty PP); always check these before claiming "no solution at the corners."

CounterexampleGeometry breaks for non-vertex search

Consider max⁡ x1+x2\max\ x_1 + x_2 subject to x1+x2≤1, x≥0x_1 + x_2 \le 1,\ x \ge 0. The objective is constant (=1=1) along the entire top edge from (1,0)(1,0) to (0,1)(0,1). Searching only interior points or expecting a single corner answer is wrong — every point on that segment, including the midpoint (12,12)(\tfrac12,\tfrac12), is optimal. The Fundamental Theorem still holds (at least one optimum is a vertex), but uniqueness fails. Worse, replacing ≤\le by << (strict inequality) makes the supremum 11 unattained — LP theory requires closed feasible sets.

Connections

connection

LP sits at the crossroads of several fields. It is the foundational case of Convex Optimization — every LP is convex, so local optima are global. Its duality generalizes to Lagrangian Duality and is mirrored in the minimax theorem of Game Theory (von Neumann's zero-sum games reduce to a pair of dual LPs). Restricting variables to integers yields Integer Programming, where the LP relaxation provides crucial bounds for branch-and-bound. Network problems — shortest paths, max-flow/min-cut, assignment — are special LPs with totally unimodular matrices guaranteeing integer vertices, linking LP to Combinatorial Optimization and the Max-Flow Min-Cut Theorem. The geometry rests on Convex Polyhedra and separating-hyperplane theorems.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1827 — Fourier studies systems of linear inequalities (Fourier–Motzkin elimination), an early ancestor of LP feasibility.
- 1939 — Leonid Kantorovich formulates production-planning as linear optimization in the USSR; later shares the 1975 Nobel Prize in Economics.
- 1941 — Frank Hitchcock states the transportation problem in modern form.
- 1947 — George Dantzig invents the simplex method; John von Neumann articulates LP duality and links it to game theory.
- 1947–49 — Tjalling Koopmans develops activity-analysis economics on LP foundations (Nobel 1975 with Kantorovich).
- 1958 — Gomory introduces cutting planes, bridging LP to integer programming.
- 1972 — Klee and Minty construct a polytope on which simplex takes exponential time in the worst case.
- 1979 — Leonid Khachiyan's ellipsoid method proves LP is solvable in polynomial time (first such result).
- 1984 — Narendra Karmarkar's interior-point method delivers polynomial time and practical speed, revolutionizing large-scale LP.

Subtleties & Limits

open-problem

Is there a strongly polynomial algorithm for LP? Current polynomial methods (ellipsoid, interior-point) run in time depending on the bit-length of the data, not purely on the dimensions m,nm,n. Whether an algorithm exists whose arithmetic-operation count is bounded by a polynomial in mm and nn alone — independent of the size of the numbers — is a famous open question (related to Smale's 9th problem). Connected to this is the diameter of polytopes: the Hirsch conjecture (that the graph diameter of a dd-dimensional polytope with nn facets is at most n−dn-d) was disproved by Santos in 2012, yet the true polynomial-diameter question (the polynomial Hirsch conjecture) remains open — and a positive answer could yield a polynomial-pivot simplex variant. Whether simplex with some pivot rule runs in polynomial time is likewise unresolved.

See Also

Simplex Method · Duality Theory · Farkas' Lemma · Convex Polyhedra · Integer Programming · Network Flow Theory · Game Theory · Karmarkar's Algorithm · Total Unimodularity