Skip to main content

get_isomorphisms_vf2

Function get_isomorphisms_vf2 

Source
pub fn get_isomorphisms_vf2(
    graph1: &Graph,
    graph2: &Graph,
    vertex_color1: Option<&[u32]>,
    vertex_color2: Option<&[u32]>,
    edge_color1: Option<&[u32]>,
    edge_color2: Option<&[u32]>,
) -> IgraphResult<Vec<Vec<u32>>>
Expand description

Collect every VF2 isomorphic mapping between two graphs.

Each returned vector is a map21 mapping: position j holds the vertex of graph1 that vertex j of graph2 maps to. The list is empty when the graphs are not isomorphic. Colour arguments behave as in isomorphic_vf2.

§Errors

Same conditions as isomorphic_vf2.

§Examples

use rust_igraph::{Graph, get_isomorphisms_vf2};

// A single edge has two automorphisms (identity and the swap).
let mut g = Graph::new(2, false).unwrap();
g.add_edge(0, 1).unwrap();
let maps = get_isomorphisms_vf2(&g, &g, None, None, None, None).unwrap();
assert_eq!(maps.len(), 2);