NeighborQueue
NeighborQueue uses a LongHeap to store lists of arcs in an HNSW graph, represented as a neighbor node id with an associated score packed together as a sortable long, which is sorted primarily by score. The queue provides both fixed-size and unbounded operations via .insertWithOverflow and .add, and provides MIN and MAX heap subclasses.
Functions
Link copied to clipboard
Link copied to clipboard
If the heap is not full (size is less than the initialSize provided to the constructor), adds a new node-and-score element. If the heap is full, compares the score against the current top score, and replaces the top element if newScore is better than (greater than unless the heap is reversed), the current top score.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard