Skip to main content

Sparsifier

Trait Sparsifier 

Source
pub trait Sparsifier: Send + Sync {
    // Required methods
    fn insert_edge(&mut self, u: usize, v: usize, weight: f64) -> Result<()>;
    fn delete_edge(&mut self, u: usize, v: usize) -> Result<()>;
    fn audit(&self) -> AuditResult;
    fn rebuild_local(&mut self, nodes: &[usize]) -> Result<()>;
    fn rebuild_full(&mut self) -> Result<()>;
    fn sparsifier(&self) -> &SparseGraph;
    fn compression_ratio(&self) -> f64;
    fn stats(&self) -> &SparsifierStats;
}
Expand description

A dynamic spectral sparsifier that maintains a compressed shadow graph preserving the Laplacian energy of the original within (1 +/- epsilon).

Required Methods§

Source

fn insert_edge(&mut self, u: usize, v: usize, weight: f64) -> Result<()>

Insert an edge into the full graph and update the sparsifier.

Source

fn delete_edge(&mut self, u: usize, v: usize) -> Result<()>

Delete an edge from the full graph and update the sparsifier.

Source

fn audit(&self) -> AuditResult

Run a spectral audit comparing the sparsifier against the full graph.

Source

fn rebuild_local(&mut self, nodes: &[usize]) -> Result<()>

Rebuild the sparsifier around specific vertices.

Source

fn rebuild_full(&mut self) -> Result<()>

Fully reconstruct the sparsifier from scratch.

Source

fn sparsifier(&self) -> &SparseGraph

Return a reference to the current sparsifier graph.

Source

fn compression_ratio(&self) -> f64

Return the current compression ratio.

Source

fn stats(&self) -> &SparsifierStats

Return the current statistics.

Implementors§