[Scip] scip reports optimal solution along with violated constraints

Tobias Achterberg achterberg at zib.de
Wed Mar 10 14:10:51 MET 2010


Martin Bergner wrote:
> Hello Tobias, hello Stefan,
>
>> could you please try to extract a small code example that just includes default plugins,
>> creates and populates a problem, and solves it? Then, we could look at your problem setup
>> code and see whether this is correct or not.
> Ok, I found the problem while trying to get a minimal test case to work.
> Your first intuition that the setup code was incorrect was right. At
> some point I got the scip instances messed up and I created the
> constraint in one (the original) instance and added it to another
> instance. I thought I checked that part for exactly this mistake at
> least three times before sending the first email. So again, that was my
> fault and I'm really sorry for that. I hope I didn't waste too much of
> your time.
>
> Is there a way to notice that from a scip point of view to guard (me)
> against this stupid kind of mistake in the future? Scip somehow seemed
> to notice it after the solution process. The other way around (adding
> constraints to the wrong instance) would have been much easier to debug.

Currently, there is no way to check this as the constraint handler and the constraints do 
not know to which SCIP instance they belong. But I agree that this would be a valuable 
check. You are not the first to run into this issue.

SCIP Team: I propose to add (in DEBUG mode) a SCIP pointer SCIP_Cons and SCIP_Var, and 
check that:
1. this pointer is NULL in the SCIPcreate...() calls, and set it there to the user 
provided SCIP pointer,
2. it is identical to the user provided SCIP pointer in the SCIPadd...() calls.


Tobias


More information about the Scip mailing list