pub struct RuVectorGraphAnalyzer { /* private fields */ }Expand description
Graph connectivity analysis for ruvector
Useful for:
- Detecting communities in vector similarity graphs
- Finding cut points in knowledge graphs
- Partitioning data for distributed processing
Implementations§
Source§impl RuVectorGraphAnalyzer
impl RuVectorGraphAnalyzer
Sourcepub fn new(graph: Arc<DynamicGraph>) -> Self
pub fn new(graph: Arc<DynamicGraph>) -> Self
Create analyzer for a graph
Sourcepub fn from_similarity_matrix(
similarities: &[f64],
num_vectors: usize,
threshold: f64,
) -> Self
pub fn from_similarity_matrix( similarities: &[f64], num_vectors: usize, threshold: f64, ) -> Self
Build graph from similarity matrix
Creates edges between vectors with similarity above threshold
Sourcepub fn from_knn(neighbors: &[(usize, Vec<(usize, f64)>)]) -> Self
pub fn from_knn(neighbors: &[(usize, Vec<(usize, f64)>)]) -> Self
Build k-NN graph from vectors
Sourcepub fn partition(&mut self) -> Option<(Vec<VertexId>, Vec<VertexId>)>
pub fn partition(&mut self) -> Option<(Vec<VertexId>, Vec<VertexId>)>
Get partition (two sides of minimum cut)
Sourcepub fn is_well_connected(&mut self, threshold: u64) -> bool
pub fn is_well_connected(&mut self, threshold: u64) -> bool
Check if graph is well-connected (min cut above threshold)
Sourcepub fn find_bridges(&self) -> Vec<EdgeId> ⓘ
pub fn find_bridges(&self) -> Vec<EdgeId> ⓘ
Find bridge edges (edges whose removal disconnects graph)
Sourcepub fn invalidate_cache(&mut self)
pub fn invalidate_cache(&mut self)
Invalidate cache after graph modification
Auto Trait Implementations§
impl Freeze for RuVectorGraphAnalyzer
impl !RefUnwindSafe for RuVectorGraphAnalyzer
impl Send for RuVectorGraphAnalyzer
impl Sync for RuVectorGraphAnalyzer
impl Unpin for RuVectorGraphAnalyzer
impl !UnwindSafe for RuVectorGraphAnalyzer
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> 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