Helpful mini function to fit the nearest neighbor (NN) algorithm given a set and defined distance
fitNN(uniqueDraws, uniqueLabels, distance, minDist)
List. tsSolution gives the ordered labels, tsValues gives the ordered values, tsDiffs is a vector of distances between consecutive values in tsValues
List of unique values that make up the set on which we are using the NN algorithm
List of unique labels associated 1-1 with the unique values
Function with arguments x,y that returns a distance defined on the given values
Minimum possible distance between two points that aren't equivalent. May be ignored, but if possible to specify, may speed up the algorithm.