8 Duality in conic optimization¶
In Sec. 2 (Linear optimization) we introduced duality and related concepts for linear optimization. Here we present a more general version of this theory for conic optimization and we illustrate it with examples. Although this chapter is self-contained, we recommend familiarity with Sec. 2 (Linear optimization), which some of this material is a natural extension of.
Duality theory is a rich and powerful area of convex optimization, and central to understanding sensitivity analysis and infeasibility issues. Furthermore, it provides a simple and systematic way of obtaining non-trivial lower bounds on the optimal value for many difficult non-convex problems.
From now on we consider a conic problem in standard form
where
of smaller cones corresponding to actual constraints in the problem formulation. The abstract formulation (8.1) encompasses such special cases as
The feasible set for (8.1):
is a section of
allowing the special cases of
The conic quadratic problem
with constraint equivalent to
8.1 Dual cone¶
Suppose
For simplicity we write
This is obvious for
which we invite the reader to prove.
All cones studied in this cookbook can be explicitly dualized as we show next.
We only sketch some parts of the proof and indicate geometric intuitions. First, let us show
by the Cauchy-Schwartz inequality
For the semidefinite cone we use the property
As our last exercise let us check that vectors in
and then we have
using the inequality
Finally it is nice to realize that
8.2 Infeasibility in conic optimization¶
We can now discuss infeasibility certificates for conic problems. Given an optimization problem, the first basic question we are interested in is its feasibility status. The theory of infeasibility certificates for linear problems, including the Farkas lemma (see Sec. 2.3 (Infeasibility in linear optimization)) extends almost verbatim to the conic case.
Problems which fall under option 2. (limit-feasible) are ill-posed: an arbitrarily small perturbation of input data puts the problem in either category 1. or 3. This fringe case should therefore not appear in practice, and if it does, it signals issues with the optimization model which should be addressed.
Here is an example of an ill-posed limit-feasible model created by fixing one of the root variables of a rotated quadratic cone to
The problem is clearly infeasible, but the sequence
Having cleared this detail we continue with the proof and example for the actually useful part of conic Farkas’ lemma.
Consider the set
It is a convex cone. Feasibility is equivalent to
But then
and the same argument works in the limit if
Therefore Farkas’ lemma implies that (up to certain ill-posed cases) either the problem (8.1) is feasible (first alternative) or there is a certificate of infeasibility
Consider a minimization problem:
It can be expressed in the standard form (8.1) with
A certificate of infeasibility is
8.3 Lagrangian and the dual problem¶
Classical Lagrangian
In general constrained optimization we consider an optimization problem of the form
where
The variables
Lagrangian for a conic problem
We next set up an analogue of the Lagrangian theory for the conic problem (8.1)
where
For any feasible
Note the we used the definition of the dual cone to conclude that
Dual problem
From (8.5) every
or simply:
The optimal value of (8.6) will be denoted
We can just as easily derive the dual of a problem with more general constraints, without necessarily having to transform the problem to standard form beforehand. Imagine, for example, that some solver accepts conic problems of the form:
Then we define a Lagrangian with one set of dual variables for each constraint appearing in the problem:
and that gives a dual problem
Consider a simplified version of the portfolio optimization problem, where we maximize expected return subject to an upper bound on the risk and no other constraints:
where
and we can directly write the Lagrangian
with
Note that it is actually more natural to view problem (8.9) as the dual form and problem (8.10) as the primal. Indeed we can write the constraint in (8.9) as
which fits naturally into the form (8.7). Having done this we can recover the dual as a minimization problem in the standard form (8.1). We leave it to the reader to check that we get the same answer as above.
8.4 Weak and strong duality¶
Weak duality
Suppose
so the dual objective value is a lower bound on the objective value of the primal. In particular, any dual feasible point
and we immediately get the next lemma.
It follows that if
Complementary slackness
Moreover, (8.11) asserts that
i.e. complementary slackness. It is not hard to verify what complementary slackness means for particular types of cones, for example
for
we have iff or ,vectors
are orthogonal iff and are parallel,vectors
are orthogonal iff and are parallel.
One implicit case is worth special attention: complementary slackness for a linear inequality constraint
Strong duality
The obvious question is now whether
Consider the problem
The only feasible points are
with feasible points
Similarly, we consider a problem
with feasible set
which has a feasible set
To ensure strong duality for conic problems we need an additional regularity assumption. As with the conic version of Farkas’ lemma Lemma 8.3, we stress that this is a technical condition to eliminate ill-posed problems which should not be formed in practice. In particular, we invite the reader to think that strong duality holds for all well formed conic problems one is likely to come across in applications, and that having a duality gap signals issues with the model formulation.
We say problem (8.1) is very nicely posed if for all values of
satisfies either the first or third alternative in Lemma 8.3.
Suppose that (8.1) is very nicely posed and
For any
Optimality of
If
The first constraint means that
There are more direct conditions which guarantee strong duality, such as below.
Suppose that (8.1) is strictly feasible: there exists a point
We omit the proof which can be found in standard texts. Note that the first problem from Example 8.6 does not satisfy Slater constraint qualification: the only feasible points lie on the boundary of the cone (we say the problem has no interior). That problem is not very nicely posed either: the point
8.5 Applications of conic duality¶
8.5.1 Linear regression and the normal equation¶
Least-squares linear regression is the problem of minimizing
and we can write the Lagrangian
so the constraints in the dual problem are:
The problem exhibits strong duality with both the primal and dual values attained in the optimal solution. The primal solution clearly satisfies
so if
8.5.2 Constraint attribution¶
Consider again a portfolio optimization problem with mean-variance utility function, vector of expected returns
where the linear part represents any set of additional constraints: total budget, sector constraints, diversification constraints, individual relations between positions etc. In the absence of additional constraints the solution to the unconstrained maximization problem is easy to derive using basic calculus and equals
We would like to understand the difference
The conic version of problem (8.12) is
with dual
Suppose we have a primal-dual optimal solution
which leads to
or equivalently
This equation splits the difference between the constrained and unconstrained solutions into contributions from individual constraints, where the weights are precisely the dual variables
8.6 Semidefinite duality and LMIs¶
The general theory of conic duality applies in particular to problems with semidefinite variables so here we just state it in the language familiar to SDP practitioners. Consider for simplicity a primal semidefinite optimization problem with one matrix variable
We can quickly repeat the derivation of the dual problem in this notation. The Lagrangian is
and we get the dual problem
The dual contains an affine matrix-valued function with coefficients
From a modeling perspective it does not matter whether constraints are given as linear matrix inequalities or as an intersection of affine hyperplanes; one formulation is easily converted to other using auxiliary variables and constraints, and this transformation is often done transparently by optimization software. Nevertheless, it is instructive to study an explicit example of how to carry out this transformation. An linear matrix inequality
where
Apart from introducing an explicit semidefinite variable
Obviously we should only use these transformations when necessary; if we have a problem that is more naturally interpreted in either primal or dual form, we should be careful to recognize that structure.
Consider the problem:
with the variables
The dual problem is
in the variable
In Sec. 6.2.4 (Singular value optimization), and specifically in (6.18), we expressed the problem of minimizing the sum of singular values of a nonsymmetric matrix
Treating this as the dual and going back to the primal form we get:
which is equivalent to the claimed (6.19). The dual formulation has the advantage of being linear in