Space-Time Tradeoffs for Approximate Nearest Neighbor Searching
Nearest neighbor searching is the problem of preprocessing a set of n point points in d-dimensional space so that, given any query point q, it is possible to report the closest point to q rapidly. In approximate nearest neighbor searching, a parameter epsilon > 0 is given, and a multiplicative error of (1 + epsilon) is allowed. We assume that the dimension d is a constant and treat n and epsilon as asymptotic quantities. Numerous solutions have been proposed, ranging from low-space solutions having space O(n) and query time O(log n+1/epsilon(d-1)) to high-space solutions having space roughly O((n log n)/epsilon(d)) and query time O(log(n/epsilon)). We show that there is a single approach to this fundamental problem, which both improves upon existing results and spans the spectrum of space-time tradeoffs. Given a tradeoff parameter gamma, where 2 <= gamma <= 1/epsilon, we show that there exists a data structure of space O(n gamma(d-1) log(1/epsilon)) that can answer queries in time O(log(n gamma) + 1/(epsilon gamma)((d-1)/2)). When gamma = 2, this yields a data structure of space O(n log(1/epsilon)) that can answer queries in time O(log n + 1/epsilon((d-1)/2)). When gamma = 1/epsilon, it provides a data structure of space O((n/epsilon(d-1)) log(1/epsilon)) that can answer queries in time O(log(n/epsilon)). Our results are based on a data structure called a (t, epsilon)-AVD, which is a hierarchical quadtree-based subdivision of space into cells. Each cell stores up to t representative points of the set, such that for any query point q in the cell at least one of these points is an approximate nearest neighbor of q. We provide new algorithms for constructing AVDs and tools for analyzing their total space requirements. We also establish lower bounds on the space complexity of AVDs, and show that, up to a factor of O(log(1/epsilon)), our space bounds are asymptotically tight in the two extremes, gamma = 2 and gamma = 1/epsilon.
space-time tradeoffs nearest neighbor searching algorithms theory