Order Incompatibility
An important business criteria for logistics providers is handling the cargo safely which can sometimes entail not mixing cargo of certain types when transporting them. Order Incompatibility feature of NextBillion.ai’s Route Optimization is designed to efficiently solve such cases involving multiple types of loads. Once the load types of each pickup/delivery are configured along with the information about incompatible load types, the optimization engine suggests a route plan in which vehicles carrying a particular load type will not be assigned to fulfill another pickup/delivery involving an incompatible load type.
Let’s take a look at the following example where we generate an optimized routing plan for a business which manages deliveries involving different types of cargo and some of them are incompatible with each other.
Setup
We have 8 deliveries to be made using 3 vehicles which start from a fixed depot location. Each of the deliveries have a load type and accompanying incompatible load types. Let’s configure the jobs, vehicles and location attributes one by one below.
Locations
First, we define the locations
object and add all the location coordinates used in the problem along with a valid id
. The locations
object used in this example:
Jobs
Next, we define the 8 delivery jobs in our problem statement. For each delivery we add:
- A unique identifier
- Location index
- Load type and the corresponding incompatible load type(s)
- Delivery quantities
Following is the JSON we use in this example:
Vehicles
Now we configure 3 delivery vans that will be responsible for fulfilling the tasks. We specify:
- A unique ID for each vehicle
start_index
to denote the depot location from where all vehicles start with right cargo loaded on them for deliveriescapacity
to indicate the amount of load that can be carried
Once the vehicle 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.
![documentation image](https://static.nextbillion.io/docs-next/docs/route-optimization/order-incompatibility.webp)
Analyzing the Solution
Looking at the result we can observe that:
- All task were fulfilled and the total cost of the solution is 1165
- All 3 vehicles were used to cater to different load compatibility constraints of the items to be delivered
- Vehicle 1 caters to deliveries involving “groceries” & “dairy” type items, vehicle 2 caters to “fragile” type and vehicle 3 caters to “materials” type items.
- The Delivery tasks 6, 7, 8 do not mention the incompatible types but were still grouped with other deliveries which shared their “load_types”.
- We can also observe that “Delivery 4” was not configured with a load type, instead only the incompatible load types were provided. Consequently, it was fulfilled by a vehicle which did not fulfill deliveries involving the incompatible load types, which in this case is, Vehicle 1.
The above example exhibits how NextBillion.ai’s Route Optimization Flexible API uses the order incompatibility configurations to solve the problem and suggests the optimized route plan. We encourage you to go ahead and try out different configurations of load types, and varying distribution of delivery / pickup tasks to 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.