Linear Programming — Optimizing Linear Objectives Under Linear Constraints

Decision Sciences
Introduced by
George B. Dantzig
Year
1947
Type
Mathematical programming / continuous optimization

What does it do?

Linear programming (LP), pioneered by George B. Dantzig in 1947, is a mathematical method for finding the best value of a linear objective function, such as minimum cost or maximum profit, subject to a set of linear inequality and equality constraints.

It is a foundational technique in operations research and is used for production planning, resource allocation, logistics, blending and diet problems, and many other decision problems in engineering, economics and the natural sciences.

The intuition behind the method

Imagine a small factory that makes two products. Each product earns a fixed profit per unit, but making it consumes limited raw material and machine time. Linear programming finds the mix of quantities that gives the highest profit without exceeding any of those limits. The 'linear' part means that profit and resource use grow in direct proportion to the quantities produced. The feasible choices form a polygon in two dimensions or a polyhedron in higher dimensions. When an optimum exists, it can be found at a corner (vertex) of that region, although the optimum may not be unique, and a model with conflicting constraints or missing bounds may have no finite optimum at all.

History

LP developed from George B. Dantzig's work in 1947, when he introduced the Simplex method for planning problems; his theory was set out in the 1963 book Linear Programming and Extensions. Later theoretical work, including the ellipsoid method associated with Khachiyan and the interior-point approach associated with Karmarkar, showed that LP can be solved in polynomial time in theory and made interior-point methods practical for large problems.

When to use it

Choose LP when the quantity to optimise is a linear function of continuous decision variables and every constraint is also linear, with fractional values meaningful for the decision (for example, amounts of material or hours of machine time). LP is a deterministic model rather than a statistical estimator, so it needs no distributional assumptions or sample data, but its coefficients are treated as known. Do not use plain LP when variables must be whole numbers or yes/no choices, which calls for integer programming; when the objective or constraints are nonlinear; or when uncertainty in the parameters matters for the decision, in which case stochastic optimisation is more appropriate. Typical uses include production scheduling, supply-chain logistics, diet and blending problems, portfolio allocation, transportation and assignment problems, and energy dispatch.

Limitations and considerations

  • Linearity requirement: if the objective or any constraint is nonlinear, the LP is mis-specified and its solution may be wrong or infeasible for the real problem.
  • Continuous variables only: when variables must be integer or binary, the LP relaxation gives a bound on the objective but not a valid decision, so integer programming is needed.
  • Deterministic: LP does not represent uncertainty in its coefficients, so the solution is optimal only for the data supplied.
  • Degeneracy and cycling: at degenerate vertices the Simplex method can stall or cycle without making progress; anti-cycling pivot rules are used to prevent this.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Guaranteed global optimum: because the objective and constraints are linear, the feasible region is convex, so a local optimum is also a global optimum and a solver cannot stop at a sub-optimal point.
  • Scalability: interior-point methods are used for large-scale problems, and LP solvers routinely handle models with many variables and constraints.
  • Rich post-solution information: shadow prices and sensitivity ranges come from the same solve and show the value of resources and how stable the solution is to changes in data.
  • No distributional assumptions: LP is a purely algebraic model, so it does not require normality or any statistical property of the data.

Applications

  • Production planning: finding the optimal product mix that maximises profit while respecting machine capacity and raw-material limits.
  • Agriculture and crop planning: choosing which crops to grow, in what quantities and how to use them, so that farm revenue increases.
  • Supply-chain and transportation logistics: minimising shipping costs across a network of warehouses and customers.
  • Diet and blending problems: selecting ingredient quantities that meet nutritional requirements at minimum cost.
  • Financial portfolio optimisation: allocating capital across assets to maximise expected return subject to risk and regulatory constraints.
  • Energy dispatch and power-grid scheduling: minimising fuel cost while satisfying electricity demand and generator capacity limits.
  • Staff and workforce scheduling: assigning shifts to workers to cover demand at minimum labour cost.

How it works

How it works

1

The real-world decision problem is translated into mathematical symbols. You identify the decision variables (the quantities you can control), write the objective function as a linear combination of those variables, and write every constraint, such as resource limits, capacity caps and demand requirements, as a linear inequality or equality. A well-formed LP states a clear objective, explicit variable bounds (such as non-negativity where it applies), and every structural constraint in linear form.

2

The model is brought into a canonical or standard form that a solver can process. In a common general form, a maximisation problem is written as: maximise cᵀx subject to Ax ≤ b and x ≥ 0, where x is the vector of decision variables, c the objective coefficients, A the constraint coefficients and b the right-hand sides. A minimisation objective is handled either directly or by maximising −cᵀx. Inequalities are converted to equalities by introducing non-negative slack or surplus variables: a constraint aᵀx ≤ b becomes aᵀx + s = b with s ≥ 0, and a constraint aᵀx ≥ b becomes aᵀx − s = b with s ≥ 0. Any unrestricted variable is replaced by the difference of two non-negative variables. This mechanical step produces the tableau or matrix representation the algorithm acts on, and it does not change the problem; it only reshapes it for computation.

3

A solver searches the feasible polyhedron for an optimal vertex. The Simplex method moves from vertex to vertex along edges of the polyhedron, improving or holding the objective at each step, until no neighbouring vertex is better. Interior-point (barrier) methods instead move through the interior of the feasible region along a central path and are often preferred for very large models. Because the feasible region is convex, a solution the solver reports as optimal is a global optimum for the model as written.

4

The solver returns the optimal values of the decision variables and the optimal objective value, along with dual variables (shadow prices) and sensitivity ranges. A shadow price gives the approximate change in the optimal objective value per unit change in a binding constraint's right-hand side, within that constraint's sensitivity range. In a maximisation model this shows where additional resources would be most valuable; in a minimisation model the direction of the effect follows the sense of the objective, so the sign of the reported dual value should be read against the solver's convention. Sensitivity analysis shows how far a cost coefficient or right-hand-side value can change before the current optimal solution stops being optimal.

Common pitfalls

  • Applying LP to nonlinear relationships, such as products of two decision variables, which makes the model invalid for LP solvers.
  • Rounding: rounding a continuous LP solution to integers does not in general give a feasible or optimal integer solution; use integer programming instead.
  • Infeasible or unbounded models: conflicting constraints make the feasible region empty, and missing bounds can make the objective unbounded. Check the model structure before reading any solution.
  • Non-unique optima: several different solutions can share the same optimal objective value, so the point the solver reports is one of possibly many.
  • Trusting the optimum without sensitivity analysis: a solution may sit close to a tie where a small change in data alters the recommendation, so sensitivity ranges should be inspected.

Frequently asked questions

What makes a problem 'linear' for LP purposes?

Both the objective function and every constraint must be linear, meaning each term is a constant multiplied by a single decision variable, with no products of variables, no exponents, and no nonlinear functions. If even one constraint or the objective involves, say, x times y or x squared, standard LP no longer applies and a nonlinear or quadratic programming solver is needed.

Why does the optimal solution lie at a corner of the feasible region?

The feasible region defined by linear constraints is a convex polyhedron (or polytope). If the region has at least one vertex and the problem has a finite optimum, at least one optimal solution is found at a vertex (corner point). In standard form, the non-negativity constraints x ≥ 0 rule out lines, so the region has a vertex whenever it is non-empty. If a region contains a line and has no vertex, this result does not apply. This is the geometric idea behind the Simplex method's vertex-to-vertex strategy. The optimum may not be unique, so an optimal edge or face, with its vertices also optimal, is possible.

When should I use integer programming instead of LP?

Whenever one or more decision variables must take integer or binary (0/1) values, for example whether to open a facility (yes/no), how many trucks to dispatch (whole numbers), or which items to include in a selection. Simply solving the LP and rounding the continuous solution is not reliable: rounded solutions can be infeasible or far from optimal. Integer programming handles integrality correctly, at greater computational cost.

What do shadow prices tell me?

A shadow price (dual variable) for a binding constraint indicates approximately how much the optimal objective value would change if that constraint's right-hand side were increased by one unit, holding everything else constant and within the sensitivity range. In a profit-maximising model, a positive shadow price on a labour-hours constraint means that each extra labour hour would raise the optimal profit by about the shadow price. In a cost-minimising model the same quantity describes a change in cost, and the direction of the change and the sign convention used for the reported value depend on the sense of the objective and the solver. Constraints that are not binding have a shadow price of zero, because they are not limiting the current optimum.

Related methods

Sources

  1. Dantzig, G.B. (1963). Linear Programming and Extensions. Princeton University Press.

    ISBN: 9780691059136
  2. Vanderbei, R.J. (2014). Linear Programming: Foundations and Extensions. Springer.

    Open DOI reference