pub struct DegreePresparse { /* private fields */ }Expand description
Degree-based presparse implementation
Uses effective resistance approximation R_eff(u,v) ≈ 1/(deg_u × deg_v) to pre-filter edges before exact sparsification, achieving 5.9x speedup.
Implementations§
Source§impl DegreePresparse
impl DegreePresparse
Sourcepub fn with_config(config: PresparseConfig) -> Self
pub fn with_config(config: PresparseConfig) -> Self
Create with custom config
Sourcepub fn effective_resistance(&self, deg_u: usize, deg_v: usize) -> f64
pub fn effective_resistance(&self, deg_u: usize, deg_v: usize) -> f64
Compute effective resistance approximation for an edge
R_eff(u,v) ≈ 1 / (deg(u) × deg(v))
High resistance = edge is important for connectivity Low resistance = edge can likely be removed
Sourcepub fn presparse(&mut self, graph: &DynamicGraph) -> PresparseResult
pub fn presparse(&mut self, graph: &DynamicGraph) -> PresparseResult
Perform degree-based presparse on a graph
Returns a sparsified edge set that preserves spectral properties for minimum cut computation.
Sourcepub fn should_include_edge(
&mut self,
graph: &DynamicGraph,
u: VertexId,
v: VertexId,
) -> bool
pub fn should_include_edge( &mut self, graph: &DynamicGraph, u: VertexId, v: VertexId, ) -> bool
Incremental update: handle edge insertion
Returns whether the edge should be included in the sparse graph
Sourcepub fn config(&self) -> &PresparseConfig
pub fn config(&self) -> &PresparseConfig
Get statistics for the presparse
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DegreePresparse
impl RefUnwindSafe for DegreePresparse
impl Send for DegreePresparse
impl Sync for DegreePresparse
impl Unpin for DegreePresparse
impl UnwindSafe for DegreePresparse
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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