does CP Optimizer somehow offer the ability to define the following global cardinality constraint?
count( | P >= x | >= n )
... that is, is there a way to constraint the number of variables P that take values greater than or equal to a value x to greater than or equal to the number n ?
IloDistribute doesn't seem to be able to do it -- do I have to implement my own global constraint to do this?
Pinned topic Global cardinality constraint with ranges
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-11-13T14:56:01Z at 2012-11-13T14:56:01Z by ol
ol 270002SRX780 Posts
Re: Global cardinality constraint with ranges2012-11-13T14:56:01ZThis is the accepted answer. This is the accepted answer.Hello,
you want the number of Pi greater or equal than value x to be greater or equal than n: count( | P >= x |) >= n.
You can introduce an array of 0-1 variables, Q, s.t. Qi = (Pi >= x)
Then you can express your constraint by: sum(Q) >= n. No need to use count() or distribute() here.