pub struct SparseGraph { /* private fields */ }Expand description
A sparsified graph that preserves cut structure
Implementations§
Source§impl SparseGraph
impl SparseGraph
Sourcepub fn from_graph(graph: &DynamicGraph, config: SparsifyConfig) -> Result<Self>
pub fn from_graph(graph: &DynamicGraph, config: SparsifyConfig) -> Result<Self>
Create a sparsified version of the graph
Sourcepub fn graph(&self) -> &DynamicGraph
pub fn graph(&self) -> &DynamicGraph
Get the sparse graph
Sourcepub fn sparsification_ratio(&self) -> f64
pub fn sparsification_ratio(&self) -> f64
Get the sparsification ratio
Sourcepub fn approximate_min_cut(&self) -> f64
pub fn approximate_min_cut(&self) -> f64
Query approximate minimum cut on sparse graph
Sourcepub fn insert_edge(
&mut self,
u: VertexId,
v: VertexId,
weight: Weight,
) -> Result<()>
pub fn insert_edge( &mut self, u: VertexId, v: VertexId, weight: Weight, ) -> Result<()>
Update for edge insertion in original graph
Auto Trait Implementations§
impl !Freeze for SparseGraph
impl !RefUnwindSafe for SparseGraph
impl Send for SparseGraph
impl Sync for SparseGraph
impl Unpin for SparseGraph
impl !UnwindSafe for SparseGraph
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