compute_nearest_neighbor_distances function

Compute Nearest Neighbor Distances