Achieved 10X performance improvement with customized solution using Google Distance Matrix
About the Client
The client leveraged our expertise to enable their logistics business unit and fulfill their last mile delivery's needs and technological challenges. In spite of the enormous demand and competition, the client was able to sustain the market and has become a prominent player in the field of last mile delivery.
As the client's last mile delivery business accelerated with wide adoption amongst its new users, we found a performance bottleneck in the intelligent solution for routing, that efficiently maps eligible drivers to deliveries. Upon further investigating the application logs, we identified the root cause of the issue to lie with the construction of cost matrix for the routing solution, that used sequential api calls made to Google APIs, to determine the distance and estimated time among the routing points such as customers, drivers and storage centers. This bottleneck consumed about 95% of the time for generating the routing solution.
Cost Matrix Performance Bottle Neck
Modular Generic Solution resolving Cost Matrix Bottle Neck
We developed a customized generic solution to construct the cost matrix using Google Distance Matrix API, that eliminated this performance bottleneck and diminished the time consumption by a factor of 10X. This solution was still challenging to achieve due to the limitation with the Google Distance Matrix API, that caps the total combination of source and destination inputs to 100 elements. With our customized generic solution we were able to work around this limitation and develop modular reusable components for the generic solution, that catered to various cost matrix size permutations based on the unique requirements for each routing problem, which frequently exceeded the limitation of 100 elements with various sizes of source and destination points.
The overall performance of our routing solution increased by 10X. The generic solution was leveraged to solve cost matrix problems of different sizes and shapes. The significant improvements in the performance also positively affected our real time automated routing solution to handle time sensitive routing problems such as re-deliveries, new deliveries and delivery cancellations.