cdlib.algorithms.sbm_dl_nested

sbm_dl_nested(g_original, B_min=None, B_max=None, deg_corr=True, **kwargs)

Efficient Monte Carlo and greedy heuristic for the inference of stochastic block models. (nested)

Fit a nested non-overlapping stochastic block model (SBM) by minimizing its description length using an agglomerative heuristic. Return the lowest level found. Currently cdlib do not support hierarchical clustering. If no parameter is given, the number of blocks will be discovered automatically. Bounds for the number of communities can be provided using B_min, B_max.

Parameters:
  • g_original – igraph/networkx object
  • B_min – minimum number of communities that can be found
  • B_max – maximum number of communities that can be found
  • deg_corr – if true, use the degree corrected version of the SBM
Returns:

NodeClustering object

Example:
>>> from cdlib import algorithms
>>> import networkx as nx
>>> G = nx.karate_club_graph()
>>> coms = sbm_dl(G)
References:

Tiago P. Peixoto, “Hierarchical block structures and high-resolution model selection in large networks”, Physical Review X 4.1 (2014): 011047 .. note:: Use implementation from graph-tool library, please report to https://graph-tool.skewed.de for details