Skip to main content

get_subisomorphisms_lad

Function get_subisomorphisms_lad 

Source
pub fn get_subisomorphisms_lad(
    pattern: &Graph,
    target: &Graph,
    domains: Option<&[Vec<u32>]>,
    induced: bool,
) -> IgraphResult<Vec<Vec<u32>>>
Expand description

Enumerate all subgraph isomorphisms from pattern into target with the LAD algorithm. Each returned vector maps pattern vertex i (by index) to its target vertex.

Arguments mirror subisomorphic_lad. A null pattern yields a single empty mapping. Port of igraph_subisomorphic_lad with a non-null maps.

ยงExamples

use rust_igraph::{Graph, get_subisomorphisms_lad};

// A single edge embeds into a triangle in six ordered ways.
let mut target = Graph::new(3, false)?;
for (u, v) in [(0, 1), (1, 2), (2, 0)] {
    target.add_edge(u, v)?;
}
let mut pattern = Graph::new(2, false)?;
pattern.add_edge(0, 1)?;
let maps = get_subisomorphisms_lad(&pattern, &target, None, false)?;
assert_eq!(maps.len(), 6);