0

Picking up multiple shipments, dropping off at central location. Problem is, sometimes the vehicle fills up and drops things off at central location, but only enough to finish the route. I'd like it to drop off everything it has if it is already at the depot.

See below, it delivers job #3 to the depot, leaving 4 other items in the vehicle (which has a capacity of 5). Then picks up the final thing, before delivering everything.

+--------------------------------------------------------------------------------------------------------------------------------+
| detailed solution                                                                                                              |
+---------+----------------------+-----------------------+-----------------+-----------------+-----------------+-----------------+
| route   | vehicle              | activity              | job             | arrTime         | endTime         | costs           |
+---------+----------------------+-----------------------+-----------------+-----------------+-----------------+-----------------+
| 1       | vehicle              | start                 | -               | undef           | 0               | 0               |
| 1       | vehicle              | pickupShipment        | 3               | 353             | 1253            | 3527            |
| 1       | vehicle              | pickupShipment        | 2               | 1253            | 2153            | 3527            |
| 1       | vehicle              | pickupShipment        | 4               | 2582            | 3482            | 7819            |
| 1       | vehicle              | pickupShipment        | 6               | 3801            | 4701            | 11012           |
| 1       | vehicle              | pickupShipment        | 5               | 4701            | 5601            | 11012           |
| 1       | vehicle              | deliverShipment       | 3               | 5945            | 6845            | 14455           |
| 1       | vehicle              | pickupShipment        | 1               | 7025            | 7925            | 16248           |
| 1       | vehicle              | deliverShipment       | 2               | 8104            | 9004            | 18042           |
| 1       | vehicle              | deliverShipment       | 4               | 9004            | 9904            | 18042           |
| 1       | vehicle              | deliverShipment       | 6               | 9904            | 10804           | 18042           |
| 1       | vehicle              | deliverShipment       | 5               | 10804           | 11704           | 18042           |
| 1       | vehicle              | deliverShipment       | 1               | 11704           | 12604           | 18042           |
| 1       | vehicle              | end                   | -               | 12604           | undef           | 18042           |
+--------------------------------------------------------------------------------------------------------------------------------+

What's a good way to model some time or monetary cost that assures shipments do no spend any unnecessary time in the vehicle? All I want is an optimal route to pick up / drop off shipments.

Sam Barnum
  • 10,559
  • 3
  • 54
  • 60
  • You can try adding a cost associated with time in vehicle for each job to the objective function. You might also need to add a corresponding soft activity constraint to guide the insertion. – He Huang Dec 13 '16 at 06:27
  • @HeHuang, sounds promising, any further examples or methods I can look at to accomplish this? – Sam Barnum Dec 13 '16 at 17:28
  • I don't have anything at hand, but there is a branch trying to model a max in vehicle time constraint (still in development), and perhaps you can learn a thing or two from there. See: https://github.com/graphhopper/jsprit/issues/261 – He Huang Dec 14 '16 at 07:26
  • @HeHuang you know the code base much better than me. I would think this is incidental? In other words, if there were more jobs that needed doing, requiring the vehicle to have greater vacancy, then everything would be dropped off? Is this an algorithm issue, or post-solution processing? – roganjosh Dec 14 '16 at 18:14
  • This seems like an arbitrary decision by the routing algorithm. The cost to drop off all shipments if you are at the destination is the same as the cost to carry them to pick up the last shipments then bring them back. Could the order of the insertion be changed to try deliveries before pickups? – Sam Barnum Dec 14 '16 at 21:35
  • @SamBarnum I'm curious as to whether you resolved this in any way? – roganjosh Jan 10 '17 at 18:47
  • @roganjosh No, didn't find a good way to prioritize deliveries over pickups. Human operators just know to deliver whatever is on the vehicle. – Sam Barnum Jan 10 '17 at 19:13
  • Hmm, well at least you can solve the issue in (effectively) post-processing. It's a pity that there's no clear way to try and force this behaviour; it's logical in reality but inconsequential in terms of real costs considered by the algorithm. Thanks for the update. – roganjosh Jan 10 '17 at 19:16

0 Answers0