Nearest Neighbor Query, Definition