VRP with arbitrary start and end locations max distance "directly" from end of a route to start. #3018
Unanswered
ubuntumaroon
asked this question in
Routing (and legacy CP) questions
Replies: 1 comment 4 replies
-
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What language and solver does this apply to?
Python
Describe the problem you are trying to solve.
I am solving a pickup and delivery problem with multiple vehicles, and the vehicles can start/end at any arbitrary start and end locations.
But we do not want driver takes long time to drive back from end location to start location. Limit the max distance travel directly from end node of a vehicle to start of a vehicle.
distance_matrix[end_node][start_node] < MAX
There is no limitation on the cumVar of a vehicle.
For example, we have solution:
0 -> 1- > 2 -> 3->4->0, real start node: 1, end node 4, we want the solution meet: distance_matrix[4][1] < MAX
Tried to add constraints using: routing.solver().Add(), but could not get the actual start node and end not. As for all vehicles the start/end node index are the dummy 0.
Is it possible to get second node and the node before the last?
Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions