Is it possible in ortool's vrp model to allow for violation of a constraint (sometimes called a soft-constraint)? E.g. Say each route should pick up a minimum volume of x
in some unit, can I configure or-tools such that it will also return me tours subjected that this constraint is not always met?
Looking at the penalties section I get the impression that when configured with addDisjunction
or-tools will drop a visit if this makes a solution feasible. However, the problem I have at hand is quite the opposite: the visit shouldn't be dropped and instead, the constraint should be violated, subjected to some penalty.
You should create a "Volume" dimension and use on the end node:
void RoutingDimension::SetCumulVarSoftLowerBound(int64 index, int64 lower_bound, int64 coefficient);