Ola Trip Match Making Algorithm

Balaji Jadhav
5 min readJun 19, 2022

--

Hello all here I’m with another exciting topic as Ola trip match making algorithm on previous blogs, we put our self in the shoes of either customer, Manager or Boss in this case we will try to solve the problem from scratch as how match will happen? What are the factors behind that? How does search pricing affect? To start then I would like to divide this blog in three parts as Features, Model and Algorithms and Trigger after deployment. In this case we will see factors regarding pool ride as well as single user.

Selection of Ride.

Features

For the simplicity and overall understanding as case study we will take simple features and we will look for low level system design.

· Distance: distance from pick up location and drop location.

· Time: time to reach destination.

· Threshold distance: how much distance a driver can travel apart from decided track to pick up passenger.

· Traffic conditions: heavy, medium or low traffic conditions.

· Fuel price: to calculate the basic fair of the ride.

· Demand: how much cabs are needed?

· Supply: how many cabs are available?

· Festivals/ Events: is there any festival or event in the area.

· Gender: male or female passenger (for pool if there are already 2 male passengers then we can’t assign 1 female passenger.)

· Number of passengers are already in the cab: if already 2 passengers are there, we can’t adjust more than 2 passengers.

· Number of passengers requested for the cab: if already 2 passengers are there, we can’t adjust more than 2 passengers.

Last three features are considered for pool cab rest will be the same for the if single person is traveling from cab. Before going to algorithm what will be our dependent variable as we have a list of independent variables and more than this. Here in this case when we are looking to select a cab it is a ‘Double commit model’ as both driver as well as passengers will decide to take a ride or not. In this situation our dependent variable id ‘yes or no’ either to take ride or not. As soon as we know our dependent variable is either yes or no the problem becomes a classification problem.

We can think of time and price as dependent variables but in the case of time using historical data and live data algorithms can calculate estimated time as well. With estimated distance and fuel price we can calculate a fair price.

Model and Algorithms.

With all the features in our hand and dependent variable is known as categorical variable we know this is the problem of classification. Instead of applying complex algorithms directly we will apply logistic regression to predict output as we all know that tree-based algorithm and bagging as well as boosting algorithm always performs well, we will apply them also and finally select the best model. This will be the best suited answer in this case. Apart from this there will be a defending statement to this as ‘Why should we apply complex models if we get the same result with less complex models?’.

Model and Algorithms.

Trigger after deployment.

One question arises is when we should trigger our model as when to activate it or how it will get activated? Answer to this question is as soon as we receive any request from customers this model will trigger as well as find perfect ride service.

Expected Time of Arrival (ETA)

Expected time of arrival known as ETA in this feature we will come to know how much time is needed for a cab or any delivery item will take to arrive or deliver. Due to this feature, passengers will come to know his/her waiting time. In this situation passengers will feel less conscious and also, they can plan their routine.

Search Pricing

Apart from the model and all the features we may see in the app pricing as 1.25,1.5,2.0 and so on in this situation how perfectly the algorithm is deciding to go for exactly 1.25 value and not 2.0 value of course more the profit to company should be considered but this is not the case. If we do so then there is a high chance of losing customers here, we need to consider the customer base as they are continuously using ride service and also know about ups and downs in the price of fare. In this case we need to look for demand and supply if demand is more and supply is less then we can use search pricing. As soon as we know in a specific area demand is more and supply is less, we can send more drivers to that location with this business will be more as well as customers will be satisfied.

There might be a case once in a while such as festivals or some concert in a certain area then we can use a search pricing algorithm in that case it should be used in the case where it is beneficial for both customer as well as company so there will be less chances of losing customers. Generally, we calculate the base price of a fair and according to which we will apply a search pricing algorithm over it.

Search pricing.

Conclusion.

· All the features will be the same during pool as well as separate ride options only some what extra features need to be considered for pool ride case.

· Dependent variable in this case will categorical variable as ‘yes or no’ to take ride or reject it.

· Generally, when we are explaining case study then use normal (general) features and simple algorithms.

· Search pricing plays an important role in both customer retention as well as customer profit. So, we need to implement it wisely.

Thank you… Any suggestions are welcomed…

--

--

Balaji Jadhav

I am Data science enthusiast interested in Machine learning, Deep learning and AI.