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§
Sourcefn insert_edge(&mut self, u: usize, v: usize, weight: f64) -> Result<()>
fn insert_edge(&mut self, u: usize, v: usize, weight: f64) -> Result<()>
Insert an edge into the full graph and update the sparsifier.
Sourcefn delete_edge(&mut self, u: usize, v: usize) -> Result<()>
fn delete_edge(&mut self, u: usize, v: usize) -> Result<()>
Delete an edge from the full graph and update the sparsifier.
Sourcefn audit(&self) -> AuditResult
fn audit(&self) -> AuditResult
Run a spectral audit comparing the sparsifier against the full graph.
Sourcefn rebuild_local(&mut self, nodes: &[usize]) -> Result<()>
fn rebuild_local(&mut self, nodes: &[usize]) -> Result<()>
Rebuild the sparsifier around specific vertices.
Sourcefn rebuild_full(&mut self) -> Result<()>
fn rebuild_full(&mut self) -> Result<()>
Fully reconstruct the sparsifier from scratch.
Sourcefn sparsifier(&self) -> &SparseGraph
fn sparsifier(&self) -> &SparseGraph
Return a reference to the current sparsifier graph.
Sourcefn compression_ratio(&self) -> f64
fn compression_ratio(&self) -> f64
Return the current compression ratio.
Sourcefn stats(&self) -> &SparsifierStats
fn stats(&self) -> &SparsifierStats
Return the current statistics.