← Road Journal
Route Engine TECHNICAL · ENGINEERING DEEP DIVE

Algorithms of the Road: How WayloShare Matches Routes and Calculates Fair Fares

WS WayloShare Engineering · Routing & Algorithmic Systems · 01 Oct 2026 · 7 min read
verified highway rides ✎

Urban ride-hailing algorithms are optimized for short, radial trips: assign the nearest cab to a waiting rider. But inter-city highway carpooling is a fundamentally different mathematical problem.

A driver travelling 400 kilometres on NH44 is not a taxi looking for random diversions; they have a scheduled departure, a fixed destination, and limited willingness to detour. Here is how our Routing and Fare Engines coordinate highway matching at scale.

The national highway routing problem

When a driver posts a route from Delhi to Jaipur, prospective riders may wish to board in Gurugram, Dharuhera, or Neemrana, and disembark at Shahpura, Amer, or Jaipur Bypass. The matching algorithm must calculate whether an intermediate pickup is economically and temporally viable without disrupting the primary travel schedule.

Waypoint buffering & corridor deviation limits

WayloShare utilizes an adaptive polyline buffering algorithm. When a driver enters their route, the system constructs a corridor polygon with dynamic radius thresholds:

  • Urban Origins & Terminals: 8 to 12 km tolerance radius around major transit ring roads and metro interchanges.
  • Highway Corridors: Strict 2.5 km lateral deviation limit along expressways and national highways.
  • Maximum Detour Time Threshold: No intermediate pickup can add more than 15 minutes of total detour time to the driver's journey.

Fare calculation mathematics & MoRTH caps

Unlike commercial ride apps that use opaque surge multipliers, WayloShare's fare calculation engine is deterministic and completely transparent:

Seat_Fare = Min( (Distance × Rate_Per_Km) + Prorated_Toll, MoRTH_Statutory_Cap )

Where Rate_Per_Km is determined by vehicle efficiency category (₹2.50 to ₹3.80/km) and Prorated_Toll evenly divides national highway FASTag tolls across occupied seats.

Atomic seat allocation & concurrency control

Because multiple co-riders along different segments of the same highway may attempt to book overlapping legs simultaneously (e.g. Rider A booking Delhi→Ambala and Rider B booking Ambala→Chandigarh), seat allocation requires strict ACID transactional semantics. WayloShare utilizes Redis-backed distributed locks with PostgreSQL row-level versioning to ensure zero double-booking across multi-stop journeys.

ENG WayloShare EngineeringAuthored by the Algorithmic Routing & Geospatial Infrastructure Group.
Was this guide useful?
Feedback is private and helps us keep guides accurate.

Keep reading

TECHNICAL Engineering Trust: The Architecture Behind WayloShare's Two-Way KYC System 8 min read SAFETY Two-Way Verification Explained: Why Both Driver and Rider Must Complete KYC 6 min read SAVINGS MoRTH Guidelines & Legal Carpooling in India: What Every Commuter Should Know 7 min read