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: F

The 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]

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]

fn value(&self) -> Self::Flow[src]

Return the value of the latest computed flow value.

fn flow(&self, a: <Self::Graph as GraphType<'a>>::Edge) -> Self::Flow[src]

The flow of an Edge.

fn flow_vec(&self) -> EdgeVec<'a, &'a Self::Graph, Self::Flow>[src]

The flow as vector.

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]

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]

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]

fn set_lowers<F>(&mut self, lower: F) where
    F: Fn(<Self::Graph as GraphType<'a>>::Edge) -> Self::Flow
[src]

fn set_uppers<F>(&mut self, upper: F) where
    F: Fn(<Self::Graph as GraphType<'a>>::Edge) -> Self::Flow
[src]

fn set_costs<F>(&mut self, cost: F) where
    F: Fn(<Self::Graph as GraphType<'a>>::Edge) -> Self::Flow
[src]

Auto Trait Implementations

impl<'a, G, F> RefUnwindSafe for NetworkSimplex<'a, G, F> where
    F: RefUnwindSafe,
    G: RefUnwindSafe

impl<'a, G, F> Send for NetworkSimplex<'a, G, F> where
    F: Send,
    G: Sync

impl<'a, G, F> Sync for NetworkSimplex<'a, G, F> where
    F: Sync,
    G: Sync

impl<'a, G, F> Unpin for NetworkSimplex<'a, G, F> where
    F: Unpin

impl<'a, G, F> UnwindSafe for NetworkSimplex<'a, G, F> where
    F: UnwindSafe,
    G: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.