Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Difficulties to express certain constraints

    Posted 06/18/14 12:08 PM

    Originally posted by: LeonardH


    Hello everyone,

    sorry for the bad title but I just don't know how to explain it better.

    I have the following problem:

     

    I have a series of binaries (0 or 1). In this series, there shall always be at least three 1s after each other. Never only one or two 1s.

    For example: No 0001000 or 00011000, but 0011100 is fine.

     

    Now the first binary is x1, the second binary x2 and so on.

    Does anyone know a way how to express the correct constraints to make my request possible?

    Maybe I am overseeing a way how that is easily possible with CPLEX.

     

    Thanks so much for your help, I am bit on a loss..!

    Leo


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Difficulties to express certain constraints

    Posted 06/18/14 04:23 PM

    Hi

    could the following example help ?

    int n=10;

    dvar int x[1..n] in 0..1;

    subject to
    {


    x[1]<=x[2];
    x[n]<=x[n-1];

    x[1]+x[2]-1<=x[3];
    x[n]+x[n-1]-1<=x[n-2];

    forall(i in 2..n-1) x[i]<=x[i+1]+x[i-1];
    forall(i in 2..n-2) x[i]+x[i+1]-1<=x[i+2]+x[i-1];
    }
     

    what is the kind of business problem you intend to solve ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Difficulties to express certain constraints

    Posted 06/19/14 04:23 AM

    Originally posted by: LeonardH


    Hey Alex,

    I should have mentioned that I work with Matlab and use only the commands to do the optimization by CPLEX.

    Is it possible to write your code in Matlab, so CPLEX "understands" it as well?

    Thanks so much again!

    Leo


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Difficulties to express certain constraints

    Posted 06/21/14 07:58 AM

    Originally posted by: LeonardH


    Regarding the kind of business problem:

     

    I have some generators which have to be running for a certain amount of time before they can be shut down again. To make the constraints for that in CPLEX, I have to check that there are enough 1s after another before there is another zero!

     

    Would be very glad if someone still has an idea or could answer the question regarding Alex' reply.

    Leo


    #DecisionOptimization
    #OPLusingCPLEXOptimizer