graphlet_decomposition#
- graph_tool.structure.graphlet_decomposition(g, weight, niter=1000)[git][source]#
Return the graphlet decomposition of a weighted graph.
- Parameters:
- g
Graph Graph to be used. Edge directions are ignored. The graph must not have parallel edges, and self-loops are ignored.
- weight
EdgePropertyMap Nonnegative edge weights.
- niter
int(optional, default:1000) Number of iterations of the projection.
- g
- Returns:
- cliques
listofnumpy.ndarray The vertices of every graphlet (clique of the basis), in order of decreasing weight.
- mu
numpy.ndarray The weight of every graphlet.
- cliques
See also
maximal_cliquesMaximal cliques, which yield the candidate graphlets
graph_tool.inference.OverlapBlockStateOverlapping stochastic block model
Notes
The graphlet decomposition of Soufiani and Airoldi [soufiani-graphlet-2012] models the edge weights as Poisson variables, with the mean of the weight of edge \(e\) given by \(\lambda_e = \sum_c \mu_c [e\in c]\), a sum over overlapping cliques \(c\) (the graphlets) with weights \(\mu_c\). The candidate cliques are found as follows: the maximal cliques of the graph with the edges of weight at least a threshold \(t\) (initially the smallest weight) are candidates, and for each of them the search is repeated in the subgraph of its edges heavier than its lightest edge, with the next weight of its edges as the threshold; candidates contained in another one with the same smallest edge weight are discarded. The weights are then obtained by the expectation-maximization (multiplicative) updates of the maximum likelihood estimate,
\[\mu_c \leftarrow \frac{\mu_c}{|E_c|}\sum_{e\in c}\frac{w_e}{\lambda_e},\]from \(\mu_c = 1\), where \(|E_c|\) is the number of edges of clique \(c\). Isolated vertices are not part of any graphlet. The time is dominated by the enumeration of maximal cliques, which is exponential in the worst case, plus \(O(n_{\text{iter}}\sum_c |E_c|)\) for the projection.
References
[soufiani-graphlet-2012]Hossein Azari Soufiani and Edoardo M. Airoldi, “Graphlet decomposition of a weighted network”, Proceedings of the Fifteenth International Conference on Artificial Intelligence and Statistics, PMLR 22, 54-63 (2012), arXiv: 1203.2821
Examples
>>> g = gt.collection.data["lesmis"] >>> cliques, mu = gt.graphlet_decomposition(g, g.ep.value) >>> print(len(cliques), cliques[0], mu[0]) 143 [11 26 55] 14.417990123...