How to solve a MIP problem with cvx

Uncategorized
Jul 18, 2013
J
f=xlsread('air04',2,'B1:B8904');
Aeq=zeros(823,8904);
M=xlsread('air04',4);
for k=1:size(M,1);
  i=M(k,1);
  j=M(k,2);
  Aeq(i,j)=1;
end;
beq=ones(823,1);
lb=zeros(8904,1);
ub=ones(8904,1);
cvx_begin
 variable x(8904) binary
 minimize( f' * x )
 subject to 
  Aeq * x == beq;
cvx_end

  Name         Size            Bytes  Class     Attributes
  f         8904x1             71232  double              
  Name        Size                 Bytes  Class     Attributes
  Aeq       823x8904            58623936  double              
  Name        Size            Bytes  Class     Attributes
  beq       823x1              6584  double     

Error using cvx_sdpt3>solve (line 124)
SDTP3 does not support integer variables.

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

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

Error in air04 (line 17)
cvx_end 

Should I use variable x(n) binary to describe the binary constraint? What’s wrong with my program?
Thanks a lot!

M

The error message here says exactly what the problem is. SDPT3 and SeDuMi solvers cannot solve MIPs. Only the professional solvers Gurobi and MOSEK can do this.

Assuming you have a CVX Professional license, you can switch to those solvers and attempt to solve this problem.

C

Actually, Gurobi is quite capable of handling models with 8904 binary variables. Models with millions of binary variables are routinely solved in several hours. Obviously the time to solve a MIP depends highly on the specific model. But I wouldn’t say the likelihood of arriving at a solution to a MIP of that size is small. You should give Gurobi a try!

M

Fair enough, I’ve edited my answer!