You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To model multiple shifts per vehicle, I duplicate each real vehicle into as many "virtual" vehicles as there are shifts. This way each shift has its own time window in the solver. I'm then modelling a pick-up and delivery problem with time windows in OR-Tools. The reason I have modelled it this way is that I sometimes have to deliver to a customer several times in my planning horizon. However, this cannot be done during the same shift. Otherwise, the option of creating dummy depot nodes with a breakpoint would probably also work. However, the solution would then tell me to deliver to the same customer one after the other:
(depot -> customer A -> customer A -> depot -> depot) instead of (depot -> customer A -> depot -> customer A -> depot).
With the current approach, I can add a constraint that the same customer cannot be delivered by the same vehicle. The challenge I'm facing now is how to deal with the fixed costs:
Current issue: OR‑Tools charges the fixed‑cost parameter for every virtual vehicle that is used. If a single real vehicle covers three shifts, the fixed cost is counted three times. Desired behaviour: I need the fixed cost to apply once per real vehicle, regardless of how many of its shifts are utilized.
Question:
What’s the best way in OR‑Tools to group those shift‑vehicles so that the solver only incurs the fixed cost once per group?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
To model multiple shifts per vehicle, I duplicate each real vehicle into as many "virtual" vehicles as there are shifts. This way each shift has its own time window in the solver. I'm then modelling a pick-up and delivery problem with time windows in OR-Tools. The reason I have modelled it this way is that I sometimes have to deliver to a customer several times in my planning horizon. However, this cannot be done during the same shift. Otherwise, the option of creating dummy depot nodes with a breakpoint would probably also work. However, the solution would then tell me to deliver to the same customer one after the other:
(depot -> customer A -> customer A -> depot -> depot) instead of (depot -> customer A -> depot -> customer A -> depot).
With the current approach, I can add a constraint that the same customer cannot be delivered by the same vehicle. The challenge I'm facing now is how to deal with the fixed costs:
Current issue: OR‑Tools charges the fixed‑cost parameter for every virtual vehicle that is used. If a single real vehicle covers three shifts, the fixed cost is counted three times.
Desired behaviour: I need the fixed cost to apply once per real vehicle, regardless of how many of its shifts are utilized.
Question:
Beta Was this translation helpful? Give feedback.
All reactions