Possible values of the "Status" attribute

711 views
Skip to first unread message

Iain

unread,
Mar 25, 2014, 4:46:15 PM3/25/14
to gur...@googlegroups.com

However, the following Python example has the Status attribute returning code 10022, which is an error code for non-PSD constraints

from gurobipy import *

m = Model("qcp")

x  = m.addVar()
u0 = m.addVar()
u1 = m.addVar()
y  = m.addVar(vtype=GRB.BINARY)
m.update()

m.addConstr(x == 10.0 * y)
u_data = [0.5, 0.5]
m.addConstr( u_data[0]**2 - u_data[0]*u0 + u0*u0  +
             u_data[1]**2 - u_data[1]*u1 + u1*u1  + 
             y >= 1)
m.optimize()
print m.status


(I experienced the same through the Julia/C interface).

This broke the Gurobi.jl interface because it didn't anticipate the possibility of other codes.
My question is, are we misunderstanding something, or is the documentation out-of-date? In either case, is there a known subset of codes that can be returned?

Cheers,
Iain Dunning
MIT ORC

Jakob Sch.

unread,
Mar 26, 2014, 9:15:01 AM3/26/14
to gur...@googlegroups.com
Hi Iain,

I think the error is due to the fact, that you specified a concave constraint. Note that gurobi can only handle convex quadratic constraints: see http://www.gurobi.com/documentation/5.6/reference-manual/py_model_addqconstr
Just change >= to <= to get a valid constraint that gurobi can solve.
It is kind of odd nonetheless that gurobi tries to solve the model even if the quadratic constraint is concave. Judging from the log I would say that a trivial heuristic found a feasible solution, but gurobi realizes that the model is not convex. therefore no bound is given and just the feasible solution is returned (but without any guaranty of optimality).
@Gurobi-Developers: When trying to write the presolved model I get the error "Failed to create presolved model", but nowhere it is stated that this is due to the non-convexity of the problem. Maybe a more precise error output would help to clear things up when there is a problem with non-convexity in the model.

Best regards,
Jakob 

Ed Rothberg

unread,
Mar 26, 2014, 4:27:46 PM3/26/14
to gur...@googlegroups.com

Iain,

Your understanding is correct.  The status values provided at the link you included are the only ones that should be returned.  Any exception is a bug.

Thanks for sending the code sample.  You indeed found a bug.  It will be fixed in our next release.

Ed


Iain

unread,
Mar 27, 2014, 1:22:28 PM3/27/14
to gur...@googlegroups.com
Jakob: yes, I am well aware.

Ed: thanks!

Cheers,
Iain
Reply all
Reply to author
Forward
0 new messages