Struct rs_graph::mcf::simplex::NetworkSimplex [−][src]
pub struct NetworkSimplex<'a, G, F> {
pub pricing: Pricing,
pub artificial_cost: Option<F>,
pub infinite: F,
// some fields omitted
}Fields
pricing: Pricingartificial_cost: Option<F>The artificial cost value.
Should be larger than the value of any augmenting cycle. If
None (the default) the artificial cost is set to
(max(max(cost), 0) + 1) * n, which should be large enough.
infinite: FThe infinite flow value.
Capacities greater than or equal to this are considered
unbounded and flows are considered infinite. The default is
F::max_value(). For floating-point types F::infinity() can
be used as well.
Implementations
impl<'a, G, F> NetworkSimplex<'a, G, F> where
G: IndexDigraph<'a>,
F: NumCast + NumAssign + Signed + PartialOrd + Copy + FromPrimitive, [src]
impl<'a, G, F> NetworkSimplex<'a, G, F> where
G: IndexDigraph<'a>,
F: NumCast + NumAssign + Signed + PartialOrd + Copy + FromPrimitive, [src]pub fn num_iterations(&self) -> usize[src]
Trait Implementations
impl<'a, G, F> MinCostFlow<'a> for NetworkSimplex<'a, G, F> where
G: IndexDigraph<'a>,
F: Bounded + NumCast + NumAssign + PartialOrd + Copy + FromPrimitive + Signed, [src]
impl<'a, G, F> MinCostFlow<'a> for NetworkSimplex<'a, G, F> where
G: IndexDigraph<'a>,
F: Bounded + NumCast + NumAssign + PartialOrd + Copy + FromPrimitive + Signed, [src]fn solve(&mut self) -> SolutionState[src]
fn solve(&mut self) -> SolutionState[src]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.
type Graph = G
type Flow = F
fn new(g: &'a Self::Graph) -> Self[src]
fn as_graph(&self) -> &'a Self::Graph[src]
fn balance(&self, u: <Self::Graph as GraphType<'a>>::Node) -> Self::Flow[src]
fn set_balance(
&mut self,
u: <Self::Graph as GraphType<'a>>::Node,
balance: Self::Flow
)[src]
&mut self,
u: <Self::Graph as GraphType<'a>>::Node,
balance: Self::Flow
)
fn lower(&self, e: <Self::Graph as GraphType<'a>>::Edge) -> Self::Flow[src]
fn set_lower(&mut self, e: <Self::Graph as GraphType<'a>>::Edge, lb: Self::Flow)[src]
fn upper(&self, e: <Self::Graph as GraphType<'a>>::Edge) -> Self::Flow[src]
fn set_upper(&mut self, e: <Self::Graph as GraphType<'a>>::Edge, ub: Self::Flow)[src]
fn cost(&self, e: <Self::Graph as GraphType<'a>>::Edge) -> Self::Flow[src]
fn set_cost(
&mut self,
e: <Self::Graph as GraphType<'a>>::Edge,
cost: Self::Flow
)[src]
&mut self,
e: <Self::Graph as GraphType<'a>>::Edge,
cost: Self::Flow
)
fn solution_state(&self) -> SolutionState[src]
fn solution_state(&self) -> SolutionState[src]Return the current solution state.
fn set_balances<F>(&mut self, balance: F) where
F: Fn(<Self::Graph as GraphType<'a>>::Node) -> Self::Flow, [src]
F: Fn(<Self::Graph as GraphType<'a>>::Node) -> Self::Flow,
fn set_lowers<F>(&mut self, lower: F) where
F: Fn(<Self::Graph as GraphType<'a>>::Edge) -> Self::Flow, [src]
F: Fn(<Self::Graph as GraphType<'a>>::Edge) -> Self::Flow,
fn set_uppers<F>(&mut self, upper: F) where
F: Fn(<Self::Graph as GraphType<'a>>::Edge) -> Self::Flow, [src]
F: Fn(<Self::Graph as GraphType<'a>>::Edge) -> Self::Flow,
fn set_costs<F>(&mut self, cost: F) where
F: Fn(<Self::Graph as GraphType<'a>>::Edge) -> Self::Flow, [src]
F: Fn(<Self::Graph as GraphType<'a>>::Edge) -> Self::Flow,
Auto Trait Implementations
impl<'a, G, F> RefUnwindSafe for NetworkSimplex<'a, G, F> where
F: RefUnwindSafe,
G: RefUnwindSafe,
F: RefUnwindSafe,
G: RefUnwindSafe,
impl<'a, G, F> Send for NetworkSimplex<'a, G, F> where
F: Send,
G: Sync,
F: Send,
G: Sync,
impl<'a, G, F> Sync for NetworkSimplex<'a, G, F> where
F: Sync,
G: Sync,
F: Sync,
G: Sync,
impl<'a, G, F> Unpin for NetworkSimplex<'a, G, F> where
F: Unpin,
F: Unpin,
impl<'a, G, F> UnwindSafe for NetworkSimplex<'a, G, F> where
F: UnwindSafe,
G: RefUnwindSafe,
F: UnwindSafe,
G: RefUnwindSafe,