First, kudos for the great work on developing graphhopper and jsprit. It is amazing how refined and well thought both tools are.
I have a VRP that involves hazardous liquid materials and, for safety reasons, a vehicle compartment carrying such materials must either be empty of completely full. So, if I have a 28 m3 load and a 6-compartments 30 m3 truck, for instance, I am not able to use such a truck for this cargo as the last compartment would only have 3 m3 (60% of its capacity), or would load only 25 m3 and have a 3 m3 pending deliver.
I though about modeling this using a hard constraint that would check if there are no partially filled compartments in the given vehicle and though of a couple of ways for storing the compartments descriptions of a vehicle:
- Using a “dummy” capacity position to store the number of compartments in the vehicle (disadvantage of not being able to model vehicles with asymmetrical compartment sizes)
- Piggybacking the compartments description in some String variable (like the vehicle id or vehicle type id)
I am not really sure if those are good alternatives or if there is a better way to do those and I am open to suggestions. Thanks in advance for any help on the matter.