Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

variable ordering

  • 1.  variable ordering

    Posted Wed April 24, 2013 07:24 PM

    Originally posted by: Hosssein


     

    Hi,

    I am solving a constraint programming model by CP optimizer.  There are two sets of decision variables in the model as follows:

    IloIntVarArray W(envvv, 20, 0, 10);

    IloIntVarArray S(envvv, 20, 0, 10);

    I want to use the following variable ordering in the CP search:

    W[0], S[0] , W[1], S[1] , W[2] , S[2] , … , W[i-1],S[i-1],W[i],S[i] , ...

    How can I implement this variable ordering?

    IloSearchPhase accepts only one set of variables and if I use IloSearchPhaseArray cp optimizer decide about one set of variables first (for example W) and then the other set (for example S) which is not what I am looking for.

     

    Thanks in advance for your help


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: variable ordering

    Posted Fri April 26, 2013 09:54 AM

    Originally posted by: ChrisBr


    Hello Hossein,

    Why don't copy your variables in a dedicated array?

      IloIntVarArray vars(envvv);
      for(i=0; i<20; i++) {
        vars.add(W[i]);
        vars.add(S[i]);
      }


    then use this new array into the search-phase.

    I hope this helps,

    Chris.
     


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: variable ordering

    Posted Fri April 26, 2013 01:45 PM

    Originally posted by: Hosssein


    Hi Chris.

    Great ! Good Idea.

    But adding a new set of variables increases the complexity of CP model. Right?

     


    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: variable ordering

    Posted Mon April 29, 2013 08:46 AM

    Originally posted by: ChrisBr


    Hi Hossein,

    Following my advice you are not creating new variables, instead you are copying existing variables in a new array. So the complexity of the model will not increase.
    You might have a look to the search log and notice that you get the same number of variables in both cases.
    Regards,

    Chris.
     


    #CPOptimizer
    #DecisionOptimization