3.1. igraph_motifs_randesu — Count the number of motifs in a graph

int igraph_motifs_randesu(const igraph_t *graph, igraph_vector_t *hist, 
			  int size, const igraph_vector_t *cut_prob);

Motifs are small subgraphs of a given structure in a graph. It is argued that the motif profile (ie. the number of different motifs in the graph) is characteristic for different types of networks and network function is related to the motifs in the graph.

This function is able to find the different motifs of size three and four (ie. the number of different subgraphs with three and four vertices) in the network. (This limitation is the result of the lack of code to decide graph isomorphism for larger graphs.)

In a big network the total number of motifs can be very large, so it takes a lot of time to find all of them, a sampling method can be used. This function is capable of doing sampling via the cut_prob argument. This argument gives the probability that a branch of the motif search tree will not be explored. See S. Wernicke and F. Rasche: FANMOD: a tool for fast network motif detection, Bioinformatics 22(9), 1152--1153, 2006 for details.

Set the cut_prob argument to a zero vector for finding all motifs.

Directed motifs will be counted in directed graphs and undirected motifs in undirected graphs.

Arguments: 

graph:

The graph to find the motifs in.

hist:

The result of the computation, it gives the number of motifs found for each isomorphism class. See igraph_isoclass() for help about isomorphism classes.

size:

The size of the motifs to search for. Only three and four are implemented currently. The limitation is not in the motif finding code, but the graph isomorphism code.

cut_prob:

Vector of probabilities for cutting the search tree at a given level. The first element is the first level, etc. Supply all zeros here (of length size) to find all motifs in a graph.

Returns: 

Error code.

See also: 

igraph_motifs_randesu_estimate() for estimating the number of motifs in a graph, this can help to set the cut_prob parameter; igraph_motifs_randesu_no() to calculate the total number of motifs of a given size in a graph.

Time complexity: TODO.