Flipkart's Automated Beat Planner enables perfect grocery deliveries

Flipkart's Automated Beat Planner enables perfect grocery deliveries


Pincodes are proliferating in most Tier-1 and 2 cities in India, accommodating the mushrooming population and supporting commercial establishments. And with this increase, there is also a parallel surge in complexity, which in the case of e-commerce is ensuring accuracy in deliveries — something one in this business would typically tag as a ‘logistical nightmare.’ Amidst all the intricate orchestration of supply chain operations, the Flipkart Grocery van always manages to deliver with clinical precision, never missing a single planned delivery slot. Does the Flipkart Grocery team have some hidden trick up their sleeves or are they just plain lucky?
 
In fact, the Flipkart Fulfilment & Services Group (FSG) - City Logistics Team is leveraging a combination of address intelligence and geocoding technologies to enable their Automated Beat Planner (ABP), all in a bid to achieve higher accuracy in grocery deliveries within metros with compounding pincode density.
 
Bangalore roads are frequently congested and traffic snarls are the daily norm for its residents, so much so that they are now acclima
tised to delays in doorstep deliveries and frequent reschedules. But when it comes to groceries, the customer expectation is quite the opposite. Groceries, being an everyday necessity for customers, are expected to reach them bang on the time slot they have chosen. At Flipkart, the teams that work in the Flipkart Grocery vertical understand this sentiment and know that keeping their promise is the way to ensure customer loyalty and stickiness.
 
To ensure that time slots for grocery deliveries are religiously adhered to, the Flipkart FSG Tech team has come up with a smart framework — the Automated Beat Planner. For the uninitiated, a ‘beat plan’ is the path that a delivery van traverses while performing deliveries. Identifying optimised paths for vans is no easy feat, and this was the fundamental use case for designing the Automated Beat Planner. For Flipkart, another critical input to ensure the success of the ABP initiative was the geocode of addresses.
 
Finding the needle in a haystack — the perfect address
 When it comes to groceries, the problem to solve is ensuring the accuracy of deliveries within the pre-decided slots. The moment a customer shops for groceries and picks a delivery slot, this journey begins for the Flipkart team, and with multiple shipments within a single slot, the exercise only intensifies. So while planning a beat, the first question that comes to mind is ‘Which order should I deliver first?’ This is where the Automated Beat Planner comes into the picture, where multiple beats and deliveries are put into a matrix that enables optimised delivery plans.
 
ABP was developed with two intentions: maximising customer experience, and optimising the cost on deliveries. For a tool to achieve this dual purpose, multiple input signals are required. Aside from the input signals, another critical dependency, especially in the Indian context, is the precision of the delivery address. In India, where many pincodes have labyrinths within them and where addresses can take myriad and often ridiculous forms, pinpointing a location every time requires a huge investment in technology.
 
Accurately identifying an inaccurate customer address results in loss of productivity for our Wishmasters (eKart delivery personnel). This also results in multiple customer connects by the Wishmaster to rule out any ambiguity in
accurate deliveries. Thus, the very first input is to get precise latitude-longitude (lat-long) coordinates of a select customer address from the geocoding engine, which at Flipkart is known as the Flipkart Location Intelligence Platform or FLIP. When placing an order, customers populate the address field in text format. For us, the challenge is to convert that text into an accurate lat-long location and zero in on the customer’s exact address. Arriving at this algorithm requires multiple data points — past customer data, historical delivery data and address data from third-party crowdsourced databases to create complex machine learning (ML) models.
 

 


 
















How exactly do we zero in on an address? Here’s a scenario to give you perspective. Imagine that you have historically collected your Flipkart deliveries from Tower A of your office building, and every successful delivery registers your location (lat-long) in our database. This is what we consider historical data and the first dimension to ensure delivery accuracy in the future. Now, if there are other orders coming from your office, but from a different tower (say, Tower B or Tower C,) we would scour the historical database for this address. For our database, the variation in delivery location is minor, being just the location of the tower. To ensure that we don't miss out on any part of the address field, we divide each portion of the text in the address field into various tokens and then run a check for lat-long coordinates for each of these tokens within our database. This means that your office now has a series of sub-address tokens, pooled under a primary address. All these points within your office campus are then joined to construct a polygon of the token type, which has an accuracy of ‘x’ metres. Now, for another token in the address field, say Devarabeesanahalli, we make up another polygon of lat-long positions. This process is repeated multiple times for all the address tokens, and finally, the intersection zone of all the polygons is where we try and pinpoint the exact location. This model is what we refer to as the geocode learning model. The output from the geocode engine is then fed into the Automated Beat Planner.



 


























To test the accuracy of the model, we run the model against millions of address data points where we have successfully delivered, and then check and compare them with the results of the learning model. It is an exciting result that gives us an unerring accuracy of less than 500 metres for 90% of addresses.
 
Take the road less travelled, or the one suggested by the Beat Planner
 
With the address figured out, the role of the Automated Beat Planner begins. Imagine a furnace with multiple valves, pipes and vats with various materials pouring in and freshly prepared ingots rolling out. The Automated Beat Planner is analogous to that furnace, except that it takes in multiple inputs and generates a beat plan, which is an optimised route for the delivery vans to follow. One of the most important inputs for the Beat Planner are the previously mentioned geocodes. There is also the concept of ‘cluster identification’. Cluster identification is nothing but a geographical area with multiple pincodes.
Basis input business parameters of demand density and delivery costs clusters are autogenerated with a functionality to manually override and adjust the cluster boundaries bias serviceability definition.Hub employees have been enabled with the user interface (UI) to modify and generate their own clusters. This ensures that orders are assigned accurately to a serviceable hub, which is critical for on-time delivery.


 

Apart from the geocode, another input that is fed into the Beat Planner is ‘traffic prediction.’ If we have promised a delivery slot between 7:30am-9:30am, then traffic prediction at that time decides how many orders can be delivered in that particular beat. Traffic prediction is projected based on historical data, answering the question ‘What will be the traffic prediction on a future date?’ We generally predict for a mid-day traffic pattern, which is an input from the Google application programming interface (API). This is then used to calculate how many shipments can be done based on the ‘vehicle’s speed,’ which is also an input that feeds into the Beat Planner. ‘Capacity of vehicle’ and ‘volume of shipment’ are two other dimensions added to this analysis. This is the point where we do beat planning and generate the Beat Plan, which is developed at least 12-14 hours before dispatch. Finally, during the delivery slot time, if a customer is not available, the system automatically moves to the next slot.
 
Address learning and geocoding are explorations that were started in January 2018 and are presently only deployed in Bangalore, Hyderabad and Chennai. As we refine the address geocodes using ML and move towards perfect beat plans, we plan to add a lot of interesting features and extend it to other geographies.
 
So the next time you get a Flipkart grocery shipment delivered bang-on-time at your location, do spare a thought about the complex and innovative means by which the teams at Flipkart ensure that you never fall short of a great shopping experience.
 
 This Article is written by Aditya Madan from PGP Co '13.