title: all entries at implied bounds CPLEX
body: <ol>
  <li>I have a set of cars with scheduled time <code>originaltime[cars]</code> to arrive at destination.
  However, based on the sequence of arrival, they have to be some time
  apart (given by data input <code>separate[cars][cars]</code>).</li>
  <li>My objective is to minimize the delay of the cars from the original time while respecting the necessary separation.</li>
  <li>The cars can only come 60seconds before their scheduled time <code>originaltime[cars]</code> and 1800seconds after.</li>
  <li>I fix the sequence to enforce first-come-first-served based on their scheduled time <code>originaltime[cars]</code></li>
  </ol>
  <p>It should be a straight forward implementation, however i encountered problems with some entries at implied bounds. I looked at my input data and constraints and I am really not sure why.</p>
  <p>I've written the CPLEX code below for my attempts at the problem. Thank you for helping in advance.</p>
  <pre><code>//index of the cars considered
  {string} cars = ...;
  //original scheduled time
  int originaltime[cars] = ...;
  //time separation apart based on arrival sequence
  int separation[cars][cars] = ...;
  //decision variables
  //the modified time to minimized the delays
  dvar float assignedtime[cars];
  //the earliest and latest time the cars can arrive
  dvar float earliesttime[cars];
  dvar float latesttime[cars];
  //0-1 variable to specify the order of the cars
  dvar boolean order[cars][cars];
  //to measure the delay of each car
  dvar float indvdelay[cars];
  //decision expression to calculate objective ( separated them because I've simplified the problem)
  dexpr float objcost[f in cars] = indvdelay2[f];
  dexpr float totalobjcost = sum(f in cars) objcost[f];
  dexpr float overallobjcost = (1.3*totalobjcost); 
  //objective functionn
  minimize
      overallobjcost;    
  //constraints;
  subject to{ 
  //obj remove modulus constraint (to account for +/- delay numbers so that it is always positive)
      forall(f in cars)
        indvdelay[f] &gt;= assignedtime[f] -originaltime[f];
      forall(f in arrflights)
        indvdelay[f] &gt;= -(assignedtime[f] -originaltime[f]);  
  //earliest and latest times
      forall(f in cars)
        earliesttime[f] == (originaltime[f]-60);
      forall(f in cars)
        latesttime[f] == (originaltime[f] + 1800);  
  //constraint to set order precedence based on original time FCFS
    forall(i in cars)
      forall(j in cars: i!=j)
        ctest:(originaltime[j] - originaltime[i])&lt;= (100000*order[i][j] - 0.0005);
    forall(i in cars)
      forall(j in cars: i!=j)
        ctest1b:(originaltime[j] - originaltime[i])&gt;= (-100000*(1-order[i][j]));
        
  //order precedence
    forall( i in cars)
      forall(j in cars: i == j)
        ctAA:order[i][j] == 0;
    forall( i in cars)
      forall(j in cars: j &gt; i)
        ctBB:order[i][j] + order[j][i] == 1;    
   //separation 
    forall(i in cars)
      forall(j in cars: i != j)
        ctCC:assignedtime[j] &gt;= assignedtime[i] + separation[i][j] - (100000*(1-order[i][j]));
   //time window constraint 
    forall(f in cars)
      ctDD:assignedtime[f] &gt;= earliesttime[f];
    forall(f in cars)
      ctEE:assignedtime[f] &lt;= latetesttime[f];
        }    
  </code></pre>
  <p>data file code</p>
  <pre><code>SheetConnection sheet(&quot;stage2errortest.xlsx&quot;);
  cars from SheetRead(sheet,&quot;'ARR'!B2:B25&quot;);
  originaltime from SheetRead(sheet,&quot;'ARR'!C2:C25&quot;);
  separation from SheetRead(sheet,&quot;'septable1arr'!A1:X24&quot;);
  
  assignedttime to SheetWrite(sheet,&quot;'ARR'!E2:E25&quot;);
  indvdelay to SheetWrite(sheet,&quot;'ARR'!F2:F25&quot;);
  </code></pre>
  <p>I've included the excel datafile
  <a href="https://drive.google.com/file/d/14oMZR6DPxR5Gvvh0US00WXpsjozJJYha/view?usp=sharing" rel="nofollow noreferrer">exceldata file</a></p>