Catering to Dynamic Demands: Adapting Objectives for Agile Operations in Quick Commerce
Introduction
With the rapid growth of the online food and grocery delivery industry comes inherent operational challenges. The daily fluctuations in demand, courier density, and the pursuit of operational excellence necessitate periodic adjustments to our algorithm objectives. Our primary aim, ensuring customer satisfaction while maintaining courier productivity, centers around delivery time. Each day, we confront the question: “How can we simultaneously enhance customer satisfaction and courier efficiency?” These deliberations spur actions that enable our algorithms to more precisely target problematic areas. Within this narrative, you’ll discover an iteration of our Matching Algorithm, which orchestrates courier-to-delivery connections. Through a refinement of its objective functions, we present real-life examples showcasing the tangible results of these adaptations.
Problem Environment
In quick commerce, there are two types of deliveries, meal and grocery. Even tough they have their unique environments with their respective operational complexities, for a matching point of view, we have the same target and that is matching our deliveries with given set of available couriers. But before doing so, a courier will have some tasks to deliver an order to the final customer which brings up the concept of “Mission” to our environment. The “Mission” include several tasks such as, a courier traveling to the store location, receiving order, traveling to the related buyer location and delivering the order to its customer. So, in the end, we are assigning “Missions” to available couriers in a given region with a predetermined objective. The following figure gives a brief plot of the courier and mission environment
In the diagram above, we observe a matching occurrence between an available courier and the corresponding mission. As explained earlier, a mission consists of four main tasks. When a courier is matched with a mission, the first task is to travel from its current location to the store’s location. After that, the courier picks up the delivery and continues the journey to the customer. A mission is completed when the order has been delivered to the customer. Overall, this diagram illustrates a single interaction between a courier and a mission. In our world, there are thousands of missions and couriers that we need to match in order to meet our customer demand. Thus, it becomes a problem to solve whether we can match this pool of missions and couriers in a way that optimizes our predetermined objective.
This objective was initially set to minimize the total route length within a designated region of assignments. This total distance represents the combined distance between all pairings of missions and couriers. It measures the distance between the courier’s current location and the mission’s store location. By minimizing this total distance, our goal is to reduce the start-to-pickup component of delivery time, which is the distance between the store location and the courier’s current location.
Optimization Model
As explained earlier, our first aim was to come up with a solution that minimizes the total distance between courier and store locations. In order to achieve that, we designed and implemented a mathematical model which considers courier and mission pools and their assignments.
The objective of the model is to minimize the total distance between the couriers’ current locations and the mission’s store locations. This objective also ensures the minimization of the start-to-pickup cost, thereby decreasing delivery times. Constraints 1b and 1c ensure that a one-to-one matching occurs between couriers and missions. Finally, constraint 1d ensures that the total number of assignments equals a predetermined level, denoted as c. Parameter c is predetermined using a greedy assignment algorithm for comparison purposes. This algorithm attempts to find the closest courier by iterating through each mission. The number of assignments from this greedy algorithm is then used as a parameter in our mathematical model. Further research may be conducted to find better matching count levels in future studies.
A quick note about parameter c: Parameter c also denotes the number of assignments in the old matching system, where a greedy assignment algorithm was used to deliver the results. With our mathematical model, we aim to ensure that the number of assignments remains the same as with our previous algorithm, but now our objective is to minimize the total start-to-pickup distance.
However, in a quick commerce environment, there are numerous factors that influence our decision-making frameworks. The volatility of these factors may impact our targets and, naturally, our algorithms. Adopting this perspective, changing circumstances and data analyses have revealed that some missions are lingering for too long in our matching systems. Moreover, our matching models and associated algorithms operate every “t” seconds in real-time. Nonetheless, we have noticed that certain missions cannot be promptly matched within the allotted time, leading to delays in our matching environment that adversely affect our delivery times.
To tackle this problem, we had to think of a solution that considers the time that has been spent in our matching system for each mission. To clarify the situation the following figure is presented.
For each run-time period “t”, our matching systems gets the current input set of missions and couriers. Later, in real-time, our matching model has been triggered to generate assignments(matchings) between couriers and missions. However, as the figure illustrates in red rectangle, some missions might not be assigned for multiple run-time periods and thus it increases mission’s delivery time. To tackle this problem, we proposed the iteration 2 of our matching model. The difference of iteration 2 model compared to base model is that the objective function has been altered to handle this undesired case.
To capture the amount of time that a mission has spent and not assigned in our matching service is denoted in Iteration 2 parameters section. Furthermore, we converted our distance parameter to a time perspective to have a unified metric, which is not meter-wise but time-wise. Our revised objective function considers both distance between courier’s current location and mission’s store location in terms of time and total time spent of the mission in our system. The following figure illustrates a case where our iterated model’s behavior compared to our base model.
In this illustration, mission 1 has been waiting for assignment to our free couriers for 7 minutes and mission 2 is just for 1 minute. Even tough the distance is larger, mission 1 is assigned to our courier to be fulfilled. With this iteration, we were able to capture the undesired assignment behavior.
Results and Acknowledgements
Utilizing optimization algorithms to address operational problems proves to be crucial and impactful when dealing with a well-defined problem and a set of constraints. The success of this approach is contingent on fostering strong relationships between business partners who possess insights into operational challenges and needs, and technology partners who are both agile and open to approaching problems with innovative perspectives. Through this collaborative effort, we achieved a significant accomplishment — realizing between 2–3% uplift in average delivery times. This success highlights the effectiveness of a synergistic partnership in implementing optimization solutions for operational enhancement.
Join Us
We’re building a team of the brightest minds in our industry. Interested in joining us? Visit the pages below to learn more about our open positions.