pub trait BackboneStrategy: Send + Sync {
// Required methods
fn insert_edge(&mut self, u: usize, v: usize, weight: f64) -> bool;
fn delete_edge(&mut self, u: usize, v: usize, weight: f64) -> bool;
fn is_backbone_edge(&self, u: usize, v: usize) -> bool;
fn num_components(&self) -> usize;
fn connected(&mut self, u: usize, v: usize) -> bool;
fn backbone_edge_count(&self) -> usize;
fn ensure_capacity(&mut self, n: usize);
}Expand description
Strategy for maintaining a backbone (spanning forest) that ensures global connectivity in the sparsifier.
Required Methods§
Sourcefn insert_edge(&mut self, u: usize, v: usize, weight: f64) -> bool
fn insert_edge(&mut self, u: usize, v: usize, weight: f64) -> bool
Insert an edge, potentially adding it to the backbone.
Returns true if the edge was added to the backbone forest.
Sourcefn delete_edge(&mut self, u: usize, v: usize, weight: f64) -> bool
fn delete_edge(&mut self, u: usize, v: usize, weight: f64) -> bool
Delete an edge, repairing the backbone if needed.
Returns true if the backbone was modified.
Sourcefn is_backbone_edge(&self, u: usize, v: usize) -> bool
fn is_backbone_edge(&self, u: usize, v: usize) -> bool
Check whether an edge is currently in the backbone.
Sourcefn num_components(&self) -> usize
fn num_components(&self) -> usize
Return the number of connected components.
Sourcefn connected(&mut self, u: usize, v: usize) -> bool
fn connected(&mut self, u: usize, v: usize) -> bool
Check whether two vertices are in the same component.
Sourcefn backbone_edge_count(&self) -> usize
fn backbone_edge_count(&self) -> usize
Return the number of edges in the backbone.
Sourcefn ensure_capacity(&mut self, n: usize)
fn ensure_capacity(&mut self, n: usize)
Ensure the backbone can accommodate at least n vertices.