knn solver