find_first_match

Function find_first_match 

Source
pub fn find_first_match(pattern: &Graph, target: &Graph) -> Option<NodeMapping>
Expand description

Finds the first subgraph isomorphism between the pattern and target graphs.

This is a convenience function that wraps find_subgraph_matches with max_matches = 1 and returns the first match found, if any.

ยงExamples

use vf3::{Graph, find_first_match};

// Create a simple pattern graph (a -> b)
let mut pattern = Graph::new(2);
pattern.add_edge(0, 1).unwrap();

// Create a target graph with no matching subgraph
let target = Graph::new(2); // No edges

// Try to find a match
let match_result = find_first_match(&pattern, &target);
assert!(match_result.is_none()); // No match found