Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Alternative for < > operator

    Posted 10/27/13 05:13 PM

    Originally posted by: tazingerurl


    Hi,

    how is it possible to fullfill the following constraint:

    (x <= 5 && x > 0) => y == 1;

    (x > 5) => y == 2;

    Considering the operator x > 0, the program says, that this operator is not available.

    Could you give me an alternative way to solve my problem?

    Edit: The dvar is a float, so the program says, that (x <= 5 && x != 0) => y == 1; is not possible as well.

     

    King regards

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Alternative for < > operator

    Posted 10/28/13 10:23 AM

    Hi,

     

    could

    dvar float x;
     dvar float y;
     
     float epsilon=0.0000001;
     
     subject to
     {
      (x <= 5 && x >= epsilon) => (y == 1);

    (x >= 5+epsilon) => (y == 2);

    }

    help ?

     

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Alternative for < > operator

    Posted 10/28/13 10:52 AM

    Originally posted by: JorisK


    Hi,

    Basically what Alex is saying is that you cannot do '>', '<', or '<>' in linear programming. Instead, use something like '>= value + epsilon' to obtain '> value'. For the remainder of your question, have a look at piecewise linear functions and how you can model them. 

    What I often do is refer to the AIMMS modeling guide as it has quite a lot modelling tricks and examples, including some examples on how to do piecewise linear functions:

    http://www.aimms.com/downloads/manuals/optimization-modeling


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Alternative for < > operator

    Posted 10/28/13 05:37 PM

    Originally posted by: tazingerurl


    Alright,

    i tried it by adding a small value, i guess it works.

    Thanks to both of you, much appreciated!


    #CPLEXOptimizers
    #DecisionOptimization