[SCIP] add constraint x!=y for decision optimization using pyscipopt

Peter Notebaert mail at peno.be
Wed Jan 31 09:50:01 CET 2024


What would be the purpose of such a constraint? Only when x and y would be
integer this would make sense according to me.
Suppose x is 1.0 in the end result. What is then an acceptable value for y?
Not 1.0 but what about 1.000000000000000000001 or 0.9999999999999999999999 ?

You see my point?

On Wed, 31 Jan 2024 at 08:45, Jing GONG <jing.gong at gmail.com> wrote:

> Hi,
>
> I am a new user of pyscipopt and try to add a constraint for two integers
> with * x!=y *for decision optimization.
>
> As scip  seems to only  "support constraints with '<=', '>=', or '=='", I
> could not use model.addCons(x!=y).
>
> If use addConsOr likes
>
>  x = model.addVar("x", "I")
>  y = model.addVar("y", "I")
>  r = model.addVar("r", "B")
>  model.addConsOr([x>=y+1, x<=y-1],r)
>
> there is  "segmentation fault" error.
>
> How can I add constraint for x!=y ?  Thanks.
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20240131/17c48efc/attachment.html>


More information about the Scip mailing list