use crate::error::Result;
use crate::graph::SparseGraph;
use crate::types::{AuditResult, EdgeImportance, SparsifierStats};
pub trait Sparsifier: Send + Sync {
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;
}
pub trait ImportanceScorer: Send + Sync {
fn score(&self, graph: &SparseGraph, u: usize, v: usize, weight: f64) -> EdgeImportance;
fn score_all(&self, graph: &SparseGraph) -> Vec<EdgeImportance>;
}
pub trait BackboneStrategy: Send + Sync {
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);
}