scipopt / SCIP.jl

Julia interface to SCIP solver
MIT License
95 stars 24 forks source link

Constraint handler failing on SCIP 7.0.3 #196

Closed matbesancon closed 3 years ago

matbesancon commented 3 years ago

I cross-posted this issue on the SCIP repo:

# create an empty problem
mscip = SCIP.ManagedSCIP()
SCIP.set_parameter(mscip, "display/verblevel", 0)

# add the constraint handler
ch = NeverSatisfied.NSCH()
SCIP.include_conshdlr(mscip, ch; needs_constraints=false)

# solve the problem
SCIP.@SCIP_CALL SCIP.SCIPsolve(mscip.scip[])

@test ch.check_called >= 1
@test ch.enfo_called == 1
@test ch.lock_called == 1

on SCIP v7.0.3, @test ch.enfo_called == 1 fails with 0 on the left-hand side

@rschwarz do you know if something in the NSCH handler could break?

rschwarz commented 3 years ago

That's strange, a SCIP bugfix release shouldn't change the behavior w.r.t. callbacks, right?

If I remember correctly, the NeverSatisfied constraint handler simply has a CHECK callback that always returns false. Maybe the new SCIP has some kind of "shortcut" where the infeasibility of the overall problem can be decided without ever calling the ENFORCE method.

EDIT: That is to say: maybe the assumptions that the test makes are too strong. As long as the resulting status is Infeasible, and either CHECK or ENFORCE is called at least once, it seems to be correct?!

matbesancon commented 3 years ago

That's strange, a SCIP bugfix release shouldn't change the behavior w.r.t. callbacks, right?

not really. In that case it did, just in the case when there are no variables left after presolving.

matbesancon commented 3 years ago

Closed by enforcing the SCIP version now, and adapted the test in the #195 PR