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.
Lijis constant). Look up indicator constraints.Lijis constant for now. So I introduced a binary variableyijand modify my objective function asmin sum((fij+yij*1440)*Lij)such thatxi - xj +M*yij >= 0. This way yij will be forced to 1 whenxi - xj < 0. Is it safe to assume that whenxi - xj >= 0the minimization function will force yij to be 0. Also M could be set at 1440. Does this look okay?