[gecode-users] Arithmetic element
Christian Schulte
cschulte at kth.se
Fri Mar 20 11:51:53 CET 2015
Hi Javier,
Yes, I think that is the best you can. I would create a new integer variable
u with appropriate bounds and post the constraints in the following order:
u <= y and element(x,z,u)
If you use minimodeling support by writing
rel(home, element(x,z) <= y)
everything will be done for you automatically.
Cheers
Christian
--
Christian Schulte, www.gecode.org/~schulte
Professor of Computer Science, KTH, cschulte at kth.se
Expert Researcher, SICS, cschulte at sics.se
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Javier Larrosa
Sent: Friday, March 20, 2015 11:20 AM
To: users at gecode.org
Subject: [gecode-users] Arithmetic element
Hi,
I am working in a scheduling problem and I need to post a constraint
x[z]<=y, where x is an IntVarArray, z is an IntVar and y is a constant (but
in general could be another variable).
It is close to the element constraint which allows to post the constraint
x[z]==y. What is the best way to do it?
best,
Javier Larrosa
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
More information about the users
mailing list