pub struct Edge {
pub from: usize,
pub to: usize,
pub flow: i32,
pub capacity: i32,
pub residual: Weak<RefCell<Edge>>,
pub cost: i32,
pub original_cost: i32,
}
Expand description
This edge type is designed specifically for networkflow graphs.
Fields§
§from: usize
§to: usize
§flow: i32
§capacity: i32
§residual: Weak<RefCell<Edge>>
a weak reference to the residual edge that’s pointing in the opposite direction
cost: i32
§original_cost: i32
Implementations§
Source§impl Edge
impl Edge
pub fn new(from: usize, to: usize, capacity: i32) -> [Rc<RefCell<Self>>; 2]
pub fn new_with_cost( from: usize, to: usize, capacity: i32, cost: i32, ) -> [Rc<RefCell<Self>>; 2]
pub fn is_residual(&self) -> bool
pub fn reamaining_capacity(&self) -> i32
pub fn augment(&mut self, bottleneck: i32)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Edge
impl !RefUnwindSafe for Edge
impl !Send for Edge
impl !Sync for Edge
impl Unpin for Edge
impl !UnwindSafe for Edge
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