In optimization problems in applied mathematics, the duality gap is the difference between the primal and dual solutions. If is the optimal dual value and is the optimal primal value then the duality gap is equal to . This value is always greater than or equal to 0. The duality gap is zero if and only if strong duality holds. Otherwise the gap is strictly positive and weak duality holds.[1]
In general given two dual pairs separated locally convex spaces and . Then given the function , we can define the primal problem by
If there are constraint conditions, these can be built in to the function by letting where is the indicator function. Then let be a perturbation function such that . The duality gap is the difference given by
where is the convex conjugate in both variables.[2][3][4]
The duality gap is used in certain optimization methods to determine how far off from optimality the current solution is.[5]