hnswlib icon indicating copy to clipboard operation
hnswlib copied to clipboard

The searching process sometimes only return the entorpoint

Open orrorcol opened this issue 5 years ago • 3 comments

My application occasionally met a case that when all neighbors of entorpoint are marked delete and are further to the query point. The search process will terminate and only return the entorpoint.

https://github.com/nmslib/hnswlib/blob/a97ec891e8aa19587897523ef70b3a923c14f99a/hnswlib/hnswalg.h#L259-L265 https://github.com/nmslib/hnswlib/blob/a97ec891e8aa19587897523ef70b3a923c14f99a/hnswlib/hnswalg.h#L295-L311

Should we add some constrains to prevent the searching process from terninating too quickly?

orrorcol avatar Jun 20 '20 11:06 orrorcol

@uestc-lfs, thanks for reporting! One of the the stop condition does not hold if some elements are omitted. Probably the best way to solve it is to add check if there are deletions and top_candidates.size()>=ef the in line #264. Not sure.

yurymalkov avatar Jun 21 '20 22:06 yurymalkov

@yurymalkov Thank you for your quick response. I agree that we can check the size of top_candidates or visited_list in line 264

orrorcol avatar Jun 22 '20 02:06 orrorcol

Not yet implemented it.

yurymalkov avatar Jun 27 '20 04:06 yurymalkov