Allow vehicles to arrive later than Shipment time window end

As far as I know, applying time windows to Shipment using .setPickupTimeWindow() and .setDeliveryTimeWindow() will impose a hard constraint on solution searching process. If I understand it correctly, it means that these windows should not be broken.

On the other hand, I would like to allow vehicles to pickup / deliver shipments slightly out of time window (let’s say, they can arrive and deliver shipment in 5 minutes after time window ends). While searching for possible solutions, I’ve looked through SoftActivityConstraint class and thought about applying a soft constraint on each inserted job in route to have 0 cost if vehicle is late for less than 5 minutes.

Can I influence vehicles’ arrival and finish times? Can it be implemented using SoftActivityConstraint?
Thanks in advance.

Yes, it could be implemented using a SoftActivityConstraint and modifying the objective function. Each time an insertion would cause a vehicle to finish its route later than its scheduled latest arrival time or a shipment would be late, a penalty term could be added.

A good approach for calculating time window penalties during insertion for the VRPTW is given in http://dx.doi.org/10.1016/j.cor.2013.02.002.

Powered by Discourse