Exact Trajectory Similarity Search With N-tree: An Efficient Metric Index for kNN and Range Queries
Ralf Hartmut Güting, Suvam Kumar Das, Fabio Valdés, Suprio Ray
TL;DR
This work tackles scalable, exact similarity search over large trajectory collections by introducing DistanceAvg, a linear-time, metric distance for continuous trajectories that remains meaningful under temporal alignment. It couples DistanceAvg with N-tree, a hierarchical Voronoi-based metric index that precomputes center-center distances and uses two pivots to enable aggressive pruning for range and kNN queries, including a filter-and-refine strategy via cylinder-based approximations. The paper provides detailed algorithms for building, updating, and querying the N-tree, along with rigorous experimental comparisons against GNAT and MVPT across diverse datasets and distance measures, demonstrating strong performance, especially for longer trajectories. It also addresses distributed construction and persistence of N-trees, enabling scalable indexing on large-scale, expensive-distance scenarios. Overall, DistanceAvg and the N-tree offer exact, efficient trajectory similarity search with practical scalability and parallelizable construction.
Abstract
Similarity search is the problem of finding in a collection of objects those that are similar to a given query object. It is a fundamental problem in modern applications and the objects considered may be as diverse as locations in space, text documents, images, twitter messages, or trajectories of moving objects. In this paper we are motivated by the latter application. Trajectories are recorded movements of mobile objects such as vehicles, animals, public transportation, or parts of the human body. We propose a novel distance function called DistanceAvg to capture the similarity of such movements. To be practical, it is necessary to provide indexing for this distance measure. Fortunately we do not need to start from scratch. A generic and unifying approach is metric space, which organizes the set of objects solely by a distance (similarity) function with certain natural properties. Our function DistanceAvg is a metric. Although metric indexes have been studied for decades and many such structures are available, they do not offer the best performance with trajectories. In this paper we propose a new design, which outperforms the best existing indexes for kNN queries and is equally good for range queries. It is especially suitable for expensive distance functions as they occur in trajectory similarity search. In many applications, kNN queries are more practical than range queries as it may be difficult to determine an appropriate search radius. Our index provides exact result sets for the given distance function.
