Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  about empty set in sum

    Posted 09/10/15 08:50 PM

    Originally posted by: qtbgo


    Hi, in the following constraint, x[i] is bool var. S is a set, I use script to change S dynamicly. Now, in my procedure, sometimes S will be set as an empty set, then the constraint will be reported infeasible (0>=1), this is not what I want. I want that when S is empty, the constraint should be ignored simply. Could someone help me to resolve this problem?   Sorry for my poor English, hope you can understand.

      sum(i in S)(1-x[i])>=1


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: about empty set in sum

    Posted 09/11/15 02:04 AM

    Hi,

    could

    {int} S={};
    dvar int x[1..10] in 1..10;

    subject to
    {

    if (card(S)>=1) sum(i in S)(1-x[i])>=1 ;

    }

    help ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: about empty set in sum

    Posted 09/11/15 03:20 AM

    Originally posted by: qtbgo


    thank you.

    card(S)*sum(i in S)(1-x[i])>=1*card(S)


    #DecisionOptimization
    #OPLusingCPLEXOptimizer