VRP Implementing cabotage constraints #4338
Unanswered
tueboesen
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
-
Cabotage rules summarized
In EU (not sure about the rest of the world), we have something called cabotage rules which allows trucks from foreign countries to do some limited amount of national pickup and deliveries. The rules are rather convoluted, but somewhat simplified the rules are:
I am not sure how to implement something like this, so I would be curious about any kind of feedback on how this might be achieved, or even just partially achieved.
My own idea towards a solution
Start by making each pickup and delivery have an associated country. Say for instance we have 4 deliveries:
In this case we only track whether vehicles are allowed to do cabotage in Denmark.
Based on this I can create a cabotage matrix:
which tells whether moving from index i to j, enables or disables cabotage.
is_cabotage_delivery = [0, 1, 1, 0]
Finally I need to know whether a truck is carrying a load, This is relatively simple since I only do pickup and deliveries, hence I can just create the following vector:load_carrying = [1, -1, 1, -1, 1, -1, 1, -1]
To use these variables in the actual VRP problem, my thinking is to define a bunch of extra dimensions:
Then based on these I can add constraints:
AddConstraint(cabotage_drives_done_dim.CumulVar(pickup_index) <= cabotage_limit_dim.CumulVar(pickup_index)) # So enforce that you cannot do more cabotage drives than allowed.
Questions
Edit:
I cross posted this question to: https://groups.google.com/g/or-tools-discuss/c/hVxtW1Rctis
Beta Was this translation helpful? Give feedback.
All reactions