graphlet_decomposition

graphlet_decomposition#

graph_tool.structure.graphlet_decomposition(g, weight, niter=1000)[git][source]#

Return the graphlet decomposition of a weighted graph.

Parameters:
gGraph

Graph to be used. Edge directions are ignored. The graph must not have parallel edges, and self-loops are ignored.

weightEdgePropertyMap

Nonnegative edge weights.

niterint (optional, default: 1000)

Number of iterations of the projection.

Returns:
cliqueslist of numpy.ndarray

The vertices of every graphlet (clique of the basis), in order of decreasing weight.

munumpy.ndarray

The weight of every graphlet.

See also

maximal_cliques

Maximal cliques, which yield the candidate graphlets

graph_tool.inference.OverlapBlockState

Overlapping 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...