paralellize different algorithms for calculating K-nearest-neighbour