# The Data and Science Behind GrabShare Part I: Verifying Potential and Developing the Algorithm

[Grab](https://yomu.fyi/company/grab) · Tang Muchen · Oct 20, 2017

**Type:** Problem & solution

## Summary

Expanding from point-to-point dispatch services to dynamic carpooling requires matching independent passenger requests traveling in similar directions without causing unacceptable delays. Grab evaluated the feasibility of its GrabShare service by analyzing historical trip data with DBSCAN clustering on coordinates projected into a Universal Transverse Mercator system. This analysis demonstrated that 35% to 46% of rides across typical daytime windows fell into tight geographic clusters with near-identical pickup and drop-off coordinates. The resulting matching framework adapts the baseline dispatch flow by searching for in-transit drivers and enforcing real-time seat reservation constraints. Route assignment decisions subsequently evaluate detour times, trip angles, and expected arrival times to ensure driver utilization improves while total driving distance decreases.

## Context

Real-time dynamic pooling can reduce traffic congestion and improve driver utilization, but scaling it requires matching strangers traveling in similar directions while preserving seat availability and acceptable travel times.

## Approach / What changed

Grab verified ride-pooling potential using DBSCAN clustering on historical booking coordinates mapped to Universal Transverse Mercator projections, then formulated a real-time matching algorithm that queries in-transit drivers, tracks occupied vehicle capacity, and filters routes using detour and efficiency constraints.

## Takeaways

- DBSCAN clustering with a 300-meter neighborhood threshold demonstrated that 35% to 46% of daytime GrabCar trips shared near-identical pickup and drop-off areas.
- GrabShare modifies the standard booking flow by searching active in-transit drivers and enforcing dynamic vehicle capacity checks before assignment.
- Matching routes are evaluated against trip angle, detour, arrival time, and efficiency metrics to minimize extra passenger transit time while significantly reducing total driven distance.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Machine Learning](https://yomu.fyi/topic/machine-learning)

[Read original post](https://engineering.grab.com/the-data-and-science-behind-grabshare-part-i)
