pub struct MatchingGraph { /* private fields */ }Implementations§
Source§impl MatchingGraph
impl MatchingGraph
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn from_graph<G: Graph>(graph: &G) -> Self
pub fn has_edge(&self, from: usize, to: usize) -> bool
pub fn add_edge(&mut self, from: usize, to: usize)
pub fn remove_edge(&mut self, from: usize, to: usize)
Sourcepub fn create_vertex_if_not_exists(&mut self, vertex: usize)
pub fn create_vertex_if_not_exists(&mut self, vertex: usize)
if given vertex is removed but has neighbors - will be recovered as is
pub fn add_vertex(&mut self, vertex: MatchingVertex)
pub fn size(&self) -> usize
pub fn max_vertex_index(&self) -> usize
pub fn vertices(&self) -> MatchingGraphVerticesIter<'_> ⓘ
Sourcepub fn neighbors(&self, vertex: usize) -> &Vec<usize>
pub fn neighbors(&self, vertex: usize) -> &Vec<usize>
can crash if vertex >= self.vertices.len()
pub fn remove_vertex(&mut self, vertex: usize)
pub fn has_odd_size_component(&mut self) -> bool
pub fn perfect_matchings(&mut self) -> Vec<Matching>
Trait Implementations§
Source§impl Clone for MatchingGraph
impl Clone for MatchingGraph
Source§fn clone(&self) -> MatchingGraph
fn clone(&self) -> MatchingGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MatchingGraph
impl RefUnwindSafe for MatchingGraph
impl Send for MatchingGraph
impl Sync for MatchingGraph
impl Unpin for MatchingGraph
impl UnwindSafe for MatchingGraph
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