Fast Nearest Neighbor Search Algorithms and Applications