CVX Gurobi showing errors


I am trying to solve a mixed integer linear programming problem using CVX Gurobi. I can find a feasible solution of the problem by hand. However, CVX Gurobi is showing me errors.

I will show my code and the CVX error here. I am sorry for this long post but I am just trying to explain the problem. If anyone thinks that a feasible solution will be helpful, please let me know. I can provide that later.

Any help will be appreciated.



CVX Original Code:

cvx_solver Gurobi


%% MaxPowerMobile(1), sLMobile(2x2), sUMobile(2x2), betaMobile(2x2), NodeAccessGain(2x2), %% N0(1) and W(1) are predefined constants

variables K FlowMobile(NodeNum,PortFreqNum) PowerMobile(NodeNum, PortFreqNum) …
SINRMobile(NodeNum, PortFreqNum)

variable DecisionMobile(NodeNum, PortFreqNum) binary

maximize K

subject to

     sum(FlowMobile,2) >= K ;
     sum(DecisionMobile,1) <= 1 ;  
     sum(DecisionMobile,2) <= 1  ;

    SINRMobile >= SINR_Thres * DecisionMobile ;
    (NodeAccessGain .* PowerMobile) >= N0 * SINRMobile ;
    sum(PowerMobile,2) <= MaxPowerMobile ;
    PowerMobile <= MaxPowerMobile * DecisionMobile ;
    (1 + sLMobile) .* FlowMobile - W * SINRMobile <= W * (1 + sLMobile) .* (log(1 + sLMobile) - 1) + W  ;   
    (1 + betaMobile) .* FlowMobile - W * SINRMobile <= W * (1 + betaMobile) .* (log(1 + betaMobile) - 1) + W ;    
    (1 + sUMobile) .* FlowMobile - W * SINRMobile <= W * (1 + sUMobile) .* (log(1 + sUMobile) - 1) + W  ; 
    FlowMobile >= 0 ;
    K >= 0 ;
    PowerMobile >= 0 ;
    SINRMobile >= 0 ;


CVX_Error message:

Calling Gurobi: 49 variables, 32 equality constraints

Optimize a model with 32 rows, 49 columns and 98 nonzeros
Found heuristic solution: objective 0
Presolve removed 28 rows and 48 columns
Presolve time: 0.00s

Explored 0 nodes (0 simplex iterations) in 0.00 seconds
Thread count was 1 (of 4 available processors)

Model is unbounded
Best objective 0.000000000000e+00, best bound -, gap -

??? Error using ==> solve at 259
An unexpected error was encountered:
Error using ==> gurobi
Gurobi error 10005: Unable to retrieve attribute 'ObjVal’
Error in ==> cvx_run_solver at 45
[ varargout{1:nargout} ] = sfunc( inputs{:} );
Error in ==> D:

Please submit a full bug report to … Thanks! If possible, please include enough Matlab code and data to reproduce the error.

Thanks, Michael. I have submitted a bug report to that page. I have included my CVX code and a feasible solution with the email. Your feedback will be very appreciated.

How do you install gurobi? We have a proxy before we can reach the internet, but we are in a university. I can not make it work because it can not validate my IP address. Do you have any suggestions? I have searched the Internet, I can not find any useful solutions.


You’ll have to contact Gurobi about that, I’m afraid.

To update readers of this post: he did submit a bug report to the CVX support site. We identified two bugs, in fact; one with CVX, one with Gurobi. The CVX bug has been fixed and will be uploaded in the next release. A fix for the Gurobi bug will appear in Gurobi 5.5. However, the problem as written is unbounded, at least to within numerical precision. Part of the problem, it turns out, is due to scaling issues.