2
fij = xi - xj        if xi > xj
fij = xi - xj + 1440    if xi < xj

min sum(fij*Lij)
cons by:
0 =< xi <= 1439          #Minutes in a day

Context: xi and xj correspond to departure and arrival times. fij gives us the waiting time corresponding to ij combination. If departure happens before arrival then we add 1 day to the difference. Objective is to minimize sum product of waiting time and load corresponding to ij .

Is it possible to model this function as a linear program.

  • LP`? Probably not. MIP, sure (if ```Lij``` is constant). Look up indicator constraints. – sascha Oct 18 '17 at 14:08
  • Thanks for the tip. For simplicity, I am assuming `Lij` is constant for now. So I introduced a binary variable `yij` and modify my objective function as `min sum((fij+yij*1440)*Lij)` such that `xi - xj +M*yij >= 0`. This way yij will be forced to 1 when `xi - xj < 0`. Is it safe to assume that when `xi - xj >= 0` the minimization function will force yij to be 0. Also M could be set at 1440. Does this look okay? – Shantanu Chopra Oct 23 '17 at 06:58

0 Answers0