pub struct FlowNetwork { /* private fields */ }Expand description
A flow network with residual arcs. Each added edge creates a forward arc with its capacity
and a reverse arc of capacity zero, stored as consecutive indices 2k, 2k + 1.
Implementations§
Source§impl FlowNetwork
impl FlowNetwork
pub fn new(n: usize) -> Self
Sourcepub fn add_edge(
&mut self,
from: usize,
to: usize,
capacity: f64,
) -> Result<usize, ErrorsJSL>
pub fn add_edge( &mut self, from: usize, to: usize, capacity: f64, ) -> Result<usize, ErrorsJSL>
Adds a directed edge from → to with a non-negative capacity; returns its index.
Trait Implementations§
Source§impl Clone for FlowNetwork
impl Clone for FlowNetwork
Auto Trait Implementations§
impl Freeze for FlowNetwork
impl RefUnwindSafe for FlowNetwork
impl Send for FlowNetwork
impl Sync for FlowNetwork
impl Unpin for FlowNetwork
impl UnsafeUnpin for FlowNetwork
impl UnwindSafe for FlowNetwork
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more