
Calculate all isomorphic mappings between the vertices of two graphs
Source:R/topology.R
isomorphisms.RdCalculate all isomorphic mappings between the vertices of two graphs
Arguments
- graph1
The first graph.
- graph2
The second graph.
- method
Currently only ‘vf2’ is supported, see
isomorphic()for details about it and extra arguments.- ...
Extra arguments, passed to the various methods.
- callback
Optional callback function to call for each isomorphism found. If provided, the function should accept two arguments:
map12(integer vector mapping vertex IDs from graph1 to graph2, 1-based indexing) andmap21(integer vector mapping vertex IDs from graph2 to graph1, 1-based indexing). The function should returnFALSEto continue the search orTRUEto stop it. IfNULL(the default), all isomorphisms are collected and returned as a list. Only supported formethod = "vf2".Important limitation: Callback functions must NOT call any igraph functions (including simple queries like
vcount()orecount()). Doing so will cause R to crash due to reentrancy issues. Extract any needed graph information before calling the function with a callback, or use collector mode (the default) and process results afterward.
Value
If callback is NULL, returns a list of vertex sequences, corresponding
to all mappings from the first graph to the second. If callback is provided,
returns NULL invisibly.