# Stochastic block model

The **stochastic block model** is a generative model for random graphs. This model tends to produce graphs containing *communities*, subsets characterized by being connected with one another with particular edge densities. For example, edges may be more common within communities than between communities. The stochastic block model is important in statistics, machine learning, and network science, where it serves as a useful benchmark for the task of recovering community structure in graph data.

## Definition

The stochastic block model takes the following parameters:

- The number of vertices;
- a partition of the vertex set
into disjoint subsets
, called
*communities*; - a symmetric matrix of edge probabilities.

The edge set is then sampled at random as follows: any two vertices and are connected by an edge with probability .

## Special cases

If the probability matrix is a constant, in the sense that for all , then the result is the Erdős–Rényi model . This case is degenerate—the partition into communities becomes irrelevant—but it illustrates a close relationship to the Erdős–Rényi model.

The *planted partition model* is the special case that the values of the probability matrix
are a constant
on the diagonal and another constant
off the diagonal. Thus two vertices within the same community share an edge with probability
, while two vertices in different communities share an edge with probability
. Sometimes it is this restricted model that is called the stochastic block model. The case where
is called an *assortative* model, while the case
is called *dissortative*.

Returning to the general stochastic block model, a model is called *strongly assortative* if
whenever
: all diagonal entries dominate all off-diagonal entries. A model is called *weakly assortative* if
whenever
: each diagonal entry is only required to dominate the rest of its own row and column.^{[1]} *Dissortative* forms of this terminology exist, by reversing all inequalities. Algorithmic recovery is often easier against block models with assortative or dissortative conditions of this form.^{[1]}

## Typical statistical tasks

Much of the literature on algorithmic community detection addresses three statistical tasks: detection, partial recovery, and exact recovery.

### Detection

The goal of detection algorithms is simply to determine, given a sampled graph, whether the graph has latent community structure. More precisely, a graph might be generated, with some known prior probability, from a known stochastic block model, and otherwise from a similar Erdos-Renyi model. The algorithmic task is to correctly identify which of these two underlying models generated the graph.^{[2]}

### Partial recovery

In partial recovery, the goal is to approximately determine the latent partition into communities, in the sense of finding a partition that is correlated with the true partition significantly better than a random guess.^{[3]}

### Exact recovery

In exact recovery, the goal is to recover the latent partition into communities exactly. The community sizes and probability matrix may be known^{[4]} or unknown.^{[5]}

## Statistical lower bounds and threshold behavior

Stochastic block models exhibit a sharp threshold effect reminiscent of percolation thresholds.^{[6]}^{[2]}^{[7]} Suppose that we allow the size
of the graph to grow, keeping the community sizes in fixed proportions. If the probability matrix remains fixed, tasks such as partial and exact recovery become feasible for all non-degenerate parameter settings. However, if we scale down the probability matrix at a suitable rate as
increases, we observe a sharp phase transition: for certain settings of the parameters, it will become possible to achieve recovery with probability tending to 1, whereas on the opposite side of the parameter threshold, the probability of recovery tends to 0 no matter what algorithm is used.

For partial recovery, the appropriate scaling is to take for fixed , resulting in graphs of constant average degree. In the case of two equal-sized communities, in the assortative planted partition model with probability matrix

partial recovery is feasible^{[3]} with probability
whenever
, whereas any estimator fails^{[2]} partial recovery with probability
whenever
.

For exact recovery, the appropriate scaling is to take
, resulting in graphs of logarithmic average degree. Here a similar threshold exists: for the assortative planted partition model with
equal-sized communities, the threshold lies at
. In fact, the exact recovery threshold is known for the fully general stochastic block model.^{[4]}

## Algorithms

In principle, exact recovery can be solved in its feasible range using maximum likelihood, but this amounts to solving a constrained or regularized cut problem such as minimum bisection that is typically NP-complete. Hence, no known efficient algorithms will correctly compute the maximum-likelihood estimate in the worst case.

However, a wide variety of algorithms perform well in the average case, and many high-probability performance guarantees have been proven for algorithms in both the partial and exact recovery settings. Successful algorithms include spectral clustering of the vertices,^{[8]}^{[3]}^{[4]}^{[9]} semidefinite programming,^{[1]}^{[7]} and forms of belief propagation,^{[6]}^{[10]} among others.

## Variants

Several variants of the model exist. One minor tweak allocates vertices to communities randomly, according to a categorical distribution, rather than in a fixed partition.^{[4]} More significant variants include the censored block model and the mixed-membership block model.^{[11]}

## References

- 1 2 3 Amini, Arash A.; Levina, Elizaveta (June 2014). "On semidefinite relaxations for the block model". arXiv:1406.5647.
- 1 2 3 Mossel, Elchanan; Neeman, Joe; Sly, Allan (February 2012). "Stochastic Block Models and Reconstruction". arXiv:1202.1499.
- 1 2 3 Massoulie, Laurent (November 2013). "Community detection thresholds and the weak Ramanujan property". arXiv:1311.3085.
- 1 2 3 4 Abbe, Emmanuel; Sandon, Colin (March 2015). "Community detection in general stochastic block models: fundamental limits and efficient recovery algorithms". arXiv:1503.00609.
- ↑ Abbe, Emmanuel; Sandon, Colin (June 2015). "Recovering communities in the general stochastic block model without knowing the parameters". arXiv:1506.03729.
- 1 2 Decelle, Aurelien; Krzakala, Florent; Moore, Cristopher; Zdeborova, Lenka (September 2011). "Asymptotic analysis of the stochastic block model for modular networks and its algorithmic applications".
*Physical Review E*.**84**. arXiv:1109.3041. Bibcode:2011PhRvE..84f6106D. doi:10.1103/PhysRevE.84.066106. - 1 2 Abbe, Emmanuel; Bandeira, Afonso S.; Hall, Georgina (May 2014). "Exact Recovery in the Stochastic Block Model". arXiv:1405.3267.
- ↑ Krzakala, Florent; Moore, Cristopher; Mossel, Elchanan; Neeman, Joe; Sly, Allan; Lenka, Lenka; Zhang, Pan (October 2013). "Spectral redemption in clustering sparse networks".
*Proceedings of the National Academy of Sciences*. arXiv:1306.5550. Bibcode:2013PNAS..11020935K. doi:10.1073/pnas.1312486110. - ↑ Lei, Jing; Rinaldo, Alessandro (February 2015). "Consistency of spectral clustering in stochastic block models".
*The Annals of Statistics*.**43**(1): 215–237. arXiv:1312.2050. doi:10.1214/14-AOS1274. ISSN 0090-5364. - ↑ Mossel, Elchanan; Neeman, Joe; Sly, Allan (September 2013). "Belief Propagation, Robust Reconstruction, and Optimal Recovery of Block Models". arXiv:1309.1380.
- ↑ Airoldi, Edoardo; Blei, David; Feinberg, Stephen; Xing, Eric (May 2007). "Mixed membership stochastic blockmodels". arXiv:0705.4485.