cmuparlay / ParlayANN

A library of algorithms for approximate nearest neighbor search in high dimensions, along with a set of useful tools for designing such algorithms.
MIT License
108 stars 23 forks source link

infinite loop in Vamana graph construction when n is small #9

Closed yushangdi closed 11 months ago

yushangdi commented 1 year ago

When the input data size is very small, max_batch_size here can be 0, and lead to an infinite loop.

yushangdi commented 1 year ago

one easy fix could be to add the following?

    if(max_batch_size == 0){
      max_batch_size = n;
    }
magdalendobson commented 11 months ago

Thanks for pointing this out. It is now fixed on main.