Struct MfGraph

Source
pub struct MfGraph<Cap> { /* private fields */ }

Implementations§

Source§

impl<Cap> MfGraph<Cap>
where Cap: Integral,

Source

pub fn new(n: usize) -> MfGraph<Cap>

Source

pub fn add_edge(&mut self, from: usize, to: usize, cap: Cap) -> usize

Source§

impl<Cap> MfGraph<Cap>
where Cap: Integral,

Source

pub fn get_edge(&self, i: usize) -> Edge<Cap>

Source

pub fn edges(&self) -> Vec<Edge<Cap>>

Source

pub fn change_edge(&mut self, i: usize, new_cap: Cap, new_flow: Cap)

Source

pub fn flow(&mut self, s: usize, t: usize) -> Cap

s != t must hold, otherwise it panics.

Source

pub fn flow_with_capacity(&mut self, s: usize, t: usize, flow_limit: Cap) -> Cap

§Parameters
  • s != t must hold, otherwise it panics.
  • flow_limit >= 0
Source

pub fn min_cut(&self, s: usize) -> Vec<bool>

Trait Implementations§

Source§

impl<Cap: Default> Default for MfGraph<Cap>

Source§

fn default() -> MfGraph<Cap>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<Cap> Freeze for MfGraph<Cap>

§

impl<Cap> RefUnwindSafe for MfGraph<Cap>
where Cap: RefUnwindSafe,

§

impl<Cap> Send for MfGraph<Cap>
where Cap: Send,

§

impl<Cap> Sync for MfGraph<Cap>
where Cap: Sync,

§

impl<Cap> Unpin for MfGraph<Cap>
where Cap: Unpin,

§

impl<Cap> UnwindSafe for MfGraph<Cap>
where Cap: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.