Skip to main content

is_clique_cover

Function is_clique_cover 

Source
pub fn is_clique_cover(graph: &Graph, parts: &[Vec<u32>]) -> IgraphResult<bool>
Expand description

Check whether a partition of vertices forms a valid clique cover.

Each part must be a clique in the graph, and every vertex must appear exactly once.

ยงExamples

use rust_igraph::{Graph, is_clique_cover};

let g = Graph::from_edges(
    &[(0,1),(0,2),(1,2),(3,4)], false, Some(5)
).unwrap();
assert!(is_clique_cover(&g, &[vec![0,1,2], vec![3,4]]).unwrap());
assert!(!is_clique_cover(&g, &[vec![0,1,3], vec![2,4]]).unwrap());