The nearest neighbor problem in computational geometry asks for the point from a set of points which is nearest to a given
point according to some measure of distance. The nearest neighborhood problem involves
identifying the locus of points lying nearer to the query point than to any other
point in the set.
The nearest neighbor from the set of points ,
can be computed in the Wolfram Language
using Nearest[{u1,
u2, ..., }, x].
An extensive site of nearest neighbor material is maintained by Lifshits.
Lifshits, Y. "The Homepage of Nearest Neighbors and Similarity Search." http://simsearch.yury.name.Skiena,
S. S. "Nearest Neighbor Search." §8.6.5 in The
Algorithm Design Manual. New York: Springer-Verlag, pp. 361-363, 1997.Smid,
M. "Closest-Point Problems in Computational Geometry." Ch. 20 in Handbook
of Computational Geometry (Ed. J.-R. Sack and J. Urrutia). Amsterdam,
Netherlands: North-Holland, pp. 877-935, 2000.