title: Model Cumulative VRP in Cplex
body: <p>I am new to Cplex IBM ILOG CPLEX Optimization Studio and I am currently programming a Cumulative VRP model (ref: DOI: 10.5772/5812) like the following:</p>
  
  <p><a href="https://i.stack.imgur.com/hDjLg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hDjLg.png" alt="enter image description here"></a></p>
  
  <p>This is my code:</p>
  
  <pre><code>{string} CIUDADES = ...;
   int READY_TIME[CIUDADES] = ...;
   int DUE_TIME[CIUDADES] = ...;
   int SERVICETIME[CIUDADES] = ...;
   int DISTANCIA[CIUDADES, CIUDADES] = ...;
   int CLIENTES=11;
   int Penalizacion = 10;
   int DEMANDAS[CIUDADES] = ...;
   int NROCIUDADES[CIUDADES] = ...;
  int PESO_VACIO = 6350;
  int PESO_LLENO = 3650;
  int VELOCIDAD_MINIMA = 20;
  int VELOCIDAD_MAXIMA = 90;
  int UMBRAL_RETRASO = 300;
  int aux = 0;
  int CARGAT = sum(ci in CIUDADES) DEMANDAS[ci];
  int vehiculos =1;
  
  //DV
  dvar int X[CIUDADES,CIUDADES] in 0..1;
  dvar int Y[CIUDADES, CIUDADES] in 0..(CARGAT+PESO_VACIO);
  
  minimize
      sum(ci in CIUDADES) 
          sum(cj in CIUDADES)
            DISTANCIA[ci,cj]*Y[ci,cj];
  
  subject to {
      restriccion1: 
              sum(ci in CIUDADES) 
                  X["Kingston_upon_Hull",ci]==1;  
  
      restriccion2: 
              sum(ci in CIUDADES) 
                  X[ci,"Kingston_upon_Hull"]==1;
  
      forall(cj in CIUDADES) {
      restriccion3: 
              sum(ci in CIUDADES: ci!=cj) 
                  (X[ci,cj])==1;
  }
  
      forall(ci in CIUDADES) {
      restriccion4: 
              sum(cj in CIUDADES: ci!=cj) 
                  (X[ci,cj])==1;
  }   
  
  forall(ci in CIUDADES) {
      restriccion5: 
              ((sum(cj in CIUDADES: ci!=cj) 
                  (Y[cj,ci]))
                  -
              (sum(cj in CIUDADES: ci!=cj) 
                  (Y[ci,cj])))
              == DEMANDAS[ci];
  
  }   
  
  forall(ci in CIUDADES) {
      restriccion6:
       Y[ci,"Kingston_upon_Hull"]== PESO_VACIO*X[ci,"Kingston_upon_Hull"];
  }   
  
  forall(ci in CIUDADES, cj in CIUDADES) {
      restriccion7:
       Y[ci,cj] &lt;= ((77777777)-DEMANDAS[ci])*X[ci,cj];
  
  }
  
  forall(ci in CIUDADES, cj in CIUDADES) {
      restriccion8:
       Y[ci,cj] &gt;= ((PESO_VACIO)-DEMANDAS[cj])*X[ci,cj];
  }
  
  forall(ci in CIUDADES) {
      restriccion9:
       Y["Kingston_upon_Hull",ci]== (PESO_VACIO+CARGAT)*X["Kingston_upon_Hull",ci];
  }
  }
  </code></pre>
  
  <p>But compiling using CPLEX I get the following result:</p>
  
  <pre><code>/ solution (feasible relaxed sum of infeasibilities) with objective 5671
  // Quality Incumbent solution:
  // MILP objective                                 6.6464998100e+09
  // MILP solution norm |x| (Total, Max)            1.02485e+05  1.20210e+04
  // MILP solution error (Ax=b) (Total, Max)        0.00000e+00  0.00000e+00
  // MILP x bound error (Total, Max)                0.00000e+00  0.00000e+00
  // MILP x integrality error (Total, Max)          0.00000e+00  0.00000e+00
  // MILP slack bound error (Total, Max)            5.67100e+03  5.67100e+03
  Y = [[0
               0 0 0 0 0 0 0 0 0 12021]
               [0 0 10186 0 0 0 0 0 0 0 0]
               [0 0 0 9372 0 0 0 0 0 0 0]
               [0 0 0 0 0 0 0 0 8752 0 0]
               [0 10907 0 0 0 0 0 0 0 0 0]
               [0 0 0 0 11218 0 0 0 0 0 0]
               [6350 0 0 0 0 0 0 0 0 0 0]
               [0 0 0 0 0 0 6863 0 0 0 0]
               [0 0 0 0 0 0 0 0 0 7989 0]
               [0 0 0 0 0 0 0 7431 0 0 0]
               [0 0 0 0 0 11385 0 0 0 0 0]];
  X = [[0 0 0 0 0 0 0 0 0 0 1]
               [0 0 1 0 0 0 0 0 0 0 0]
               [0 0 0 1 0 0 0 0 0 0 0]
               [0 0 0 0 0 0 0 0 1 0 0]
               [0 1 0 0 0 0 0 0 0 0 0]
               [0 0 0 0 1 0 0 0 0 0 0]
               [1 0 0 0 0 0 0 0 0 0 0]
               [0 0 0 0 0 0 1 0 0 0 0]
               [0 0 0 0 0 0 0 0 0 1 0]
               [0 0 0 0 0 0 0 1 0 0 0]
               [0 0 0 0 0 1 0 0 0 0 0]];
  </code></pre>
  
  <p>and compiling through cmd in windows with <code>oplrun -p folder</code> and I get the following:</p>
  
  <pre><code>Version identifier: 12.10.0.0 | 2019-11-26 | 843d4de2ae    
  Infeasibility row 'restriccion1':  0  = 1.
  Presolve time = 0.02 sec. (0.76 ticks)  
  </code></pre>
  
  <p>My program makes an assignment to variables Xij and Yij, but does not optimize the target function. Where would I have the error? your help would be appreciated.</p>
  
  <p>Thanks!</p>