[SCIP] The strange behavior of the CONSENFOLP callback assertion

Abbas Omidi abb.omidi at gmail.com
Tue Jul 25 10:00:10 CEST 2023


Dear support team,

I am working on the problem that I am willing to use SCIP's (PySCIPopt)
*conshdlr*callback to check how the constraints might be added to the
model. Please, see the attached file.
As long as the problem is solved by the usual paradigm, the solver returns
the optimal solution, but when I added the constraints by callbacks, it
throws an issue as follows:

AssertionError Traceback (most recent call last)
> <ipython-input-7-9a59f5f7b72a> in <cell line: 154>()
>     153
>     154 if __name__ == "__main__":
> --> 155 test_conshdlr()
> <ipython-input-7-9a59f5f7b72a> in test_conshdlr()
>     137 del s
>     138
> --> 139 assert "consenfolp" in calls
> AssertionError:


By having a look at the related documents
<https://scipopt.org/doc/html/CONS.php#:~:text=A%20constraint%20handler%20defines%20the,belonging%20to%20its%20constraint%20class.>,
it has been mentioned that:

The CONSENFOLP method is called after the price-and-cut loop was finished
> and an LP solution is available. Like the CHECK call, the ENFOLP method
> should return a result SCIP_FEASIBLE, if the solution satisfies all the
> constraints. However, the behavior should be different, if the solution
> violates some of the associated constraints. The constraint handler may
> return a result SCIP_INFEASIBLE in this situation, but this is not the best
> what one can do.


As far as I know, the *conscheck* is used when we only need to know the
feasibility of the provided solution that might come from the problem or
any heuristic method. On the other hand, the *consenfolp/consenfops* callbacks
are highly sensitive again to any behavior of the added constraints. Now,
my questions are:

1) As the above definition is very specific, what does exactly CONSENFOLP
mean? and how does it work?
2) As the problem is primal feasible and also has an optimal solution, and
already other callbacks seem to work fine, how is it possible to reject the
constraints/solution by CONSENFOLP?
3) Is it still necessary to use *conshdlr.createData* to add the same
constraint? (in some instances it does not use).


Best regards
Abbas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20230725/b13432af/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conshdlr.py
Type: application/octet-stream
Size: 4830 bytes
Desc: not available
URL: <http://listserv.zib.de/pipermail/scip/attachments/20230725/b13432af/attachment.obj>


More information about the Scip mailing list