Helpful mini function to fit the nearest neighbor (NN) algorithm given a set and defined distance
Useful links