Describe what you are looking for
When using filtered_search with a predicate, the search often returns fewer than wanted results even when plenty of passing nodes exist in the graph.
I think the issue is in search_to_find_in_base_:
if ((-candidate.distance) > radius)
break;
radius comes from top.top().distance, but only predicate-passing nodes enter top. So with a selective predicate, radius collapses to the nearest passing node and the traversal exits almost immediately — before finding wanted results.
Without a predicate every node enters top, so radius tracks the true exploration frontier and this works fine. With a predicate they diverge.
This would keep traversing through non-passing nodes until enough passing results are found (or the graph is exhausted), while preserving the existing early-exit when no predicate is used.
Can you contribute to the implementation?
Is your feature request specific to a certain interface?
C++ implementation
Contact Details
jack@spice.ai
Is there an existing issue for this?
Code of Conduct
Describe what you are looking for
When using
filtered_searchwith a predicate, the search often returns fewer thanwantedresults even when plenty of passing nodes exist in the graph.I think the issue is in
search_to_find_in_base_:radiuscomes fromtop.top().distance, but only predicate-passing nodes entertop. So with a selective predicate,radiuscollapses to the nearest passing node and the traversal exits almost immediately — before findingwantedresults.Without a predicate every node enters
top, soradiustracks the true exploration frontier and this works fine. With a predicate they diverge.This would keep traversing through non-passing nodes until enough passing results are found (or the graph is exhausted), while preserving the existing early-exit when no predicate is used.
Can you contribute to the implementation?
Is your feature request specific to a certain interface?
C++ implementation
Contact Details
jack@spice.ai
Is there an existing issue for this?
Code of Conduct