Trait pathfinding::EdmondsKarp
[−]
[src]
pub trait EdmondsKarp<C: Clone + Zero + Signed + PartialOrd + Bounded> { fn common(&self) -> &Common<C>; fn common_mut(&mut self) -> &mut Common<C>; fn residual_neighbours(&self, from: usize) -> Vec<(usize, C)>; fn residual_capacity(&self, from: usize, to: usize) -> C; fn flow(&self, from: usize, to: usize) -> C; fn flows(&self) -> Vec<((usize, usize), C)>; fn set_capacity(&mut self, from: usize, to: usize, capacity: C); fn add_flow(&mut self, from: usize, to: usize, capacity: C); fn reset_if_needed(&mut self); fn size(&self) -> usize { ... } fn source(&self) -> usize { ... } fn sink(&self) -> usize { ... } fn total_capacity(&self) -> C { ... } fn set_total_capacity(&mut self, capacity: C) { ... } fn omit_detailed_flows(&mut self) { ... } fn detailed_flows(&self) -> bool { ... } fn augment(&mut self) -> EKFlows<usize, C> { ... } }
Representation of capacity and flow data.
Required Methods
fn common(&self) -> &Common<C>
Common data.
fn common_mut(&mut self) -> &mut Common<C>
Mutable common data.
fn residual_neighbours(&self, from: usize) -> Vec<(usize, C)>
List of neighbours with positive residual capacity and this capacity.
fn residual_capacity(&self, from: usize, to: usize) -> C
Residual capacity between two nodes.
fn flow(&self, from: usize, to: usize) -> C
Flow between two nodes.
fn flows(&self) -> Vec<((usize, usize), C)>
All flows between nodes.
fn set_capacity(&mut self, from: usize, to: usize, capacity: C)
Set capacity between two nodes. This might trigger a reset of the already computed flows.
fn add_flow(&mut self, from: usize, to: usize, capacity: C)
Add a given flow between two nodes. This should not be used directly.
fn reset_if_needed(&mut self)
Reset the flows if needed.
Provided Methods
fn size(&self) -> usize
Number of nodes.
fn source(&self) -> usize
Source.
fn sink(&self) -> usize
Sink.
fn total_capacity(&self) -> C
Get total capacity.
fn set_total_capacity(&mut self, capacity: C)
Set total capacity.
fn omit_detailed_flows(&mut self)
Do not request the detailed flows as a result. The returned flows will be an empty vector.
fn detailed_flows(&self) -> bool
Are detailed flows requested?
fn augment(&mut self) -> EKFlows<usize, C>
Compute the maximum flow.
Implementors
impl<C: Clone + Zero + Signed + Eq + PartialOrd + Bounded> EdmondsKarp<C> for SparseCapacity<C>
impl<C: Clone + Zero + Signed + PartialOrd + Bounded> EdmondsKarp<C> for DenseCapacity<C>