[gecode-users] catalog (compatibility) constraints in Gecode
Guido Tack
tack at ps.uni-sb.de
Wed Jun 13 21:43:40 CEST 2007
Hi!
Nicolas BERGER wrote:
> Are catalog (compatibility) constraints such as (x,y,z) \in
> {(1,2,3),(4,4,4),(8,6,9)} allowed in Gecode ? How to represent them ?
In the released version of Gecode (1.3.1), we don't have a special
propagator for this kind of constraint. You can, however, express
them using the regular constraint. Your example would look like this:
REG reg = (REG(1)+REG(2)+REG(3)) | (REG(4)+REG(4)+REG(4)) | (REG(8)
+REG(6)+REG(9));
DFA dfa = reg;
IntVarArgs xs(3);
xs[0] = x; xs[1] = y; xs[2] = z;
regular(this, xs, dfa);
However, the resulting DFAs may become big, so this may not be a good
solution for all applications. The next version of Gecode will come
with a specialized propagator for this constraint.
Cheers,
Guido
--
Guido Tack
Programming Systems Lab, Saarland University, Germany
http://www.ps.uni-sb.de/~tack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20070613/ce8a11a7/attachment.htm>
More information about the gecode-users
mailing list