Food Delivery Route Optimization: Guide for Efficient Route Planning

In the food delivery domain, delivery route optimization stands out as a pivotal solution for service providers grappling with logistical challenges. This process taps into cutting-edge technology and mathematical algorithms to engineer the most efficient paths for delivery drivers. The outcomes of optimized delivery routes are far-reaching, encompassing essential objectives for businesses in the food industry.

Cost Reduction takes center stage as optimized routes strategically minimize fuel consumption and slash overall operational costs, thereby boosting a company’s bottom line. The ripple effect extends to Faster Deliveries, where customers experience prompt order fulfillment, fostering heightened satisfaction and potential increases in customer loyalty.

Environmental Benefits emerge as a natural consequence of reduced mileage and fuel consumption, aligning with the sustainability goals of conscientious businesses. Resource Management is another critical facet, where delivery vehicles, drivers, and time are harnessed with maximum efficiency, elevating the overall productivity of the workforce.

The nexus between improved customer experience and reliable, timely deliveries is undeniable. Satisfied customers not only contribute to positive reviews but also become advocates through word-of-mouth recommendations. 

In the following sections, we will go over the methods, technologies, and real-world applications that support the route planning of modern food delivery services. Whether you are a restaurant owner, a logistics manager, or simply curious about the mechanics that allow your favorite cuisine to arrive on time, this notebook will give a walkthrough of the steps involved in food delivery route planning.

Problem Statement

The scenario involves a food delivery enterprise in India specializing in the timely delivery of pre-booked, freshly prepared meals within its two-hour delivery window. Unlike conventional delivery scenarios, the company has segregated service areas into distinct zones, each assigned a dedicated team of delivery personnel and vehicles.

The challenge arises from the customers’ freedom to place orders from any location, regardless of the predefined zones. However, strict adherence to zone boundaries by delivery personnel complicates the scenario. To overcome this, the company has strategically positioned designated handover points within each zone.

Operational Workflow

Upon a customer placing an order beyond their designated zone, the delivery executive assigned to the food preparation zone assumes control. They undertake the transportation of the order to the specified handover point within their respective zone. Subsequently, the delivery executive designated to the customer’s zone takes command, retrieving the order from the handover point and executing the final delivery to the customer’s specified address.

This procedural framework guarantees compliant and efficient food deliveries, even when orders originate from locations outside the predefined zones. Nextbillion.ai’s Route Optimization solution plays an important role by refining the delivery procedure and elevating the overall customer experience.

Solution Approach

Commencing with the vehicle allocation phase, we assign specific vehicles to each zone, capturing details such as vehicle identification, starting location, and other information. Additionally, we compile data on hotel pickup locations, complete with latitude and longitude coordinates, along with corresponding zone assignments and designated pickup time windows. Customer delivery addresses, their respective geographical zones, and specified delivery time windows are also included in our data set.

The optimization process revolves around strategically assigning vehicles to zones, primarily for pickups. For intra-zone deliveries, the delivery executives seamlessly handle the entire process, transporting the food directly to the customer.

In the case of inter-zone deliveries, our optimization system employs a two-step process:

  1. Handover Location Assignment: We designate a specific handover location as the drop-off point for the executive responsible for the initial food pickup. This ensures smooth transitions between zones.
  2. Zone-Specific Delivery Assignment: Subsequently, we allocate the delivery task to an executive situated within the customer’s zone. This executive retrieves the order from the designated handover location and completes the delivery to the customer’s address.

Our route optimization algorithm rigorously analyzes the available data, generating efficient delivery routes. This involves accurate order assignments to our field delivery executives, maximizing efficiency and ensuring timely deliveries.

For in-depth information and technical specifications, refer to our Route Optimization API documentation. The documentation offers a thorough understanding of our optimization strategies and guides on applying our services effectively for your business requirements.

Optimization Steps

In this technical notebook, we will guide you through the steps required to build, solve, and visualize a complex multi-vehicle routing problem tailored to this specific use case.

Step 1: Enter API Key

To initiate Route Optimization API in this technical notebook, enter your assigned API key. If you require an API key, kindly reach out to us at [email protected].

Step 2: Load Custom Input Data

In this step, we provide input data required for our food delivery optimization process. This dataset includes information regarding orders and corresponding customer ID, name, pick-up location, zone and customer address, as well as vehicle data such as their initial locations and maximum capacity constraints.

Order Data

In this notebook, we will be using the following sample CSV as order data.

Sample Order CSV

Vehicles Data

Similarly, the following sample vehicle CSV is tailored for our use case.

Delivery Vehicles CSV

Step 3: Define Problem Constraints

In this section, we define specific constraints for our optimization model, focusing on the chosen objective function.

Objective Function  

The objective function serves as a crucial parameter in our optimization model, guiding the system in decision-making. Two options are available for consideration:

  • Minimize Time: The optimization model aims to minimize the overall time involved in the delivery process. We have considered minimizing the time in this use case.
  • Minimize Distance: Alternatively, the model can be configured to minimize the total distance covered during deliveries.

These constraints and the designated objective function are integral components that shape the optimization algorithm, ensuring that the solution aligns with operational requirements and objectives.

Step 4: Submit the Problem to the Route Optimization API Endpoint

After defining the problem constraints, we submit the problem to the Route Optimization API endpoint.

compute delivery routes

The Route Optimization endpoint operates on a non-blocking/asynchronous model. Upon submission, the system returns a reference ID for the optimization job, accompanied by a status message. The reference ID, crucial for tracking the job, is visually highlighted in green.

We get the following MVRP Request ID: 61ba482e049a8367df8f687aabdc2431,  which will be used in this notebook for further steps.

Step 5: Retrieving the Optimization Result

Upon obtaining the reference ID for the MVRP request, we proceed to poll the MVRP status endpoint to retrieve the optimized solution. In this notebook, a waiting period of 10 seconds precedes the polling process. Once a status message of “OK” is confirmed, you can explore the result to analyze the optimized routing solution.

Key Performance Indicators (KPIs) for all Vehicles:

KPI

Value

Total Distance

800.3 km

Total Time

2062.3 mn

Number of Routes

16

Average Capacity per Vehicle

6.65

Unassigned job

0

The algorithm returns 16 optimized routes, Select the route to view from the list. 

The following image visualizes the route with the following details: 

  • ID: Rider 18
  • Zone: THN
route optimization technique

The green marker designates the vehicle start location (the office), while the red markers signify delivery and handover locations. Detailed information can be retrieved by clicking on the respective markers.

Visualize All Routes using the Route Planner Tool

The NB.ai Route Planner tool is at your disposal to visualize the optimized routing solution, including the sequencing of stops.

  1. NB.AI Route Planner Tool

Note: Make sure you have an NCC account set up with login credentials. Reach out to the Support Team for detailed instructions. 

  1. Visualization Steps
  • Select the `SOLUTION` tab within the tool.
  • Enter the same NB.ai API key utilized for the MVRP solution.
  • Paste the MVRP Request ID into the designated input box (e.g., 61ba482e049a8367df8f687aabdc2431).
  • Press the `Load` button.

The following image visualizes all the optimized routes using the planner tool.

Delivery routes visualization in Route planner tool

This process ensures a visual representation of the optimized routing solution, offering insights into the sequence of stops. Utilize the NB.AI Route Planner tool for a comprehensive understanding of the spatial dynamics and efficiency achieved through the MVRP optimization.