Deep Dive: How Uber Fixes The Best Job-Supply Match To Fulfil Trips Anywhere It Operates

The cab-hailing market over the years has grown tremendously. However, today, it is much more than booking a cab from point A to point B. San Francisco-based company operates in more than 700 cities, 63 countries, has over 93 million monthly active platform users, over 3.9 million active drivers and completes more than 14 million trips daily.

Looking into the Indian cab hailing market, there are other players too. However, Uber is managing well to stay on top of their game — whether it’s about booking a cab or ordering food, Uber is fast becoming a go-to platform.

But have you ever wondered how this process works? In this article, we are going to have a look at some of the prime engineering concepts explained by the Uber Engineering Bangalore team.

Uber Marketplace

Before jumping right into how Uber works, let us first have a look at the Uber marketplace. The Uber marketplace is basically divided into three domains: Product, Business and Infrastructure. The product domain consists of rider, driver, eats, freight, and uber for business. And this is that domain which is kind of familiar to most of the consumers. Talking about the business domain, it is basically about the monetary aspects, and the infrastructure domain is about how engineering side.

Uber Engineering Team

The entire Uber business depends on these three domains. And the Uber engineering team, Bangalore is playing a vital role for the Uber Marketplace. Some of the charters that the team has are:

AdTech, which focuses on the ad spends and large scale ROI

Maps, to maintain the ride accuracy

Customer engagement through technologies like AI and ML

The team also has the global rider access and this is about getting the next billion riders into the Uber network.

Furthermore, the team is also solving a massive problem that many riders face is the problem if network coverage in some particular areas. And to fill the void, Uber is working it next app “Uber lite” that delivers a seamless experience to its consumers even the network coverage is low.

“Many riders experience a patchy network across different locations while booking a cab, and we are trying to reduce those barriers through our technology and bring those riders back to the Uber network,” saidManish Bharani, Product and Platform Engineering at UBER.

The Typical Uber Trip Scenarios

Every time we book a cab, the only thing we know is that a driver is assigned to pick us up and drop us to our desired destination. However, things are not that simple when you take a look through the engineering perspective — the way a trip is modelled.

Uber Cab: When a rider requests a ride, a trip is modelled as a job in Uber’s system. So, a job basically represents a unit of work that supply gets paid for, and it consists of two waypoints — pickup and drop-off. When a job is modelled by the system, a supply (a driver) is assigned and the waypoints are added to the supply’s plan. This is the basic scenario of a trip.

Uber Pool: But what about an Uber pool (when there are multiple riders involved)? Will the same approach work? To deal with this, Uber uses the logic of capacity. Each rider creates a separate job and each job has a specification for capacity requested by the rider. And each driver has a notion of available capacity, which is based on the seats in their vehicle. Therefore, multiple jobs are assigned to a supply based on the seat availability and along with an ordered list of waypoints.

Uber Eats: Here the concept is kind of similar to Uber cab. A restaurant is ordered to prepare the food which is the pickup point and the location of the eater is the drop-off point. So, the waypoints are treated in this manner. This how the scenario was:

Forward Dispatch: This is one more scenario that riders witness a significant number of times. Forward dispatch is when a supply first completes and job and then moves to the next. This happens when all the nearby supplies are busy, but a supply completing a job has a capacity. The uber system takes a few seconds to scan the nearby supplies and assigns the most suitable one.

Matching Job And Supply

When you request an Uber ride, the system takes a deep look at all the supplies and their ETAs within a certain threshold and assign the best-suited supply based on the best ETA. However, it is not a simple task.

“In the real world, entities are always moving — the drivers are always on the go, and even sometimes the rider keeps moving. And in this case, one wrong turn and the ETA would increase, making the rider wait for a long time,” saidAnkit Srivastava, Senior Software Engineer II at Uber.

For example, let’s assume a driver is already dispatched and a new trip request comes in; so, for that new trip, the driver with an already assigned job is invisible. However, there is a chance that the assigned driver might be the best driver for the new trip and the worst driver for the assigned trip. So, what does uber do in this scenario?

To cope with this challenge, Uber makes use of an algorithm called “Greedy Swap”. If you don’t know what a greedy swap is, it is a technique used in proving the correctness of greedy algorithms. The idea behind this method is to morph a solution produced by an optimal algorithm into the solution produced by the greedy algorithm. And the entire thing is done in a way that doesn’t worsen the ETA, rather, it improves the ETA.

However, there is a condition for making use of Greedy Swap — this method of matching job and supply can only be triggered when there is a new ride request. Meaning, these swaps don’t know when to optimise the trip, which results in leaving no way to optimise the existing trips.

This is when uber introduced the concept of “Continuous Scanning”. Every city is divided into super-regions, and Uber every second scans these regions for all the trips that are going. Based on that scan, the uber system looks at all the driver and their ETAs and figures out which drivers can be swapped. And those swaps would result in optimising ETAs for all drivers in that region.

Outlook

The Uber UI seems smooth and easy to use — board, pay, ride complete. But when we actually take a deep dive into the life of an Uber Trip, we understand how technology is evolving and making things easier for us. No doubt, how Uber today is able to expand its offerings from cars to boats to buses to even choppers.

Provide your comments below

Harshajit is a writer / blogger / vlogger. A passionate music lover whose talents range from dance to video making to cooking. Football runs in his blood. Like literally!
He is also a self-proclaimed technician and likes repairing and fixing stuff. When he is not writing or making videos, you can find him reading books/blogs or watching videos that motivate him or teaches him new things.