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.

2
  • LP`? Probably not. MIP, sure (if Lij is constant). Look up indicator constraints. Commented Oct 18, 2017 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? Commented Oct 23, 2017 at 6:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.