I’m trying to use the Vehicle Routing Problem to create a strategy for making deliveries. I’ve built a working network dataset. I have depots, orders, and routes set up. But it seems like it has a serious limitation regarding vehicle capacity vs delivery requirements.
Background Information:
What I’d like:
My (Untested) Ideas:
Neither of these ideas will produce perfect results, and they'll require some post-analysis interpretation to manage the real-world deliveries of the goods. But I'm hoping they'll be close enough. I've wondered about using each DeliveryQuantity field to represent a different truck within the same route too, but haven't gone beyond surface thoughts with that.
It would be really nice if there was a Yes/No field in the orders to allow for return trips and/or multiple vehicles, but alas.
If anyone has any thoughts or suggestions about any of this, I’d really appreciate it. (Sorry this is a very long post)
Solved! Go to Solution.
This forum and solution sounds similar to your use-case.
You mentioned a delivery location requires 3 units, and it would be acceptable for three trucks with a capacity of 1 unit each to service that location. Have you tried creating three orders with a delivery amount of one unit each for that location? The points would be coincident, this should allow three different trucks to service the one location, or allow the same truck to service the location with renewals. If the location only requires 2 units, I think you would set up the same scenario-two coincident orders with 1 unit each.
I did just finish solving the VRP using a very similar method (2 hour runtime for 1 of my 7 depots). I haven't gone through the results very comprehensively yet, but I think I'm on the right track. This is what I did (I'll admit, it's a bit convoluted):
-Calculated the total number of deliveries required by each line segment based on the capacity of an individual truck, rounded up to the nearest integer.
-Used that integer and the entire line length to calculate the "line length between deliveries"
-Generated points along the lines using the "line length between deliveries" as the distance, but did not include start/end points. This yielded points equivalent to n-1 required deliveries along each line.
-Added a final point at the end vertex, and set the required delivery quantity for that point to be the remainder from the previous calculation. Adding together this delivery quantity and the previous delivery quantities gives me the exact total required delivery for that line.
-Set up a number of routes equal to the approximate number of days the entire delivery project should take based on other analyses and historical data. Each route has a delivery capacity of the number of trucks multiplied by the capacity of each truck to emulate sending multiple trucks at a time.
It yielded results far better than I was getting before, but I can see some problems with it just for my specific case. I'm going to keep tinkering away with it
This forum and solution sounds similar to your use-case.
That's extremely similar--good catch. I'll mark this as resolved and refer to that one. Thanks for the help