<div dir="ltr"><div>What would be the purpose of such a constraint? Only when x and y would be integer this would make sense according to me.</div><div>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 ?</div><div><br></div><div>You see my point?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 31 Jan 2024 at 08:45, Jing GONG <<a href="mailto:jing.gong@gmail.com">jing.gong@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I am a new user of pyscipopt and try to add a constraint for two integers with <b> x!=y </b>for decision optimization.</div><div><br></div><div>As scip seems to only "support constraints with '<=', '>=', or '=='", I could not use model.addCons(x!=y).</div><div><br></div><div>If use addConsOr likes</div><div><br></div><div> x = model.addVar("x", "I")<br> y = model.addVar("y", "I")<br> r = model.addVar("r", "B")<br> model.addConsOr([x>=y+1, x<=y-1],r)<br></div><div><br></div><div>there is "segmentation fault" error. </div><div><br></div><div>How can I add constraint for x!=y ? Thanks. </div><div><br></div><div><br></div></div>
_______________________________________________<br>
Scip mailing list<br>
<a href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a><br>
<a href="https://listserv.zib.de/mailman/listinfo/scip" rel="noreferrer" target="_blank">https://listserv.zib.de/mailman/listinfo/scip</a><br>
</blockquote></div></div>