Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Integer programming, conditional constraints

    Posted 11/20/18 11:04 AM

    Originally posted by: 88Simon88


    Hello everybody,

     

    I want to linearize the following situation:

    Itip: inventory

    Xti: Binary decision variable

    IAtip: Inventory after the decision has been done

    Ytip: another binary variable

     

    Note that for each t and i, there is only one value for I. See the below table.


    Note that IA should be greater than zero and not greater than equal to zero. If Xti=1, then IAtip should be zero (for all p) and If X=0, then IAtip = Itip.

     

    If IAtip > 0, then Ytip = 1 otherwise it should be zero, as you can find the above table. 

    I used the following equations, but sometimes it doesn't work, I mean sometimes the OPL decide X=1 so the IA should be zero, but the value for IA = 0.00001 (like epsilon) and consequently the Y=1 however, it should be zero.

    How can I model this problem? 

    Thanks in advance for your help.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Integer programming, conditional constraints

    Posted 11/20/18 02:50 PM

    Is there any chance you can define IA as an integer variable? Strict inequality (>0) is not supported by the theory of linear programming, so you will always be stuck with some sort of epsilon. For an integer variable however >0 is the same as >=1, so the cases "equal to 0" and "different from 0" can be distinguished without any epsilon. Also this M looks fishy. Have you tried using logical constraints instead of big-M formuations?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Integer programming, conditional constraints

    Posted 11/20/18 02:57 PM

    Originally posted by: 88Simon88


    If I am going to use IA as an integer, I think that I have to change almost all of the other decision variables. I have to review carefully and then try it. 

    I am not familiar that much with logical constraints, could you please let me know how I can use logical constraints for this problem?


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Integer programming, conditional constraints

    Posted 11/20/18 03:15 PM

    You can read about logical constraints here. What should come in handy in your case is the "implies" constraint which is written using operator "=>". With that, you can directly state what you said above:

    forall (i in I, t in T, p in P) (X[t][i] == 1) => (IA[t][i][p] == 0);

    forall (i in I, t in T, p in P) (X[t][i] == 0) => (IA[t][i][p] == I[t][i][p]);

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Integer programming, conditional constraints

    Posted 11/20/18 03:30 PM

    Originally posted by: 88Simon88


    FYI:

    I used the integer for IA, but it doesn't work. 

    and

    When I use the logical constraints as you mentioned, I will miss the Y, but I need Y in the other constraints.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Integer programming, conditional constraints

    Posted 11/21/18 01:25 AM

    Why would you miss Y? I only showed the logical constraints for X. You can add similar ones for Y.

    In the case IA is integer but CPLEX returns fractional values, what are those fractional values? Are they 1e-5 as before or are they smaller?

    Does it help to set CPX_PARAM_EPINT to 0?


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Integer programming, conditional constraints

    Posted 11/22/18 10:05 AM

    Originally posted by: 88Simon88


    I just removed the Epsilon, and it works :)

    By the way, thank you so much for the time you spent on my problem.


    #CPLEXOptimizers
    #DecisionOptimization