Skip to main content

matching_count_sequence

Function matching_count_sequence 

Source
pub fn matching_count_sequence(graph: &Graph) -> IgraphResult<Vec<u64>>
Expand description

Compute the matching count sequence [m(G,0), m(G,1), …].

m(G, k) is the number of k-matchings (sets of k pairwise non-adjacent edges). m(G, 0) = 1 always.

§Examples

use rust_igraph::{Graph, matching_count_sequence};

// K_3 (triangle): m(0)=1, m(1)=3 → [1, 3]
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert_eq!(matching_count_sequence(&g).unwrap(), vec![1, 3]);