Fast Implementation of the Exact PNN Algorithm

Pasi Fränti, Timo Kaukoranta · 1999

Straightforward implementation of the exact pairwise nearest neighbor (PNN) takes O(N³) time, where N is the number of training vectors. This is rather slow in practical situations. Fortunately much faster implementation can be obtained with rather simple modifications to the basic algorithm. In the present paper we propose a fast O(tN²) time implementation of the exact PNN, where t is shown to be significantly smaller than N. We give all necessary data structures and implementation details, and give time complexity of the algorithm both in the best and in the worst case. The proposed implementation achieves the results of the exact PNN with the same O(N) memory requirement.

Read the paper · More papers on PaperTik