Applied and computational mathematics
Linear programming
Optimizing a linear objective subject to linear constraints, solved efficiently by the simplex method.
IntuitionSqueezing the most profit out of limited resources
Imagine a small factory that makes two products using shared machine time and raw material. Each product earns a different profit per unit, and each constraint — machine hours, material, storage space — limits how much can be made. Linear programming asks: how much of each product should be made to maximize total profit without breaking any constraint? Because the profit function and every constraint are straight lines (or flat hyperplanes in higher dimensions), the set of feasible production plans forms a convex polyhedron, and the best plan always sits at one of its corners.
SchoolStandard form
Definition: Standard form of a linear program
A linear program in standard form chooses a vector of decision variables to maximize a linear objective subject to linear inequality constraints and non-negativity . Here is the vector of per-unit profits, is the matrix of resource usage coefficients, and is the vector of resource limits.
Each row of represents one limited resource: the left-hand side is how much of that resource a production plan consumes, and the right-hand side is how much is available. Adding a slack variable for each row turns every inequality into an equality, , which is the form the simplex method actually works with.
| Method | How it searches | Scales to how many variables? | Worst-case complexity |
|---|---|---|---|
| Graphical method | Plots the feasible polygon and slides the objective line across it | Only 2 variables (3 with a 3D plot) | Not applicable (visual method) |
| Simplex method | Walks from vertex to adjacent vertex, always improving the objective | Hundreds to thousands of variables in practice | Exponential in theory, fast in practice |
| Interior-point method | Moves through the interior of the polyhedron toward the optimum | Very large problems (millions of variables) | Polynomial time |
UndergraduateThe fundamental theorem and the simplex method
Let the feasible region be nonempty and bounded. If the linear program has an optimal value, then that optimal value is attained at a vertex (extreme point) of .
Why is it true?
The objective is linear, so its level sets are parallel hyperplanes; sliding such a hyperplane across a convex polyhedron, the last point it touches before leaving the region is always a corner, never a point in the interior of a face, because interior points can always be pushed further in the direction that improves the objective.
Proof
Since is a bounded polyhedron defined by finitely many linear inequalities, it has finitely many vertices , and a classical fact about polytopes (Minkowski's theorem) states that every point of is a convex combination of these vertices: , where and .
Because the objective is linear, evaluating it on such a convex combination gives , since each and they sum to .
This shows every feasible has objective value no larger than the best vertex value . But that best vertex, call it , is itself a feasible point of , so it actually attains this upper bound: . Hence the optimum of the linear program is achieved at the vertex , proving the claim.
The fundamental theorem justifies restricting the search for an optimum to the finitely many vertices of , but checking every vertex directly is too slow when there are many constraints. The simplex method instead starts at one vertex and repeatedly moves to an adjacent vertex along an edge that strictly increases the objective, stopping only when no neighboring vertex is better — at that point, every reduced cost is non-negative and the current vertex is provably optimal.
For the primal program , define the dual program . Then (weak duality) for every primal-feasible and dual-feasible , and (strong duality) if the primal has an optimal solution , the dual has an optimal solution with .
Why is it true?
Duality says the primal maximization and the dual minimization are two views of the same number: the dual variables act as prices on the resources, and weak duality says no feasible production plan can ever earn more than the value of the resources it uses at any valid pricing, while strong duality says that at the optimum, the best production plan and the cheapest valid pricing agree exactly.
Proof
(Weak duality.) Let be any primal-feasible point (, ) and any dual-feasible point (, ). Since and , multiplying the inequality by the nonnegative vector preserves it: . Since and , the same argument gives . Chaining the two inequalities, for every feasible pair, which is weak duality.
(Strong duality.) Run the simplex method on the primal until it terminates at an optimal basic feasible solution with optimal basis matrix , so that and the reduced costs of every non-basic variable are non-negative — this termination condition is equivalent to defining , which one can check satisfies and , i.e. is dual-feasible.
Substituting, the primal optimal value is . Combined with weak duality ( always), equality here forces to be dual-optimal as well, so , proving strong duality.
UndergraduateReal-World Applications and Worked Examples
Linear programming underlies decision-making software across industries: airlines solve crew-scheduling and fleet-assignment LPs with millions of variables, oil refineries blend crude inputs to meet product specifications at minimum cost, telecom companies route network traffic to maximize throughput, and portfolio managers allocate capital across assets subject to risk limits — all as instances of maximizing or minimizing a linear objective under linear constraints.
Example: Maximizing profit with two products
A factory makes two products, and units per week, earning profit . Production is limited by , , and , with . Find the values of and that maximize .
Solution
The constraint bounds directly, means , and is the binding resource constraint; together with these four lines cut out a pentagon with vertices , , , , and .
By the fundamental theorem, the maximum of the linear objective over this bounded feasible polygon occurs at one of these five vertices, so it suffices to evaluate at each: , , , , and .
The largest value is , attained at the vertex , which is exactly the point where the constraints and meet, confirming both resources are fully used at the optimum.
Example: Reading resource prices from the dual problem
For the factory in the previous example, suppose management wants to know the marginal value of one more unit of the resource in constraint — that is, how much extra profit one more unit of that resource would be worth. Using the dual problem, find this marginal value (the shadow price) without re-solving the whole linear program from scratch.
Solution
The dual of maximizing subject to , , , is the minimization subject to , , and , where are the dual prices attached to constraints , , respectively.
By strong duality, the dual optimal value equals the primal optimal value found earlier, . At the optimal vertex , only the constraints and are binding (the constraint is slack since ), so complementary slackness forces the dual price on the slack constraint to be zero: .
With , the remaining dual constraints become and , and solving the two binding dual equalities gives : the shadow price of the constraint is , meaning one more unit of that resource would raise the maximum profit by approximately .
In the factory example with objective and feasible vertices , , , , , which vertex gives the maximum value of ?
According to the fundamental theorem of linear programming, if a linear program with a bounded, nonempty feasible region has an optimal solution, where can that optimum always be found?
What does weak duality guarantee about a primal maximization LP and its dual minimization LP?
An airline needs to assign the cheapest combination of crews to flights while satisfying staffing rules and duty-hour limits. Which technique is this problem a typical instance of?
References
- George B. Dantzig (1963). Linear Programming and Extensions
- Dimitris Bertsimas, John N. Tsitsiklis (1997). Introduction to Linear Optimization