Detectability thresholds and optimal algorithms for community structure in dynamic networks

We study the fundamental limits on learning latent community structure in dynamic networks. Specifically, we study dynamic stochastic block models where nodes change their community membership over time, but where edges are generated independently at each time step. In this setting (which is a special case of several existing models), we are able to derive the detectability threshold exactly, as a function of the rate of change and the strength of the communities. Below this threshold, we claim that no algorithm can identify the communities better than chance. We then give two algorithms that are optimal in the sense that they succeed all the way down to this limit. The first uses belief propagation (BP), which gives asymptotically optimal accuracy, and the second is a fast spectral clustering algorithm, based on linearizing the BP equations. We verify our analytic and algorithmic results via numerical simulation, and close with a brief discussion of extensions and open questions.


page 6

page 7


Spectral redemption: clustering sparse networks

Spectral algorithms are classic approaches to clustering and community d...

Community Detection with Node Attributes and its Generalization

Community detection algorithms are fundamental tools to understand organ...

Clustering Network Vertices in Sparse Contextual Multilayer Networks

We consider the problem of learning the latent community structure in a ...

Stochastic block model entropy and broadcasting on trees with survey

The limit of the entropy in the stochastic block model (SBM) has been ch...

Algorithmic detectability threshold of the stochastic blockmodel

The assumption that the values of model parameters are known or correctl...

Autoregressive Networks

We propose a first-order autoregressive model for dynamic network proces...

I A dynamic stochastic block model

The stochastic block model (SBM) is a classic model of community structure in static networks. Here, we use a variant of the SBM in which the community labels of nodes change over time, but where edges are independent, which is a special case of several models previously introduced for community detection in dynamic networks Kim and Leskovec (2013); Xu and Hero (2014); Han et al. (2014); Yang et al. (2009); Xing et al. (2010). Crucially, our variant captures the important behavior of changing community labels and is analytically tractable.

Under the SBM a graph is generated as follows. Using a prior distribution over group or community labels, we assign each of the nodes to a group . We then generate the edges

according to the probability specified by a

community interaction matrix and the group assignments . In the sparse case, where

, the resulting network is locally tree like and the number of edges between groups is Poisson distributed with parameter


In a dynamic network, we have a sequence of graphs with

, where each graph has its own group assignment vector

. To generate each such assignment, we draw from the prior, where each node has probability of being in community . With probability , each node keeps its label from one time step to the next , and otherwise it chooses a new label from the prior . Formally, the transition probability for community memberships is


where if and 0 otherwise. The edges are then generated independently for each according to the community interaction matrix , by connecting each pair of nodes at the same time and with probability . Note that while the group assignments may change over time, the matrix remains constant. Subsequently, we use to denote the adjacency matrix for the graph at time , and to denote the diagonal matrix of node degrees at time , i.e. .

At successive times in this model, edges are correlated only through the group assignments . Given these, the full likelihood of a graph sequence under this dynamic SBM is


where .

For our subsequent analysis, we focus on the common choices of a uniform prior , and where has two distinct entries:  if and if . In this setting the average degree of each graph is then . We are interested in the sparse regime where , because most real-world networks of interest are sparse (e.g., the Facebook social network), and sparsity allows us to carry out asymptotically optimal inference. Note that the case where every group has distinct average degrees is easier than the equal-average-degree case that we consider, because distinct average degrees give prior information about group memberships.

Ii The detectability threshold in dynamic networks

The fundamental question we now consider is, under what conditions can we detect, better than chance, the correct time-evolving labeling of the latent communities in this model?

Previous work on community detection in static networks has shown that there exists a sharp threshold below which no algorithm can perform better than chance in recovering the latent community structure Decelle et al. (2011); Mossel et al. (2012), at least in the case . This threshold occurs at positive values of the difference in the internal and external group connection probabilities, meaning that the community structure may still exist, but is undetectable. In terms of the SBM’s parameters, this phase transition occurs at


In a dynamic network where community memberships correlate across time, we will exploit these correlations to improve upon the static detectability threshold. In the worst case, when these temporal correlations are absent, i.e., , we should do no worse than the static threshold. To facilitate our analysis, we define an extended graph structure, called a spatiotemporal graph, in which we take and add special “temporal” edges that connect each node with its time-adjacent versions and . Under our model, the “spatial” edges are independent and sparse, implying that this spatiotemporal graph is locally treelike.

Consider a particular node as and . Moving outward in space and time, inference becomes a tree reconstruction problem, with stochastic transition matrix , along each spatial edge



is the identity matrix,

is the matrix of all s, and


Similarly, along each temporal edge we have a stochastic matrix


Thus, moving along a spatial or temporal edge copies a community label with probability or respectively, and otherwise randomizes it according to the prior. That is, these edges multiply the distribution of labels by the stochastic matrices and

, whose eigenvalues are

and , other than the trivial eigenvalue

corresponding to the uniform distribution.

Since each node in the spatiotemporal graph has

(Poisson-distributed random variable with mean

) spatial edges but exactly two temporal edges, the tree is generated by a two-type branching process. Each spatial edge gives rise to two temporal edges (to each of the time-adjacent versions of its end point), and each temporal edge gives rise to one temporal edge (continuing in the same direction in time), and both give rise to spatial edges. Thus the matrix describing the expected number of children (where we multiply a column vector of populations on the left) is . Using the results of Ref. Janson and Mossel (2004), the detectability threshold occurs when the largest eigenvalue of matrix exceeds unity, which yields


When , i.e., when there is no temporal correlation in community assignments over time, Eq. (7) recovers the static detectability threshold , which is equivalent to Eq. (3). On the other hand, when , i.e., when the community assignments are fixed across time, we may simply integrate the graph over , making it arbitrarily dense. We then have detectability for any , implying that any amount of community structure can be detected. At intermediate values of , the detectability threshold falls between these two extremes.

Figure 1: A schematic representation of belief propagation messages (see Eqs.(9) and (10)) being passed along spatial and temporal edges in a spatiotemporal graph.

This analysis corresponds to robust reconstruction on trees, where we are given noisy information at the leaves of a tree and we want to propagate this information to the root Janson and Mossel (2004). For groups, it is known rigorously in the static case Mossel et al. (2012) that detecting the communities below this bound is information-theoretically impossible. We conjecture that the same is true in the dynamic case. For groups, it has been conjectured Decelle et al. (2011) that it is information-theoretically possible to succeed beyond the Kesten-Stigum bound, but that doing so takes exponential time.

Iii Bayesian inference of the model

Given an observed graph sequence , we use Bayesian inference to learn the posterior distribution of latent community assignments:


This distribution is hard to compute in general because the summation runs over an exponential number of terms. However, when the spatiotemporal graph is sparse, as generated by our model, we may make a controlled Bethe approximation (also known as belief propagation (BP) in machine learning and as the “cavity method” in statistical physics) that allows us to carry out Bayesian inference in an efficient and asymptotically optimal way. We now describe a BP algorithm for learning our model form data, which we then linearize to obtain a fast spectral approach, based on a dynamic version of the non-backtracking matrix. This yields two inference algorithms that perform accurately all the way down to the transition.

iii.1 Belief propagation

Instead of inferring the joint posterior distribution, we use belief propagation to compute posterior marginal probabilities of node labels over time. Belief propagation assumes conditional independence of these marginals, which is exact when the graph is a tree and is a good approximation when the graph is locally-tree like, as in our spatiotemporal graph. In our setting, nodes update their current belief about marginals according to the marginals of both their spatial and temporal neighbors. That is, we define two types of messages: spatial messages that pass along spatial edges and temporal messages that pass along temporal edges. Fig. 1 illustrates this message passing scheme for a spatiotemporal graph.

A spatial message gives the marginal probability of a node at time being in community , when we consider node to be absent at time . This message is computed as


where is the normalization. The temporal message (or ) represents the marginal probability of node at time being in community , when we consider node to be absent at time (or at ) and has a similar form:


When or , we remove the term corresponding to the temporal edge coming from outside the domain of . Furthermore, following past work on BP for the static SBM Decelle et al. (2011); Aicher et al. (2015), we exploit these networks’ sparsity to reduce the computational complexity of the spatial updates at the cost of introducing corrections in sparse graphs. Specifically, we let be the same for all of ’s non-neighbors

. We then model the effects of all such non-edges as an adaptive external field on each node, which depends on the current estimated marginals

. That is, we let , where , which has the effect of preventing belief propagation from putting all the nodes at a given time into the same community. The adaptive fields only need to be updated after each BP iteration. This approximation yields a significant improvement in efficiency, reducing the computational complexity to be proportional to total number of edges in the spatiotemporal graph , rather than .

Once the BP messages converge, we compute the marginal probability that node belongs at time . This is identical to (9) and (10), except that we take all incoming edges into account. We then obtain a partition by marginalization, which assigns each node to its most-likely group:


It is well known in Bayesian inference Iba (1999) that if the marginals are exact, then the marginalized partition is the optimal estimator of the latent community labels. Because spatiotemporal graphs under our model are sparse, we know that with , the marginals given by BP are asymptotically correct. Thus, our BP algorithm succeeds all the way down to the detectability threshold given by Eq. (7), and gives an asymptotically optimal partition in terms of accuracy.

iii.2 Spectral clustering

The BP equations described above can be linearized to obtain a fast spectral approach for detecting community structure in dynamic networks. It is easy to verify that in our setting, when , the average degree in each group is . This implies that BP equations will always have a solution


which we call a factorized fixed point. This fixed point only reflects the permutation symmetry in the system, and could be unstable due to random perturbations. If we use the correct parameters in BP equations, i.e., the same parameter used to generate the observed network, then in the language of physics we would say that system is in the Nishimori line Iba (1999). That is, if the BP messages deviate from the factorized solution, then they are correlated with the latent community labels and we say that there is no spin glass phase in system Iba (1999). This allows us to simplify the BP equations by studying how the messages deviate from the factorized solution, which results in a linearized version of BP. In the static SBM, this linearization is equivalent to a spectral clustering algorithm using the non-backtracking matrix Krzakala et al. (2013).

To do this, we rewrite the BP messages as the uniform fixed point plus deviations away from it. The vector of deviations is given by

and the linearized BP equations are then


where means neighbors of , and denote derivatives evaluated at the factorized fixed point:


Solving Eq. (III.2

) amounts to finding eigenvectors of the Jacobian matrix

composed of derivatives of the BP messages. However, the size of the matrix is , which is relatively large for an eigenvector problem. Using the non-backtracking matrix approach Krzakala et al. (2013), we convert this problem into a smaller eigenvector problem of size by defining


where denotes the -dimensional identity matrix; is the adjacency matrix of temporal edges with ; is the diagonal matrix of temporal degrees with if , and if or ; is the -dimensional matrix consisting of all the spatial edges, i.e., meaning ; is the diagonal matrix of spatial degrees where .

We now obtain a spectral clustering algorithm using in the following way: given a spatiotemporal graph, we construct matrix , then take vectors composed of first entries of eigenvectors associated with the largest (absolute) eigenvalues, and finally perform -means clustering on matrix composed of the vectors. This yields a partition of the nodes; if desired number of clusters is two, then we simply use the sign of entries of the vector to separate nodes into two communities.

Figure 2: (left) Spectrum (in the complex plane) of matrix for a network generated by our model with groups and . The complex eigenvalues are circumscribed by the circle. (right) Overlap as a function of for different values of (given in the legend). The detectability thresholds for each choice of , according to Eq. (7), are shown as vertical lines in lower panel, and the hatched area shows the region of detectability for static networks Decelle et al. (2011). Each data point is the average of 100 instances of dynamic networks from our model, with , , and groups, with average degree .

From the principle of linearization, we know that real eigenvalues of the non-backtracking matrix describe stability properties of fixed points of the BP equations, i.e., if there is a real-valued eigenvalue larger than unity, it represents a stable fixed point in the equations. Moreover, if the BP equations have a stable fixed point, then should have a real-eigenvalue that is larger than unity, denoting a partition of the nodes that correlates with the latent community labels. Thus, our spectral clustering algorithm should work as long as BP works, implying that it also works all the way down to the detectability transition in sparse networks.

In Fig. 2 (left) we show the spectrum of in the complex plane for a network in the detectable regime, generated by the model. As with existing non-backtracking approaches Krzakala et al. (2013), most of the eigenvalues are confined to a disk, while several real eigenvalues fall outside this disk. In this example, entries of the eigenvector associated with the largest real eigenvalue have the same sign, hence the leading or “ferromagnetic” eigenvector does not yield information about the latent community structure. In practice, we can perform regularizations to push such ferromagnetic eigenvectors back into bulk, thereby lifting the eigenvectors correlated with the latent community structure to the top positions. Eigenvectors associated with other real eigenvalues outside the bulk are correlated with the latent community structure. In this case, because we have two groups, we obtain the inferred partition by using the sign of entries of second real eigenvector .

Iv Numerical verification

To verify our claims of the detectability transition in dynamic networks, and the accuracy of our algorithms, we conduct the following numerical experiment. Using our generative model of dynamic networks with community structure, we generate a number of dynamic networks for various choices of . When , communities are maximally strong, with every edge being located within a community, while at , we have Erdős-Rényi random graphs with no community structure. We then use our BP or spectral algorithm to infer the group assignments, assuming within each sequence that parameters are known. For each choice of , we average our results over 100 dynamic networks with graphs and nodes (for nodes total), with an average degree , divided into latent communities.

We measure the accuracy of the inferred community labels by the overlap between the latent partition and the inferred one . This is the fraction of nodes labeled correctly, maximized over all permutations of the groups, normalized so that it is if and if is uniformly random. In Fig. 2 (right) we show the overlap obtained by BP for dynamic networks as a function of for several choices of . The detectability threshold for each , from (7) is shown as vertical lines in the lower panel. When , we recover the static detectability threshold given by Eq. (3). As we increase , the phase transition occurs at increasing values of , as predicted, with the largest increase occurring when .

Similar results are obtained for other choices of and , with better agreement for larger networks. The slight deviation between numerical and analytic transition points observable in Fig. 2 right is a finite-size effect, which we numerically estimated to decrease like .

Figure 3 show the overlap throughout the -plane, using both BP and spectral algorithms, along with the line of the threshold given by Eq. (7). Notably, both algorithms perform similarly: they have large overlap with small , indicating that the learned partition is highly correlated with the latent community structure. As increases (weaker community structure), both algorithms encounter a second-order phase transition in which the overlap decreases from a finite value to zero. Separate numerical experiments indicate that the convergence time of BP diverges in the vicinity of the phase transition, which agrees with past work on the detectability threshold in static networks Decelle et al. (2011). We also find that at each point in ()-plane, the accuracy of BP is always larger than that of the spectral algorithm, especially away from the transition, reflecting the optimality of our BP algorithm.

Figure 3: Heat maps showing the numerically estimated overlap for (left) belief propagation and (right) spectral algorithms. The detectability threshold from Eq. (7) is shown as a solid line. Each point shows the average over 100 instances of dynamic networks drawn from our model with , groups, and average degree .

V Conclusions

We have derived a mathematically precise and general limit to the detectability of communities in dynamic networks. This threshold assumes a probabilistic model of community structure that is a special case of several previously developed methods to detect dynamic communities: specifically, where nodes may change their community membership over time, but where edges are generated independently at each time step. We also gave two efficient algorithms for learning latent community structure that are optimal in the sense that they succeed all the way down to the detectability threshold in dynamic networks.

A simple extension of our algorithm is to apply our BP equations to a dense network consisting of all spatial edges from all graphs projected to the time , handling the message passing over time steps by using a damping factor . This approach extends our analysis to networks that evolve in continuous time rather than in discrete time steps.

For larger numbers of groups, such as , it has been conjectured Decelle et al. (2011) that there is a “hard but detectable” regime where the factorized fixed point described in Section III.2 is locally stable, but where one or more accurate fixed points exist as well. In such a regime, community detection is information-theoretically possible, but we believe that it takes exponential time (though see Kanade et al. (2014) for the case where the number of groups grows with ). We propose this as a direction for further work.

Other directions for future work include handling cases where the community interaction matrix may also change over time (a situation similar to change-point detection in networks Peel and Clauset (2015)), where edges are not generated independently at each time step, or where networks have edge weights Aicher et al. (2015) or node annotations.

The authors thank Elchanan Mossel and Andrey Lokhov for helpful conversations. Financial support for this research was provided in part by Grant No. IIS-1452718 (AG, AC) from the National Science Foundation, Grant #FA9550-12-1-0432 from the U.S. Air Force Office of Scientific Research (AFOSR) and the Defense Advanced Research Projects Agency (DARPA) (LP), and the John Templeton Foundation (PZ, CM). Author order is joint first-authorship for AG and PZ, with the remaining authors appearing alphabetically.