Abstract
Efficiently searching for similar trajectories in graph-constrained environments is a critical task for urban planning, traffic management, and recommendation systems. This paper introduces a novel spatio-temporal distance metric that satisfies the triangle inequality, enabling the development of highly efficient indexing structures. By combining pivot-based spatial filtering with temporal interval trees and upper-bounding heuristics, the proposed methods achieve significant speedups in top-k similarity queries over large-scale trajectory datasets while maintaining high result accuracy. Experimental results on real-world and synthetic datasets demonstrate that these indexing techniques can be constructed orders of magnitude faster than existing baselines.
Introduction
The proliferation of GPS-enabled devices has led to an explosion of trajectory data—sequences of locations visited over time. Finding similar paths is fundamental for various applications, from identifying common commuting patterns to recommending social connections. However, real-world movements are often constrained by networks, such as road systems or social links. Existing graph-based similarity measures frequently lack metric properties, making it difficult to build efficient search indexes. Furthermore, balancing spatial proximity with temporal overlap presents a significant computational challenge. This work addresses the top-k similarity query: identifying the $k$ most similar trajectories to a query $Q$ within a specific time interval $s$.
Methodology
The core innovation lies in the definition of a similarity function based on the intersection of time intervals and shortest-path distances between graph vertices. The authors define the similarity between two trajectory segments as the product of their temporal overlap and a spatial decay function based on graph distance.
By deriving a distance function $Dist = 1 - Sim$ and proving its adherence to the triangle inequality, the authors enable the use of metric-based indexing. This transformation is critical because it allows the search problem to be framed as a nearest-neighbor search in a metric space, moving away from exhaustive brute-force comparisons. The proposed framework utilizes three main components:
- Pivot-Based Spatial Filtering: By pre-calculating distances from all trajectories to a set of pre-selected "pivot" vertices, the algorithm can use the triangle inequality to prune the search space. It discards trajectories that are mathematically guaranteed to be too far from the query.
- Temporal Filtering: A binary interval tree is employed to quickly exclude trajectories that do not have any temporal overlap with the query's time window, significantly reducing the initial candidate set.
- Upper Bounding: A heuristic early-stopping mechanism calculates an upper bound for the similarity score. If this bound is lower than the current $k$-th best similarity, the calculation for that trajectory is terminated early.
Experimental Evaluation
The proposed methods were evaluated on four distinct datasets to test performance across different graph topologies and trajectory characteristics:
- Facebook1 & Facebook2: These datasets consist of synthetic trajectories generated on a real-world social network graph with approximately 4,000 vertices.
- Milan: This dataset contains real-world GPS trajectories of private cars in Milan, mapped to a road network graph of 3,000 vertices. These trajectories are notably shorter on average.
- T-Drive: A large-scale dataset containing GPS data from over 10,000 taxis in Beijing, providing a robust test for scalability.
Results
The indexing and query performance showed substantial improvements over existing baselines such as Gbase, Gshq, and Gshqt.
Key findings from the experimental results include:
- Indexing Efficiency: The "Pivot" index construction proved remarkably efficient. On the T-Drive dataset, it was constructed over 22,000 times faster than the Gbase baseline.
- Query Performance: The indexed solutions (Tree and Pivot) consistently outperformed baselines. For instance, on the Facebook datasets, they achieved 3x to 4x speedups in query time.
- Heuristic Effectiveness: The upper bounding technique alone, even without pre-built indexes, provided speedups of up to 14x on the T-Drive and Milan datasets.
- Result Quality: The authors used the Similarity Score Ratio (SSR) to measure the quality of the heuristic results. The SSR remained between 90% and 99%, indicating that the pruning methods find results nearly as good as an exhaustive exact search while being orders of magnitude faster.
Conclusion
Transforming trajectory similarity into a distance metric allows for scalable, indexed search in graph-constrained environments. While the benefits are less pronounced for very short trajectories (as seen in the Milan dataset), the linear memory efficiency and parallelizability make this approach highly practical for large-scale spatio-temporal data analysis. Future work will focus on optimizing pivot selection strategies to further enhance the pruning power of the spatial filters.
Summary updated