Count the isomorphic mappings between a graph and the subgraphs of another graph
count_subgraph_isomorphisms(pattern, target, method = c("lad", "vf2"), ...)
The smaller graph, it might be directed or undirected. Undirected graphs are treated as directed graphs with mutual edges.
The bigger graph, it might be directed or undirected. Undirected graphs are treated as directed graphs with mutual edges.
The method to use. Possible values: ‘lad’, ‘vf2’. See their details below.
Additional arguments, passed to the various methods.
Logical scalar, TRUE
if the pattern
is
isomorphic to a (possibly induced) subgraph of target
.
This is the LAD algorithm by Solnon, see the reference below. It has the following extra arguments:
If not NULL
, then it specifies matching
restrictions. It must be a list of target
vertex sets, given
as numeric vertex ids or symbolic vertex names. The length of the
list must be vcount(pattern)
and for each vertex in
pattern
it gives the allowed matching vertices in
target
. Defaults to NULL
.
Logical scalar, whether to search for an induced
subgraph. It is FALSE
by default.
The processor time limit for the computation, in
seconds. It defaults to Inf
, which means no limit.
This method uses the VF2 algorithm by Cordella, Foggia et al., see references below. It supports vertex and edge colors and have the following extra arguments:
Optional integer vectors giving the
colors of the vertices for colored graph isomorphism. If they
are not given, but the graph has a “color” vertex attribute,
then it will be used. If you want to ignore these attributes, then
supply NULL
for both of these arguments. See also examples
below.
Optional integer vectors giving the
colors of the edges for edge-colored (sub)graph isomorphism. If they
are not given, but the graph has a “color” edge attribute,
then it will be used. If you want to ignore these attributes, then
supply NULL
for both of these arguments.
LP Cordella, P Foggia, C Sansone, and M Vento: An improved algorithm for matching large graphs, Proc. of the 3rd IAPR TC-15 Workshop on Graphbased Representations in Pattern Recognition, 149--159, 2001.
C. Solnon: AllDifferent-based Filtering for Subgraph Isomorphism, Artificial Intelligence 174(12-13):850--864, 2010.
Other graph isomorphism: count_isomorphisms
,
graph.count.isomorphisms.vf2
;
graph.get.isomorphisms.vf2
,
isomorphisms
;
graph.get.subisomorphisms.vf2
,
subgraph_isomorphisms
;
graph.isoclass
,
graph.isoclass.subgraph
,
isomorphism_class
;
graph.isocreate
,
graph_from_isomorphism_class
;
graph.isomorphic
,
graph.isomorphic.34
,
graph.isomorphic.bliss
,
graph.isomorphic.vf2
,
is_isomorphic_to
, isomorphic
;
graph.subisomorphic.lad
,
graph.subisomorphic.vf2
,
is_subgraph_isomorphic_to
,
subgraph_isomorphic