The duality gap is a concept in mathematical optimization that measures the difference between the optimal values of a primal problem and its associated dual problem. Formally, if $p^$ denotes the optimal value of the primal problem and $d^$ denotes the optimal value of the dual problem, the duality gap is defined as
$$ \text{Duality gap} = p^* - d^* . $$
When the primal problem is a minimization problem and the dual is a maximization problem (as is common in linear and convex programming), a non‑negative gap indicates that the primal optimum is at least as large as the dual optimum, consistent with the weak duality theorem.
Key Properties
| Property | Description |
|---|---|
| Weak Duality | For any feasible primal solution $x$ and any feasible dual solution $y$, the primal objective value is never less than the dual objective value. Consequently, the duality gap is always non‑negative. |
| Strong Duality | In many important classes of problems—most notably linear programming, convex programming with Slater’s condition, and certain conic programs—the optimal primal and dual values coincide, yielding a duality gap of zero. |
| Zero Gap Conditions | Sufficient conditions for a zero duality gap include: • Linear programming (no additional assumptions). • Convex problems where Slater’s condition (existence of a strictly feasible point) holds. • Certain non‑convex problems where specific regularity conditions are satisfied. |
| Non‑Zero Gap | In general non‑convex optimization problems, integer programming, or when regularity conditions fail, the duality gap can be strictly positive, indicating that the dual provides only a bound on the primal optimum. |
Contexts of Use
- Linear Programming (LP) – Strong duality guarantees a zero duality gap; the primal and dual optimal values are identical.
- Convex Optimization – Under Slater’s condition, strong duality holds, leading to a zero gap. The gap is frequently used to assess convergence of interior‑point and primal‑dual algorithms.
- Integer Programming – The gap is often positive because the dual of an integer program (e.g., its linear‑programming relaxation) typically yields a lower bound that is strictly less than the integer optimal value. The magnitude of the gap informs the quality of relaxations and cutting‑plane methods.
- Lagrangian Relaxation – The dual problem derived from relaxing constraints via Lagrange multipliers provides a bound. The duality gap quantifies the loss incurred by the relaxation.
- Machine Learning & Statistical Estimation – In formulations such as support vector machines and certain regularized risk minimization problems, duality gaps are employed as stopping criteria for iterative solvers.
Practical Implications
- Algorithmic Stopping Criteria: Many primal‑dual algorithms terminate when the computed duality gap falls below a prescribed tolerance, indicating that the solution is close to optimal.
- Quality of Relaxations: In combinatorial optimization, a small duality gap between an integer program and its linear relaxation suggests that the relaxation is a tight approximation of the original problem.
- Sensitivity Analysis: The gap can provide insight into how perturbations of the problem data affect optimal values, especially when the gap is zero, implying that primal and dual solutions are mutually optimal.
Example (Linear Programming)
Consider the primal LP:
$$ \begin{aligned} \min_{x \in \mathbb{R}^n} ;& c^{\top} x \ \text{s.t. } & Ax \ge b , \ & x \ge 0 . \end{aligned} $$
Its dual is:
$$ \begin{aligned} \max_{y \in \mathbb{R}^m} ;& b^{\top} y \ \text{s.t. } & A^{\top} y \le c , \ & y \ge 0 . \end{aligned} $$
If the optimal primal value is $p^* = 15$ and the optimal dual value is $d^* = 15$, the duality gap is $0$, reflecting strong duality for LPs.
References (selected)
- Boyd, S., & Vandenberghe, L. (2004). Convex Optimization. Cambridge University Press.
- Dantzig, G. B. (1963). Linear Programming and Extensions. Princeton University Press.
- Nemirovski, A., & Shapiro, A. (2006). Convex Optimization in Signal Processing and Communications. IEEE Signal Processing Magazine.
(These sources discuss duality theory, conditions for zero duality gap, and applications across optimization domains.)