pub struct MatchingResult {
pub matching_size: usize,
pub matching_weight: f64,
pub matching: Vec<Option<u32>>,
}Expand description
Result of maximum_bipartite_matching or
maximum_bipartite_matching_weighted.
§Fields
matching_size— number of matched vertex pairs.matching_weight— total weight of matched edges (equalsmatching_sizefor unweighted).matching— per-vertex match:matching[v]is the partner ofv, orNoneifvis unmatched.
use rust_igraph::{create, maximum_bipartite_matching, MatchingResult};
// K_{2,2}: 0-2, 0-3, 1-2, 1-3
let g = create(&[(0, 2), (0, 3), (1, 2), (1, 3)], 4, false).unwrap();
let types = vec![false, false, true, true];
let r = maximum_bipartite_matching(&g, &types).unwrap();
assert_eq!(r.matching_size, 2);Fields§
§matching_size: usizeNumber of matched vertex pairs.
matching_weight: f64Total weight of matched edges (1.0 per edge if unweighted).
matching: Vec<Option<u32>>Per-vertex matching partner: Some(j) if matched to j, None if unmatched.
Trait Implementations§
Source§impl Clone for MatchingResult
impl Clone for MatchingResult
Source§fn clone(&self) -> MatchingResult
fn clone(&self) -> MatchingResult
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 MatchingResult
impl RefUnwindSafe for MatchingResult
impl Send for MatchingResult
impl Sync for MatchingResult
impl Unpin for MatchingResult
impl UnsafeUnpin for MatchingResult
impl UnwindSafe for MatchingResult
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