pub struct CutAwareHNSW { /* private fields */ }Expand description
Extended HNSW that respects coherence boundaries
Implementations§
Source§impl CutAwareHNSW
impl CutAwareHNSW
Sourcepub fn new(config: CutAwareConfig) -> Self
pub fn new(config: CutAwareConfig) -> Self
Create a new cut-aware HNSW index
Sourcepub fn insert(&mut self, id: u32, vector: &[f32]) -> Result<(), FrameworkError>
pub fn insert(&mut self, id: u32, vector: &[f32]) -> Result<(), FrameworkError>
Insert a vector into the index
Sourcepub fn search_gated(&self, query: &[f32], k: usize) -> Vec<SearchResult>
pub fn search_gated(&self, query: &[f32], k: usize) -> Vec<SearchResult>
Search with coherence gating
Sourcepub fn search_ungated(&self, query: &[f32], k: usize) -> Vec<SearchResult>
pub fn search_ungated(&self, query: &[f32], k: usize) -> Vec<SearchResult>
Search without coherence gating
Sourcepub fn coherent_neighborhood(&self, node: u32, radius: usize) -> Vec<u32>
pub fn coherent_neighborhood(&self, node: u32, radius: usize) -> Vec<u32>
Get nodes reachable without crossing weak cuts
Sourcepub fn remove_edge(&mut self, u: u32, v: u32)
pub fn remove_edge(&mut self, u: u32, v: u32)
Remove edge and update cut watcher
Sourcepub fn batch_update(&mut self, updates: Vec<EdgeUpdate>) -> UpdateStats
pub fn batch_update(&mut self, updates: Vec<EdgeUpdate>) -> UpdateStats
Batch update with efficient cut recomputation
Sourcepub fn prune_weak_edges(&mut self, threshold: f64) -> usize
pub fn prune_weak_edges(&mut self, threshold: f64) -> usize
Prune weak edges based on cut analysis
Sourcepub fn compute_zones(&mut self) -> Vec<CoherenceZone>
pub fn compute_zones(&mut self) -> Vec<CoherenceZone>
Compute coherence zones
Sourcepub fn cross_zone_search(
&self,
query: &[f32],
k: usize,
zones: &[usize],
) -> Vec<SearchResult>
pub fn cross_zone_search( &self, query: &[f32], k: usize, zones: &[usize], ) -> Vec<SearchResult>
Cross-zone search (explicitly crosses boundaries)
Sourcepub fn metrics(&self) -> &CutAwareMetrics
pub fn metrics(&self) -> &CutAwareMetrics
Get current metrics
Sourcepub fn reset_metrics(&self)
pub fn reset_metrics(&self)
Reset metrics
Sourcepub fn export_metrics(&self) -> Value
pub fn export_metrics(&self) -> Value
Export metrics as JSON
Sourcepub fn cut_distribution(&self) -> Vec<LayerCutStats>
pub fn cut_distribution(&self) -> Vec<LayerCutStats>
Get cut distribution across layers
Auto Trait Implementations§
impl Freeze for CutAwareHNSW
impl RefUnwindSafe for CutAwareHNSW
impl Send for CutAwareHNSW
impl Sync for CutAwareHNSW
impl Unpin for CutAwareHNSW
impl UnwindSafe for CutAwareHNSW
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more