GraphHopper.com | Forum | GitHub | Maps | Blog

Round trip in Shipment


#1

Hi all,

I have an issue with round trip of shipment job.
I want vehicle return to pickup location of shipment after delivery of same shipment.
What I did is I created new service for this return trip of pickup shipment and add this service to ‘in_sequence’ relations after delivery shipment.

When I optimize, pickup and delivery of shipment is not in the activities as not enough capacity, but the new service created for return trip of pickup is in the activities of routes.

How could I handle this issue?

Thanks,
Lin


#2

Modelling shipments this way does not work since a single Pickup will consume vehicle capacity from pickup location to the end of the route. Conversely, a single Delivery consumes capacity from the start of the vehicle until the delivery location.
What you can do here is using “in_direct_sequence” relation like this:

{
     "type": "in_direct_sequence",
     "ids": ["my_shipment_pickup","my_shipment_delivery"]
 }

This forces the algorithm to delivery my_shipment just after picking it up.


#3

Thanks stefan,

Yeah, I already tried with ‘in_direct_sequence’ relation and it’s working.
But I create new service for round trip as I said before and add the relation as the following as I want dynamically created return trip needs to be done after delivery:

{
type: “in_direct_sequence”,
ids: [ “shipment_delivery”, “roundtrip” ]
}