3

I implement VRP with time windows, breaks and penalties, using or-tools v7.3.7083 in python. But I find that break intervals is not scheduled as expected.

I simplify to a single route to explain:

Lunch Break for vehicle 0: Start(240) Duration(60)

Route for vehicle 0:

0 Load(0),Time(0,0) -> ... -> 7 Load(6),Time(227,227) -> 4 Load(7),Time(319,319) -> ...

Location 7 takes 32 mins to reach location 4. Based on the assignment, the vehicle takes the break during travelling to location 7 to 4:

location 7 -> +13 min -> lunch break(+60 min) -> +19 min -> location 4

However, what I want is the vehicle take a break than go to location 4:

location 7 -> +13 min -> lunch break(+60 min) -> +32 min -> location 4

Or even better, go to location 4 first than take a lunch break:

location 7 -> +32 min -> lunch break(+60 min) -> location 4

How can I specific this constraint in the model?

Code file attached: https://gist.github.com/MarioLeung/45a32aaa7423c262ecdc384fc710c248

Data file for time matrix attached: https://gist.github.com/MarioLeung/0b9f3e9af76715339c64f1f6f72e3313

Community
  • 1
  • 1
Mario
  • 55
  • 1
  • 8
  • How did you learn about `solver.FixedDurationIntervalVar` and `time_dimension.SetBreakIntervalsOfVehicle`? – Leevi L Oct 25 '19 at 22:24
  • 3
    From [here](https://github.com/google/or-tools/blob/v6.0/examples/cpp/cvrptw_with_breaks.cc) – Mario Oct 28 '19 at 01:38

0 Answers0