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 Linear Constraint involving Modulo in cplex?

    Posted 09/29/14 12:09 AM

    Originally posted by: Nodame


    I am calling cplex from C# to solve an LP. I want to write a Linear constraint in Cplex that would achieve the following:

    my variables should be multiples of a certain number, say 10 i.e. x modulo 10 = 0 for all my variables x.

    I don't know if cplex has a modulo operator, and even if it does, I am not sure how to write this constraint in a linear form.

    I would like to have the constraint x = 10 k , for some integer k

    or something like "cplex.AddEq( cplex.Modulo(x, 10), 0 )" with this constraint being Linear.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How to write a Linear Constraint involving Modulo in cplex?

    Posted 09/29/14 12:38 AM

    Originally posted by: T_O


    In a pure linear program, this is not possible. If it is ok to have a mixed-integer program, you could just create some integer variable k and some continous variable x. Then just use the constraint x = 10 k.

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How to write a Linear Constraint involving Modulo in cplex?

    Posted 09/29/14 01:05 PM

    Originally posted by: Nodame


    Thanks, that works!


    #CPLEXOptimizers
    #DecisionOptimization