# Error using Mosek Solver with binary constraints

(Sandeep ) #1

I am trying to solve the following optimization problem with binary variables using a Mosek solver in MATLAB R2012b and Windows 10 OS.
n1=6;n2=3
A=rand(n1,n1);
cvx_begin
variable x(n1,n1) diagonal binary
minimize lambda_max(AxA’)
subject to
sum(sum(x))=n2
cvx_end

And I get the following error

Error:
Reference to non-existent field ‘sol’.
Error in G:\Other Stuff\Softwares\cvx\shims\cvx_mosek.p>solve
(line 490)

Error in cvxprob/solve (line 428)
[ x, status, tprec, iters ] = shim.solve( At, b, c,
cones, quiet, prec, solv.settings, eargs{:} );

Error in cvx_end (line 87)
solve( prob );

First, the above problem gives a optimum solution for n1=2 and n2=1. For n1>3 the above error is displayed.
Later I attempted to solve the problem by reformulating in the below given way to get a solution which is binary (0 or 1). I am able to run the cvx without any errors But it doesn’t return a binary solution x for every matrix A. Any suggestions to solve the above given problem using binary restrictions on variables?

n1=6; n2=3;
cvx_begin
variable x(n1,n1) diagonal nonnegative
minimize lambda_max(AxA’)
subject to
sum(sum(x))==n2
norm(x,Inf)<=1
cvx_end

Mixed Integer SDPs which are not Mixed Integer SOCPs
(Sandeep ) #2

I found a way to solve the above problem using YALMIP. I came to know that, CVX with Mosek solver (academic license) cannot handle binary semidefinite variables. Below given is the mosek error displayed in matlab.
Mosek error: MSK_RES_ERR_GLOBAL_INV_CONIC_PROBLEM (The global optimizer can only be applied to problems without semidefinite variables.)

Whereas YALMIP can handle binary semidefinite variables. I have solved using the following code.

n1=5;n2=3;
A=rand(n1,n1)
x = diag(binvar(n1,1));
F = [sum(sum(x))==n2];
h = lambda_max(AxA’);
optimize(F,h);
sol = value(x)

MOSEK SDP integer programming
(Mark L. Stone) #3

(Erling D.Andersen) #4

Yalmip has implemented its own B&B to my knowledge. That is why Yalmip can solve it.

(Mosam Dabhi) #5

For Mosek error: MSK_RES_ERR_GLOBAL_INV_CONIC_PROBLEM (The global optimizer can only be applied to problems without semidefinite variables.)

The reason behind that is, you are trying to implement a mixed integer solution along with normal Semidefinite Program, which Mosek doesn’t allow. So try to remove the line:

“prob.ints.sub”

Removing this, I got my solution, though I had to solve the Mixed Integer part through the Second Order Cone Program and thereby used those values accordingly to solve my Semidefinite Program.

#6

I have faced similar problem and I cannot understand why mosek doesn’t allow, according to CVX 7th and later versions of MOSEK should allow.
and I did not understand where should I remove the line “prob.ints.sub”

(Mark L. Stone) #7

MOSEK, even the forthcoming version 9.0, does not natively handle mixed-integer SDPs, but does handle mixed-integer SOCPs (among other things). Read the link Mixed Integer SDPs which are not Mixed Integer SOCPs provided above.