Region Prioritisation Algorithm: Helping Business identify Top Regions to serve | by Abhishek Mungoli | Towards Data Science

In the present time, due to the Pandemic, many suppliers and online services are serving selected regions which could be the major sales contributors. Also, when someone starts a new business they want to focus on a few regions which can draw maximum profit and think of expansion later. Many times suppliers at times close low-profit regions where ROI(Return on Investment) is poor.
All the above instances need identification of regions as per their importance/priority/contribution to the business. Through this blog, I intend to propose an algorithm that is simple, intuitive, scalable, and does a decent job of dividing the regions as per their importance. I will also propose a metric that can quantify the algorithm’s effectiveness in prioritizing the regions.
The proposed algorithm consists of three steps :
The first step consists of counting the frequency of orders coming from every region. A region can be defined based on postal code or city or state depending on the type of business and the way it operates.
Similarly, the frequency can be daily, weekly, or monthly depending on the type of business and the way it operates.
The blue line denotes the route in the figure. The Circle represents different regions and dots the orders.
In the above figure, we have a supplier ‘S’ and 10 Regions (A-J). The frequency of orders on a weekly basis is summarised in the table:
Sort the regions by order frequency (from step 1) and divide them into high, medium, and low-frequency regions.
Normally, my selection criteria goes like90-100th percentile of Frequency ~ High-frequency region75-90th percentile of Frequency ~ Medium-frequency region<75th percentile of Frequency ~ Low-frequency regionThis percentile used for region selection is a hyperparameters which can be tuned as per the Business, its type and needs.
This final step is the heart of the Algorithm. Here we cluster regions based on priority and then move a few regions from one cluster to another to come up with the final ranking.
Initialize high-priority regions with all high-frequent regions from Step 2.
Initialize medium-priority regions with all medium-frequent regions from Step 2.
Initialize low-priority regions with all low-frequent regions from Step 2.
For all high-priority regions store the intermediate points in the route(at some interval), there are Map Apis which provides that. Find the distance of regions belonging to medium and low priority regions with all these intermediate points. If the shortest distance is anywhere less than a threshold (< 5 miles ~ example), move the region into the high priority cluster. The distance can be Map distance (Road distance) or other distance like Haversine.
The main reason is that, if there is a medium or low-priority region in the route or near-by of the high-priority region, it can be served with minimal efforts while serving the high-priority ones.
Similarly, move regions from low to medium-priority clusters that fall on the route or nearby of the medium-priority regions.
As a result of this step Regions ‘E’, ‘H’, and ‘F’ move to High-priority regions as they are in the route or near-by of the high priority region ‘G’. Intuition is ‘E’, ‘H’, and ‘F’ can be served together with high-priority region ‘G’ with minimal efforts. The final Supplier location map looks like:
To quantify the effectiveness of the proposed algorithm, we devise a metric ‘Prioritization Gain’. Prioritization Gain is defined as the ratio of Sales Coverage to that of Distance coverage.
Let’s say after prioritization of regions and just serving the high-priority ones, we have reduced the distance to 40% to that of actual and sales reduced to 80% to that of actual. ‘Prioritization Gain’ in this case will be:
Prioritization Gain = 0.80/0.40 = 2.28
Higher the ‘Prioritization Gain’ value, better is the algorithm’s performance.
With this blog post, We devised a simple and scalable Region Prioritisation algorithm to help a business identify the top-priority(most profitable) regions to serve smartly. Also, we analyzed visually how it works and defined a metric to measure its effectiveness.
If you have any doubts or queries, do reach out to me. I will be interested to know if you are working on some Route prioritisation or Graph based algorithms and this blog post was helpful.
My Youtube channel for more content:
www.youtube.com
About the author-:
Abhishek Mungoli is a seasoned Data Scientist with experience in ML field and Computer Science background, spanning over various domains and problem-solving mindset. Excelled in various Machine learning and Optimization problems specific to Retail. Enthusiastic about implementing Machine Learning models at scale and knowledge sharing via blogs, talks, meetups, and papers, etc.
My motive always is to simplify the toughest of the things to its most simplified version. I love problem-solving, data science, product development, and scaling solutions. I love to explore new places and working out in my leisure time. Follow me up at Medium, Linkedin or Instagram and check out my previous posts. I welcome feedback and constructive criticism. Some of my blogs -
5 Mistakes every Data Scientist should avoid
Decomposing Time Series in a simple & intuitive way
How GPU Computing literally saved me at work?
Information Theory & KL Divergence Part I and Part II
Process Wikipedia Using Apache Spark to Create Spicy Hot Datasets
A Semi-Supervised Embedding based Fuzzy Clustering
Compare which Machine Learning Model performs Better
Analyzing Fitbit Data to Demystify Bodily Pattern Changes Amid Pandemic Lockdown
Myths and Reality around Correlation