PGWelch / com.opendoorlogistics

http://www.opendoorlogistics.com
GNU Lesser General Public License v3.0
80 stars 45 forks source link

Multiple Trips for each vehicle #50

Open sandeepravi opened 5 years ago

sandeepravi commented 5 years ago

This is a pretty wonderful tool!

I was trying to model a pickup and delivery problem. But it looks like the vehicles don't take multiple trips. After it completes one drop, it doesn't try to find the next trip.

Is there a way to model this?

PGWelch commented 5 years ago

You should try linked pickup-delivery jobs - these involve moving something from one location (linked pickup stop) to another location (linked delivery stop), where neither is the vehicle start/end location. Both stops need the same jobid. In the demo data creator, tick the option to create some linked pickup-delivery to see their data format (look for the stops with stop type LP and LD and same job id). The pickup and delivery can have separate time windows (open time and close time).

mjzwick commented 2 years ago

If your scenario is to do multiple delivery runs from a depot per day, then I find this technique can yield very odd results, such as trucks going out full and delivering 2/3 of their load and returning to top off the truck capacity at the depot and again not delivering the whole load, until of course the last run of the day. Maybe this makes mathematical sense, but it doesn't make intuitive sense.

PGWelch commented 2 years ago

Yes that can happen. Our commercial route optimiser engine ODL Live uses a different algorithm internally, and so it has an option to fix this but ODL Studio just uses jsprit internally though, so it unfortunately doesn't have that option.

The issue as you say is the maths, it's the same cost for the optimiser to pickup on the first pass or the second, even if it's not delivering until the second.

The workaround for yourself is to take the solution ODL Studio gives you, and then just rejig it so that every pickup at the depot is done on the pass before its delivered.

i.e. if ODL Studio gives you:

Pickup1 Pickup2 Pickup3 Deliver1 Deliver2 Pickup4 Deliver3 Deliver4

when you use it in real-life, just re-write it as:

FillUpAtDepot Deliver1 Deliver2 FillUpAtDepot Deliver3 Deliver4

i.e. ignore when ODL Studio says to do the pickup and just use when it says to the deliveries, and when to go back to depot. The number will work out the same (i.e. you won't blow the capacity).

mjzwick commented 2 years ago

Not sure that actually solves the issue. Let's say you have a truck capacity of 40, and you have 500 items to deliver. If you use linked pickup (LP, at depot) and linked deliveries (LD), the solution may come back:

Pickup 1 (20 items) [at depot] Pickup 2 (10 items) [at depot] Pickup 3 (5 items) [at depot] Pickup 4 (15 items) [at depot] Deliver 1 (20 items) Deliver 3 (5 items) Pickup 5 (25 items) [at depot] etc.

This means not completely unloading the truck before coming back to the depot for more items. I have attached an example from one of our delivery years with the troop for one of the trucks to illustrate.

Screen Shot 2022-03-03 at 8 38 25 AM