# A worst-case analysis of nearest neighbor searching by projection

## Abstract

The nearest neighbor searching problem (also called the post office problem) calls for organizing the set P of N points in k-space so that the nearest neighbor in P to a new point can be quickly found. Friedman, Baskett and Shustek describe an algorithm for nearest neighbor searching based on projecting the points onto the various coordinate axes; their analysis of this method shows that a nearest neighbor search can be performed in O(N^{1−1/k}) expected time, for any fixed dimension k>1 under a variety of probability distributions. In this paper we shall prove the stronger (worst-case) result that the total time required by (an extension of) their method to find the nearest neighbor of every point in any fixed k-dimensional point set is O(N^{2−1/k}), which immediately implies a result similar to theirs. The above results hold only for the L_{∞} metric; we also investigate the Euclidean (L_{2}) metric. Our first result for that metric shows that the above analysis does not hold in general, and our second result then goes on to show that the analysis does in fact apply in practice, because of the finite word-length restrictions of real computers.

## Keywords

Projection Method Neighbor Search Horizontal Strip Expected Time Neighbor Problem## Preview

Unable to display preview. Download preview PDF.

## References

- Bellman, R. [1957].
*Dynamic Programming*, Princeton University Press, Princeton, New Jersey.Google Scholar - Bentley, J. L. [1976]. "Divide and conquer algorithms for closest point problems in multidimensional space," unpublished Ph.D. Thesis, University of North Carolina, December 1976.Google Scholar
- Bentley, J.L. [1979]. "Multidimensional divide-and-conquer," to appear in
*Communications of the ACM*.Google Scholar - Bentley, J. L., B. W. Weide, and A. C. Yao [1979]. "Optimal expected-time algorithms for closest-point problems," Carnegie-Mellon University Computer Science Report CMU-CS-79-111.Google Scholar
- Friedman, J. H., F. Baskett, and L. J. Shustek [1975]. "An algorithm for finding nearest neighbors,"
*IEEE Transactions on Computers C-24*, 10, pp. 1000–1006, October 1975.Google Scholar - Friedman, J. H., J. L. Bentley, and R. A. Finkel [1977]. "An algorithm for finding best matches in logarithmic expected time,"
*ACM Transactions on Mathematical Software 3*, pp. 209–226, September 1977.Google Scholar - Knuth, D. E. [1973].
*The Art of Computer Programming, volume 3: Sorting and Searching*, Addison-Wesley, Reading, Massachusetts.Google Scholar - Lee, R. C. T., Y. H. Chin, and S. C. Chang [1976]. "Application of principal component analysis to multikey searching,"
*IEEE Transactions on Software Engineering SE-2*, 3, pp. 185–193, September 1976.Google Scholar - Lipton, R. and R. E. Tarjan [1977]. "Applications of a planar separator theorem,"
*Eighteenth Symposium on the Foundations of Computer Science*, pp. 162–170, IEEE, October 1977.Google Scholar - Papadimitriou, C. H. [1979]. "Worst-case probabilistic analysis of a geometric location problem," submitted to
*Mathematics of Operations Research*, November 1979.Google Scholar - Shamos, M. I. [1978]. "Computational geometry", unpublished Ph.D. Thesis, Yale University, May 1978.Google Scholar
- Weide, B. W. [1978]. "Statistical methods in algorithm design and analysis," Ph.D. Thesis, Carnegie-Mellon University, Carnegie-Mellon University Computer Science Report CMU-CS-78-142.Google Scholar
- Zolnowsky, J. E. [1978]. "Topics in computational geometry," Ph.D. Thesis, Stanford University. Stanford Computer Science Department Report STAN-CS-78-659.Google Scholar