pub trait EdmondsKarp<C: Copy + Zero + Signed + Ord + Bounded> {
Show 22 methods fn new(size: usize, source: usize, sink: usize) -> Self
    where
        Self: Sized
; fn from_matrix(source: usize, sink: usize, capacities: Matrix<C>) -> Self
    where
        Self: Sized
; fn common(&self) -> &Common<C>; fn common_mut(&mut self) -> &mut Common<C>; fn residual_successors(&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_from(&self, from: usize) -> Vec<usize>; fn flows(&self) -> Vec<((usize, usize), C)>; fn add_flow(&mut self, from: usize, to: usize, capacity: C); fn add_residual_capacity(&mut self, from: usize, to: usize, capacity: C); fn from_vec(source: usize, sink: usize, capacities: Vec<C>) -> Self
    where
        Self: Sized
, { ... } fn size(&self) -> usize { ... } fn source(&self) -> usize { ... } fn sink(&self) -> usize { ... } fn set_capacity(&mut self, from: usize, to: usize, capacity: C) { ... } 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> { ... } fn cancel_flow(&mut self, from: usize, to: usize, capacity: C) { ... }
}
Expand description

Representation of capacity and flow data.

Required Methods§

Create a new empty structure.

Panics

This function panics when source or sink is greater or equal than size.

Create a new populated structure.

Panics

This function panics when source or sink is greater or equal than the number of rows in the capacities matrix, or it the matrix is not a square one.

Common data.

Mutable common data.

List of successors with positive residual capacity and this capacity.

Residual capacity between two nodes.

Flow between two nodes.

All positive flows starting from a node.

All flows between nodes.

Add a given flow between two nodes. This should not be used directly.

Add some residual capacity.

Provided Methods§

Create a new populated structure.

Panics

This function panics when source or sink is greater or equal than the number of rows in the square matrix created from the capacities vector.

Number of nodes.

Source.

Sink.

Set capacity between two nodes.

Get total capacity.

Set total capacity.

Do not request the detailed flows as a result. The returned flows will be an empty vector.

Are detailed flows requested?

Compute the maximum flow.

Internal: cancel a flow capacity between two nodes.

Implementors§