Hi,

I am building a model incrementally. I know in advance how many variables there will be, but the constraints will be added to the model through a graph search. I will have n integer variables, each taking a value from an integer domain {1,...,k}. During the graph search, we are given a sets of alldifferent (i.e. distinct) constraints. In a set of alldiff constraints, at least one has to be satisfied (but not necessarily all!).

For example, a constraint to the model could be: (alldifferent(x1,x2,x3) OR alldifferent(x2,x4,x6) OR alldifferent(x1,x2,x8)), where x_i's are variables. If this 3-ary OR of 3 alldiff constraints is denoted by X, the ultimate model could be say: (X AND Y AND Z), where Y and Z are similar sets of alldiffs.

As far as I could tell from the documentation, an n-ary OR is not supported between constraints. I can do this easily in MiniZinc though (just use \/), so I wonder if I am mistaken here. If that is the case, what is a convenient way of modeling such an n-ary OR between alldifferent constraints?

_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to