addPickupAndDelivery
group-linking constraint causes all multi-part ride requests to be dropped
#4710
Replies: 1 comment
-
I couldn't find a clean way to enforce the "all-or-nothing" constraint during solving, so as a workaround I'm now trying to post-process the solution: after the solver finishes, I go through the solution and check for partially served ride groups. If I find one, I remove the entire group from the solution. How can I do this and keep the route 'optimized', I don't want to leave a space where the ride does nothing because i removed a visit from it Is this a reasonable approach? Any suggestions or best practices would be appreciated. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I’m attempting to enforce an “all-or-nothing” behavior for multi-part ride requests in the Vehicle Routing Problem: if any pickup in a ride group is dropped, all pickups in that group should be dropped (and similarly served together).
I added a custom constraint to link the first pickup’s active variable to each subsequent pickup’s active variable, but instead the solver ends up dropping every multi-part request.
Example: user_1 goes from house->hospital and later from hospital->house. I need the solver
to realize if it can't serve the hospital->house part then it shouldn't serve the house->hospital part.
Code Snippet:
Expected Behavior:
If the solver chooses to drop the pickup (and delivery) for any part of a multi-part ride request, all pickups in that same ride group should be dropped.
If the solver serves one part, it should serve all parts.
Actual Behavior:
Adding the above equality constraints leads the solver to drop every ride group that has more than one part—even when vehicles and time windows are available. Single-part rides behave correctly.
Beta Was this translation helpful? Give feedback.
All reactions