Solver Status, Termination Condition for SCIP

817 views
Skip to first unread message

René

unread,
Apr 28, 2016, 11:04:06 AM4/28/16
to Pyomo Forum
Hey,

SolverStatus and TerminationCondition (http://www.pyomo.org/blog/2015/1/8/accessing-solver) don't work for solver SCIP (http://scip.zib.de/) yet.
Can anyone comment on whether this will be added?
Is there the possiblity that I contribute this analogously to how it works for other solvers?
If so, what would be the best way for me to start?

Best,
René

Gabriel Hackebeil

unread,
Apr 29, 2016, 8:22:05 AM4/29/16
to pyomo...@googlegroups.com
Our interface to SCIP is through the AMPL Solver Library (scipampl), which means that the piece of code that it calls to generate the Pyomo results object and populate those status fields is generic to a large number of solvers. As far as I can tell, that code seems to be working correctly.

Can you be more specific about what does not work? Is there an example you can share?

Gabe

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

René

unread,
May 3, 2016, 1:22:45 PM5/3/16
to pyomo...@googlegroups.com
Hello Gabe,

please see the following example:
from pyomo.environ import *
from pyomo.opt import SolverStatus, TerminationCondition

model
= ConcreteModel()
model
.x = Var(domain=Reals, bounds=(-1,1))
model
.y = Var(domain=Reals, bounds=(-1,1))
model
.con1 = Constraint(expr=model.x - model.y >= 1)
model
.con2 = Constraint(expr=model.y - model.x >= 1)
model
.obj = Objective(expr=model.x + model.y, sense=maximize)

opt
= SolverFactory('ipopt', symbolic_solver_labels = True)
results
= opt.solve(model, tee = True)

print results.solver.status, results.solver.termination_condition

For cplex, this prints
ok infeasible

For gurobi and ipopt, this print
warning infeasible

For scip, this prints
ok optimal

As you can see, the fields in the results object are not populated correctly.

Best,
René

Gabriel Hackebeil

unread,
May 3, 2016, 2:39:30 PM5/3/16
to pyomo...@googlegroups.com
My response was going to be that this is a bug in SCIP (and it might be).

However, when I run your example locally and compare the solution produced by SCIP to the one produced by Ipopt (or cplexamp, or gurobi_ampl), I see that there is a critical line missing in SCIP’s solution file:  objno X Y.

The Y part of this line is where we extract the ampl solver status number that we map to a solver status and solution status. SCIP's solution file ends just before this line is supposed to appear. It turns out Pyomo’s ASL solution file parser handling this scenario by returning “ok” and “optimal” for those statuses when that line is missing. 

I’m not sure how to proceed here because I don’t know if this is a bug with SCIP or if there are many other solvers that do not output that line (it must have something to do with how the ASL routines are called). Interestingly enough, SCIP does indicate that the problem is infeasible through the message in the first line of the file, and this makes its way into the results.solver.message slot, so you could use this as a workaround for the time being.

Would you mind creating a ticket for this? Something obviously needs to change in the SOL parser to handle this situation better. The current behavior is terribly misleading.

Gabe

P.S. Thanks for reporting this.

On May 3, 2016, at 10:22 AM, René <r.saite...@gmail.com> wrote:

Hello Gabe,

please see the following example:
from pyomo.environ import *
from pyomo.opt import SolverStatus, TerminationCondition

model
= ConcreteModel()

model
.x = Var(domain=Reals)
model
.y = Var(domain=Reals)

Watson, Jean-Paul

unread,
May 3, 2016, 3:25:36 PM5/3/16
to pyomo...@googlegroups.com
Also sounds like we should notify/engage the SCIP folks…

jpw

Gabriel Hackebeil

unread,
May 3, 2016, 3:26:40 PM5/3/16
to pyomo...@googlegroups.com
Already submitted a bug report.

Gabe
Reply all
Reply to author
Forward
0 new messages