6.3 Conic Quadratic Optimization¶
The structure of a typical conic optimization problem is
(see Sec. 12 (Problem Formulation and Solutions) for detailed formulations). We recommend Sec. 6.2 (From Linear to Conic Optimization) for a tutorial on how problems of that form are represented in MOSEK and what data structures are relevant. Here we discuss how to set-up problems with the (rotated) quadratic cones.
MOSEK supports two types of quadratic cones, namely:
Quadratic cone:
\[\Q^n = \left\lbrace x \in \real^n: x_0 \geq \sqrt{\sum_{j=1}^{n-1} x_j^2} \right\rbrace.\]Rotated quadratic cone:
\[\Qr^n = \left\lbrace x \in \real^n: 2 x_0 x_1 \geq \sum_{j=2}^{n-1} x_j^2,\quad x_0\geq 0,\quad x_1 \geq 0 \right\rbrace.\]
For example, consider the following constraint:
which describes a convex cone in \(\real^3\) given by the inequality:
For other types of cones supported by MOSEK, see Sec. 15.8 (Supported domains) and the other tutorials in this chapter. Different cone types can appear together in one optimization problem.
6.3.1 Example CQO1¶
Consider the following conic quadratic problem which involves some linear constraints, a quadratic cone and a rotated quadratic cone.
The two conic constraints can be expressed in the ACC form as shown in (6.8)
Setting up the linear part
The linear parts (constraints, variables, objective) are set up exactly the same way as for linear problems, and we refer to Sec. 6.1 (Linear Optimization) for all the details. The same applies to technical aspects such as defining an optimization problem, retrieving the solution and so on.
Setting up the conic constraints
To define the conic constraints, we set the prob.f
and prob.g
equal to the matrix and vector shown in (6.8). Since g
is zero it can be omitted. The domains and dimensions of affine conic constraints are specified using the structure accs
.
Listing 6.6 demonstrates how to solve the example (6.7) using MOSEK.
function cqo1()
clear prob;
[r, res] = mosekopt('symbcon');
% Specify the non-conic part of the problem.
prob.c = [0 0 0 1 1 1];
prob.a = sparse([1 1 2 0 0 0]);
prob.blc = 1;
prob.buc = 1;
prob.blx = [0 0 0 -inf -inf -inf];
prob.bux = inf*ones(6,1);
% Specify the cones as affine conic constraints.
% Two conic constrains: one with QUAD, one with RQUAD, both of dimension 3
prob.accs = [res.symbcon.MSK_DOMAIN_QUADRATIC_CONE 3 res.symbcon.MSK_DOMAIN_RQUADRATIC_CONE 3];
% The matrix such that f * x = [x(4), x(1), x(2), x(5), x(6), x(3)]
prob.f = sparse( 1:6, [4, 1, 2, 5, 6, 3], ones(1, 6) );
% That implies:
% (x(4), x(1), x(2)) \in QUAD_3
% (x(5), x(6), x(3)) \in RQUAD_3
% Optimize the problem.
[r,res]=mosekopt('minimize',prob);
% Display the primal solution.
res.sol.itr.xx'
For a step by step introduction to formulating problems with affine conic constraints (ACC) see also Sec. 6.2 (From Linear to Conic Optimization).