Introduction
The Solvice Maps Distance Matrix service is specifically made for products that use route optimization to power scheduling operations.
The /cube
endpoint provides access to Solvice’s high-performance travel time prediction system. This endpoint is designed to support route optimization at scale, handling millions of requests in parallel with exceptional performance characteristics.
Traffic Profile Processing
TomTom provides us with 1000 distinct traffic profiles. Each traffic profile represents a curve that measures travel time variations throughout the day in 288 time blocks (one block per 5 minutes).
In our graph representation, each way (road segment) is assigned a specific traffic profile pattern for different days of the week:
This notation indicates that way segments use profile #8 on Mondays, profile #3 on Tuesday through Thursday, profile #5 on Fridays, and profile #12 on weekends.
Optimal Time Slices
Before fitting polynomials, we first identify the optimal time segments to model separately using the Pruned Exact Linear Time (PELT) changepoint detection algorithm. PELT is particularly well-suited for this task because:
- It efficiently identifies significant changes in the pattern of travel times
- It runs in linear time (O(n)) making it suitable for processing large datasets
- It automatically determines the optimal number of changepoints
The PELT algorithm identifies critical transition points in the traffic profiles, such as:
- Morning rush hour start/end times
- Evening congestion periods
- Transitions between weekend and weekday patterns
For example, a typical weekday might be segmented into time slices like:
- (0:00-6:30) - Night free flow
- (6:30-9:30) - Morning rush hour
- (9:30-11:30) - Morning travel pattern
- (11:30-14:00) - Midday travel pattern
- (14:00-16:00) - Afternoon travel pattern
- (16:00-20:00) - Evening rush hour
- (20:00-24:00) - Night free flow (same as first)
This approach allows us to:
- Model each segment with a tailored polynomial fit
- Reduce the complexity of each polynomial (fewer coefficients needed per slice)
- Improve overall accuracy by focusing on homogeneous time periods
The changepoint detection results are visualized in our traffic profiles as red horizontal lines, showing where PELT has identified significant transitions in traffic patterns.
Travel Time Curve Processing
The raw TomTom data shows how travel times fluctuate throughout the day, with characteristic patterns like:
- Morning rush hour peaks
- Midday plateaus
- Evening rush hour peaks
- Overnight free flow
Rather than storing 288 individual time values per profile per road segment (which would be inefficient), we apply polynomial fitting techniques to represent these curves mathematically.
Implementation with Time Slices
Polynomial Fitting Approach
We transform the raw time series data into polynomial coefficients using least squares regression. For a given route:
- The original travel time data might look like:
(25, 28, 26, 28, 25)
measured at specific times - We transform this into a polynomial equation: Y = 12t^5 - 8t^4 + t^3 + 3t^2 - 4t
- This polynomial can then be evaluated for any time value
t
(where t ranges from 0-288)
Benefits of the Coefficient Method
This approach provides several key advantages:
- Storage efficiency: Instead of storing 288 values per segment per profile (easily billions of values), we store just 6 coefficients
- Continuous representation: We can calculate travel time for any arbitrary time, not just the 5-minute intervals
- Smoothed interpolation: The polynomial curves filter out noise while preserving important patterns
- Computational efficiency: Evaluating a polynomial is extremely fast
The /cube Endpoint
The /cube
endpoint provides access to a 3D matrix (cube) of travel coefficients for route planning. This is our solution for efficiently handling time-dependent routing at massive scale.
Available Endpoints
Usage Pattern
When you need to calculate travel time for a specific departure time:
- Request a travel coefficient cube using
POST /cube
- Poll
GET /cube/status
until processing is complete - Retrieve the coefficient data via
GET /cube/response
- Use the polynomial function to calculate actual travel times:
Y = 12t^5 -8t^4 + t^3 +3t^2 -4t +25
for t=[0,288]
Request Format
The cube request follows the same format as the table endpoint, but returns coefficient data rather than pre-calculated travel times.
Response Format
The response contains a 3D matrix (cube) where each element is a length-6 array representing the polynomial coefficients for calculating travel time between points at different times of day.
Integration with Solvice Maps Platform
The /cube
endpoint is part of our broader high-performance routing solution that includes:
- Multiple vehicle profiles (CAR, BIKE, TRUCK, ELECTRIC_CAR, ELECTRIC_BIKE)
- Traffic profile integration from TomTom
- Directional routing capability
- Synchronized distance matrix computation
All of these components leverage our advanced routing technology based on contraction hierarchies, which can be 10,000× faster than traditional Dijkstra’s algorithm on continental-scale road networks.