Use KD-trees and Locality Sensitive Hashing (LSH) to find exact and approximate nearest neighbor
The KD-tree implementation was downloaded from http://sourceforge.net/pro jects/java-ml.
For datasets with high dimensionality d, KD-trees will not scale well and other methods must be used. LSH offers a method for reducing the dimensionality of the data while still enabling approximate neighbor finding.