Hello,
I'm trying to solve a VRP with 6 depots (i1 to i6), and 16 customers (k1 to k16). Each vehicle starts and returns to the same depot. The trucks have the following capacity [15, 100, 100, 100, 100, 100]. Below is the solution I'm getting. Notice that the capacity constraint holds for all the routes EXCEPT for vehicle 2 for which the final load is ~101.43. My plan is to later feed this solution to a problem in GAMS, however, this violation of the capacity results in infeasibilities in GAMS.
Route for vehicle 1:
i1 Load(0) -> i1 Load(0)
Distance of the route: 0.0m
Load of the route: 0
Route for vehicle 2:
i2 Load(0) -> k1 Load(19.642722117202254) -> k5 Load(39.2854442344045) -> k7 Load(59.141776937618005) -> k4 Load(81.78449905482026) -> k2 Load(101.42722117202251) -> i2 Load(101.42722117202251)
Distance of the route: 639039.0m
Load of the route: 101.42722117202251
Route for vehicle 3:
i3 Load(0) -> i3 Load(0)
Distance of the route: 0.0m
Load of the route: 0
Route for vehicle 4:
i4 Load(0) -> i4 Load(0)
Distance of the route: 0.0m
Load of the route: 0
Route for vehicle 5:
i5 Load(0) -> k16 Load(21.429111531190987) -> k14 Load(41.07183364839324) -> k12 Load(60.71455576559549) -> k6 Load(80.35727788279775) -> k13 Load(100.0) -> i5 Load(100.0)
Distance of the route: 162355.0m
Load of the route: 100.0
Route for vehicle 6:
i6 Load(0) -> k9 Load(19.642722117202254) -> k11 Load(41.07183364839325) -> k10 Load(60.7145557655955) -> k15 Load(80.35727788279775) -> k8 Load(100.0) -> i6 Load(100.0)
Distance of the route: 571027.0m
Load of the route: 100.0
Total distance of all routes: 1372421.0m
Total load of all routes: 301.42722117202254
This is how I'm defining the truck capacity constraint:
routing.AddDimensionWithVehicleCapacity(
demand_callback_index,
0, # null capacity slack
data['vehicle_capacities'], # vehicle maximum capacities
True, # start cumul to zero
'Capacity')
Any suggestions are appreciated.
Andres J.