KNN_SUM function

Sum of distance to k-nearest neighbors