pub struct SparsifierConfig {
pub epsilon: f64,
pub edge_budget_factor: usize,
pub audit_interval: usize,
pub walk_length: usize,
pub num_walks: usize,
pub n_audit_probes: usize,
pub auto_rebuild_on_audit_failure: bool,
pub local_rebuild_fraction: f64,
}Expand description
Configuration for the adaptive spectral sparsifier.
Controls approximation quality (epsilon), memory budget, audit frequency,
and random-walk parameters.
§Defaults
| Parameter | Default | Notes |
|---|---|---|
epsilon | 0.2 | (1 +/- eps) spectral guarantee |
edge_budget_factor | 8 | budget = factor * n |
audit_interval | 1000 | updates between audits |
walk_length | 6 | random-walk hops for importance |
num_walks | 10 | walks per edge for scoring |
n_audit_probes | 30 | random vectors per audit |
Fields§
§epsilon: f64Spectral approximation factor in (0, 1).
Smaller values yield a more faithful sparsifier but require more
edges. A value of 0.2 means the Laplacian quadratic form is
preserved within a factor of (1 +/- 0.2).
edge_budget_factor: usizeEdge budget expressed as a multiple of n (number of vertices).
The sparsifier will target at most edge_budget_factor * n edges.
Typical values range from 4 (aggressive) to 12 (conservative).
audit_interval: usizeNumber of dynamic updates between automatic spectral audits.
walk_length: usizeMaximum number of hops in importance random walks.
num_walks: usizeNumber of random walks per edge for importance estimation.
n_audit_probes: usizeNumber of random probe vectors used in spectral audits.
auto_rebuild_on_audit_failure: boolWhether to automatically trigger a rebuild when an audit fails.
local_rebuild_fraction: f64Fraction of the graph to rebuild during a local rebuild (0..1].
Trait Implementations§
Source§impl Clone for SparsifierConfig
impl Clone for SparsifierConfig
Source§fn clone(&self) -> SparsifierConfig
fn clone(&self) -> SparsifierConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SparsifierConfig
impl Debug for SparsifierConfig
Source§impl Default for SparsifierConfig
impl Default for SparsifierConfig
Source§impl<'de> Deserialize<'de> for SparsifierConfig
impl<'de> Deserialize<'de> for SparsifierConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SparsifierConfig
impl RefUnwindSafe for SparsifierConfig
impl Send for SparsifierConfig
impl Sync for SparsifierConfig
impl Unpin for SparsifierConfig
impl UnsafeUnpin for SparsifierConfig
impl UnwindSafe for SparsifierConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more