Problem with negative lower bounds (MATLAB) - are they assumed as >= 0 in Gurobi?

146 views
Skip to first unread message

Martin K

unread,
Oct 5, 2015, 1:04:16 AM10/5/15
to Gurobi Optimization
When I start implementing negative lower bounds for some of the variables in a model, it seems like Gurobi consider them as >= 0 anyway. Do anyone know if this is the case? That Gruobi assumes that all variables are greater or equal to zero?

I have included the upper- and lower bounds in the A matrix with the corresponding limits in the b vector. 

model.A = sparse([A; Aeq]);
model.obj = C';
model.sense = [repmat('<',size(A,1),1); repmat('=',size(Aeq,1),1)];
model.rhs = [b;beq];

VarType(~yidx)='C';
VarType(yidx)='I';
model.vtype = VarType;

params=struct();
params.LogToConsole = 0;
params.LogFile = 'gurobi_log.txt';
params.ResultFile = 'Results4IIS.mps';

result = gurobi(model, params); 

Martin K

unread,
Oct 5, 2015, 8:08:17 AM10/5/15
to Gurobi Optimization
FYI:
I changed solver from Gurobi to Cplex with the same problem structure. It works fine in Cplex..

Renan Garcia

unread,
Oct 5, 2015, 8:14:31 AM10/5/15
to gur...@googlegroups.com
Gurobi always assumes variables are non-negative unless their lower bounds are explicitly specified. In the MATLAB API (see http://www.gurobi.com/documentation/6.0/refman/matlab_gurobi.html), you can specify negative lower bounds using the 'model.lb' field.

--

---
You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

R

unread,
Sep 25, 2018, 4:52:22 AM9/25/18
to Gurobi Optimization
adding

model.lb = -Inf*ones(size(C,1),1);

before the last line of your code will also solve the problem (as it removes the default lower bound 0 for the optimization variables). This means the desired lower bounds can be still formulated through A and b.
Reply all
Reply to author
Forward
0 new messages