Luca Becchetti
email: becchetti@diag.uniroma1.it

Emilio Cruciani
email: emilio.cruciani@inria.fr

Francesco Pasquale
email: pasquale@mat.uniroma2.it

Sara Rizzo
email: sara.rizzo@gssi.it

Step-by-Step Community Detection in Volume-Regular Graphs

Keywords: Distributed algorithms, Community detection, Markov chains, Spectral analysis

Spectral techniques have proved amongst the most effective approaches to graph clustering. However, in general they require explicit computation of the main eigenvectors of a suitable matrix (usually the Laplacian matrix of the graph).

Recent work (e.g., Becchetti et al., SODA 2017) suggests that observing the temporal evolution of the power method applied to an initial random vector may, at least in some cases, provide enough information on the space spanned by the first two eigenvectors, so as to allow recovery of a hidden partition without explicit eigenvector computations. While the results of Becchetti et al. apply to perfectly balanced partitions and/or graphs that exhibit very strong forms of regularity, we extend their approach to graphs containing a hidden k partition and characterized by a milder form of volume-regularity. We show that the class of k-volume regular graphs is the largest class of undirected (possibly weighted) graphs whose transition matrix admits k "stepwise" eigenvectors (i.e., vectors that are constant over each set of the hidden partition). To obtain this result, we highlight a connection between volume regularity and lumpability of Markov chains. Moreover, we prove that if the stepwise eigenvectors are those associated to the first k eigenvalues and the gap between the k-th and the (k+1)-th eigenvalues is sufficiently large, the Averaging dynamics of Becchetti et al. recovers the underlying community structure of the graph in logarithmic time, with high probability.

Introduction

Clustering a graph in a way that reflects underlying community structure is a very important mining task [START_REF] Fortunato | Community detection in graphs[END_REF]. Informally speaking, in the classical setting, we are given a possibly weighted graph G and an integer k. Our goal is to partition the vertex set of G = (V, E) into k disjoint subsets, so that the k induced subgraphs have high inner and low outer expansion. Spectral techniques have proved amongst the most effective approaches to graph clustering [START_REF] Andrew | On spectral clustering: Analysis and an algorithm[END_REF][START_REF] Shi | Normalized cuts and image segmentation[END_REF][START_REF] Von | A tutorial on spectral clustering[END_REF]. The general approach to spectral graph clustering [START_REF] Von | A tutorial on spectral clustering[END_REF] normally implies embedding the vertices of G into the k-dimensional subspace spanned by the main k eigenvectors of a matrix defined in terms of G's adjacency matrix, typically its (normalized) Laplacian. Intuitively, one expects that, for a well-clustered graph with k communities, the profiles of the first k eigenvectors are correlated with the underlying community structure of G. Recent work has provided theoretical support to this approach. In particular, [START_REF] James R Lee | Multiway spectral partitioning and higher-order cheeger inequalities[END_REF] showed that, given the first k orthonormal eigenvectors of the normalized Laplacian, it is possible to produce a k-partition of the vertex set, corresponding to k suitably-defined indicator vectors, such that the associated values of the Rayleigh quotient are relatively small. More recently, [START_REF] Peng | Partitioning well-clustered graphs: Spectral clustering works![END_REF] proved that, under suitable hypotheses on the spectral gap between the k-th and (k+1)-th eigenvalue of the normalized Laplacian of G, the span of the first k eigenvectors largely overlaps with the span of {D 1 2 g 1 , . . . , D 1 2 g k }, where D is the diagonal degree matrix of G, while the g i 's are indicator vectors describing a k-way partition {S i } k i=1 of V such that, for every i, the conductance of S i is at most the k-way expansion constant ρ(k) [START_REF] James R Lee | Multiway spectral partitioning and higher-order cheeger inequalities[END_REF]. Note that, if v is an eigenvector associated to the i-th smallest eigenvalue of the normalized Laplacian, D -1 2 v is an eigenvector corresponding to the i-th largest eigenvalue of the random walk's transition matrix associated to G. Hence, when G is well-clustered, one might reasonably expect the first k eigenvectors of P to exhibit almost-"stepwise" profiles reflecting G's underlying community structure. The aforementioned spectral approaches require explicit computation of the k main eigenvectors of a (generally symmetric) matrix.

In [BCN + 17], the authors considered the case k = 2 for which they proposed the following distributed algorithm (Averaging dynamics, Algorithm 1): "At the outset, every node picks an initial value, independently and uniformly at random in {-1, 1}; then, in each synchronous round, every node updates its value to the average of those held by its neighbors. A node also tags itself blue if the last update increased its value, red otherwise" [BCN + 17]. The authors showed that, under a variety of graph models exhibiting sparse balanced cuts, including the stochastic block model [START_REF] Holland | Stochastic blockmodels: First steps[END_REF], the process resulting from the above simple local rule converges, in logarithmic time, to a coloring that, depending on the model, exactly or approximately reflects the underlying cut. They further elaborated on how to extend the proposed approach to the case of multiple communities, providing an analysis for a strongly regular version of the stochastic block model with multiple communities. While results like those presented in [START_REF] James R Lee | Multiway spectral partitioning and higher-order cheeger inequalities[END_REF][START_REF] Peng | Partitioning well-clustered graphs: Spectral clustering works![END_REF] provide further theoretical justification for spectral clustering, the approach proposed in [BCN + 17] suggests that observing the temporal evolution of the power method applied to an initial random vector may, at least in some cases, provide equivalent information, without requiring explicit eigenvector computations.

Our contributions

The goal of this work is to take a further step in this direction by considering a more general class of graphs, even if still relatively "regular", than the one considered in [BCN + 17]. The analysis of the Averaging dynamics on this class is considerably harder, but it is likely to provide insights into the challenges of analyzing the general case, without all the intricacies of the latter. Our contribution is as follows:

• We define the class of k-volume-regular graphs. This class of edge-weighted graphs includes those considered in [BCN + 17] and it is the largest class of undirected, possibly weighted graphs that admit k "stepwise" eigenvectors (i.e., having constant values over the k steps that identify the hidden partition). This result uses a connection between volume regularity and lumpability of Markov chains [START_REF] Kemeny | Finite Markov chains[END_REF][START_REF] Paul | Lumpability and commutativity of markov processes[END_REF].

• If the stepwise eigenvectors are those associated to the first k eigenvalues and the gap between the k-th and the (k+1)-th eigenvalues is sufficiently large, we show that running the Averaging dynamics for a suitable number of steps allows recovery of the underlying community structure of the graph, with high probability. 1 To prove this, we provide a family of mutually orthonormal vectors which, when the graph is volume-regular, span the eigenspace of the main k eigenvectors of the normalized adjacency matrix of the graph.

It should be noted that the first and second of these vectors are respectively the main eigenvector and the Fiedler vector [START_REF] Fiedler | Laplacian of graphs and algebraic connectivity[END_REF] associated to the normalized adjacency matrix.

• While the results of [BCN + 17] apply when the underlying communities are of the same size, our results do not require this assumption and they apply to weighted graphs. It should also be noted that volume regularity is a weaker notion than regularity of the graph.

• We further show that variants of the Averaging dynamics (and/or its labeling rule) can address different problems (e.g., identifying bipartiteness) and/or other graph classes.

We further note that the overall algorithm we consider can be viewed as a fully decentralized, synchronous algorithm that works in anonymous networks,2 with a completely local clustering criterion, though it cannot be considered a dynamics in the sense of [BCN + 17] since it requires a bound on the number of nodes in the underlying network.

Finally, this paper extends a preliminary version [START_REF] Becchetti | Step-by-step community detection in volume-regular graphs[END_REF] in several ways. To begin, the main result presented in [START_REF] Becchetti | Step-by-step community detection in volume-regular graphs[END_REF] was weaker, in the sense that the constraints imposed on the eigenvalues in [BCPR19, Theorem 9] polynomially depend on network parameters like the maximum degree and the number of vertices. In this respect, they are substantially stronger than those imposed to prove Theorem 4.1, where results (in particular, the time window in which recovery of the hidden partition is possible) are expressed in terms of the spectrum of the graph, while constraints imposed on the second eigenvalue only logarithmically depend on the aforementioned network parameters. In reframing these results, we also realized that the presence of a window in which recovery is possible is something that is hardly avoidable in general using the simple averaging heuristic of [BCN + 17]. This is something we remark right after Theorem 4.1 (see Remark 1), while we also observe (see Remarks 3 and 4) that the analysis presented here also encompasses the class of regular graphs considered in [BCN + 17] as a special case, something that was not obvious in [START_REF] Becchetti | Step-by-step community detection in volume-regular graphs[END_REF]. Finally, the result given in [START_REF] Becchetti | Step-by-step community detection in volume-regular graphs[END_REF] for bipartite graphs assumed volume regularity, an assumption that is not necessary as we show in Section 5.

Further related work

We briefly discuss further work that bears some relationship to this paper, either because it adopts simple and/or decentralized heuristics to uncover community structure, or because it relies on the use of spectral techniques.

Decentralized heuristics for block reconstruction. Label propagation algorithms [START_REF] Nandini Raghavan | Near linear time algorithm to detect community structures in large-scale networks[END_REF] are dynamics based on majority updating rules [START_REF] Angluin | A Simple Population Protocol for Fast Robust Approximate Majority[END_REF] and have been applied for detecting communities in complex networks. Several papers present experimental results for such protocols on specific classes of clustered graphs [START_REF] Michael | Detecting network communities by propagating labels under constraints[END_REF][START_REF] Liu | Advanced modularity-specialized label propagation algorithm for detecting communities in networks[END_REF][START_REF] Nandini Raghavan | Near linear time algorithm to detect community structures in large-scale networks[END_REF]. The only available rigorous analysis of a label propagation algorithm on planted partition graphs is the one presented in [START_REF] Kothapalli | On the analysis of a label propagation algorithm for community detection[END_REF], where the authors analyze a label propagation algorithm on G 2n,p,q graphs in the case of dense topologies. In particular, their analysis considers the case where p = Ω(1/n 1 4 -ε ) and q = O(p 2 ), a parameter range in which very dense clusters of constant diameter separated by a sparse cut occur w.h.p. In this setting, characterized by a polynomial gap between p and q, simple combinatorial and concentration arguments show that the protocol converges in constant expected time. A logarithmic bound for sparser topologies is conjectured in [START_REF] Kothapalli | On the analysis of a label propagation algorithm for community detection[END_REF].

Following [BCN + 17], a number of recent papers analyze simple distributed algorithms for community detection that rely on elementary dynamics. In the Averaging dynamics considered in this paper, every node communicates in parallel with all its neighbors in each round. While this might be too expensive in scenarios characterized by dense topologies, it is simply infeasible in other settings (for instance, when links represent opportunistic meetings that occur asynchronously). Motivated by similar considerations, a first line of follow-up work considered "sparsified", asynchronous variants of the Averaging dynamics [BCM + 18, MMM18, SZ17].

Another interesting direction is the rigorous analysis of well-known (non-linear) dynamics based on majority rules on graphs that exhibit community structure. In [START_REF] Cruciani | Phase transition of the 2-Choices dynamics on core-periphery networks[END_REF], Cruciani et al. consider the 2-Choices dynamics where, in each round, every node picks two random neighbors and updates its value to the most frequent among its value and those held by its sampled neighbors. They show that if the underlying graph has a suitable core-periphery structure and the process starts in a configuration where nodes in core and periphery have different states, the system either rapidly converges to the core's state or reaches a metastable regime that reflects the underlying graph structure. Similar results have been also obtained for clustered regular graphs with dense communities in [START_REF] Cruciani | Distributed community detection via metastability of the 2-Choices dynamics[END_REF], where the 2-Choices dynamics is proposed as a distributed algorithm for community detection.

Although based on the Averaging dynamics and thus extremely simple and fully decentralized, the algorithm we consider in this paper is not itself a dynamics in the sense proposed in [BCN + 17], since its clustering criterion is applied within a time window, which in turn requires (at least approximate) knowledge of the network size.

Because of their relevance for the reconstruction problem, we also briefly discuss the class of belief propagation algorithms, best known as message-passing algorithms for performing inference in graphical models [START_REF] David | Information theory, inference and learning algorithms[END_REF]. Though not a dynamics, belief propagation is still a simple approach. Moreover, there is non-rigorous, strong supporting evidence that some belief propagation algorithms might be optimal for the reconstruction problem [START_REF] Decelle | Asymptotic analysis of the stochastic block model for modular networks and its algorithmic applications[END_REF]. A rigorous analysis is a major challenge; in particular, convergence to the correct value of belief propagation is far from being fully-understood on graphs which are not trees [START_REF] Joris | Sufficient conditions for convergence of the sum-product algorithm[END_REF][START_REF] Weiss | Correctness of local probability propagation in graphical models with loops[END_REF]. As we discuss in the next subsection, more complex algorithms inspired by belief propagation have been rigorously shown to perform reconstruction optimally.

General algorithms for block reconstruction. Several algorithms for community detection are spectral: They typically consider the eigenvector associated to the second largest eigenvalue of the adjacency matrix A of G, or the eigenvector corresponding to the largest eigenvalue of the matrix A -d n J [Bop87, CO05, CO10, McS01], 3 since these are correlated with the hid-den partition. More recently spectral algorithms have been proposed [AS15, BLM15, CO10, KMM + 13, MNS13, PSZ17] that find a weak reconstruction even in the sparse, tight regime. Interestingly, spectral algorithms turn out to be a feasible approach also in distributed settings. In particular, Kempe and McSherry [START_REF] Kempe | A decentralized algorithm for spectral analysis[END_REF] show that eigenvalue computations can be performed in a distributed fashion, yielding distributed algorithms for community detection under various models, including the stochastic block model. However, their algorithm does not match any simple decentralized computing model. In particular, the algorithm of Kempe and McSherry as well as any distributed version of the above mentioned centralized algorithms are neither dynamics, nor do they correspond to the notion of light-weight algorithm of Hassin and Peleg [START_REF] Hassin | Distributed probabilistic polling and applications to proportionate agreement[END_REF]. Moreover, the mixing time of the simple random walk on the graph is a bottleneck for the distributed algorithm of Kempe and McSherry and for any algorithm that performs community detection in a graph G by employing the power method or the Lanczos method [Lan50] as a subroutine. This is not the case for the Averaging dynamics, since it removes the component of the state in the span of the main eigenvector.

In general, the reconstruction problem has been studied extensively using a multiplicity of techniques, which include combinatorial algorithms [START_REF] Dyer | The solution of some random NP-hard problems in polynomial expected time[END_REF], belief propagation [START_REF] Decelle | Asymptotic analysis of the stochastic block model for modular networks and its algorithmic applications[END_REF] and variants of it [START_REF] Mossel | Belief propagation, robust reconstruction and optimal recovery of block models[END_REF], spectral-based techniques [START_REF] Coja-Oghlan | Graph partitioning via adaptive spectral techniques[END_REF][START_REF] Mcsherry | Spectral partitioning of random graphs[END_REF], Metropolis approaches [START_REF] Jerrum | The metropolis algorithm for graph bisection[END_REF], and semidefinite programming [START_REF] Abbe | Exact recovery in the stochastic block model[END_REF], among others.

Roadmap

The rest of this paper is organized as follows. In Section 2, we formally define the Averaging dynamics and briefly recall how it is connected with the transition matrix of a random walk on the underlying graph. We also define the notion of community-sensitive algorithm and the class of clustered volume-regular graphs. In Section 3 we show the relation between lumpability of Markov chains and volume-regular graphs. In Section 4 we state the main result of the paper (see Theorem 4.1) on the analysis of the Averaging for clustered volume-regular graphs: We give the two main technical lemmas and show how the main theorem derives from them. In Section 5, we show how slightly modified versions of the Averaging dynamics can be used to identify the hidden partition of other non-clustered volume-regular graphs, e.g., bipartite graphs. In Section 6 we briefly show how our approach can be extended to slightly more general graph classes than the ones considered in this paper. We finally highlight some open problems and directions for further research on the topic.

Preliminaries

Notation. Consider an undirected edge-weighted graph G = (V, E, w) with nonnegative weights. For each node u ∈ V , we denote by δ(u) the volume, or weighted degree, of node u, namely δ(u) = v:(u,v)∈E w(u, v). Similarly, we denote the volume of a set of nodes T ⊆ V as vol(T ) := u∈T δ(u). D denotes the diagonal matrix, such that D uu = δ(u) for each u ∈ V . Without loss of generality we assume min u δ(u) = 1, since the behavior of the Averaging dynamics (and the corresponding analysis) is not affected by a normalization of the weights. We refer to the maximum volume of a node as ∆ := max u δ(u).

In the remainder, W denotes the weighted adjacency matrix of G, while P = D -1 W is the transition matrix of a random walk on G, in which a transition from node u to node v occurs with probability proportional to w(u, v). We call λ 1 , . . . , λ n the eigenvalues of P , in non-increasing order, and v 1 , . . . , v n a family of eigenvectors of P , such that

P v i = λ i v i . We let N = D -1 2 W D -1 2 = D 1 2 P D -1
2 denote the normalized weighted adjacency matrix of G. Note that N is real and symmetric (thus, the eigenvectors of N are orthogonal) and that its spectrum is the same as that of P . We denote by w 1 , . . . , w n a family of eigenvectors of N , such that N w i = λ i w i . It is important to note that w i is an eigenvector of N if and only if D -1 2 w i is an eigenvector of P .

We use the Bachmann-Landau asymptotic notation (i.e., ω, Ω, Θ, O, o) to describe the limiting behavior of functions depending on n. In this sense, our results only hold for large n. We say that an event E n holds with high probability (w.h.p., in short) if P (E n ) = 1 -O(n -γ ), for any positive constant γ.

Averaging dynamics

The simple algorithm we consider in this paper, named Averaging dynamics (Algorithm 1) after [BCN + 17] in which the algorithm was first proposed, can be seen as an application of the power method, augmented with a Rademacher initialization and a suitable labeling scheme. In this form, it is best described as a distributed process, executed by the nodes of an underlying edge-weighted graph. The Averaging dynamics can be used as a building-block to achieve "community detection" in some classes of "regular" and "almost regular" graphs. Herein, we extend its use and analysis to broader graph classes and, in one case, to a different problem.

Algorithm 1 Averaging dynamics Rademacher initialization: At round t = 0, every node v ∈ V independently samples its value x (0) (v) from {-1, +1} uniformly at random.

Update rule: At each subsequent round t 1, every node v ∈ V :

1. Averaging: updates its value x (t) (v) to the weighted average of the values of its neighbors at the end of the previous round.

2. Labeling:

if x (t) (v) x (t-1) (v) then v sets label (t) (v) = 1; otherwise v sets label (t) (v) = 0.
Spectral decomposition of the transition matrix. Let x (t) denote the state vector at time t, i.e., the vector whose u-th entry is the value held by node u at time t. We let x (0) = x denote the initial state vector. Globally, the averaging update rule of Algorithm 1 corresponds to one iteration of the power method, in this case an application of the transition matrix P to the current state vector, i.e., x (t) = P x (t-1) . We can write

x (t) = P t x = D -1 2 N t D 1 2 x (a) = D -1 2 n i=1 λ t i w i w ⊺ i n i=1 β i w i (b) = n i=1 λ t i β i D -1 2 w i ,
where in (a) we spectrally decomposed the matrix N t and expressed the vector D 1 2 x as a linear combination of the eigenvectors of N , i.e., D

1 2 x = n i=1 β i w i , with β i = D 1 2 x, w i ; in (b)
we used that the eigenvectors of N are orthonormal, i.e., that w ⊺ i w i = 1 for every i ∈ {1, . . . , n} and that w ⊺ i w j = 0 for every i, j ∈ {1, . . . , n} and such that i = j. By explicitly writing the β i s and by noting that

w i = D 1 2 v i D 1 2 v i we conclude that x (t) = n i=1 λ t i D 1 2 x, D 1 2 v i D 1 2 v i D -1 2 D 1 2 v i D 1 2 v i = n i=1 λ t i α i v i , (1)
where

α i := D 1 2 x,D 1 2 v i D 1 2 v i 2 = x ⊺ Dv i D 1 2 v i 2
is the length of the projection of D

1 2 x on D 1 2 v i .
Note that λ 1 = 1 and v 1 = 1,4 since P is stochastic, and λ i ∈ (-1, 1) for every i > 1, if G is connected and non bipartite. The long term behavior of the dynamics can be written as

lim t→∞ x (t) = lim t→∞ n i=1 λ t i α i v i = α 1 1, with α 1 = u∈V δ(u)x(u) u∈V δ(u) = u∈V δ(u) vol(V ) x(u),
i.e., each node converges to the initial global weighted average of the network.

Community-sensitive algorithms

We give the following definition of community-sensitive algorithm, that closely resembles that of locality-sensitive hashing (see, e.g., [START_REF] Leskovec | Mining of massive datasets[END_REF]).

Definition 2.1 (Community-sensitive algorithm). Let A be a randomized algorithm that takes in input a (possibly weighted) graph G = (V, E) with a hidden partition V = {V 1 , . . . , V k } and assigns a Boolean value A(G)[v] ∈ {0, 1} to each node v ∈ V . We say A is an (ε, δ)-communitysensitive algorithm, for some ε, δ > 0, if the following two conditions hold:

1. For each set V i of the partition and for each pair of nodes u, v ∈ V i in that set, the probability that the algorithm assigns the same Boolean value to u and v is at least 1 -ε:

∀i ∈ [k], ∀u, v ∈ V i , P (A(G)[u] = A(G)[v]) 1 -ε.
2. For each pair V i , V j of distinct sets of the partition and for each pair of nodes u ∈ V i and v ∈ V j , the probability that the algorithm assigns the same value to u and v is at most δ:

∀i, j ∈ [k] with i = j, ∀u ∈ V i , ∀v ∈ V j , P (A(G)[u] = A(G)[v]) δ.
For example, for (ε, δ) = (1/n, 1/2), an algorithm that simply assigns the same value to all nodes would satisfy the first condition but not the second one, while an algorithm assigning 0 or 1 to each node with probability 1/2, independently of the other nodes, would satisfy the second condition but not the first one. Note that Algorithm 1 is a distributed algorithm that, at each round t, assigns one out of two labels to each node of a graph. In the next section (see Theorem 4.1) we prove that a time window [T 1 , T 2 ] exists, such that for all rounds t ∈ [T 1 , T 2 ], the assignment of the Averaging dynamics satisfies both conditions in Definition 2.1: The first condition with

ε = ε(n) = O(n -1 2 ), the second with δ = δ(n) = 1 -Ω(1).
Community-sensitive labeling. We here generalize the concept of community-sensitive labeling (appeared in [BCM + 18, Definition 3]), given only for the case of two communities, to the case of multiple communities. If we execute ℓ = Θ(log n) independent runs of an (ε, δ)community-sensitive algorithm A, each node is assigned a signature of ℓ binary values, with pairwise Hamming distances probabilistically reflecting community membership of the nodes. More precisely, let A be an (ε, δ)-community-sensitive algorithm and let A 1 , . . . , A ℓ be ℓ = Θ(log n) independent runs of A. For each node u ∈ V , let s(u) = (s 1 (u), . . . , s ℓ (u)) denote the signature of node u, where

s i (u) = A i (G)[u]. For each pair nodes u, v, let h(u, v) = |{i ∈ [ℓ] : s i (u) = s i (v)}|
be the Hamming distance between s(u) and s(v).

Lemma 2.2 (Community-sensitive labeling). Let A be an (ε, δ)-community-sensitive algorithm with ε = O( 1 n γ ) for any arbitrarily small positive constant γ, and δ = 1-Ω(1). Let ℓ = Θ(log n), α = Ω( 1 n γ-c ) with c ∈ (0, γ], and β = b(1 -δ) for any constant b ∈ (0, 1) and such that 0 α β 1. Then, for each pair of nodes u, v ∈ V it holds that:

1. If u and v belong to the same community then h(u, v) < αℓ, w.h.p.

2. If u and v belong to different communities then h(u, v) βℓ, w.h.p.

Proof. From the definition of (ε, δ)-community-sensitive algorithm we have that, if u and v belong to the same community, then

E [h(u, v)] = ℓ i=1 P (s i (u) = s i (v)) εℓ . Similarly, if they belong to different communities, then E [h(u, v)] = ℓ i=1 P (s i (u) = s i (v)) (1 -δ)ℓ.
If u and v belong to the same community, we compute P (h(u, v) > αℓ) and by Markov inequality we get that

P (h(u, v) αℓ) E [h(u, v)] αℓ ε α = O 1 n c , (2)
where in the last inequality we use the hypothesis

ε = O( 1 n γ ) and α = Ω( 1 n γ-c
). On the other hand, if u and v belong to different communities, we apply Theorem A.1 to h(u, v) by using the lower bound on the expected value of h(u, v) and the hypothesis ℓ = Θ(log n). Thus,

P (h(u, v) < b(1 -δ)ℓ) exp - (1 -b) 2 2 (1 -δ)ℓ = O 1 n d , (3)
where d is a positive constant. The thesis follows by combing Eqs.

(2) and (3).

Volume-regular graphs

Recall that, for an undirected edge-weighted graph G = (V, E, w), we denote by δ(u) the volume a node u ∈ V , i.e., δ(u) = v:(u,v)∈E w(u, v). Note that the transition matrix P of a random walk on G is such that P uv = w (u, v) /δ(u). Given a partition V = {V 1 , . . . , V k } of the set of nodes V , for a node u ∈ V and a partition index i ∈ [k], δ i (u) denotes the overall weight of edges connecting u to nodes in V i , δ i (u) = v∈V i : u,v∈E w (u, v) . Hence, δ(u) = k i=1 δ i (u). Definition 2.3 (Volume-regular graph). Let G = (V, E, w) be an undirected edge-weighted graph with |V | = n nodes and let V = {V 1 , . . . , V k } be a k-partition of the nodes, for some k ∈ [n]. We say that G is volume regular with respect to V if, for every pair of partition indexes i, j ∈ [k] and for every pair of nodes u, v ∈ V i ,

δ j (u) δ(u) = δ j (v) δ(v) .
We say that G is k-volume regular if there exists a k-partition V of the nodes such that G is volume regular with respect to V.

In other words, G is volume regular if there exists a partition of the nodes such that the fraction of a node's volume toward a set of the partition is constant across nodes of the same set. Note that all graphs with n nodes are trivially 1-and n-volume regular.

Let G = (V, E, w) be a k-volume regular graph and let P be the transition matrix of a random walk on G. In the next lemma we prove that the span of k linearly independent eigenvectors of P equals the span of the indicator vectors of the k communities of G. The proof makes use of the correspondence between random walks on volume regular graphs and ordinary lumpable Markov chains [START_REF] Kemeny | Finite Markov chains[END_REF]; in particular the result follows from Lemma 3.2 and Lemma 3.3, that we prove in Section 3.

Lemma 2.4. Let P be the transition matrix of a random walk on a k-volume regular graph G = (V, E, w) with k-partition V = {V 1 , . . . , V k }. There exists a family {v 1 , . . . , v k } of linearly independent eigenvectors of P such that Span ({v 1 , . . . ,

v k }) = Span ({1 V 1 , . . . , 1 V k }) , with 1 V i the indicator vector of the i-th set of the partition, for i ∈ [k].
In the rest of the paper we call "stepwise" the eigenvectors of P that can be written as linear combinations of the indicator vectors of the communities. In the next definition, we formalize the fact that a k-volume regular graph is clustered if the k linearly independent stepwise eigenvectors of P , whose existence is guaranteed by the above lemma, are associated to the k largest eigenvalues of P . Definition 2.5 (Clustered volume regular graph). Let G = (V, E, w) be a k-volume regular graph and let P be the transition matrix of a random walk on G. We say that G is a clustered k-volume regular graph if the k stepwise eigenvectors of P are associated to the first k largest eigenvalues of P .

Volume-regular graphs and lumpable Markov chains

The class of volume-regular graphs is deeply connected with the definition of lumpability [START_REF] Kemeny | Finite Markov chains[END_REF] of Markov chains. We here first recall the definition of lumpable Markov chain and then show that a graph G is volume-regular if and only if the associated weighted random walk is a lumpable Markov chain. Definition 3.1 (Ordinary lumpability of Markov Chains). Let {X t } t be a finite Markov chain with state space V and transition matrix P = (P uv ) u,v∈V and let V = {V 1 , . . . , V k } be a partition of the state space. Markov chain {X t } t is ordinary lumpable with respect to V if, for every pair of partition indexes i, j ∈ [k] and for every pair of nodes in the same set of the partition u, v ∈ V i , it holds that

w∈V i P uw = w∈V i P vw , ∀ u, v ∈ V j . (4)
We define the lumped matrix P of the Markov Chain as the matrix such that P ij = w∈V i P uw , for any u ∈ V j .

We first prove that random walks on Volume-regular graphs define exactly the subset of reversible and ordinary lumpable Markov chains.

Lemma 3.2. A reversible Markov chain {X t } t is ordinary lumpable if and only if it is a random walk on a volume-regular graph.

Proof. Assume first that {X t } t is ordinary lumpable and let P be the corresponding transition matrix. Consider the weighted graph G = (V, E, w) obtained from P as follows: V corresponds to the set of states in P , while w(u, v) = π(u)P uv , for every u, v ∈ V , with π the stationary distribution of P . Note that G is an undirected graph, i.e., w(u, v) = π(u)P uv

(a) = π(v)P vu = w(v, u)
, where (a) holds because P is reversible. Moreover

δ(u) = z∈V w(u, v) = z∈V π(u)P uv = π(u) z∈V P uv (a) = π(u),
where (a) holds because P is stochastic. Thus G meets Definition 2.3 because, for any u, v ∈ V i ,

δ j (u) δ(u) = 1 π(u) z∈V j w(u, z) = z∈V j P uz = z∈V j P vz = 1 π(v) z∈V j w(v, z) = δ j (v) δ(v) .
Next, assume G is k-volume-regular with respect to the partition V = {V 1 , . . . , V k }. Let P be the transition matrix of the corresponding random walk. For every i, j ∈ [k] and for every u, v ∈ V i we have:

z∈V j P uz = z∈V j w(u, z) δ(u) = δ j (u) δ(u) (a) = δ j (v) δ(v) = z∈V j w(v, z) δ(v) = z∈V j P vz ,
where (a) follows from Definition 2.3. Moreover note that P is reversible with respect to distribution π, where π(u) = δ(u) vol(G) . Note that infinitely many k-volume-regular graphs have the same k-ordinary lumpable random walk chain.

We next show that a Markov chain is k-ordinary lumpable if and only if the corresponding transition matrix P has k stepwise, linearly independent eigenvectors. Lemma 3.3. Let P be the transition matrix of a Markov chain. Then P has k stepwise linearly independent eigenvectors if and only if P is ordinary lumpable.

Proof. We divide the proof in two parts. First, we assume that P is ordinary lumpable and show that P has k stepwise linearly independent eigenvectors. Second, we assume that P has k stepwise linearly independent eigenvectors and show that P is ordinary lumpable.

1. Let P be ordinary lumpable and P its lumped matrix. Let λ i , v i be the eigenvalues and eigenvectors of P , for each i ∈ [k]. Let w i ∈ R n be a stepwise vector defined as

w i = (v i (1), . . . , v i (1) |V 1 | times , v i (2), . . . , v i (2) |V 2 | times , . . . , v i (k), . . . , v i (k) |V k | times ) ⊺ ,
where v i (j) indicates the j-th component of v i , and then the |V j | components relative to V j are all equal to v i (j).

Since the eigenvectors v i of P are linearly independent, the vectors w i are also linearly independent. Moreover, it is easy to see that P w i = λ i w i by just verifying the equation for every

i ∈ [k].
2. Assume P has k stepwise linearly independent eigenvectors w i , associated to k eigenvalues λ i , for each i ∈ [k]. Let v i ∈ R k the vector that has as components the k constant values in the steps of w i . Since the w i are linearly independent, the v i also are.

For every eigenvector w i and for every two states x, y ∈ V l , for every l ∈ [k], we have that λ i w i (x) = λ i w i (y) since w i is stepwise. Then, since P w i = λ i w i , we have that

k j=1 z∈V j P xz v i (j) = (P w i )(x) = (P w i )(y) = k j=1 z∈V j P yz v i (j).
Thus k j=1 v i (j) z∈V j (P xz -P yz ) = 0 and then it follows that

k j=1 v i (j) u xy (j) = u xy , v i = 0,
where u xy (j) := z∈V j (P xz -P yz ). Since the v i are k linearly independent vectors in a kdimensional space, u xy cannot be orthogonal to all of them and then it has to be the null vector, i.e., u xy (j) = 0 for all j ∈ [k]. This implies that P is ordinary lumpable, i.e., z∈V j P xz = z∈V j P yz . It is easy to verify that the eigenvalues and eigenvectors of P are exactly

λ i , v i , with i ∈ [k].

Averaging dynamics on clustered volume regular graphs

Let n min := min i∈[k] |V i | and n max := max i∈[k] |V i | be the maximum and minimum sizes of the communities of a volume-regular graph G = (V, E, w) with n nodes and k-partition V = {V 1 , . . . , V k }. Recall also that ∆ is the maximum weighted degree of the nodes of G and λ 1 , . . . , λ n are the eigenvalues of the transition matrix of a random walk on G (see Section 2). In this section we prove the following result. and λ k

7λ 2 -5 2 . A non-empty time interval [T 1 , T 2 ] exists, with T 1 = O log n log(λ k /λ k+1 ) and T 2 = Ω λ k 1-λ 2 , such that for each t ∈ [T 1 , T 2 ],
the Averaging dynamics truncated at round t is a (O(n -1/2 ), 1 -Ω(1))-community-sensitive algorithm.

Remark 1 (The extent of the time-window). Notice that the time window cannot be too long: by Cheeger's inequality 1 -λ 2

h 2 G 2 1/(2∆ 2 n 2 ), 5 thus T 2 = O(∆ 2 n 2 ).
Remark 2 (The extent of non-regularity). Notice that the condition k > 2∆(n max /n min ) implies

max i∈[k] {vol(V i )} ∆n max < k 2 n min k 2 min i∈[k] {vol(V i )}.
In other words, the Averaging dynamics gives a good community-sensitive labeling when the communities are not too unbalanced in terms of their volumes. Moreover, the smaller the number of communities the more the volume-balance requirement is tight.

In the remainder of this section, we first introduce further notation and then state the main technical lemmas (Lemmas 4.2 to 4.4), that will be used in the proof of Theorem 4.1, which concludes this section.

Let G = (V, E, w) be a clustered k-volume regular graph and, without loss of generality, let V 1 , . . . , V k be an arbitrary ordering of its communities. We introduce a family of stepwise vectors that generalize Fiedler vector [START_REF] Fiedler | Laplacian of graphs and algebraic connectivity[END_REF], namely

χ i = mi m i 1 V i - m i mi 1 Vi : i ∈ [k -1] , (5)
where 1 V i is the indicator vector of the set V i and, for convenience sake, we denoted by m i the volume of the i-th community, Vi the set of all nodes in communities i + 1, . . . , k, and mi the volume of Vi , i.e., m i := u∈V i δ(u), Vi := k h=i+1 V h , and mi := k h=i+1 m h . Note that vectors χ i s are "stepwise" with respect to the communities of G (i.e., for every i ∈ [k -1], χ i (u) = χ i (v) whenever u and v belong to the same community).

Recall from Eq. (1) that the initial state vector can be written as

x = n i=1 α i v i . Let z := k i=1 α i v i and note that z = α 1 1 + k-1 i=1 γ i χ i by applying Lemma 2.4 and because Span ({1, χ 1 , . . . , χ k-1 }) = Span ({1 V 1 , . . . , 1 V k }).
Let us now define the vector y := z -α 1 1 or, equivalently,

y = k-1 i=1 γ i χ i , where γ i = x ⊺ Dχ i D 1/2 χ i 2 . (6)
Note that the coefficients γ i s are proportional to the length of the projection of the (inhomogeneously) contracted state vector on the (inhomogeneously) contracted D 1 2 χ i s; the previous expression is valid since the vectors in {D

1 2 1} ∪ {D 1 2 χ i : i ∈ [k -1]} are mutually orthogonal. 6
In Lemma 4.2 we show that every component of y, i.e., the projection of the (inhomogeneously) contracted initial state vector D 1 2 x on the (inhomogeneously) contracted vectors D 1 2 χ i s, is not too small, w.h.p. Lemma 4.2 (Length of the projection of the state vector). Let G = (V, E, w) be a connected clustered k-volume-regular graph with n nodes and k-partitions V = {V 1 , . . . , V k }. Under the hypotheses of Theorem 4.1, for every u ∈ V ,

P |y(u)| 1 ∆n 1 -O 1 √ n .
Proof. Without loss of generality, we assume u ∈ V 1 , which possibly just amounts to a relabeling of the nodes. With this assumption, we have

y(u) = γ 1 χ 1 (u) = γ 1 m1 m 1 ,
where the second equality follows from the definitions of the χ i 's (Eq. ( 5)) and the fact that u ∈ V 1 . Next, observe that we have:

D 1/2 χ 1 2 = m1 m 1 v∈V 1 δ(v) + m 1 m1 v∈ V1 δ(v) = m1 + m 1 = m,
where m := vol(V ). We now bound

|γ 1 | = |x ⊺ Dχ 1 | D 1/2 χ 1 2 = |x ⊺ Dχ 1 | m .
More precisely, we prove that it is at least 1/m with probability 1 -O 1 √ n , where probability is computed over the randomness of x.

Assume for the moment that m1 m 1 . From the definition of χ 1 we have:

x ⊺ Dχ 1 = x ⊺ D m1 m 1 1 V 1 - m 1 m1 1 V1 = m 1 m1 x ⊺ D m1 m 1 1 V 1 -1 V1 . Now, set w = D m1 m 1 1 V 1 -1 V1
and note that |w(u)| 1 from the hypothesis that m1 m 1 and since δ(v) 1, for every v ∈ V . We can thus apply Theorem A.5 to w with r = 0, so that we can write:

P |x ⊺ Dχ 1 | < m 1 m1 = P |x T w| < 1 O 1 √ n ,
where the equality follows since x ⊺ Dχ 1 = m 1 m1 x T w. Hence, with probability 1

-O 1 √ n we have |γ 1 | m 1 m1
• 1 m and thus, with the same probability:

|y(u)| = |γ 1 | m1 m 1 1 m 1 ∆n .
Assume now that m 1 > m1 . This time we write:

x ⊺ Dχ 1 = m1 m 1 x ⊺ D 1 V 1 - m 1 m1 1 V1
and we set w

= D 1 V 1 -m 1 m1 1 V1 . Note that, again, |w(v)| 1 for every v ∈ V . Proceeding as in the previous case we obtain |γ 1 | m1 m 1 • 1 m with probability 1 -O 1
√ n and thus, with the same probability:

|y(u)| = |γ 1 | m1 m 1 m1 mm 1 = m -m 1 mm 1 (a) 1 m 1 ∆n ,
where in (a) we used that m i < m 2 (see Remark 2). This concludes the proof.

In Lemma 4.3 we show that given any "pair of steps" of the vector y (defined in Eq. ( 6)), the two steps have different signs, with constant probability. and with k > 2∆(n max /n min ). For each pair of nodes u ∈ V i and v ∈ V j , with i = j, it holds that P ( sgn(y(u)) = sgn(y(v)) ) = Ω(1).

Proof. Since the ordering of the communities (and consequent definition of the χ i 's, given in Eq. ( 5)) is completely arbitrary, we can assume i = 1 and j = 2, without loss of generality. Let us define X(V i ) := w∈V i δ(w)x(w), where x = x (0) is the initial state vector.

Note that y(u) = γ 1 χ 1 (u) and y(v) = γ 1 χ 1 (v) + γ 2 χ 2 (v), since the other terms of the χ i s are equal to 0 on the components relative to u and v. Thus, with some algebra, we get

y(u) = 1 m m1 m 1 X(V 1 ) -X(V 2 ) -X( V2 ) , y(v) = 1 m m 1 m 2 + m m2 m1 m 2 X(V 2 ) -X(V 1 ) -X( V2 ) ,
where Vi := k h=i+1 V h . Note that, by linearity of expectation, E [X(V i )] = 0. Moreover, since the terms x(w)s are independent Rademacher random variables, we can write the standard deviation of X(V i ) as

σ(X(V i )) = w∈V i σ 2 (δ(w)x(w)) = w∈V i E [δ(w) 2 x(w) 2 ] -E [δ(w)x(w)] 2 = w∈V i δ(w) 2 .
Then we can upper and lower bound the standard deviation σ(X

(V i )) getting m i √ n i σ(X(V i )) ∆
√ n i , where the lower bound follows from d 2 d 1 / √ n i , where d i is the vector of weighted degrees of nodes in community V i , and for the upper bound we used that δ(w) ∆, for each w ∈ V .

Let us now define the following three events:

1

. E 1 : X(V 1 ) > σ(X(V 1 )) =⇒ X(V 1 ) > m 1 √ n 1 min i m i √ n max ; 2. E 2 : X(V 2 ) < -σ(X(V 2 )) =⇒ X(V 2 ) < -m 2 √ n 2 -min i m i √ n max ; 3. E 3 : 0 X( V2 ) < 2/ √ k σ(X( V2 )) =⇒ 0 X( V2 ) < 2∆ (1/k) k i=3 n i 2∆ √ n max ,
When E 1 , E 2 , E 3 are true it follows directly that y(v) < 0. As for y(u) > 0 we have

m1 m 1 X(V 1 ) -X(V 2 ) -X( V2 ) > m1 m 1 σ(X(V 1 )) + σ(X(V 2 )) -(2/ √ k) • σ(X( V2 )) kn min √ n max -2∆ √ n max > 0,
since, for the last inequality, k > 2∆(n max /n min ) by hypothesis.

Note that all three events E 1 , E 2 , E 3 have probability at least constant and, being the events independent, also P (E 1 ∩ E 2 ∩ E 3 ) is constant. Indeed, it is possible to prove the constant lower bounds on the probabilities by approximating the random variables with Gaussian ones using Berry-Esseen's theorem (Theorem A.4). Note that X(V 1 ), X(V 2 ), X( V2 ) all are of the form Z =

w∈T Z w , for some T ⊆ V and where Z w = δ(w)x(w). Recall that E [Z w ] = 0 and that σ 2 (Z w ) = δ(w) 2 . Moreover, note that the third absolute moment of 3 . Therefore we can apply Theorem A.4 which claims that there exists a positive constant C 1.88 [START_REF] Andrew | The accuracy of the gaussian approximation to the sum of independent variates[END_REF] such that, for every z ∈ R,

Z w is E |Z w | 3 = δ(w) 3 E |x(w)| 3 = δ(w)
|P (Z z • σ(Z)) -Φ(z)| C σ(Z) max w∈T δ(w) 3 δ(w) 2 C • ∆ σ(Z) ,
where Φ is the cumulative distribution function of the standardized normal distribution. Thus

P (Z > z • σ(Z)) 1 -Φ(z) - C • ∆ σ(Z) . (7) Since ∆
√ n min 25 by hypothesis and σ(Z) |T | for every T ⊆ V , taking z = 1 it follows from Eq. ( 7) that

P (E 1 ) = P (X(V 1 ) > σ(X(V 1 ))) 1 -Φ(1) - C • ∆ √ n min 1 -Φ(1) - C 25 1 -Φ(1) 2 ≈ 0.08, since 1 25 < 1-Φ(1)

2C

≈ 0.042. Since the distribution of Z is symmetric for every T ⊆ V , it holds that P (E 2 ) 1 -Φ(1) -C 25 ≈ 0.08. Similarly, it also holds that

P (E 3 ) = 1 2 -P X( V2 ) > 2/ √ k σ(X( V2 )) Φ(2/ √ k) + C 25 - 1 2 > C 25 ≈ 0.075.
Recall that the binary labeling of each node only depends on the difference of its state in two consecutive rounds (see Algorithm 1). In Lemma 4.4 we show that, under suitable assumptions on the transition matrix of a random walk on G, a large enough time window exists where, for each node u, the sign of the difference x (t) (u)x (t+1) (u) of the state vector across two consecutive rounds equals the sign of y(u), w.h.p. Since y (defined in Eq. ( 6)) is a stepwise vector, this implies that two nodes in the same community have the same label, w.h.p. For the sake of readability, in the proof of Lemma 4.4 we use two technical lemmas as black boxes, postponing their proofs to Subsection 4.1.

Lemma 4.4 (Sign of the difference). Let G = (V, E, w) be a clustered k-volume regular graph with maximum weighted degree

∆ √ n min 25 . If λ k 7λ 2 -5 2 , 1 -λ 2 λ k log(λ k /λ k+1 ) 7 log(2∆n) , |y(u)| 1 ∆n for every u ∈ V , then a non-empty time interval [T 1 , T 2 ] exists, with T 1 = O log n log(λ k /λ k+1 ) and T 2 = Ω λ k 1-λ 2 , such that, for every u ∈ V and every t ∈ [T 1 , T 2 ] of the Averaging dynamics, sgn( x (t) (u) -x (t+1) (u) ) = sgn(y(u)).
Proof. Recall from Eq. (1) that the state vector at time t, i.e., x (t) , can be written as the sum of the first k stepwise vectors of P and of the remaining ones, namely

x (t) = α 1 1 + k i=2 λ t i α i v i + n i=k+1 λ t i α i v i = α 1 1 + c (t) + e (t)
.

In what follows we call c (t) := k i=2 λ t i α i v i the core contribution and e (t) := n i=k+1 λ t i α i v i the error contribution. If we look at the difference of the state vector in two consecutive rounds, the first term cancels out being constant over time, so that

x (t) (u) -x (t+1) (u) = c (t) (u) -c (t+1) (u) + e (t) (u) -e (t+1) (u)
for each node u ∈ V . Note that the sign of the difference between two consecutive rounds is determined by the difference of the core contributions, c (t) (u)c (t+1) (u), whenever

c (t) (u) -c (t+1) (u) > e (t) (u) -e (t+1) (u) . (8)
To identify conditions on t for which Eq. ( 8) holds, we give suitable bounds on both hand sides of the inequality. In more detail:

1. In Lemma 4.5 we prove that |e (t) (u)| λ t k+1 √ ∆n, for every u ∈ V , so that

e (t) (u) -e (t+1) (u) e (t) (u) + e (t+1) (u) 2λ t k+1 √ ∆n.
2. In Lemma 4.6 we prove that

c (t) (u) -c (t+1) (u) > λ t k (1 -λ 2 ) |y(u)
| for every u ∈ V and for every time t < T 2 , where T 2 λ k 2(1-λ 2 ) ; note that the hypotheses on 1 -λ 2 imply T 2 = Ω log n log(λ k /λ k+1 ) . Moreover, the assumptions of Lemma 4.6 are satisfied, since y(u) = 0 and λ k 7λ 2 -5 2 . Combining Lemma 4.5 and Lemma 4.6, we see that Eq. (8) holds whenever

λ t k (1 -λ 2 ) |y(u)| > 2λ t k+1 √ ∆n, (9)
An easy calculation shows that this happens for all t > T 1 , where

T 1 := log 2 √ ∆n (1-λ 2 )|y(u)| log (λ k /λ k+1 ) . Note that T 1 = O log n log(λ k /λ k+1 )
and, e.g., T 1 = O(log n) whenever λ k λ k+1 = 1 + Ω(1). We next show that, under the assumptions of the lemma, the window [T 1 , T 2 ] is not empty and, actually, it has a width that depends on the magnitude of λ 2 and the ratio λ k /λ k+1 . To this purpose, we first observe that Cheeger's inequality for weighted graphs (Theorem A.3)

implies 1 -λ 2 h 2 G 2 1
2(∆n) 2 (recall the footnote in Remark 1). Moreover, recalling that we are assuming |y(u)| 1 ∆n ,7 we have:

T 1 = log 2 √ ∆n (1-λ 2 )|y(u)| log (λ k /λ k+1 ) (a) log 4∆ 3 n 3 √ ∆n log (λ k /λ k+1 ) < 7 log(2∆n) 2 log (λ k /λ k+1 ) (b) λ k 2(1 -λ 2 ) (c) T 2 , (10)
where: in (a) we used Cheeger's inequality (Theorem A.3) in the way described above and our assumptions on |y(u)|, in (b) we used the hypothesis on 1 -λ 2 , which implies log(λ k /λ k+1 )

7(1-λ 2 ) log(2∆n) λ k
, and in (c) the lower bound on T 2 given by Lemma 4.6. From Lemma 4.6 we also know that = sgn(c (t) (u)c (t+1) (u)) = sgn(y(u)) for every time t < T 2 ; therefore we conclude that sgn(x (t) (u)x (t+1) (u)) = sgn(c (t) (u)c (t+1) (u)) = sgn(y(u)) , for every node u ∈ V and for every round t ∈ [T 1 , T 2 ] of the Averaging dynamics.

Proof of Theorem 4.1. The binary labeling of the nodes of G produced by the Averaging dynamics during the time window [T 1 , T 2 ] is such that the two conditions required by the definition of (ε, δ)-community-sensitive algorithm (Definition 2.1) are met, with ε = O(n -1/2 ) and δ = 1 -Ω(1). Indeed, the first condition follows directly from Lemma 4.4 together with the fact that y is a "stepwise" vector, while Lemma 4.2 implies that ε = O(n -1 2 ), since y(u) is not too small with probability at least 1 -O(n -1/2 ). The second condition, instead, follows directly from the combination of Lemmas 4.3 and 4.4.

Remark 3 (Equal-sized communities). If λ k = λ 2 , then an alternative version of Lemma 4.6 would tell us that, for every node

u ∈ V , c (t) (u) -c (t+1) (u) = λ t k (1 -λ 2 )y(u)
and thus sgn(c (t) (u)c (t+1) (u)) = sgn(y(u)), in every round (with no need of T 2 ); this would imply an infinite time window starting at the first round t > T 1 (where the "error contribution" becomes small). In this sense our result also covers the case of multiple communities analyzed in [BCN + 17], with k equal-sized communities in an unweighted graph and then λ k = λ 2 .

Remark 4 (Two communities). Our result also generalizes that of [BCN + 17] in the simpler case of two communities. In fact we don't require the graph to be regular, but only volumeregular, thus taking into account communities that are potentially unbalanced. Ideed, for k = 2, the Averaging dynamics truncated at round t is a (O(n -1 2 ), O(n -1 2 ))-community-sensitive algorithm for every round t > T 1 , with T 1 = O log n log(λ 2 /λ 3 ) . Therefore, a single run of the dynamics highlights the community structure, i.e., the sign of the difference x (t)x (t) is equal for nodes in the same communities and different for nodes in different communities, w.h.p.

Proofs for Lemma 4.4

In this section we prove the two lemmas used in the proof of Lemma 4.4: the upper bound on the "error contribution" and the lower bound on the "core contribution." Lemma 4.5 (Upper bound on the error contribution). Let e (t) := n i=k+1 λ t i α i v i . For every u ∈ V , it holds that

|e (t) (u)| λ t k+1 √ ∆n.
Proof. To bound all components of vector e (t) we use its ℓ ∞ norm, defined for any vector x as x ∞ := sup i |x(i)|. In particular

e (t) 2 ∞ e (t) 2 = n i=k+1 λ t i α i v i 2 = n i=k+1 λ t i β i D -1 2 w i 2 .
By using Cauchy-Schwarz inequality (Theorem A.2) and applying the definition of spectral norm of an operator, i.e., A := sup x: x=1 Ax , we get that

n i=k+1 λ t i β i D -1 2 w i 2 D -1 2 2 n i=k+1 λ t i β i w i 2 = D -1 2 2 n i=k+1 λ 2t i β 2 i ,
since the w i s are orthonormal. With some additional simple bounds it follows that

D -1 2 2 n i=k+1 λ 2t i β 2 i D -1 2 2 λ 2t k+1 n i=k+1 β 2 i D -1 2 2 λ 2t k+1 n i=1 β 2 i = D -1 2 2 λ 2t k+1 D 1 2 x 2 D -1 2 2 λ 2t k+1 D 1 2 2 x 2 .
By using the fact that the spectral norm of a diagonal matrix is equal to its maximum value, we conclude that

D -1 2 2 λ 2t k+1 D 1 2 2 x 2 = max u δ(u) min u δ(u) λ 2t k+1 x 2 λ 2t k+1 ∆n.
Thus, for every u ∈ V it holds that

|e (t) (u)| e (t) 2 ∞ λ t k+1 √ ∆n.
In Lemma 4.6 we show that the difference of the core contribution in consecutive rounds can be approximated, for our purposes in Lemma 4.4, with y.

Lemma 4.6 (Lower bound on the core contribution). Let c (t) := k i=2 λ t i α i v i and let y(u) = 0 for every u ∈ V . If λ k 7λ 2 -5 2 , then, for every u ∈ V and for every t T 2 , with T 2 λ k 2(1-λ 2 ) , the following holds:

• sgn(c (t) (u)c (t+1) (u)) = sgn(y(u));

• c (t) (u) -c (t+1) (u) > λ t k (1 -λ 2 ) |y(u)|.
Proof. Let us define d i,j := λ i -λ j . Note that

c (t) -c (t+1) = k i=2 λ t i (1 -λ i )α i v i = k i=2 (λ k + d i,k ) t (1 -λ 2 + d 2,i )α i v i = k i=2 [λ t k + (λ k + d i,k ) t -λ t k ](1 -λ 2 + d 2,i )α i v i = k i=2 [λ t k (1 -λ 2 ) + c i ]α i v i = λ t k (1 -λ 2 ) k i=2 α i v i + k i=2 c i α i v i = λ t k (1 -λ 2 )y + k i=2 c i α i v i ,
where in the last equality we applied Lemma 2.4 to get k i=2 α i v i = y, and where we defined

c i := λ t k d 2,i + [(λ k + d i,k ) t -λ t k ](1 -λ 2 + d 2,i
). Using the definition of d i,j , we get

c i = λ t k d 2,i + [(λ k + d i,k ) t -λ t k ](1 -λ 2 + d 2,i ) = λ t k (λ 2 -λ i ) + [(λ k + (λ i -λ k )) t -λ t k ](1 -λ 2 + (λ 2 -λ i )) = λ t k (λ 2 -λ i ) + (λ t i -λ t k )(1 -λ i ) = λ t i (1 -λ i ) -λ t k (1 -λ 2 ). Note that min i [λ t i (1-λ i )]-λ t k (1-λ 2 ) c i max i [λ t i (1-λ i )]-λ t k (1-λ 2 )
, for every i ∈ {2, . . . , k}. Since the minimum and the maximum are obtained for i = k and i = 2 respectively, we have

λ t k (λ 2 -λ k ) c i (λ t 2 -λ t k )(1 -λ 2 ).
Let us call the positive and negative terms of y(u) as

y + (u) := i:α i v i (u)>0 α i v i (u) and y -(u) := - i:α i v i (u)<0 α i v i (u).
Therefore, for each u ∈ V , it holds that

c (t) (u) -c (t+1) (u) λ t k (1 -λ 2 )y(u) + λ t k (λ 2 -λ k )y + (u) -(λ t 2 -λ t k )(1 -λ 2 )y -(u), (11)
c (t) (u) -c (t+1) (u) λ t k (1 -λ 2 )y(u) + (λ t 2 -λ t k )(1 -λ 2 )y + (u) -λ t k (λ 2 -λ k )y -(u). ( 12
)
In the following we look for a time T 2 such that, for every t T 2 it holds that

c (t) (u) -c (t+1) (u) > λ t k (1 -λ 2 ) |y(u)| .
Note that y(u) = y + (u)y -(u). We consider two cases: y(u) > 0 and y(u) < 0. Case y(u) > 0: We look for a time T 2 such that, for every time t T 2 , it holds that

λ t k (λ 2 -λ k )y + (u) > (λ t 2 -λ t k )(1 -λ 2 )y -(u). ( 13
)
Indeed, since y(u) > 0, we can use y + (u) > y -(u) to upper bound the right hand side of the previous equation, so that Eq. ( 13) holds for every t that satisfies:

λ t k (λ 2 -λ k ) > (λ t 2 -λ t k )(1 -λ 2 ) ⇐⇒ λ 2 λ k t < 1 -λ k 1 -λ 2 ,
i.e., for every t T 2 , where

T 2 := ln 1-λ k 1-λ 2 ln λ 2 λ k = ln 1 + λ 2 -λ k 1-λ 2 ln 1 + λ 2 -λ k λ k . Next, note that λ 2 -λ k 1-λ 2 5 2 whenever λ k 7λ 2 -5
2 . Hence, under the hypotheses of the lemma, we can use that 1 + x e x 2 for every x ∈ [0, 5 2 ] and 1 + x e x for every x. Thus:

T 2 = ln 1 + λ 2 -λ k 1-λ 2 ln 1 + λ 2 -λ k λ k λ 2 -λ k 2(1-λ 2 ) λ 2 -λ k λ k = λ k 2(1 -λ 2 )
.

Plugging Eq. (13) into Eq. ( 11) we finally get

c (t) (u) -c (t+1) (u) > λ t k (1 -λ 2 )y(u) > 0. ( 14
)
Case y(u) < 0: Proceeding along the same lines we obtain:

(λ t 2 -λ t k )(1 -λ 2 )y + (u) < λ t k (λ 2 -λ k )y -(u) (15)
for every t T 2 . Therefore, by combining Eq. (15) and Eq. ( 12) we obtain

c (t) (u) -c (t+1) (u) < λ t k (1 -λ 2 )y(u) < 0. ( 16
)
Finally, by combining Eq. ( 14) and Eq. ( 16):

• sgn(c (t) (u)c (t+1) (u)) = sgn(y(u));

• c (t) (u) -c (t+1) (u) > λ t k (1 -λ 2 ) |y(u)|.

Bipartite graphs

Assume G = (V, E, w) is an edge-weighted bipartite graph with

V = V 1 ∪ V 2 and E ⊆ V 1 × V 2 ,
i.e. a graph with hidden partition identified by the bipartition. In this case, basic properties of random walks imply that the Averaging dynamics does not converge to the global (weighted) average of the values, but it periodically oscillates. In fact, in this case the transition matrix P has an eigenvector χ = 1 V 1 -1 V 2 with eigenvalue λ n = -1 (as implied by Lemma 5.1). Thus, the state vector is mainly affected by the eigenvectors associated to the two eigenvalues of absolute value 1 (i.e., λ 1 and λ n ). After a number of rounds of the dynamics that depends on 1/λ 2 , we have that, in even rounds, all nodes in V i (i = 1, 2) have a state that is close to some local average µ i ; in odd rounds, these values are swapped (as shown in Eq. ( 17)).

If one were observing the process in even rounds,8 however, the states of nodes in V 1 would converge to µ 1 and those of nodes in V 2 would converge to µ 2 . Unfortunately, convergence to the local average for nodes belonging to the same community does not eventually become monotone (i.e., increasing or decreasing). This follows since the eigenvector associated to λ 2 is no longer stepwise in general. However, we can easily modify the labeling scheme of the Averaging dynamics to perform bipartiteness detection as follows: Nodes apply the labeling rule every two time steps and they do it between the states of two consecutive rounds, i.e., each node v ∈ V sets label (2t) (v) = 1 if x (2t) (v) x (2t-1) (v) and label (2t) (v) = 0 otherwise. We call this new protocol Averaging Bipartite dynamics.

We now show how Averaging Bipartite dynamics can perform bipartiteness detection. Recall that we denote with W ∈ R n×n the weighted adjacency matrix of G. Since G is undirected and bipartite, the matrix W can be written as

W = 0 W 1 W 2 0 = 0 W 1 W ⊺ 1 0 .
Thus, the transition matrix of a random walk on G, i.e., P = D -1 W where D -1 is a diagonal matrix and D ii = 1 δ(i) , has the form

P = 0 P 1 P ⊺ 1 0 .
Lemma 5.1 shows that the spectrum of P is symmetric and it gives a relation between the eigenvectors of symmetric eigenvalues.

Lemma 5.1. Let G = (V 1 ∪ V 2 , E, w) be an edge-weighted undirected bipartite graph with bipartition

(V 1 , V 2 ) and such that |V i | = n i . If v = (v 1 , v 2 ) T , with v i ∈ R n i , is an eigenvector of P with eigenvalue λ, then v ′ = (v 1 , -v 2 )
⊺ is an eigenvector of P with eigenvalue -λ.

Proof. If P v = λv then we have that P 1 v 2 = λv 1 and P ⊺ 1 v 2 = λv 2 . Using these two equalities we get that P v ′ = -λv ′ . Indeed,

P v ′ = 0 P 1 P ⊺ 1 0 v 1 -v 2 = -P 1 v 2 P ⊺ 1 v 1 = -λ v 1 -v 2 .
The transition matrix P is stochastic, thus the vector 1 (i.e., the vector of all ones) is an eigenvector associated to λ 1 = 1, that is the first largest eigenvalue of P . Lemma 5.1 implies that χ

= 1 V 1 -1 V 2 is an eigenvector of P with eigenvalue λ n = -1.
As in Section 2, we write the state vector at time t using the spectral decomposition of P . Let 1 = λ 1 > λ 2 . . . > λ n = -1 be the eigenvalues of P . We denote by 1 = v 1 , v 2 , . . . , v n = χ a family of n linearly independent eigenvectors of P , where each v i is the eigenvector associated to λ i . Thus, we have that

x (t) = P t x = n i=1 λ t i α i v i = α 1 1 + (-1) t α n χ + n-1 i=2 λ t i α i v i (17)
where

α i = D 1 2 x,D 1 2 v i D 1 2 v i 2
. The last equation implies that x (t) = P t x does not converge to some value as t tends to infinity, but oscillates. In particular, nodes in V 1 on even rounds and nodes in V 2 on odd rounds, converge to α 1 + α n . Instead in the symmetric case, i.e., odd rounds for nodes in V 1 and even rounds for nodes in V 2 , the process converges to α 1 -α n . These quantities are proportional to the weighted average of the initial values in the first and in the second partition, respectively. Theorem 5.2, whose proof follows, shows that Averaging Bipartite dynamics performs bipartiteness detection in O(log n / log(1/λ 2 )) rounds. Note that, as in the case of volumeregular graphs with two communities (see Remark 4), one single run of the dynamics identifies the bipartition. Moreover, if log(1/λ 2 ) = Ω(1), then the Averaging Bipartite dynamics takes logarithmic time to find the bipartition.

Theorem 5.2. Let G = (V, E, w) be an edge-weighted bipartite graph with bipartition (V 1 , V 2 ) and maximum weighted degree ∆ = O(n K ), for any arbitrary positive constant K. Then for every time t > T , with T = O(log n / log(1/λ 2 )), the Averaging Bipartite dynamics truncated at round t is a (O(n -1 2 ), O(n -1 2 ))-community-sensitive algorithm.

Proof. We assume that the labeling rule is applied between every even and every odd round (conversely, the signs of the nodes in the analysis are swapped). Recall the definition of the error contribution, namely e (t) (u) = n-1 i=2 λ t i α i v i (u). We compute the difference between the state vectors of two consecutive steps by using Eq. (17), namely x (2t)x (2t+1) = α 1 1 + (-1) 2t α n χ + e (2t) -α 1 1 -(-1) 2t+1 α n χe (2t+1) = 2α n χ + e (2t)e (2t+1) .

We want to find a time T such that for every t > T the sign of a node u ∈ V depends only on χ(u), i.e., sgn(x (2t) (u)x (2t+1) (u)) = sgn(α n χ(u)). Since |χ(u)| = 1, the last equation holds whenever 2|α n | > |e (2t) (u)e (2t+1) (u)|.

We upper bound |e (2t) (u)e (2t+1) (u)| by using Lemma 4.5, getting that |e (2t) (u)e (2t+1) (u)| 2λ 2t 2 √ ∆n. Therefore, with some algebra we get that Eq. ( 18) holds in every round t > T , where T is defined as

T := log √ ∆n/|α n | 2 log(1/λ 2 ) .
To conclude the proof, we provide a lower bound on |α n | showing that it is not too small, w.h.p.

Recall that

α i = D 1 2 x,D 1 2 v i D 1 2 v i 2
and thus

α n = D 1 2 x, D 1 2 χ D 1 2 χ 2 = 1 vol(V ) v∈V δ(v)x(v)χ(v). (19)
The lower bound then follows, with high probability. Indeed,

P |α n | 1 ∆n P |α n | 1 vol(V ) (a) = P v∈V δ(v)x(v)χ(v) 1 (b) = O 1 √ n ,
where in (a) we used Eq. ( 19) and in (b) we applied Theorem A.5. The thesis then follows from the above bound on |α n | and from the hypothesis on ∆ = O(n K ), for any arbitrary positive constant K.

Discussion and Outlook

The focus of this work is on heuristics that implicitely perform spectral graph clustering, without explicitely computing the main eigenvectors of a matrix describing connectivity properties of the underlying network (typically, its Laplacian or a related matrix). In this perspective, we extended the work of Becchetti et al. [BCN + 17] in several ways. In particular, for k communities, [BCN + 17] considered an extremely regular case, in which the second eigenvalue of the (normalized) Laplacian has algebraic and geometric multiplicities k -1 and the corresponding eigenspace is spanned by a basis of indicator vectors. We considered a more general case in which the first k eigenvalues are in general different, but the span of the corresponding eigenvectors again admits a base of indicator vectors. We also made a connection between this stepwise property and lumpability properties of the underlying random walk, which results in a class of volume-regular graphs, that may not have constant degree, nor exhibit balanced communities. We further showed that our approach naturally lends itself to addressing related, yet different problems, such as identifying bipartiteness. Finally, in the paragraphs that follow we discuss extensions to slightly more general classes than the ones considered in this work.

Other graph classes. Consider k-volume regular graphs whose k stepwise eigenvectors are associated to the k largest eigenvalues, in absolute value. These graphs include many k-partite graphs (e.g., regular ones), graphs that are "close" to being k-partite (i.e., ones that would become k-partite upon removal of a few edges). Differently from the clustered case (Theorem 4.1) some of the k eigenvalues can in general be negative. Consider the following variant of the labeling scheme of the Averaging dynamics, in which nodes apply their labeling rule only on even rounds, comparing their value with the one they held at the end of the last even round, i.e., each node v ∈ V sets label (2t) (v) = 1 if x (2t) (v) x (2t-2) (v) and label (2t) (v) = 0 otherwise. Since the above protocol amounts to only taking even powers of eigenvalues, the analysis of this modified protocol proceeds along the same lines as the clustered case, while the results of Theorem 4.1 seamlessly extend to this class of graphs.

Outlook. Though far from conclusive, we believe our results point to potentially interesting directions for future research. In general, our analysis sheds further light on the connections between temporal evolution of the power method and spectral-related clustering properties of the underlying network. At the same time, we showed that variants of the Averaging dynamics (and/or its labeling rule) might be useful in addressing different problems and/or other graph classes, as the examples given in Section 5 suggest. On the other hand, identifying k hidden partitions using the algorithm presented in [BCN + 17] requires relatively strong assumptions on the k main eigenvalues and knowledge of an upper bound to the graph size, 9 while the analysis becomes considerably more intricate than the perfectly regular and completely balanced case addressed in [BCN + 17]. Some aspects of our analysis (e.g., the aforementioned presence of a size-dependent time window in which the labeling rule has to be applied) suggest that more sophisticated variants of the Averaging dynamics might be needed to express the full power of a spectral method that explicitely computes the k main eigenvectors of a graph-related matrix. While we believe this goal can be achieved, designing and analyzing such an algorithm might prove a challenging task.

Theorem 4. 1 .

 1 Let G = (V, E, w) be a connected clustered k-volume-regular graph with n nodes and k-partitionV = {V 1 , . . . , V k }, such that ∆ √ n min 25 and 2∆(n max /n min ) < k √ n. Assume further that 1 -λ 2 λ k log(λ k /λ k+1 ) 7 log(2∆n)

  Lemma 4.3 (Different communities, different signs). Let G = (V, E, w) be a clustered k-volume regular graph with maximum weighted degree ∆ √ n min 25

An event En holds with high probability (w.h.p.) if P (En) = 1 -O(n -γ ), for some constant γ > 0.

Nodes do not possess distinguished identities.

A is the adjacency matrix of G, J is the matrix having all entries equal to 1, d is the average degree, and n is the number of vertices.

Here and in the remainder, 1 denotes the vector whose entries are 1.

This can be seen by observing that: i) the minimum volume of a cut must be at least half the minimum degree of the graph, which we normalize to 1, and ii) in computing hG, we restrict to subsets of volume at most vol(G), which is at most ∆n.

The mutual orthogonality of the vectors, including D 1 2 1, is also one of the reasons why other "simpler" families of stepwise vectors, e.g., the indicator vectors of the communities, are not used instead.

It may be worth recalling that our hypothesis on |y(u)| holds with high probability from Lemma 4.2.

Or, equivalently, in odd rounds.

As anecdotal experimental evidence suggests, the presence of a time window to perform labeling is not an artifact of our analysis.

* Partially supported by ERC Advanced Grant 788893 AMDROMA "Algorithmic and Mechanism Design Research in Online Markets" and MIUR PRIN project ALGADIMAR "Algorithms, Games, and Digital Markets"

† Partially supported by the University of "Tor Vergata" under research programme "Mission: Sustainability" project ISIDE (grant no. E81I18000110005)

A Useful inequalities

Theorem A.1 (Extension of Chernoff Bounds [START_REF] Devdatt | Concentration of measure for the analysis of randomized algorithms[END_REF]). Let X = n i=1 X i where X i are independent distributed random variables taking values in {0, 1} and let µ = E [X]. Suppose that µ L µ µ H . Then, for 0 < δ < 1,

Theorem A.2 (Cauchy-Schwarz's inequality). For all vectors u, v of an inner product space it holds that Then

Theorem A.4 (Berry-Esseen's theorem [START_REF] Andrew | The accuracy of the gaussian approximation to the sum of independent variates[END_REF]). Let X 1 , . . . , X n be independent random variables with mean µ i = 0, variance σ 2 i > 0, and third absolute moment ρ i < ∞, for every i = 1, . . . , n. Let S n = n i=1 X i and let σ = n i=1 σ 2 i be the standard deviation of S n ; let F n be the cumulative distribution function of Sn σ ; let Φ the cumulative distribution function of the standard normal distribution. Then, there exists a positive constant C such that, for all x and for all n,

where ψ := max i∈{1,...,n}

Theorem A.5 (Littlewood-Offord's small ball [START_REF] Erdös | On a lemma of littlewood and offord[END_REF]). Let a 1 , . . . , a n ∈ R be real numbers with |a i | 1 for every i = 1, . . . , n and let r ∈ R be any real number. Let {X i : i = 1, . . . , n} be a family of independent Rademacher random variables (taking values ±1 with probability 1/2) and let X be their sum weighted with the a i s, i.e., X = n i=1 a i X i , then