Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Subtourelimination

    Posted 02/06/19 04:16 AM

    Originally posted by: Hello76483


    Hey, I have a Problem. I want to model a tour starting at the Depot with 0, and ending the tour at 5 (also the Depot).

    My notations are this (programmed a little different)

    D={3,4,6}

    Depot={0,5}

    P={1,2}

    E[P] is depending on P

    AllN= D union P union Depot

    AllS= All E[P]

    All_ = AllS union AllN

    NoP= D union Depot

    {string} L = {"L1"};

    int cardofL=card(L);

     

    minimize sum(j,i in NoP) costsD[i][j]*x[i][j] + sum(i in P, k in E[i]) costsPD[i][k] *x[i][k];

     

    subject to {


        forall(i in D)        
           sum(j in All_ diff P) x[i][j] == 1; 
         
        forall(j in D)     
           sum(i in All_ diff P) x[i][j] == 1;    
              
        forall(i in P) ct3[i]:                    
          sum(k in E[i]) x[i][k] == 1;                
          
        forall(i in AllS)                     
          sum(j in All_) x[j][i] == sum(j in All_) x[i][j]; 
          
        forall(i in P, k in E[i]) ct4[i][k]:
          sum(j in E[i]) x[i][j] >= x[i][k];       
         
        forall(i in Depot: i == 0)
          sum(j in All_) x[i][j] == cardofL;
        
        forall(i in Depot: i == 5)
           sum(j in All_) x[i][j] == 0;
           
        forall(j in Depot: j == 5) ct7[j]:
          sum(i in All_) x[i][j] == cardofL;
          
        forall(j in Depot: j == 0)
          sum(i in All_) x[i][j] == 0;
          
        forall(i,j in Depot)
          x[i][j] == 0;
             

         forall(i,j in All_ : i== j)
            x[i][j] == 0;                            
                
         forall(i in P,j in All_ diff E[i])
           x[j][i] == 0;
           
         forall(i in P,j in All_ diff E[i])
           x[i][j] == 0;
                
         forall(i in P,k in E[i])
           x[i][k] == sum(j in All_ diff P) x[j][k];          


          

        forall(i in All_ diff P,j in All_ diff P) ctTravel[i][j]:
          Traveltime[i][j] == Distance[i][j]*sT;
          
        forall(i in P, k in E[i]) ctTravel2[i][k]:
          Traveltime[i][k] == Distance[i][k] *(sW + sP);
          
        forall(i in D)
          Servicetime[i] == Tu*(-Demand[i]);
        
        forall(i in P)
          Servicetime[i] == Tl*Demand[i];
        
        forall(i in Depot union AllS)
          Servicetime[i] == 0;
     

        forall(i,j in All_) ctKosten1[i][j]:
          costsD[i][j] == cA*Servicetime[i] + cA*Traveltime[i][j]*cT; //17
            
        forall(i in P,k in E[i]) ctKosten4[i][k]:
          costsPD[i][k] == cA*Servicetime[i] + Traveltime[i][k]*cA + Distance[k][i]*sP*cP ; //18
          
    }

     

    I hope it is clear what I'm trying to do. The Problem is, Cplex is doing a lot of subtours now, and I'm not able to avoid them. 

    Maybe someone could help me? That would be awesome!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Subtourelimination