Decision Optimization

Decision Optimization

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


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

    Posted 03/11/14 11:02 AM

    Originally posted by: Preemptive


     

    hello, i have problem i can't introduce the variable t ( ordre of visit for each arc in a tour: T = ( t in T={1,….|N|*(|N|-1)} :|( N| represents cardinality of the node set N  ) in my model. the model model : 

     

    tuple Sindnoeud{

        int i;
    }
       tuple Sindnoeud2{
         int j;
       }     

    tuple Sindveh{

       int v;
    {Sindnoeud} I=...;
    {Sindnoeud2} J=...;
    {Sindveh} V=...;

     

    dvar int+ Xijv[I][J][V][T]  in 0..1;  ( X[i][j][v][t] = 1 iff arc (i,j) is traversed as t-th in a tour by vehicul v) 

    For example if i have tour 0-1-3-2-6-5-4-0 then X[0][1][v][1]=1, X[1][3][v][2]=1 and so on. 

    how can i define T??


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: vrp

    Posted 03/12/14 04:21 AM

    Hi,

    if t is the rank of the arc in the tour then t is greater than 1 and smaller than the number of arcs. So why not writing anything like

    range T=1..nbArcs;

    If all arcs between nodes are possible then nbArcs <= card(N)*card(N)

    Regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: vrp

    Posted 03/12/14 07:20 AM

    Originally posted by: Preemptive


    Hi, 

    i define :

    int T_max= 20; 

     

    range T = 1..T_max; ( maximum of arc can be visited ) 

    but when i run my model i have 3 errors : 

    ** impossible de charger le modele

    ** variable de decision (ou expression F) non autorisé 

     

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: vrp

    Posted 03/12/14 10:06 AM

    hi

    can you try to rewrite ct20 into

    c20a: forall (v in V, k in K,t in T, i in ICF)
     F[i][v][t] + M *( (1- sum (j in J: j!=i)Yijvk[j][i][v][k][t] +
     sum (j in J:j!=i)Yijvk[i][j][v][k][t+1]))
     >=  G[i][v][k] ;
     
    c20b: forall (v in V, k in K,t in T, i in ICF)
      G[i][v][k]  
     >= ( F[i][v][t] - M *( (1- sum (j in J: j!=i)Yijvk[j][i][v][k][t] + sum (j in J:j!=i)Yijvk[i][j][v][k][t+1])));
     

    ?

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: vrp

    Posted 03/12/14 10:07 AM

    hi

    can you try to rewrite ct20 into

    c20a: forall (v in V, k in K,t in T, i in ICF)
     F[i][v][t] + M *( (1- sum (j in J: j!=i)Yijvk[j][i][v][k][t] +
     sum (j in J:j!=i)Yijvk[i][j][v][k][t+1]))
     >=  G[i][v][k] ;
     
    c20b: forall (v in V, k in K,t in T, i in ICF)
      G[i][v][k]  
     >= ( F[i][v][t] - M *( (1- sum (j in J: j!=i)Yijvk[j][i][v][k][t] + sum (j in J:j!=i)Yijvk[i][j][v][k][t+1])));
     

    ?

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: vrp

    Posted 03/12/14 10:43 AM

    Originally posted by: Preemptive


    Hi, 

    errors,  cplex can not extrat expression : {1}

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: vrp

    Posted 03/12/14 10:44 AM

    Originally posted by: Preemptive


    Hi, 

    errors,  cplex can not extrat expression : {1}

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: vrp

    Posted 03/12/14 01:31 PM

    Hi,

    you should protect the sum with the right indexes like in

    c20a: forall (v in V, k in K,t in T, i in ICF)
     F[i][v][t] + M *( (1- sum (j in J: j!=i)Yijvk[j][i][v][k][t] +
     sum (j in J:j!=i && (t+1) in T)Yijvk[i][j][v][k][t+1]))
     >=  G[i][v][k] ;
     
    c20b: forall (v in V, k in K,t in T, i in ICF)
      G[i][v][k]  
     >= ( F[i][v][t] - M *( (1- sum (j in J: j!=i)Yijvk[j][i][v][k][t] + sum (j in J:j!=i && (t+1) in T)Yijvk[i][j][v][k][t+1])));




    c21: forall (v in V, w in V, k in K, i in ICF, t in T)
    F[i][v][t]  >=  G[i][w][k] - M *( (1 + sum (j in J: j!=i && (t-1) in T)Yijvk[j][i][v][k][t-1] - sum (j in J:j!=i)Yijvk[i][j][v][k][t]));

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 9.  Re: vrp

    Posted 03/12/14 03:52 PM

    Originally posted by: Preemptive


     

    Hi, thank you it works now. 

     

    constraint 17 : constraint 17 calculate the  arrival time at node j by vehicle v.  so it will calculate the  arrival time at each node during a tour by the vehicle v in t ech arc. 

     

    c17: forall (v in V, i in I, j in ICF1 :j!=i, t in T)
    ( Xijv[i][j][v][t]== 1 ) => ( F[i][v][t] + item (TIJ,<i.i,j.j>).temp == F[j][v][t]);

     

    constraint 18 : if Xijvt=0 alors Fivt = 0. 

    c18: forall (v in V, i in I, j in J :j!=i, t in T)
    F[i][v][t] <= M * Xijv[i][j][v][t];
    when i run it, solution infeasible. but when i delete constraint 18 it worked, i don't know when the errors in constraint 18. 

    For example if you have tour 0-1-3-2-6-5-2-0 then : 

    X[0][1][v][1]=1,

     X[1][3][v][2]=1, 

    X[3][2][v][3]=1, 

     X[2][6][v][4]=1 ,

    X[6][5][v][5]=1 ,

    X[5][2][v][6]=1,

    so F[2][v][2] = 10, F[2][v][1]=0, F[2][v][3]=0, F[2][v][4]=0, F[2][v][5]=0, F[2][v][6]= 120)

     

    Best regards

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 10.  Re: vrp

    Posted 03/13/14 03:16 PM

    Originally posted by: Preemptive


     

    Hi,

    the model works now, but we haven't a results. i have an errors in the constraint 17 : 
     
    c17: forall (v in V, i in I, j in ICF1 :j!=i, t in T) 
    F[i][v][t] + item (TIJ,<i.i,j.j>).temp - F[j][v][t] <= M *( 1 - Xijv[i][j][v][t]); 
     
    c23 : forall ( v in V,i in ID, t in T: t==1)
    F[i][v][t] == 0; départ du dépot égal à 0. 
     
    par exemple : la solution qu'il affiche maintenant pour le véhicule 2 : 
     
    0.....(10)........2.......(45) ......5.....(20).......1...... ..(28).......6........(61).... ....3.........(30)........... 2..........(10).......0
     
    normalement : F020= 0  ; F221= 10  ; F522=55   ; F123=75   ; F624=103   ; F326=164   ; F226=194   ; 
     
    but it only equal to the arcs like : 
     
    F020= 0  ; F221= 10  ; F522=45   ; F123=20   ; F624=28   ; F326=61   ; F226=30   ; 
     so thats why we haven't a good results Best regards 

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 11.  Re: vrp

    Posted 03/17/14 02:52 PM

    Originally posted by: Preemptive


    ???????????????????


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 12.  Re: vrp

    Posted 03/17/14 03:06 PM

    Originally posted by: Preemptive


     

    Hi, 

    F[i][v][t] denotes arrival time  at node i by vehicle v after traversing t-th arc. So, if x[i][j][v][t]==1 than F[j][v][t] must be equal to F[i][v][t-1] + t[i][j] since vehicle v arrives at node i after traversing (t-1) arc. so i have this constraint : 

     

    c17: forall (v in V, i in I, j in ICF1 :j!=i, t in T: t > 0) 
    F[i][v][t-1] + item (TIJ,<i.i,j.j>).temp - F[j][v][t] <= M *( 1 - Xijv[i][j][v][t]); 

     

    c23 : forall ( v in V,i in ID, t in T: t==0)
    F[i][v][t] == 0; 
    the ordre of visit for vehicul is : 02516320 (  (..) lenth of the arc ) 
    0.....(10)........2.......(45) ......5.....(20).......1...... ..(28).......6........(61).... ....3.........(30)........... 2..........(10).......0

    normally : F020= 0  ; F221= 10  ; F522=55   ; F123=75   ; F624=103   ; F326=164   ; F226=194   ; 

    but here he put that fiv equal to the lenth of the arc like : 

    F020= 0  ; F221= 10  ; F522=45   ; F123=20   ; F624=28   ; F326=61   ; F226=30   ; 

     

    Best regards 

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer