I am using jsprit to route drivers doing deliveries in time windows, with scenarios where drivers have to come back to depots multiple times.
The issue we are running into is that given a vehicle capacity of 20 parcels, and 30 parcels to be delivered, the algorithm often has the driver take 20 parcels, drop off 10, and then come back for the rest, rather than only taking the necessary 10 parcels on the first pickup. This is an issue because sometimes these items are perishable, so the less time in transit, the better.
I am thinking of adding a soft constraint or activity cost based on adding cost to a parcel in transit, but I am not sure how to do this as it seems to require heavy state-management and volume tracking. The other option would be to shift things as a post-processing step, but this does not feel clean either.
Am I missing something? Thank you!