Q: is k-NN faster than NN ?
A: no
See below for more details.
In general, NN search is simpler, therefore, less effort is required than k-NN , when, of course, k is not equal to 1.
Take a look at my answer here , where I mainly explain the concept of NNS (* Nearest Neighbor Search).
In the case of kNN general algorithm can, for example, find the top NN , then the second top NN , etc., until k NN is found.
Another likely approach would be to have a priority_queue that contains k in the number NN , and they are ordered by their distance from the request point.
In order for the general algorithm to find more than one neighbor, it must have access to more nodes / sheets, which means a larger step, which increases the time complexity.
It is clear that accuracy can increase with increasing k, but the cost of computing also increases.
as said on this blog .
I suspect that you are talking about a specific algorithm in your question, but not knowing what, in my opinion, there can be no better answer.
source share