Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
Expand all | Collapse all

Global cardinality constraint with ranges

  • 1.  Global cardinality constraint with ranges

    Posted Mon November 12, 2012 06:28 PM

    Originally posted by: SystemAdmin


    Hi,

    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?

    Thanks!
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Global cardinality constraint with ranges

    Posted Tue November 13, 2012 09:56 AM

    Originally posted by: ol


    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.
    Regards,
    ol
    #CPOptimizer
    #DecisionOptimization