NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Efficient kNN query for moving objects on time-dependent road networks

Jiajia Li, Cancan Ni, Dan He, Lei Li, Xiufeng Xia, Xiaofang Zhou

Abstract

Finding the $k$ nearest moving objects in a road network is a fundamental task for modern location-based services like ride-hailing and logistics. However, traditional methods often rely on static distances, failing to account for the reality of time-varying traffic conditions. This paper introduces TD-H2H, a novel indexing structure designed for Time-Dependent k-Nearest Neighbor (TD-kNN) queries. By extending tree-decomposition techniques to handle piecewise linear cost functions, TD-H2H pre-computes travel time information, enabling query response times that are 100x to 1000x faster than previous state-of-the-art approaches on large-scale city networks.

The Complexity of Time-Dependent Networks

Most navigation applications calculate the "nearest" neighbor based on static road distances. In a real-world urban environment, the physically closest taxi may not be the one that can reach a passenger the fastest due to congestion. This necessitates solving the Time-Dependent kNN (TD-kNN) problem, which is significantly more complex than its static counterpart for two primary reasons:

  1. Asymmetry: In a static network, the distance from point A to B is usually equal to B to A. In a time-dependent network, travel time depends on the departure time, meaning the time for a vehicle to reach a query point is not reciprocal and fluctuates throughout the day.
  2. Computational Overhead: Instead of simple scalar addition, calculating travel times requires the composition of functions. Edge weights are represented as piecewise linear functions $f(t)$, and finding the cost of a path involves calculating $f_2(t + f_1(t))$.
Piecewise linear cost functions representing travel time variations over a 60-minute period.

The TD-H2H Indexing Structure

The core innovation of this research is the TD-H2H index. It builds upon the concept of Tree Decomposition, which partitions a complex road network into a tree of smaller, overlapping clusters. While standard H2H indexes store static distances between nodes, TD-H2H pre-computes and stores aggregated weight functions within this hierarchy.

The tree decomposition structure used in TD-H2H to organize road network nodes hierarchically.

By storing these functions, the system can determine the fastest travel time between any two points by performing a few lookups in the decomposition tree, rather than traversing the entire graph. This approach shifts the heavy computational burden of function composition from query time to a pre-computation phase.

The GLAD Framework and Query Processing

To manage moving objects, the authors integrate TD-H2H into the GLAD framework, which utilizes a uniform grid to track vehicle locations. The query process expands outward from the query point grid-by-grid, employing several pruning strategies to maintain efficiency:

  • Lower-bound Cost Pruning: The system uses a static "best-case scenario" (the minimum possible travel time for an edge) to quickly discard objects that cannot mathematically beat the current top $k$ candidates.
  • Label Pruning: This strategy reuses partial travel time calculations when multiple objects share the same path segments within the decomposition tree, avoiding redundant computations.

Additionally, the authors extend the model to Approachable kNN (TD-AkNN). This variant accounts for vehicles that are currently occupied but will become available shortly, calculating the total arrival time as the sum of the time to finish the current trip and the time to reach the new request.

Experimental Evaluation

The researchers evaluated TD-H2H using real-world road networks from New York City (NY) and Beijing (BJ), each containing over 260,000 vertices. Since exact time-dependent cost functions for every edge are rarely public, the team simulated piecewise linear functions based on typical urban rush-hour and off-peak patterns.

Key Results

  • Performance: TD-H2H outperformed existing baselines like TD-Dijkstra and TD-G-tree by 2 to 3 orders of magnitude. Even for $k=50$ in a large city, query times remained in the sub-millisecond range.
  • Scalability: While the index size is larger than static versions (approximately 30GB for New York), it fits within the RAM of modern servers, making it viable for production environments.
  • Pruning Efficiency: The proposed pruning methods successfully reduced the number of expensive travel-time function calculations by 60-70%.

Conclusion

TD-H2H represents a significant leap in the efficiency of time-dependent spatial queries. By treating edge weights as functions and leveraging the structural properties of road networks through tree decomposition, the framework enables real-time, traffic-aware kNN searches at scale. Future work may focus on reducing the index memory footprint for continental-scale networks and developing methods to integrate live traffic incidents into the pre-computed structure without requiring a full re-index.

Summary updated

BibTeX
@article{li2023efficient,
  author = {Jiajia Li and Cancan Ni and Dan He and Lei Li and Xiufeng Xia and Xiaofang Zhou},
  title = {{Efficient kNN query for moving objects on time-dependent road networks}},
  journal = {VLDB J.},
  year = {2023},
  doi = {10.1007/s00778-022-00758-w},
}
Figure