Transportation Cost Optimization
In the world of logistics and transportation, managing costs is as critical as ensuring timely deliveries. With rising fuel prices, vehicle maintenance expenses, licensing fees, and a host of other varieties of costs, effective cost optimization becomes absolutely critical. This guide explores the transportation cost management features that NextBillion.ai Route Optimization API offers to emulate real-world business constraints. For each vehicle used in the planning process, users can configure all or any combination of fixed
, per_hour
, per_km
and per_order
costs. Once specified, the routes with lower costs are preferred over others, in general, subject to other constraints like - time_windows, location of the tasks etc.
The transportation cost management functions of Route Optimization API aid users in
- Minimizing overall transportation costs
- Analyze actual costs incurred to identify favourable third party logistics providers
Let’s explore how transportation cost optimization comes into play when applied to a real-world route optimization problem.
Setup
We have a total of 3 pickup jobs and a couple of shipments to be fulfilled. We use a total of 3 vans, which starts from a designated warehouse location and brings the items collected from the pickup locations back to the depot. To highlight the impact of transportation costs on the final solution, we provide multiple combinations of different cost types for each vehicle. Let’s configure the locations, tasks, and the vehicles along with their costs one by one in the following sections.
Locations
We will start with adding the locations
used in the problem along with a valid id
. The locations
object with all the points used in this example:
Jobs & Shipments
Next we define 3 pickup jobs and 2 shipments. For each these tasks we configure:
- A unique identifier
- A Location index
- Specify the schedule of tasks using the
time_windows
- A service time
Following is the completely built JSON with the desired configurations for the jobs and shipments:
Vehicles
Next, we add the 3 vans that are going to fulfill the tasks along with their cost components. To configure each of these vans and their properties we specify:
- A unique ID
- A shift time or the time window
- Capacity to denote the amount of load that the van can take
- Start_index and end_indexes to denote the start and end points for a van.
- Skills of the driver or the van
- In order to demonstrate the impact of each type of transportation costs, let’s add
- Van 1: A
per_hour
cost - Van 2: A
per_order
cost. - Van 3: A fixed cost.
- Van 1: A
Once the vehicle and their properties are defined, the resulting vehicles
JSON is:
Optimization POST Request
Bringing all these components together to create 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 take the ID and use the Optimization GET request to retrieve the result. Here is the GET request:
Optimization GET Response
Following is the optimized route plan:
Following is a visual representation of the initial locations of tasks, vehicles and the routes suggested after optimization as per the given constraints.
Route Plan to optimize transportation cost
Analyzing the Solution
Looking at the result we can observe some interesting insights:
- As we know from the Basic Route Optimization example that the
cost
value is returned as per thetravel_cost
set in the input request. In our example, the cost is calculated based on theduration
. Let’s take a look at the costs for each vehicle:- Vehicle 1: This van’s incurs costs
per_hour
at the configured rate of 1000 per hour. In the solution, this vehicle is assigned to a route that takes around half an hour to complete (~1819 seconds). Hence, the overall cost for this van, and effectively for the route, comes out to be 505. - Vehicle 2: This vehicle was configured to incur cost for each order that it completes at a rate of 800 per order. In the solution, this vehicle fulfills only 1 order (Shipment 2) and hence the cost of 1 order is added to the overall duration of 2715 seconds that it takes to complete the route, leading to an overall cost of 3515.
- Vehicle 3: This vehicle was configured with a
fixed
cost of 2500. So the overall duration for this route, 2527 seconds, was added to the fixed cost to give a final route cost of 5027.
- Vehicle 1: This van’s incurs costs
As we saw, NextBillion.ai’s Route Optimization API understands the cost considerations you provide and suggests the best solution accordingly. We encourage you to go ahead and try out different configurations of vehicle or task locations, time window constraints, number of tasks and explore how different solutions are generated for different scenarios presented to Route Optimization API.
We hope this example was helpful. Check out more tutorials & use cases that Route Optimization API can handle for you!