I am working with Google OR-tools in Python.
The problem I am facing is basically a mixture of:
- creating both collecting and delivering dimensions for the CVRP (as in Google OR-tools VRP - Pickup/Dropoff at same node) by having a demand and a load constraint, and
- implementing a reload option at the depot (similar to https://github.com/google/or-tools/blob/master/ortools/constraint_solver/samples/cvrp_reload.py) as well as the possibility to drop orders with a penalty.
As an example, let's consider 1 vehicle with max_capacity=2 and the following 3 nodes (0 being the depot):
Node | deliveries | collects | loads (deliveries + collects) |
---|---|---|---|
0 | 0 | 0 | 0 |
A | -1 | 0 | -1 |
B | -1 | 0 | -1 |
C | -1 | 1 | 0 |
Assuming all points are equidistant, one solution would be:
0 (deliveries:2, load:2) --> C (1, 2) --> A (0, 1) --> 0, dropping order B at the given cost/penalty.
However, I would like to implement the possibility to reload at 0, i.e., getting something like:
0 (deliveries:2, load:2) --> C (1, 2) --> A (0, 1) --> 0 (1, 1) --> B (0, 0) --> 0.
I've tried to combine the two solutions mentioned above, by setting the slack capacities of both dimensions (deliveries and loads) at max_capacity. However, my program always drops all the reload stations, even though dropping the additional orders is way more expensive.
Did someone already manage to solve the problem I am facing, or has any recommendations?