advanced21 min studyLesson 284 in Mathematics

Linear programming duality and certificates

Prove global bounds by weighted constraints and distinguish optimality, infeasibility, and unboundedness certificates.

On this page

What you’ll understand

  • Derive a dual for a maximization LP with nonnegative variables.
  • Verify an optimality certificate using primal and dual feasibility.
  • Use a precise theorem of alternatives to certify infeasibility.

An optimizer proposes a decision; a certificate explains why no better decision exists. Linear programming duality builds such explanations by taking nonnegative weighted sums of the constraints. The resulting bound is independently checkable with matrix arithmetic, even when finding the proposed solution required a sophisticated algorithm. This separation between search and verification is valuable in scientific computation: a plausible objective value becomes a mathematical conclusion only after the relevant feasibility and bound conditions have been checked.

Construct the upper bound

Consider maximizing cTxc^Tx subject to Ax≤bAx\le b and x≥0x\ge0. A nonnegative weight vector yy gives yTAx≤yTby^TAx\le y^Tb. If ATy≥cA^Ty\ge c, multiplying that inequality componentwise by x≥0x\ge0 also gives cTx≤yTAxc^Tx\le y^TAx. Hence bTyb^Ty is an upper bound for every primal feasible objective. The dual minimizes this upper bound subject to the two conditions just used. Equality constraints would give unrestricted multipliers; unrestricted primal coordinates would require dual equalities. Signs follow from the bound proof rather than a memorized recipe.

Weak duality requires only feasibility and elementary inequalities. If a primal feasible point and a dual feasible point have equal objective values, both are optimal immediately. If their values differ, the nonnegative gap quantifies how far the primal point could still be from optimality. A small gap is meaningful only when feasibility has also been assessed: two infeasible vectors can have identical objective values. For floating-point results, include residual bounds or exact rational reconstruction when a formal certificate is needed rather than treating a printed gap as self-authenticating.

max⁡x≥0, Ax≤bcTx ≤ min⁡y≥0, ATy≥cbTy,cTx≤yTAx≤bTy\max_{x\ge0,\ Ax\le b}c^Tx\ \le\ \min_{y\ge0,\ A^Ty\ge c}b^Ty,\qquad c^Tx\le y^TAx\le b^Ty
Each dual feasible vector combines constraints into a valid global upper bound on the maximization objective.↔ Scroll wide equations horizontally.

Strong duality and the alternatives

For a finite-dimensional linear program, if the primal is feasible and has a finite optimal value, an optimal primal solution exists and the dual also has an attained optimum with the same value. Strict feasibility is not required for this LP theorem. An unbounded primal forces dual infeasibility by weak duality. However, primal infeasibility alone does not force dual unboundedness: both programs can be infeasible. Always state which feasible side is known before drawing an implication. Feasibility, finite optimality, and unboundedness are different statuses, not interchangeable failure messages.

A useful exact alternative applies to the equality system Ax=bAx=b, x≥0x\ge0. Either such an xx exists, or there is a vector yy with ATy≥0A^Ty\ge0 and bTy<0b^Ty<0, but never both. Indeed, simultaneous existence would imply bTy=xTATy≥0b^Ty=x^TA^Ty\ge0, a contradiction. The existence of a separating certificate when the system is infeasible is Farkas' lemma. Notice that the certificate multiplier is unrestricted in sign here because the original restrictions are equalities. A different primal form needs a correspondingly different certificate.

{x≥0:Ax=b}=∅  ⟺  ∃y: ATy≥0,bTy<0\{x\ge0:Ax=b\}=\varnothing\iff\exists y:\ A^Ty\ge0,\quad b^Ty<0
This precise equality-form Farkas certificate proves inconsistency by a weighted sum; its sign conventions must not be transferred blindly to another form.↔ Scroll wide equations horizontally.

What certificates establish

An unboundedness certificate needs both a feasible base point and an improving recession direction. In our maximization form, require x0≥0x_0\ge0, Ax0≤bAx_0\le b, d≥0d\ge0, Ad≤0Ad\le0, and cTd>0c^Td>0. Then x0+tdx_0+td remains feasible while its value grows without limit. A direction alone cannot prove unboundedness if the original region is empty. Likewise, a dual vector certifies a bound only after every dual inequality and sign restriction is verified. These details make certificates short enough to audit without rerunning the optimization algorithm.

With rational input, exact arithmetic can verify a supplied rational certificate using finitely many additions, multiplications, and comparisons. This does not imply that all optimization problems are easy to solve: integer programming can have a strong continuous bound yet a hard combinatorial search. Even within linear programming, the conditioning and encoding size affect numerical algorithms. The dual perspective gives a useful workflow: propose a feasible decision, construct a bound from prices, compare their objectives, and investigate the remaining gap rather than trusting the first solver status line.

A two-number proof of optimality

Maximize 3x1+2x23x_1+2x_2 subject to x1+x2≤4x_1+x_2\le4, 2x1+x2≤52x_1+x_2\le5, and x≥0x\ge0. Certify (x1,x2)=(1,3)(x_1,x_2)=(1,3).

  1. The proposed point is nonnegative and uses resources 1+3=41+3=4 and 2+3=52+3=5, so it is primal feasible with objective nine.

  2. The dual minimizes 4y1+5y24y_1+5y_2 with y1+y2≥2y_1+y_2\ge2, y1+2y2≥3y_1+2y_2\ge3, and y≥0y\ge0. Choose y=(1,1)y=(1,1); both dual inequalities are equalities.

  3. The dual value is also nine. Alternatively, add the two original resource inequalities to obtain 3x1+2x2≤93x_1+2x_2\le9 for every feasible decision. Equal primal and dual values close the gap exactly.

The result

The primal point (1,3) and dual prices (1,1) are feasible with equal value nine, establishing global optimality.

Explore the model

Interactive lab

Interactive lab · vectors

Inspect coefficients of a weighted bound

Pause and Reset; set angle to 0 degrees and magnitude to 1, then note the projection (1,0). Reset again and set angle to 90 degrees and magnitude to 1, giving (0,1). On paper these are the two unit resource-price vectors; their sum selects one copy of each inequality in the worked certificate.

Inspect coefficients of a weighted boundPlayback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Current readings: x component: 1.393; y component: 0.975; Magnitude: 1.7. All parameters are adjustable with the labeled controls below.−7.46−3.7303.737.46−3.5−1.7501.753.5xyvvₓ = 1.39
Vectorx / y projectionsTrace marker
x component
1.393
y component
0.975
Magnitude
1.7
t = 0 s

Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forNonnegative weights combine valid resource bounds. The instrument shows one vector and its projections; it does not draw the primal feasible region, add vectors automatically, or certify dual feasibility.

Check your understanding

For a maximization LP, a primal feasible point has value 12 and a dual feasible point has value 12. What is certified?

Try it yourself

Certify that x1+x2=−1x_1+x_2=-1 with x1,x2≥0x_1,x_2\ge0 is infeasible using the stated equality-form Farkas lemma.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

There is one equality, so its multiplier is a single real number. Seek a negative weighted right-hand side and nonnegative weighted coefficients.

Compare with the solution

Set A=(1,1)A=(1,1), b=−1b=-1, and y=1y=1. Then ATy=(1,1)T≥0A^Ty=(1,1)^T\ge0 while bTy=−1<0b^Ty=-1<0. If a feasible vector existed, multiplying its equality by this multiplier would make a nonnegative left-hand side equal a negative number, impossible.

Take it with you

  • Feasible dual prices supply global objective bounds.
  • Equal feasible primal and dual values prove optimality without a search history.
  • Infeasibility and unboundedness require different certificates and precise sign conventions.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.