jsprit shipment with single pickup and multiple delivery

1k Views Asked by At

Is it possible to make a shipment that has a single pickup point but has multiple delivery point?

An example case I have is a bike messenger that has to distribute letters from a single point of pickup to many addresses, the messenger has to go to the pickup point first, then deliver the letters. I tried making multiple Shipments for this (one Shipment per address), but then the pickup service time doesn't make sense, because there's not much difference in picking up one letter vs 100 letters for example.

Then, I tried to make separate Pickup and Delivery jobs. I made constraints that lets Pickup jobs to be done first before the other Delivery jobs. Then I read the documentation of Delivery class, it states that the job implies pickup at vehicle starting point (or depot), so this approach doesn't make sense too.

Is there any other way?

1

There are 1 best solutions below

0
On

If anyone else is having a problem with this, I hope this answer can help.

Basically I just set the Shipment pickup service time to 0 just like @roganjosh said, but then I added the outgoing travel time with the pickup service time. That and a postprocessing after the solution is obtained should work.

This is based on a post on graphhopper board here