In this post I review very basic facts on Lagrangian duality. The presentation is extracted from Chapter 5 of Boyd and Vandenberghe.
We consider the following problem:
Let be the non-empty domain of definition for this problem (that is the intersection of the domain of definitions of ). For , the Lagrangian associated to the above problem is defined by
Weak duality
First note that, if is not a valid point for the primal problem (1), then
whereas for which is valid point for (1) one has
On the other hand note that for any which is valid point for (1), and , one also has
so that
Putting together (2) and (3) we arrive at the statement of weak duality:
As we have seen in (2), the right-hand side of the above inequality corresponds to the primal problem given in (1). We now refer to the left-hand side as the dual problem, which corresponds to the maximization over of the following function:
Strong duality
Weak duality always holds true (note that we did not make any convexity assumption so far), it corresponds to the fact that a ‘max-min’ is always smaller than a ‘min-max’. We say that strong duality holds if the inequality (4) holds with equality. The next two results give different conditions under which a ‘max-min’ is equal to a ‘min-max’.
Theorem 1 Assume that are convex functions, are affine functions, and that there exists a point in the relative interior of the convex set (that is, in the interior of when is viewed as a subset of the affine subspace generated by ) such that
Then strong duality holds, that is (4) holds with equality.
Theorem 2 (Sion’s minimax) Let be convex sets such that one of them is compact. Let be a continuous function such that is convex and is concave. Then:
KKT conditions
Now let us assume that we are in the conditions of Theorem 1 (with convex objective, convex inequalities constraints, affine equality constraints, and Slater’s condition). Furthermore we assume from now on that all functions in play are differentiable.
Let be a primal solution (that is a solution to the optimization problem (1)), and let be a dual solution (that is a solution of the maximization of defined in (5) over ).
The following holds true (the first line follows by strong duality, the second by definition, the third is trivial, and the last one by the fact that and are valid points for their respective optimization problems):
Thus both inequalities are in fact equalities. For the second one this implies that , but since each term is non-positive, this means
On the other hand the first inequality now says that is a minimizer over of , thus by first order optimality one has
Complementary slackness, together with the above equality and the fact that and are valid points for their respective optimization problems are called the KKT (Karush-Kuhn-Tucker) conditions. We just proved that these conditions are necessary (and for this we did not need convexity, just strong duality), but in fact (thanks to convexity) the KKT conditions are also sufficient for optimality.
Duality gap
By weak duality one always has , and thus
The right-hand side in the above inequality is called the duality gap, and it gives an upper bound on how suboptimal is the point for the primal problem. In other words a dual point gives a certificate on how good is a primal point .
Interior Point Methods can be turned into an optimization procedure for both the primal and the dual, by tracing a central path in each problem. This is particularly useful, as by doing so one can evaluate the suboptimality gap in the primal at any given time.