Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Multidimensional Range

  • 1.  Multidimensional Range

    Posted Thu June 11, 2015 05:05 AM

    Originally posted by: gregman


    Dear Cplex-Community,

     

    I am currently struggling with the following problem:


    given a set p = {1,2}

    given a set of ranges W_i

    Since W_i is dependent on p, W_2 is supposed to be 2..6, W_1=1..6 and both are dependent on p, respectively. It is not possible to create 2 separate simple ranges. 

    -Is it possible to create a set of ranges W_i in Cplex with different starting and ending points?

     

    -Furthermore, could you give me the syntax for a max() formula inside a sum?

    Example: sum (a in 1..max(b,c) ).

     

    Thanks a lot,

    Greg

     

     

     

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Multidimensional Range

    Posted Thu June 11, 2015 06:55 AM

    It sounds like you want to do this in OPL? If that is correct then you should ask the question on the OPL Forum. There you will find the OPL experts.

    I am not an OPL expert but if you could sets instead of ranges, this would work (initialization of sets taken from here):

    {int} p = { 1, 2 };
    {int} W[i in p] = {k | k in 1..6: k >= i};
     
    minimize 0;
    subject to {}
    main {
      for (var i in thisOplModel.p) {
        writeln(i + ": " + thisOplModel.W[i]);
      }   
    }

    In your question about max() inside a sum, it is not clear whether b and c are decision variables or data.


    #CPLEXOptimizers
    #DecisionOptimization