pub trait MaxFlow<'a> {
type Graph: IndexGraph<'a>;
type Flow: Num + Ord;
fn new(g: &'a Self::Graph) -> Self;
fn as_graph(&self) -> &'a Self::Graph;
fn value(&self) -> Self::Flow;
fn flow(&self, a: <Self::Graph as Graph<'a>>::Edge) -> Self::Flow;
fn solve<Us>(
&mut self,
src: <Self::Graph as Graph<'a>>::Node,
snk: <Self::Graph as Graph<'a>>::Node,
upper: Us
)
where
Us: EdgeMap<'a, Self::Graph, Self::Flow>;
fn mincut(&self) -> Vec<<Self::Graph as Graph<'a>>::Node>;
fn flow_vec(&self) -> IndexEdgeVec<'a, Self::Graph, Self::Flow> { ... }
}
Expand description
Trait for max flow algorithms.
Required Associated Types
sourcetype Graph: IndexGraph<'a>
type Graph: IndexGraph<'a>
Type of the underlying graph.
Required Methods
sourcefn solve<Us>(
&mut self,
src: <Self::Graph as Graph<'a>>::Node,
snk: <Self::Graph as Graph<'a>>::Node,
upper: Us
)where
Us: EdgeMap<'a, Self::Graph, Self::Flow>,
fn solve<Us>(
&mut self,
src: <Self::Graph as Graph<'a>>::Node,
snk: <Self::Graph as Graph<'a>>::Node,
upper: Us
)where
Us: EdgeMap<'a, Self::Graph, Self::Flow>,
Solve the maxflow problem.
The method solves the max flow problem from the source nodes
src
to the sink node snk
with the given upper
bounds on
the edges.
Provided Methods
sourcefn flow_vec(&self) -> IndexEdgeVec<'a, Self::Graph, Self::Flow>
fn flow_vec(&self) -> IndexEdgeVec<'a, Self::Graph, Self::Flow>
The flow as vector.