Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to write a constraint with " NOT EQUAL " operator ?

    Posted 02/17/15 09:12 AM

    Originally posted by: Zak86


    Hi Guys,

    I have declared an array variable IloNumVar [ ] x = ... .

    I have constraint in which x[i] must be equal to 1 so i write cplex.addEq(x[i], 1)

    and another constraint in which x[s] must be different from 0 . How can i write this constraint of " NOT EQUAL" please ?

    Thank you in advance,

    Zak

     

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How to write a constraint with " NOT EQUAL " operator ?

    Posted 02/17/15 03:38 PM

    Short answer: you cannot. With CPOptimizer (constraint programming), not-equal is a legal constraint. With CPLEX (LP/MIP), it is not.

    Longer answer: you can adapt the solution I posted to a related problem, by replacing the 'x' variable in my solution with zero.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How to write a constraint with " NOT EQUAL " operator ?

    Posted 02/18/15 06:19 AM

    Originally posted by: Zak86


    Dear Pr Rubin,

    Thank you for the quick reply.

    However, please, as i'm a beginner in Mathematical programming. Your post seems a little bit complicated for me as it's well detailed :-) Or may be my case is very simple compared to it :-).

    Indeed, i work on JAVA with the package of CPLEX what i want to do is :

    I have a positive continuos array variable x[i]  >= 0 , where i is in [1 .. N ] and simply i want that, for a specific value of i ( for exmaple i = 3 ) , x[3] must be Not null ( x[3] <> 0),  .

    How to write that please according to your method ?

    I mean,  is the variable 'y' ( in your solution ) equal to x[3], 'L' = 0 and 'U' = POSITIVE_INFINITY ?

    What do variables " m " , "U" , "L" and "Epsilon" refer to in my case please ? 

    Note that if there is a  method to write a strict inequality on x[3] in CPLEX , ( x[3] > 0 ) , instead of ( x[3] <> 0 ) , it will also OK for me .

    Sorry for this repetitive ask.

    Thank you,

    Zak


    #CPLEXOptimizers
    #DecisionOptimization