pub struct BipartiteMatching {
pub size: usize,
pub weight: f64,
pub matching: Vec<VertexId>,
}Expand description
A maximum matching of a bipartite graph, the output of
Graph::maximum_bipartite_matching.
Fields§
§size: usizeThe number of matched pairs (the cardinality of the matching).
weight: f64The total weight of the matched edges; equal to size for
unweighted graphs.
matching: Vec<VertexId>For each vertex, the vertex it is matched to, or UNMATCHED.
Implementations§
Source§impl BipartiteMatching
impl BipartiteMatching
Sourcepub fn mate(&self, v: VertexId) -> Option<VertexId>
pub fn mate(&self, v: VertexId) -> Option<VertexId>
The vertex matched to v, or None if v is unmatched or out of range.
Sourcepub fn pairs(&self) -> Vec<(VertexId, VertexId)>
pub fn pairs(&self) -> Vec<(VertexId, VertexId)>
The matched pairs (u, v) with u < v, sorted by u.
Sourcepub fn is_matched(&self, v: VertexId) -> bool
pub fn is_matched(&self, v: VertexId) -> bool
Whether vertex v is matched.
Trait Implementations§
Source§impl Clone for BipartiteMatching
impl Clone for BipartiteMatching
Source§fn clone(&self) -> BipartiteMatching
fn clone(&self) -> BipartiteMatching
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BipartiteMatching
impl Debug for BipartiteMatching
Source§impl PartialEq for BipartiteMatching
impl PartialEq for BipartiteMatching
Source§fn eq(&self, other: &BipartiteMatching) -> bool
fn eq(&self, other: &BipartiteMatching) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BipartiteMatching
Auto Trait Implementations§
impl Freeze for BipartiteMatching
impl RefUnwindSafe for BipartiteMatching
impl Send for BipartiteMatching
impl Sync for BipartiteMatching
impl Unpin for BipartiteMatching
impl UnsafeUnpin for BipartiteMatching
impl UnwindSafe for BipartiteMatching
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