Multiple trips to a depot
Depots or fulfillment centers are a key component in industries like e-commerce, retail deliveries. They are critical for order processing, and storage of goods while helping businesses manage the inventory efficiently and ensure quick and accurate delivery to customers. In such operations, it is quite common for vehicles to make repeat trips to the depots throughout the day to pick-up inventory for the next round of deliveries. The repeated trips can be due to multiple reasons like limited number of vehicles or their limited capacity, incompatible types of goods or bulk orders among others.
NextBillion.ai’s Route Optimization Flexible API can easily model such an operation using its shipments property and generate an optimized route plan to complete all the deliveries across by making multiple trips back to a designated depot.
Setup
In this example we will deliver 7 orders using a single 1 vehicle. Each shipment has to be picked from a given location (designated depot) and then delivered to its respective drop-off location. Also, the capacity of the available vehicle is such that it can’t accommodate more than 3 orders at a time.
Let’s configure the locations, shipments, and vehicles one by one in the following sections to model this business problem.
Locations
First, we add all the location coordinates used in the problem to the locations
object along with a valid id
. The locations
object used in this example:
Shipments
Next, we define the 7 shipments in our problem statement. For each of these shipments, we add:
- A unique identifier for both steps
- Respective location index for both steps. Since we have all the pickups to be performed at the given depot, the location index for all pickup steps would be the same
- Service time to perform the pickup and delivery steps
- Quantities of the load to be delivered
Following is the JSON we use in this example:
Vehicles
Now we configure the delivery vehicle that will complete these shipments. For the given vehicle, we specify:
- A unique ID
start_index
&end_index
to indicate the starting and ending locations of the route. We will configure both locations to be the same as the depot location.capacity
of the vehicle
Once the vehicles and their properties are defined, the resulting vehicles
JSON is:
Optimization POST Request
When all the above components are put together we get the final POST request that we will submit to the optimizer.
Optimization POST Response
Once the request is made, we get a unique ID in the API response:
Optimization GET Request
We use the request ID and retrieve the result through the Optimization GET request. Following is the GET request:
Optimization GET Response
Following is the optimized route plan:
Following image shows a visual representation of the above route plan.
Analyzing the Solution
Looking at the result we can observe that:
- All task were fulfilled and the total cost of the solution is 2779
- Vehicle 1 makes multiple trips back to the depot location. After being loaded to full capacity at the start, the vehicle comes back to the depot to load goods another couple of times.
The above example exhibits how NextBillion.ai’s Route Optimization Flexible API models the conventional depot or a fulfillment center scenarios where the vehicles make multiple trips back to the center to complete all deliveries following an optimized route plan. We encourage you to go ahead and try out different configurations of vehicle capacities, delivery or pickup loads and explore how the solution changes under different scenarios presented to Route Optimization Flexible API.
Learn more about the other powerful features and the related use cases that Route Optimization Flexible API can solve for you.