Does the status code SUBOPTIMAL in gurobi mean IloAlgorithm::Status::Feasible in cplex?

377 views
Skip to first unread message

szx

unread,
Dec 28, 2015, 5:00:18 AM12/28/15
to Gurobi Optimization
Hi,

I get the description of "Unable to satisfy optimality tolerances; a sub-optimal solution is available." for SUBOPTIMAL in the reference manual.
But there are also codes like TIME_LIMIT which indicate the optimal has not been found yet.

So, if a feasible solution was found before violating one of the limits, should the status be SUBOPTIMAL?
if it is true, can I query the sub optimal solution as the way of querying optima or by the X/Xn attribute?

Also, are there any differences between LP and MIP on SUBOPTIMAL?

Kostja Siefen

unread,
Dec 28, 2015, 5:18:27 AM12/28/15
to Gurobi Optimization
Status codes are mutually exclusive. 

If Gurobi terminates with status code TIME_LIMIT you can check the SolCount attribute (http://www.gurobi.com/documentation/6.5/refman/solcount.html) to see if a feasible solution is available.
If Gurobi terminates with status code SUBOPTIMAL, a sub-optimal (and thus feasible) solution is always available (independent of the problem type).

Best wishes,
Kostja

szx

unread,
Dec 28, 2015, 8:16:13 AM12/28/15
to Gurobi Optimization
But in what condition the solver will return which code?

Do you mean SUBOPTIMAL will be returned only if I call optimize asynchronously and check the status before optimize() return?

And can I use (SolCount > 0) as an equivalent to cplex status code Feasible?

Thanks!

Kostja Siefen

unread,
Dec 28, 2015, 8:32:10 AM12/28/15
to Gurobi Optimization
There is no intermediate status, the status code is the (one and only) final result of your optimization call. It is set after optimize() has finished and available through the Status attribute until your next call to optimize().

Kostja

Kostja Siefen

unread,
Dec 28, 2015, 8:46:11 AM12/28/15
to Gurobi Optimization
The SolCount attribute (http://www.gurobi.com/documentation/6.5/refman/solcount.html) contains the total number of solutions that can be retrieved. Thus SolCount > 0 means that at least one solution is available.
Please see the documentation (e.g. http://www.gurobi.com/documentation/6.5/refman/xn.html) on how to retrieve available solutions.

Kostja

Am Montag, 28. Dezember 2015 14:16:13 UTC+1 schrieb szx:
Reply all
Reply to author
Forward
0 new messages