Hi everyone,
I'm trying to solve a CVRPTW problem and I have a constraint that's giving me a headache: Each vehicle's load must be 85% or higher. Otherwise the vehicle should stay at the depot.
- All the nodes are optional (I create a disjunction for each node).
- I have a volume dimension for vehicles [0.. MaxVolume].
I thought that a constraint for each vehicle's end node should do the trick but isn't working:
I iterate over the vehicles array (idx) and set:
routing.CumulVar(routing.End(idx), dimensionVolume).SetMin((long)(((decimal)vehicles[idx].getMaxVolume()) * 0.85));
Whenever I set this constraint to the model, the solver only finds the first solution (all nodes remain unvisited) with a 10 minutes time limit.
I assume that this happens because the solver can't find any intermediate solution to improve.
Is there another way I can model this? Maybe with a soft constraint?
I'm using the following routing parameters:
parameters.no_lns = true;
parameters.first_solution = RoutingModel.RoutingStrategyName(RoutingModel.ROUTING_GLOBAL_CHEAPEST_ARC);
parameters.guided_local_search = true;
Thanks