Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] fix panic for can not search all the vector for not clear the searcher.seen when lower_search #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

miamia0
Copy link

@miamia0 miamia0 commented Feb 22, 2025

In the lower_search function, the searcher.seen state is not properly refreshed, which may cause certain entries to be skipped during the search.

    fn lower_search(&self, layer: &[Node<M>], searcher: &mut Searcher<Met::Unit>) {
        searcher.candidates.clear();
        let &Neighbor { index, distance } = searcher.nearest.first().unwrap();
        searcher.nearest.clear();
        >>> searcher.seen.clear();
        let new_index = layer[index].next_node as usize;
        let candidate = Neighbor {
            index: new_index,
            distance,
        };
       >>>  searcher.seen.insert(layer[index].zero_node);
        searcher.nearest.push(candidate);
        searcher.candidates.push(candidate);
    }

@miamia0 miamia0 changed the title [fix] fix panic for can not search all the vector for not clear the seen when lower_search [fix] fix panic for can not search all the vector for not clear the searcher.seen when lower_search Feb 22, 2025
@miamia0
Copy link
Author

miamia0 commented Feb 23, 2025

Hi @vadixidav. Just wanted to check if you have a chance to take a look at the PR. I'd be happy to address any feedback or make adjustments if needed.
Thanks for your time and effort in maintaining this project! (。・∀・)ノ゙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant