Struct algorithm_rs::graph::graph::Graph
source · pub struct Graph {
pub n: usize,
pub graph: Vec<Vec<(usize, usize)>>,
pub rev: Vec<Vec<usize>>,
pub in_degrees: Vec<usize>,
pub out_degrees: Vec<usize>,
pub directed: bool,
}
Fields§
§n: usize
§graph: Vec<Vec<(usize, usize)>>
§rev: Vec<Vec<usize>>
§in_degrees: Vec<usize>
§out_degrees: Vec<usize>
§directed: bool
Implementations§
source§impl Graph
impl Graph
pub fn new(n: usize, directed: bool) -> Self
pub fn connect(&mut self, from: usize, to: usize, weight: usize)
pub fn connect_unweighted(&mut self, from: usize, to: usize)
pub fn connect_with_residual(&mut self, from: usize, to: usize, weight: usize)
pub fn in_degree(&self, u: usize) -> usize
pub fn out_degree(&self, u: usize) -> usize
pub fn connected(&self, u: usize, v: usize) -> bool
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnwindSafe for Graph
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