is_subgraph

Function is_subgraph 

Source
pub fn is_subgraph(pattern: &Graph, target: &Graph) -> bool
Expand description

Check if the pattern is a subgraph of the target (subgraph isomorphism test).

This is a convenience function equivalent to find_matches(pattern, target).exists().

ยงExamples

let mut pattern = Graph::new(2);
pattern.add_edge(0, 1)?;
let mut target = Graph::new(3);
target.add_edge(0, 1)?;
target.add_edge(1, 2)?;

assert!(is_subgraph(&pattern, &target));