Disjunction does not work with priority stops #4431
Replies: 3 comments 3 replies
-
Did you try to enable the GLS ? search_parameters.set_local_search_metaheuristic(
LocalSearchMetaheuristic::GUIDED_LOCAL_SEARCH);
// GLS will run forever unless a time limit is set (here 20s)
search_parameters.mutable_time_limit()->set_seconds(20); Why using some near-overflow data value ? Start Time = [1730937600000]
End Time = [1733615940000] Can't you offset your problem to zero for start time ? |
Beta Was this translation helpful? Give feedback.
-
I changed the implementation of the SetCumulVarSoftLowerBound/SetCumulVarSoftUpperBound for time dimenstion for priority stops, and now seems to be ok. Another issue I have now is that if I have different vehicle types with different matrices, after I set the disjunction, the stops order in the solution is different than how it was before. The new solution is worse, having a total duration greater than the one before. Why is that and how can I fix it? |
Beta Was this translation helpful? Give feedback.
-
First, in reference to your earlier comment, GLS should be considered a requirement for all but the most trivial of problems. Without it the solver will most likely stop at a local minimum.
Perhaps that relates to this problem you raise now, with the solution apparently being worse.
On the other hand, you haven't really shared how you implemented the soft lower/upper bounds, and the different per-vehicle matrices, so it is impossible to say what might be going wrong here.
I for one am not that good of a debugger!
James
James E. Marca
Activimetrics LLC
|
Beta Was this translation helpful? Give feedback.
-
Hello!
I am trying to add disjunction for allowing the algorithm to drop stops when a solution with all of them does not exists.
I have this example with 9 stops and 1 vehicle.
If I don't set a disjunction, I receive the solution: 8, 1, 2, 7, 0, 3, 6, 5, 4, 8
Input:
The algorithm can run with multiple distance and time matrices for different vehicle types.
For the disjunction I take the biggest value in the distance matrix, if the vrp is optimized by distance, or in time matrix, if the vrp is optimized by time and multiply it by 10, to increase it.
This is how I set the matrices:
This is how I set the priority to the stops:
And this is how I set the pieces:
*All the deliveries are made from the start node, that's why I created the 'deliveryPiecesDimension'
For firstSolutionStrategies I use: LOCAL_CHEAPEST_ARC, GLOBAL_CHEAPEST_ARC, LOCAL_CHEAPEST_INSERTION, SAVINGS, PATH_CHEAPEST_ARC, PATH_MOST_CONSTRAINED_ARC, PARALLEL_CHEAPEST_INSERTION, SEQUENTIAL_CHEAPEST_INSERTION.
And for localSearchMetaheuristics I use: AUTOMATIC and GREEDY_DESCENT.
I try to find a solution by running all of the combinations between firstSolutionStrategies and localSearchMetaheuristics and I take the best one.
I tried lowering the disjunctionValue, but then it will drop stops from other examples where solution with all stops can be found.
What I want is that the algorithm to drop stops only when there is absolutely no way to visit them all.
Do you have any idea on how to update this?
Beta Was this translation helpful? Give feedback.
All reactions