Need help on VRPTW with break intervals in C# #3863
Unanswered
bhaskar-ghub
asked this question in
Routing (and legacy CP) questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
OR Tool/Language used:
Version: v9.6
Language: C#
Solver: Routing
OS: Windows 11
I am trying to get an optimal route solution for a VRPTW problem where vehicles (in my example, I have 10 vehicles) have to be certain locations within specific time windows, and the vehicles will start and end at different locations (note: for a given vehicle, the start and end location will be the same).
A vehicle can have one or more break intervals during the day (For Example: vehicle 1 need breaks at specific intervals (Break interval 1: Between 11:00 and 12:00, Break interval 2: Between 19:00 and 21:00)).
// Configuration I have is 10 vehicles to make 7 services and below is the code snippet I have tried to introduce break intervals for a vehicle,
This code snippet for breaks is written based on the code mentioned in the below link,
https://github.com/google/or-tools/blob/v6.0/examples/cpp/cvrptw_with_breaks.cc#L134.
One thing that "SetBreakIntervalsOfVehicle" method in C# is expecting is "node_visit_transit" which is not mentioned in the above C++ solution.
Populated node_visit_transit using the logic defined below,
https://github.com/google/or-tools/blob/stable/ortools/constraint_solver/samples/cvrptw_break.py#L291.
I expect no service to be allocated to vehicle 1 between the break hours (Break interval 1: Between 11:00 and 12:00, Break interval 2: Between 19:00 and 21:00).
But instead I can see the allocation at 20:00 which overlaps with second break interval.
Additional details:
I have added penalty to my routing object as below,
Any advice on the above would help.
Beta Was this translation helpful? Give feedback.
All reactions