Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  For Help! Thanks a Lot!!

    Posted 09/15/13 09:02 AM

    Originally posted by: heidizh


    I have a difficulty in expressing the subtour elimination constraint of the selective traveling salesman problem or the orienteering problem. Please help me, thanks very much !!

    In the attachment is the constraint that I need to express using CPLEX. Looking forward to a prompt reply! Thanks !!

    Best regards,

    Heidi


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: For Help! Thanks a Lot!!

    Posted 09/24/13 08:02 AM

    Hi,

     

    suppose you want all the subsets of the set s in the array of sets s2

     

    {string} s={"A","B","C","D"};

     

     

     {string} s2[i in 0..ftoi(pow(2,card(s)))-1]={};

     

    int nb=ftoi(pow(2,card(s)));

     

    execute

    {

     for(var i in s)

     {

      

       for(var j=0;j<=nb-1;j++)

       {

         if ((j >> Opl.ord(s,i)) % 2==1) s2[j].add(i);

       }   

     }

     

     writeln(s2);  

    }  

     

    and then you can iterate in a constraint with

     

    forall(k in 0..ftoi(pow(2,card(s)))-1)

     

    and then use s2[k]

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: For Help! Thanks a Lot!!



  • 4.  Re: For Help! Thanks a Lot!!

    Posted 09/24/13 08:30 AM

    Originally posted by: heidizh


    Hi, Alex

    Thank you very much. You are always there when I need help. 

    Best regards,

    Heidi


    #DecisionOptimization
    #OPLusingCPLEXOptimizer