Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

How to set up conditional constraints for non-binary variables

  • 1.  How to set up conditional constraints for non-binary variables

    Posted 09/04/16 02:28 AM

    Originally posted by: NaomiLearnCplex


    I am sorry I might ask too many "simple" questions. I am new to CPLEX and working on an optimization problem and hope to solve it asap.

    I found indicator variables can handle constraints that include variables. However, by definition indicator variables should be binary. How does it work when the indicator constraints are not binary? How to set up conditional constraints for non-binary variables?

    In my problem I want to set up 

      C[i]=1 when i=1,2 or 3;

      C[i]=C[i-1], when x[i-1]+x[i-2]+x[i-3]<5 && x[i-1]+x[i-2] !=0; for all i = 4..10
      C[i]=-100000, when  x[i-1]+x[i-2]+x[i-3]>=5; for all i = 4..10
      C[i]=1, when x[i-1]+x[i-2]=0; for all i = 4..10

    Regards.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to set up conditional constraints for non-binary variables

    Posted 09/04/16 06:24 AM

    Hi,

    are you sure you do not look for

    forall (i in days_4_10){
      (C[i]==C[i-1])>= (x[i-1]+x[i-2]+x[i-3]<=4.9 && x[i-1]+x[i-2]+x[i-3]>=0.01);
      (C[i]==-100) >= (x[i-1]+x[i-2]+x[i-3]>=5);
      (C[i]==1)>= (x[i-1]+x[i-2]==0);  

    ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer