knn correspondences for hard constraints