VRP: set all delivery vehicles start from the depot

77 views
Skip to first unread message

Mr.Pickle

unread,
Jan 5, 2022, 4:40:33 PM1/5/22
to or-tools-discuss
Hello, I am dealing with a business scenario where trucks need to load goods from the same single depot and deliver the goods to different customers.

my previous pickup only model is based on the example here to enable arbitary starts for each truck:  https://developers.google.com/optimization/routing/routing_tasks#allowing-arbitrary-start-and-end-locations

Now with delivery only model, how to make the appropriate adjustment, especially:
1). how to program the model to allow each truck fully loaded before leaving the depot (if there is enough goods for FTL). 
2) how to configure the model to search for the right type and number of trucks and accordingly the routes.
3). how to enbale arbitary end after trucks visiting the last node. Truck will not be forced to return to the depot.

thanks for your help.

Mizux Seiha

unread,
Jan 6, 2022, 2:22:25 AM1/6/22
to or-tools-discuss
Le mercredi 5 janvier 2022 à 22:40:33 UTC+1, westli...@gmail.com a écrit :
Hello, I am dealing with a business scenario where trucks need to load goods from the same single depot and deliver the goods to different customers.

my previous pickup only model is based on the example here to enable arbitary starts for each truck:  https://developers.google.com/optimization/routing/routing_tasks#allowing-arbitrary-start-and-end-locations

Now with delivery only model, how to make the appropriate adjustment, especially:
1). how to program the model to allow each truck fully loaded before leaving the depot (if there is enough goods for FTL). 
First don't force `start cumul to zero` upon creation of the load dimension i.e. set it to False.
you could also add a constraint to force the CumulVar  of the routing.Start(vehicle_index) to be equal to the vehicle capacity
2) how to configure the model to search for the right type and number of trucks and accordingly the routes.
you can add a vehicle Fixed Cost and use a arc cost evaluator per vehicle type to better model the actual cost, then using the LNS to improve the solution to minimize your cost model.  
3). how to enbale arbitary end after trucks visiting the last node. Truck will not be forced to return to the depot.
simply make arc cost from any points to  the "end" depot being zero in your arc cost evaluator matrix or callback.

thanks for your help.

Mr.Pickle

unread,
Jan 7, 2022, 4:14:02 AM1/7/22
to or-tools-discuss
Dear Mizux, please see my issues in green color.

1). how to program the model to allow each truck fully loaded before leaving the depot (if there is enough goods for FTL). 
First don't force `start cumul to zero` upon creation of the load dimension i.e. set it to False.
you mean "routing.AddDimensionWithVehicleCapacity()"?
you could also add a constraint to force the CumulVar  of the routing.Start(vehicle_index) to be equal to the vehicle capacity
I could not find the method called "routing.Start(vehicle_index)" in routing.h. could you please privide a simple code example? Also, if we force the "CumulVar" to be eual to vehicle capacity, does it mean every vehicle must be full before leaving the depot. However, there are only a limited volume of goods for deliery. There constraint seems to be conflicted with the reality.

2) how to configure the model to search for the right type and number of trucks and accordingly the routes.
you can add a vehicle Fixed Cost and use a arc cost evaluator per vehicle type to better model the actual cost, then using the LNS to improve the solution to minimize your cost model.  
you mean select the GuidedLocalSearch option to compute the solution?

3). how to enbale arbitary end after trucks visiting the last node. Truck will not be forced to return to the depot.
simply make arc cost from any points to  the "end" depot being zero in your arc cost evaluator matrix or callback.
The problem is I have no idea how to tell model the end node for each truck. Do I make a dummy "depot" as the end node and make it 0 distance to any other real nodes?
Also, how to make deduction of vehicle loads delivered after visiting each customer nodes, is this opposite to the pickup model?

To make life easier, it it possible to provide a really simple code example for delivery only model, in comparision of the pickup model here (https://developers.google.com/optimization/routing/routing_tasks#allowing-arbitrary-start-and-end-locations). I would be able to compare directly to see how they are different and where needs appropriate adjustment.
Reply all
Reply to author
Forward
0 new messages