Skip to main content

BackboneStrategy

Trait BackboneStrategy 

Source
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§

Source

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.

Source

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.

Source

fn is_backbone_edge(&self, u: usize, v: usize) -> bool

Check whether an edge is currently in the backbone.

Source

fn num_components(&self) -> usize

Return the number of connected components.

Source

fn connected(&mut self, u: usize, v: usize) -> bool

Check whether two vertices are in the same component.

Source

fn backbone_edge_count(&self) -> usize

Return the number of edges in the backbone.

Source

fn ensure_capacity(&mut self, n: usize)

Ensure the backbone can accommodate at least n vertices.

Implementors§