VRP solution not fulfilling all added constraints #2457
Unanswered
oriolcosp
asked this question in
Routing (and legacy CP) questions
Replies: 1 comment
-
I have checked the example and as oriolcosp says setting |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've been trying to implement a VRP with breaks and I am having a hard time getting the solution to meet my constraints.
I have implemented breaks by adding a dimension and some constraints between that dimension and the time dimension. The constraints are the following:
My issue is that for some values of "max_time_to_break", the system seems to violate the constraints.
I am using Python 3.6.5 and ortools 7.4.7247.
Here is my code:
For data['max_time_to_break'] = 9, everything works fine and I get the following solution:

However, for data['max_time_to_break'] = 10 (or any value higher than 9):

Which doesn't make sense because the breaks_cumulvar increases wile breaks_slack and breaks_transit are both 0. This breaks the main relationship between dimensions of:
if j == NextVar(i), CumulVar(j) = CumulVar(i) + TransitVar(i) + SlackVar(i)
How can I fix the code so that for any value of max_time_to_break, it works as in the max_time_to_break=9 example?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions