This function searches for motifs in a graph and calls a user-provided callback function for each motif found.
Arguments
- graph
Graph object, the input graph.
- size
The size of the motif, currently sizes 3 and 4 are supported in directed graphs and sizes 3-6 in undirected graphs.
- cut_prob
Numeric vector giving the probabilities that the search graph is cut at a certain level. Its length should be the same as the size of the motif (the
sizeargument). IfNULL, the default, no cuts are made.- callback
A function to call for each motif found. The function should accept two arguments:
vids(integer vector of vertex IDs in the motif, 1-based indexing) andisoclass(the isomorphism class of the motif, 1-based). The function should returnTRUEto continue the search orFALSEto stop it.
Value
NULL, invisibly. This function is called for its side effects (calling
the callback function for each motif).
See also
motifs(), count_motifs(), isomorphism_class()
Other graph motifs:
count_motifs(),
dyad_census(),
motifs(),
sample_motifs()
