[][src]Trait pathfinding::directed::edmonds_karp::EdmondsKarp

pub trait EdmondsKarp<C: Copy + Zero + Signed + Ord + Bounded> {
    pub fn new(size: usize, source: usize, sink: usize) -> Self
    where
        Self: Sized
;
pub fn from_matrix(
        source: usize,
        sink: usize,
        capacities: Matrix<C>
    ) -> Self
    where
        Self: Sized
;
pub fn common(&self) -> &Common<C>;
pub fn common_mut(&mut self) -> &mut Common<C>;
pub fn residual_successors(&self, from: usize) -> Vec<(usize, C)>;
pub fn residual_capacity(&self, from: usize, to: usize) -> C;
pub fn flow(&self, from: usize, to: usize) -> C;
pub fn flows_from(&self, from: usize) -> Vec<usize>;
pub fn flows(&self) -> Vec<((usize, usize), C)>;
pub fn add_flow(&mut self, from: usize, to: usize, capacity: C);
pub fn add_residual_capacity(&mut self, from: usize, to: usize, capacity: C); #[must_use] pub fn from_vec(source: usize, sink: usize, capacities: Vec<C>) -> Self
    where
        Self: Sized
, { ... }
pub fn size(&self) -> usize { ... }
pub fn source(&self) -> usize { ... }
pub fn sink(&self) -> usize { ... }
pub fn set_capacity(&mut self, from: usize, to: usize, capacity: C) { ... }
pub fn total_capacity(&self) -> C { ... }
pub fn set_total_capacity(&mut self, capacity: C) { ... }
pub fn omit_detailed_flows(&mut self) { ... }
pub fn detailed_flows(&self) -> bool { ... }
pub fn augment(&mut self) -> EKFlows<usize, C> { ... }
pub fn cancel_flow(&mut self, from: usize, to: usize, capacity: C) { ... } }

Representation of capacity and flow data.

Required methods

pub fn new(size: usize, source: usize, sink: usize) -> Self where
    Self: Sized
[src]

Create a new empty structure.

Panics

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

pub fn from_matrix(source: usize, sink: usize, capacities: Matrix<C>) -> Self where
    Self: Sized
[src]

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.

pub fn common(&self) -> &Common<C>[src]

Common data.

pub fn common_mut(&mut self) -> &mut Common<C>[src]

Mutable common data.

pub fn residual_successors(&self, from: usize) -> Vec<(usize, C)>[src]

List of successors with positive residual capacity and this capacity.

pub fn residual_capacity(&self, from: usize, to: usize) -> C[src]

Residual capacity between two nodes.

pub fn flow(&self, from: usize, to: usize) -> C[src]

Flow between two nodes.

pub fn flows_from(&self, from: usize) -> Vec<usize>[src]

All positive flows starting from a node.

pub fn flows(&self) -> Vec<((usize, usize), C)>[src]

All flows between nodes.

pub fn add_flow(&mut self, from: usize, to: usize, capacity: C)[src]

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

pub fn add_residual_capacity(&mut self, from: usize, to: usize, capacity: C)[src]

Add some residual capacity.

Loading content...

Provided methods

#[must_use]pub fn from_vec(source: usize, sink: usize, capacities: Vec<C>) -> Self where
    Self: Sized
[src]

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.

pub fn size(&self) -> usize[src]

Number of nodes.

pub fn source(&self) -> usize[src]

Source.

pub fn sink(&self) -> usize[src]

Sink.

pub fn set_capacity(&mut self, from: usize, to: usize, capacity: C)[src]

Set capacity between two nodes.

pub fn total_capacity(&self) -> C[src]

Get total capacity.

pub fn set_total_capacity(&mut self, capacity: C)[src]

Set total capacity.

pub fn omit_detailed_flows(&mut self)[src]

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

pub fn detailed_flows(&self) -> bool[src]

Are detailed flows requested?

pub fn augment(&mut self) -> EKFlows<usize, C>[src]

Compute the maximum flow.

pub fn cancel_flow(&mut self, from: usize, to: usize, capacity: C)[src]

Internal: cancel a flow capacity between two nodes.

Loading content...

Implementors

impl<C: Copy + Zero + Signed + Eq + Ord + Bounded> EdmondsKarp<C> for SparseCapacity<C>[src]

impl<C: Copy + Zero + Signed + Ord + Bounded> EdmondsKarp<C> for DenseCapacity<C>[src]

Loading content...