Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Logic contraints on general integer variables

    Posted 11/07/16 12:44 AM

    Originally posted by: JorisK


    For 2 integer variables, y=1,...,10, z=1,...,10

    Is it possible to express in linear constraints:

    NOT(y=3 AND z=7), that is, y cannot be 3 while z=7 and vice versa? I want to extend this to an arbitrary number of integer variables.

     

    I tried the following:

    Let x_y3 be a binary variable with the value 1 if and only if y=3, 0 otherwise.

    Let x_z7 be a binary variable with the value 1 if and only if z=7, 0 otherwise.

    Then the constraint x_y3+x_z7 <= 1 would model the desired behavior.

    However, this approach requires that I can force x_y3=1 iff y=3, 0 otherwise. This doesn't seem to be trivial? Any suggestions on how to do this?

    In short: expressing a no-good cut in terms of binary variable is easy, but how to express a no-good cut in terms of integer variables?

     

     


    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: Logic contraints on general integer variables

    Posted 11/07/16 06:48 PM

    You can do what you want with two binaries per target value, one for exceeding it and one for falling short of it. I'll demonstrate just for y = 3. Introduce two binary variables u and v, with the constraint u + v <= 1. Constrain y as follows: y <= 3 + 7u - v; y >= 3+u-2v. If u = 1, v = 0 and y is between 4 and 10 (inclusive). If v = 1, u = 0 and y is between 1 and 2 (inclusive). If both u and v are 0, y = 3. Now just plug in (1 - u - v) where you would have had x_y3.


    #DecisionOptimization
    #MathematicalProgramming-General