Struct pathfinding::EdmondsKarp
[−]
[src]
pub struct EdmondsKarp<C> { /* fields omitted */ }
Structure holding Edmonds-Karp algorithm internal variables. This is not supposed to be manipulated from outside and must be treated as opaque.
Methods
impl<C> EdmondsKarp<C> where
C: Zero + Signed + Bounded + PartialOrd + Copy,
[src]
C: Zero + Signed + Bounded + PartialOrd + Copy,
fn new(size: usize, source: usize, sink: usize) -> EdmondsKarp<C>
[src]
Create a new EdmondsKarp
structure.
- size
is the size of each dimension of the the capacities
square matrix.
- source
is the source node (the origin of the flow).
- sink
is the sink node (the target of the flow).
fn set_capacity(
&mut self,
capacities: &mut SquareMatrix<C>,
from: usize,
to: usize,
capacity: C
) -> bool
[src]
&mut self,
capacities: &mut SquareMatrix<C>,
from: usize,
to: usize,
capacity: C
) -> bool
Set a capacity and return true
if this caused the existing flows
to be reset.
fn reset_flows(&mut self)
[src]
Reset all flows unconditionally because capacities have changed.
fn reset_if_needed(&mut self, capacities: &SquareMatrix<C>) -> bool
[src]
Reset all flows in case capacities have been reduced to below the
existing flow. Return true
if a reset has been performed since
the last computation.
fn reset_after_change(
&mut self,
capacities: &SquareMatrix<C>,
from: usize,
to: usize
) -> bool
[src]
&mut self,
capacities: &SquareMatrix<C>,
from: usize,
to: usize
) -> bool
Reset all flows in case the given capacity has been reduced to below
the existing flow value. Return true
if a reset has been performed
since the last computation.
fn reset_after_changes(
&mut self,
capacities: &SquareMatrix<C>,
changes: &[(usize, usize)]
) -> bool
[src]
&mut self,
capacities: &SquareMatrix<C>,
changes: &[(usize, usize)]
) -> bool
Reset all flows in case any of the given capacity has been reduced to below
the existing flow value. Return true
if a reset has been performed since
the last computation.
fn augment(&mut self, capacities: &SquareMatrix<C>) -> EKFlows<usize, C>
[src]
Compute the maximum flow.