Introduction
Trajectory similarity research has traditionally focused on "whole matching"—determining if two entire trips are similar. However, real-world queries often involve "subtrajectory" problems, such as identifying historical trips that passed through a specific 5km stretch of a city. This task is significantly more complex; in a database of millions of trajectories, there are billions of possible subtrajectories to evaluate.
Existing solutions are often limited to specific similarity functions. This paper introduces OSF-BT (Optimized Subsequence Filtering with Bidirectional Tries), a unified, function-agnostic framework that handles various user-defined cost functions under the Weighted Edit Distance (WED) metric while remaining fast enough for production environments.
Methodology: The OSF-BT Framework
The authors propose a two-stage "filter-and-verify" pipeline to achieve high performance.
1. Subsequence Filtering
To avoid exhaustive checks, the system selects a "representative" subsequence of the query trajectory. If a database trajectory does not contain the elements of this subsequence (or their spatial neighbors), it is pruned. Selecting the optimal subsequence to minimize candidates is an NP-hard problem. The authors address this with MinCand, a 2-approximation algorithm that efficiently selects filtering elements on the fly.
2. Local Verification with Bidirectional Tries
Once candidates are identified, they are verified using Dynamic Programming (DP). Standard alignment methods like Smith-Waterman are computationally expensive. OSF-BT innovates by using Bidirectional Tries.
Because road networks are sparse, many trajectories share common segments. By storing DP calculations in a trie structure and searching in both directions from a matched point, the algorithm caches and reuses computations, drastically reducing redundant work.
Key Insights
- WED as a Flexible Metric: Weighted Edit Distance can be parameterized to behave like Levenshtein distance, EDR, ERP, or the proposed SURS (Shortest Unshared Road Segments) metric.
- Exploiting Network Sparsity: While the "alphabet" of road segments is large, connectivity is low (typically 3–4 exits per intersection). The bidirectional trie leverages this physical constraint for effective caching.
- Practical Utility: For applications like travel time estimation, searching for similar subtrajectories provides a more robust sample size than exact matching, leading to higher accuracy.
Experimental Results
The framework was evaluated on major datasets from Beijing (T-drive), Porto, Singapore, and a synthetic San Francisco dataset (11.5 million trajectories).
- Efficiency: OSF-BT achieved up to a 73x speedup over state-of-the-art methods like Torch-BT and was 9x faster than DISON-BT on the Beijing dataset.
- Filtering Power: The MinCand algorithm reduced the candidate set by 3.4x to 25x compared to standard indexing methods.
- Scalability: The system scales linearly, processing queries on the 11.5-million-record SanFran dataset in under one second for most distance functions.
- Application Impact: In travel time estimation, similarity search reduced the Root Mean Square Error (RMSE) by approximately 50% compared to whole-matching methods.
Conclusion and Future Work
OSF-BT provides a scalable solution for subtrajectory similarity search. While currently optimized for single-core, main-memory execution, future work includes extending the framework to distributed systems for planetary-scale datasets and integrating more complex temporal traffic models into the WED cost function.
Summary updated