Fast Subtrajectory Similarity Search in Road Networks under Weighted Edit Distance Constraints

Satoshi Koide, Chuan Xiao, Yoshiharu Ishikawa

Introduction

With the proliferation of GPS-enabled devices and ride-sharing services, the analysis of vehicular trajectories has become a cornerstone for urban planning, traffic prediction, and travel time estimation. While most existing research focuses on matching entire trajectories, real-world applications often demand the ability to find similar subtrajectories. For instance, a traffic engineer might need to find all historical trips that traversed a specific congested corridor, regardless of where those trips originated or ended.

The Challenge of Subtrajectory Matching

Searching for similar subtrajectories is significantly more complex than whole-trajectory matching. A naive approach would require enumerating every possible subtrajectory within a database, a process that scales cubically with trajectory length. Furthermore, many existing solutions are tied to specific similarity metrics, lacking the flexibility to handle the diverse constraints required by different applications.

Subtrajectory matching (a) identifies similar segments within larger trips, whereas whole matching (b) requires the entire trajectory to align.

This paper addresses these challenges by proposing a unified framework for subtrajectory search under the Weighted Edit Distance (WED). WED is a versatile metric that allows users to define custom penalties for road segment substitutions, insertions, and deletions, making it adaptable to various similarity requirements.

The Filter-and-Verify Framework

To achieve scalability across massive datasets like those from Beijing and Porto, the authors employ a two-stage "filter-and-verify" paradigm:

  1. Subsequence Filtering: Instead of checking every trajectory, the system selects a specific subsequence of the query to act as a filter. The authors formulate this as the "Minimum Candidate Problem" (MinCand), aiming to select a subsequence that minimizes the number of false positives retrieved from the database. Since MinCand is NP-hard, they implement a fast 2-approximation algorithm to solve it efficiently on the fly.
  2. Local Verification: Once a small set of candidate trajectories is identified, they must be verified. Rather than performing a standard Dynamic Programming (DP) check on the entire trajectory, the algorithm uses optimized techniques to prune the search space.

Optimized Verification via Trie-based DP

The verification process is enhanced by two key innovations: bidirectional search and trie-based caching. Because road networks are physically constrained, many trajectories share common prefixes or suffixes. By organizing these segments into a Trie, the algorithm can cache and reuse DP computations, drastically reducing redundant work.

Evolution of DP verification from (a) naive approaches to (b) bidirectional and (c) trie-based bidirectional methods.

As shown in the figure above, the transition from naive DP to a trie-based bidirectional approach allows the system to stop verification early if the error threshold is exceeded and to exploit the inherent sparsity of road network paths.

Key Results and Practical Impact

The proposed method, OSF-BT, demonstrates remarkable performance gains over existing baselines:

  • Efficiency: It achieves up to 73x speedup over Torch-BT and 9x speedup over DISON-BT, often processing queries in milliseconds.
  • Precision: The optimized filtering generates candidate sets that are 3.4x to 25x smaller than traditional methods.
  • Utility: In practical tests for travel time estimation, subtrajectory matching reduced the Root Mean Square Error (RMSE) by approximately 50% compared to whole-trajectory matching, proving that local segment similarity is a better predictor of travel conditions than global trip similarity.

Conclusion

By combining a novel subsequence filtering strategy with trie-based bidirectional dynamic programming, this framework provides a scalable and flexible solution for subtrajectory search. It effectively exploits road network constraints to deliver high-speed performance without sacrificing the versatility of the Weighted Edit Distance metric.

Summary updated

BibTeX
@article{koide2020fast,
  author = {Satoshi Koide and Chuan Xiao and Yoshiharu Ishikawa},
  title = {{Fast Subtrajectory Similarity Search in Road Networks under Weighted Edit Distance Constraints}},
  journal = {Proc. VLDB Endow.},
  year = {2020},
}
Figure