pub fn subisomorphic(graph1: &Graph, graph2: &Graph) -> IgraphResult<bool>Expand description
Decide whether graph2 is isomorphic to a subgraph of graph1.
Mirrors igraph_subisomorphic, which simply delegates to the VF2 subgraph
engine for all inputs. graph1 is the (larger) target and graph2 the
(smaller) pattern; both must share directedness. Like upstream, non-simple
graphs are not supported by the VF2 backend.
Only the Boolean verdict is returned — call subisomorphic_vf2 directly
when you also need a concrete embedding.
§Errors
Propagates the VF2 backend’s errors (e.g. directedness mismatch, or a graph the engine rejects).
§Examples
use rust_igraph::{Graph, subisomorphic};
// A single edge embeds into a triangle.
let mut triangle = Graph::new(3, false).unwrap();
for (u, v) in [(0, 1), (1, 2), (2, 0)] {
triangle.add_edge(u, v).unwrap();
}
let mut edge = Graph::new(2, false).unwrap();
edge.add_edge(0, 1).unwrap();
assert!(subisomorphic(&triangle, &edge).unwrap());