Network partitioning algorithms as cooperative games
Abstract
The paper is devoted to gametheoretic methods for community detection in networks. The traditional methods for detecting community structure are based on selecting dense subgraphs inside the network. Here we propose to use the methods of cooperative game theory that highlight not only the link density but also the mechanisms of cluster formation. Specifically, we suggest two approaches from cooperative game theory: the first approach is based on the Myerson value, whereas the second approach is based on hedonic games. Both approaches allow to detect clusters with various resolutions. However, the tuning of the resolution parameter in the hedonic games approach is particularly intuitive. Furthermore, the modularitybased approach and its generalizations as well as ratio cut and normalized cut methods can be viewed as particular cases of the hedonic games. Finally, for approaches based on potential hedonic games we suggest a very efficient computational scheme using Gibbs sampling.
Keywords
Network partitioning Community detection Cooperative game Myerson value Hedonic game Gibbs samplingIntroduction
Community detection in networks is a very important topic which has numerous applications in social network analysis, computer science, telecommunications, and bioinformatics and has attracted the effort of many researchers. In the present work, we consider the framework of crisp community detection or network partitioning, where one would like to partition a network into disjoint sets of nodes. The consideration of overlapping, hierarchical, and local clustering we leave for future research. Even the literature on crisp community detection is huge. We refer to several extensive survey papers [1, 2, 3, 4, 5, 6]. Let us just mention main classes of methods for network partitioning. The first very large class is based on spectral elements of the network matrices such as adjacency matrix and Laplacian (see e.g., the surveys [1, 5] and references therein). The second class of methods is based on the use of random walks (see e.g., [7, 8, 9, 10, 11, 12] for the most representative works in this research direction). The third class of approaches to network partitioning is based on the optimization of some objective function [13, 14, 15, 16, 17, 18, 19], with modularity function [15, 16] as a notable example in this category. Finally, the fourth class, directly related to the present work, is based on the notions from game theory. We recommend to an interested reader a recent survey [4] on the application of gametheoretic techniques to community detection. Most bibliography described in [4] is in fact dedicated to noncooperative game theory approaches. It appears that the application of the cooperative or coalition games to community detection problem is underdeveloped and thus with this article we advance this research area.
There are definitely many relations among the abovementioned classes. In particular, the conditions for minima of the objective functions can often be interpreted in terms of the eigen elements of the network matrices. The eigen elements of the network matrices also characterize the stationary or quasistationary state of a random walk on a network. In the present work, we show more connections between the approach based on cooperative games and other approaches.
In essence, all the abovementioned approaches, with exception of the game theory approach, try to detect dense subgraphs inside the network and do not address the question: what are the natural forces and dynamics behind the formation of network clusters. As noticed in [20], most of traditional clustering methods pursue a topdown approach, whereas typically communities are formed by local interactions in selforganizing fashion, often driven by egocentric decisions. Thus, it is very natural to apply game theory, and in particular, coalition game theory for community detection problem. Also, in most of the abovementioned methods, the number of communities is a prerequisite parameter. The game theory approach typically does not require a priori knowledge of the number of communities. One more very important benefit in using the methods from game theory is that such methods are naturally distributed and can easily be implemented in clouds and decentralized multiagent systems.
In the present work, we explore two cooperative game theory approaches to explain possible mechanisms behind cluster formation. Our first approach is based on the Myerson value in cooperative game theory, which particularly emphasizes the value allocation in the context of games with interactions between players constrained by a network. The advantage of the Myerson value is in taking into account the impact of all coalitions. We extend the method developed in [21, 22] to calculate efficiently the Myerson value in a network. A number of network centrality measures based on gametheoretic concepts have been developed, see [22, 23, 24, 25, 26, 27, 28] and references therein. It might be interesting to combine node ranking and clustering based on the same approach such as the Myerson value to analyze the network structure. Unfortunately, the computation of the Myerson value is a very difficult problem even for a moderately large number of players. Therefore, we propose the second approach which has efficient computational implementation and can easily be distributed.
The second approach is based on hedonic games [29], which are games explaining well the mechanism behind the formation of coalitions. Both our approaches allow to detect clusters with varying resolutions and thus avoiding the problem of resolution limit [30, 31]. The hedonic game approach is especially well suited to adjust the level of resolution as the limiting cases are given by the grand coalition and sequential maximum clique decomposition, two very natural extreme cases of network partitioning. Furthermore, the modularitybased approaches as well as ratio cut [32] and normalized cut [10, 33] based methods can be cast in the setting of hedonic games. We find that this gives one more, very interesting, interpretation of the modularitybased methods. The advantage of casting the ratio cut and normalized cut in the framework of hedonic games is that we do not need to prespecify the number of clusters as was needed in the original formulations of these methods.
Some hierarchical network partitioning methods based on tree hierarchy, such as [15], cannot produce a clustering on one resolution level with the number of clusters different from the predefined tree shape. Furthermore, the majority of clustering methods require the number of clusters as an input parameter. In contrast, in our approaches we specify the value of the resolution parameter(s) and the method gives a natural number of clusters corresponding to the given resolution parameter(s).
Let us point out major differences between our approaches and approaches suggested in the other works on cooperative game theory for network clustering. In [34], a cooperative game theory approach based on Shapley value has been proposed. However, with the proposed characteristic function, the players tend to form the grand coalition. In the subsequent work [35], a new characteristic function has been proposed, which combines both linkbased as well as attributebased information. The Shapley value associated with that characteristic function is very cumbersome to compute in comparison to the Myerson value for the characteristic function proposed in the first part of our paper. Of course, we admit that the computation of any type of Shapley value is computationally demanding and this is why we propose the second approach which has an efficient, naturally distributed, computational implementation.
The authors of [20] have also proposed to use hedonic games for community detection. They consider only the modularity metric as value function. They have suggested an additional voting mechanism to overcome the resolution problem. Their algorithm is a version of greedy optimization. Our approach is much more general: not only we show that the modularity optimization is a particular case of our approach but we also demonstrate that such known methods as ratio cut and normalized cut are also particular cases of our approach. We also propose a couple of new functions that overcome the resolution problem without a need of additional voting mechanism. Our Gibbs samplingbased algorithm can be used with both fixed and decreasing temperature and hence can be used for local as well as global maxima search. Setting the temperature to a very low value corresponds to the greedy approach.
The authors of [36] in the first part of their paper propose to use the concept of strong Nash equilibrium in addition to the concept of hedonic games. They also define a community as a \((\lambda ,\gamma )\)relaxation of the clique. There are several serious problems with their propositions. First of all, the strong Nash equilibrium might not exist (they acknowledge this fact themselves in their work), and such equilibrium is very hard to compute even if it exists. Furthermore, they give two definitions of a maximal \((\lambda ,\gamma )\)relaxation of the clique which are contradictory and therefore their algorithm can cycle.
We also note that our approaches based on cooperative games easily work with multigraphs, where several edges (links) are possible between two nodes. A multiedge has several natural interpretations in the context of social networks. A multiedge can represent a number of telephone calls; a number of exchanged messages; a number of common friends; or a number of cooccurrences in some social event.

First the cooperative game theory approach based on the Myerson value is proposed for network partitioning.

Then the hedonic coalition formation framework is proposed for network partitioning which has more efficient computational implementation than the approach based on the Myerson value.

New interpretation in terms of hedonic games is given to modularity, ratio cut, and normalized cut network partitioning methods.\(^*\)

Two new network partitioning methods based on potential hedonic games are proposed. (One method is a new addition with respect to the conference paper [37].)\(^*\) These two methods are especially well suited to find partitions with different levels of resolution; the methods use only one or two parameters. We provide recommendations how to set these parameters.

For methods constructed on potential hedonic games, we suggest to use a very efficient computational algorithm based on Gibbs sampling.\(^*\)

Several numerical evaluations using real\(^*\) as well as synthetic networks are carried out. These numerical evaluations in particular demonstrate the efficacy of the clustering methods based on potential hedonic games with resolution regularization.
The paper is structured as follows: in the following section, we provide necessary definitions from graph theory, network partitioning, and network games. Then, in “Myerson cooperative game approach” section, we present our first approach based on the Myerson value. The second approach based on the hedonic games is presented in “Hedonic coalition game approach” section. In both “Myerson cooperative game approach and Hedonic coalition game approach” sections, we provide small illustrative examples to explain the essence of the methods. In “Numerical validation” section, we evaluate our methods on a number of real as well as synthetic network examples. Finally, “Conclusion and future research” section provides conclusions and directions for future research.
Preliminaries of graph theory, network partitioning, and network stability
Let \(g=(N,E)\) denote an undirected multigraph consisting of the set of nodes N and the set of edges E. We denote an edge (link) between node i and node j as ij. The interpretation is that if \(ij\in E\), then the nodes \(i\in N\) and \(j\in N\) have a direct connection in network g, while \(ij\notin E\), then nodes i and j are not directly connected. Since we generally consider a multigraph, there could be several edges between a pair of nodes. Multiple edges can be interpreted for instance as a number of telephone calls or as a number of message exchanges in the context of social networks.
We view the nodes of the network as players in a cooperative game. Let \(N(g)=\{i:\exists j \text{ such } \text{ that } ij\in E(g)\}\). For a graph g, a sequence of different nodes \(\{i_1,i_2,\dots ,i_k\},\ k\ge 2\), is a path connecting \(i_1\) and \(i_k\) if for all \(h=1,\dots ,k1\), \(i_hi_{h+1}\in g\). The length l of a path is the number of edges in that path, i.e., \(l=k1\). A path with no repeated nodes is called a simple path. Graph g on the set N is connected graph if for any two nodes i and j there exists a path in g connecting i and j.
We refer to a subset of nodes \(S \subset N\) as a coalition. The coalition S is connected if any two nodes in S are connected by a path which consists of nodes from S. The graph \(g'\) is a (connected) component of g, if for all \(i\in N(g')\) and \(j\in N(g')\), there exists a path in \(g'\) connecting i and j, and for any \(i\in N(g')\) and \(j\in N(g)\), \(ij\in g\) implies that \(ij\in g'\). Let Ng be the set of all (connected) components in g and let gS be the subgraph with the nodes in S.
Let \(gij\) denote the graph obtained by deleting edge ij from the graph g and \(g+ij\) denote the graph obtained by adding edge ij to the graph g.
The result of community detection is a partition of the network (N, E) into subsets (coalitions) \(\{S_1,\ldots ,S_K\}\) such that \(S_k \cap S_l=\emptyset , \forall k,l\) and \(S_1\cup ...\cup S_K=N\). This partition is internally stable or Nash stable if for any player from coalition \(S_k\) it is not profitable to join another (possibly empty) coalition \(S_l\). We also say that the partition is externally stable if for any player \(i\in S_l\) for whom it is beneficial to join a coalition \(S_k,\) there exists a player \(j\in S_k\) for whom it is not profitable to include there player i. The payoff definition and distribution will be discussed in the following two sections.
Myerson cooperative game approach
In general, a cooperative game of n players is a pair \(<N,v>\) where \(N=\{1,2,\ldots ,n\}\) is the set of players and v: \(2^N\rightarrow R\) is a map prescribing for a coalition \(S\in 2^N\) some value v(S) such that \(\textit{v}(\emptyset ) = 0\). This function v(S) is the total utility that members of S can jointly attain. Such a function is called the characteristic function of cooperative game. An interested reader can find more details on cooperative games in e.g., [38, 39, 40].
Additionally, as in [41], we assume that the cooperation is restricted by a network. The payoff to an individual player is called an imputation. The imputation specifies how the value associated with the network is distributed to the individual players. The imputation in our cooperative game will be based on the Myerson value [21, 22, 41] which was designed to take into account the effect of the network.
Axiom 1
Axiom 2
Characteristic function (payoff of coalition S) can be defined in different ways. Here we use a general idea from [21, 22, 42, 43], which is based on discounting paths. However, unlike [21, 22, 42, 43], we do not consider shortest paths but rather simple paths.
Theorem 1
Proof
We shall prove the theorem by checking directly the Myerson value axioms, i.e., Axioms 1 and 2.
Thus, Axiom 2 is satisfied as well. \(\square\)
We can propose the following algorithm for network partitioning based on the Myerson value: Start with a partition of the network \(N=\{1,\ldots ,n\}\), where each node forms her own coalition. Consider a coalition \(S_l\) and a player \(i\in S_l\). In the cooperative game with partial cooperation presented by the graph \(gS_l,\) we find the Myerson value for player i, \(Y_i(gS_l)\). This is the reward of player i in coalition \(S_l\). Suppose that player i decides to join the coalition \(S_k\). In the new cooperative game with partial cooperation presented by the graph \(gS_k\cup i,\) we find the Myerson value \(Y_i(gS_k\cup i)\). So, if for the player \(i\in S_l:\) \(Y_i(gS_l)\ge Y_i(gS_k\cup i)\) then player i has no incentive to join to new coalition \(S_k\), otherwise the player changes the coalition.
The partition \(N=\{S_1,\ldots ,S_K\}\) is the Nash stable or internally stable if for any player there is no incentive to move from her coalition. Notice that our definition of the characteristic function implies that for any coalition it is always beneficial to accept a new player (of course, for the player herself it might not be profitable to join that coalition). Thus, it is important that in the above algorithm, we consider the internal and not external stability. If one makes moves according to the external stability, then the result will always be the grand coalition.
We would like to note that the above approach also works in the case of multigraphs, where several edges (links) are possible between two nodes. In such a case, if two paths contain different links between the same pair of nodes, we consider these paths as different.
Example 1
A natural way of partition of this network is \(\{S_1=\{A,B,C\}, S_2=\{D,E,F\}\}\). Let us determine under which condition this structure will present the internally stable partition.
In the above example the parameter r can be used to tune the resolution of network partitioning. Resolution scale tuning will be even more natural in the next approach. We shall see that the next approach is also much more computationally efficient than the Myerson valuebased approach.
Hedonic coalition game approach
There is another gametheoretic approach for partitioning society into coalitions based on the groundbreaking work [29] on hedonic games.
Assume that the set of players \(N=\{1,\ldots , n\}\) is divided into K coalitions by the partition \(\Pi =\{S_1,\ldots ,S_K\}\). Let \(S_\Pi (i)\) denote the coalition \(S_k\in \Pi\) such that \(i\in S_k\). A hedonic game is defined in terms of player preferences for various coalitions. A player i preferences are represented by a complete, reflexive, and transitive binary relation \(\succeq _i\) over the set \(\{S\subset N: i\in S\}\). Denote by \(\succ _i\) the strict part of this relation.
Let us now apply the framework of hedonic games [29] to network partitioning problem, particularly, specifying the preferences. First, in the next subsection, we consider the case of additively separable preferences and then in “The case of nonadditively separable preferences” section, we consider the case of nonadditively separable preferences.
The case of additively separable preferences
The preferences \(\{v_i, i\in N\}\) are symmetric, if \(v_i(j)=v_j(i)=v_{ij}=v_{ji}\) for all \(i,j\in N\). The symmetry property defines a very important class of hedonic games.
As in the previous section, the network partition \(\Pi\) is Nash stable, if \(S_\Pi (i)\succeq _i S_k\cup \{i\}\) for all \(i\in N, S_k\in \Pi \cup \{\emptyset \}\). In the Nashstable partition, there is no player who wants to leave her coalition.
One natural method for detecting a stable community structure can be based on the following better response type dynamics:
Start with any partition of the network \(N=\{S_1,\ldots ,S_K\}\). Choose any player i and any coalition \(S_k\) different from \(S_\Pi (i)\). If \(S_k\cup \{i\} \succ _i S_\Pi (i)\), assign node i to the coalition \(S_k\); otherwise, keep the partition unchanged and choose another pair of nodecoalition, etc.
Since the game has the potential (5), the above algorithm is guaranteed to converge in a finite number of steps.
Proposition 1
If players’ preferences are additively separable and symmetric (\(v_{ii}=0, v_{ij}=v_{ji}\) for all \(i,j\in N\)), then the coalition partition \(\Pi\) giving a local maximum of the potential \(P(\Pi )\) is the Nashstable partition.
We can characterize the limiting cases \(\alpha \rightarrow 0\) and \(\alpha \rightarrow 1\). Towards this goal, let us introduce a special decomposition of the network into cliques. At first, let us find a maximum clique \(S_1\) in the network G (a maximum clique of a graph, is a clique, such that there is no clique with more vertices). Remove all vertices of \(S_1\) from G and consider the new network \(G'\). Let us find a maximum clique \(S_2\) in the network \(G'\) and continue this procedure until we derive the partition \(\{S_1,...,S_K\}\) of the network G into cliques. Call this partition the sequential decomposition of the network into maximum cliques.
Proposition 2
If \(\alpha =0\), the grand coalition partition \(N=\{1,\ldots ,n\}\) gives the maximum of the potential (7). Whereas if \(\alpha \rightarrow 1\), the network sequential decomposition into maximum cliques corresponds to a maximum of the potential (7).
Proof
It is immediate to check that for \(\alpha =0\) the grand coalition partition N gives the maximum of the potential (7), and \(P^\alpha (N)=m(N)\).
The grand coalition and the sequential maximum clique decomposition are two extreme partitions into communities. By varying the parameter \(\alpha\) we can easily tune the resolution of the community detection algorithm.
Example 2
Firstly, calculate the potentials (7) for largescale decompositions of G for any parameter \(\alpha \in [0,1]\). It is easy to check, that \(P(N)=78325\alpha\), \(P(\{N_1, N_2\cup N_3\cup N_4\})=77181\alpha\), \(P(\{N_1, N_2\cup N_3, N_4\})=76104\alpha\), \(P(\{ N_1, N_2, N_3, N_4\} )=7474\alpha\).
Other coalition partitions give smaller potentials: \(P(\{ N_1 \cup N_2, N_3\cup N_4\})=76156\alpha <76104\alpha\), \(P(\{ N_1 \cup N_2 \cup N_3, N_4\})=77192\alpha <77181\alpha\), \(P(\{ N_1, N_2, N_3 \cup N_4 \})=75116\alpha <76104\alpha\), \(P(\{ N_1 \cup N_2, N_3, N_4 \})=75114\alpha <76104\alpha\).
We solve a sequence of linear inequalities in order to find maximum of the potential for all \(\alpha \in [0,1]\). The result is presented in the table.
Nashstable coalition partitions in Example 2
\(\alpha\)  Coalition partition  Potential 

[0, 1/144]  \(N_1 \cup N_2 \cup N_3 \cup N_4\)  \(78325\alpha\) 
[1/144, 1/77]  \(N_1, N_2 \cup N_3 \cup N_4\)  \(77181\alpha\) 
[1/77, 1/15]  \(N_1, N_2 \cup N_3, N_4\)  \(76104\alpha\) 
[1/15, 1]  \(N_1, N_2, N_3, N_4\)  \(7474\alpha\) 
Example 1 (ctnd) Note that for the unweighted version of the network example presented in Fig. 1, there are only two stable partitions: \(\Pi =N\) for small values of \(\alpha \le 1/9\) and \(\Pi =\{\{A,B,C\},\{D,E,F\}\}\) for \(\alpha >1/9\).
Example 1 (ctnd) For the network example presented in Fig. 1, we calculate \(P(N)=3/2, P(\{B,C\}\cup \{A,D\}\cup \{E,F\})= P(\{A,B,C,D\}\cup \{E,F\})=7/2\) and \(P(\{A,B,C\}\cup \{D,E,F\})=5\). Thus, according to the value function (8) with \(\delta =1\) and \(\beta _{ij}=\beta\) (modularity value function), \(\Pi =\{\{A,B,C\},\{D,E,F\}\}\) is the unique Nashstable coalition partition.
The case of nonadditively separable preferences
Proposition 3
Proof
Let us provide a few recommendations for the choice of \(\alpha\) and \(\gamma\). Similarly to [18], from the analysis of the mean field model corresponding to a stochastic block model (SBM), one can show that the value of \(\alpha\) close to the link density ensures the internal stability of clusters in the mean field model of SBM. Thus, if a network has one main scale, such value of \(\alpha\) gives good result. If a network has nested clustering structure, one can vary \(\alpha\) to obtain clustering with the needed level of granularity. Again using the mean field model for SBM, one can show that the good value of \(\gamma\) corresponds to the product of \(\alpha\) and the smallest size of the cluster we would like to obtain.
Example 3
Let us consider a graph that consists of a clique of four nodes and two cliques of three nodes connected to it (see Fig. 4).
Gibbs sampling approach for hedonic games with potential
An (i, j)th value of the generalized covariance matrix indicates how often the ith and jth nodes appear in the same cluster.
Then, given a generalized covariance matrix one can extract the community structure using thresholdbased or PCAbased methods.
Numerical validation
In this section, we validate the proposed approaches on synthetic and realworld networks. As a benchmark, we take a widely used clustering method sklearn.cluster.spectralclustering from [47]. The method is based on the eigen elements of the normalized Laplacian and Kmeans postprocessing and have demonstrated good performance in many previous studies.
Synthetic network: stochastic block model
We first evaluate various clustering algorithms based on potential hedonic games on stochastic block model (SBM), a synthetic network with known community structure. An SBM with \(\Sigma \) clusters is represented by a symmetric square matrix P where \(p_{\sigma , \sigma }\) is a density of edges inside the cluster \(\sigma\) and \(p_{\sigma , \sigma '} = p_{\sigma ', \sigma }\) is a density between clusters \(\sigma\) and \(\sigma '\). Specifically, we use SBM with two communities of 50 and 150 nodes, intracluster density \(p_{11} = p_{22} = 0.1\) and intercluster density \(p_{12} = p_{21} = 0.02\). We start from a random coloring and run the process for 100 iterations.
In Fig. 5, we show an example of the Glauber dynamics using NCUT potential (12). For small \(\beta = 10\) we observe unstable behavior, while for large \(\beta = 500\) the process evolves around a local maximum that provides relatively bad clustering (49 out of 50 nodes of the first community and only 116 out of 150 of the second community are clustered correctly).
Now let us take a closer look at RCUT (13). We discovered that in our example the ground truth partition does not maximize the potential. The process converges fast to a clustering that differs from the ground truth and has larger \(P^{\text {RCUT}}\) than the ground truth partition. We tested the algorithm on a set of 100 graph instances generated according to the SBM and we show the results in Fig. 6 where we also compare it to the spectral clustering from [47]. One can see that while the Glauber dynamics generally ends up with \(P^\text{RCUT}(\Pi ^{\text {test}}) > P^\text{RCUT}(\Pi ^{\text {true}})\). The spectral clustering procedure provides a solution that has smaller \(P^{\text {RCUT}}\) but is closer to the ground truth.
Next let us evaluate the performance of the clustering based on the potential \(P^\alpha\), see (7). Empty clusters do not cause any singularities in \(P^\alpha\) unlike in \(P^\text{NCUT}\) and \(P^\text{RCUT}\). Hence, the final partition can have less clusters than \(\Sigma \). Let us at first restrict the number of clusters by setting \(\Sigma = \{0, 1\}\). In this context, we have two natural choices for initial coloring of a graph: either, as before, we can choose colors uniformly at random, or we can assign same color to all nodes. We tested both settings on a set of 100 SBM graph instances. The best results are obtained with \(\alpha = 0.05\) and \(\beta = 10\). If we assign clusters at random at initialization, the process may not converge to a good coloring. Assigning the same initial color to all the nodes leads to better results. Fig. 7a and b shows evolution on the same graph with different initial colorings. The average \({\mathcal {E}}\) after 20 iterations for randomcluster initialization is 0.033, for singlecluster initialization it is 0.006; while the standard spectral clustering, i.e., the continuous relaxation of the NCUT [33] provides a result with average \({\mathcal {E}} (\Pi ^{\text {true}}, \Pi ^{\text {test}}) = 0.025\). We can conclude that the \(P^\alpha\)based clustering significantly outperforms the spectral clustering in terms of accuracy. However, it depends on the parameter \(\alpha\) that determines the penalty for large clusters. If \(\alpha\) is too small, the uniform coloring becomes the ground state, as already indicated in Proposition 2. If \(\alpha\) is too large, the obtained clusters will be relatively of the same size but may not represent the real community structure.
We can also try to detect the real number of clusters, if we choose large \(\Sigma\). Here we can test the case when initially all nodes receive different colors \(\Sigma  = V\). We discovered that the final clustering consists of 9 or 10 clusters on average, most of which contain very few nodes. See Fig. 7c for an example of such clustering process.
To prevent the problem described in the previous paragraph, we modify \(P^\alpha\) to \(P^{\alpha ,\gamma }\), see Eq. (11), by introducing a penalty term proportional to the number of nonempty clusters. The potential \(P^{\alpha ,\gamma }\) depends on parameters \(\alpha\) and \(\gamma\) that determine penalties for disparate clusters and for the total number of them, respectively. We tested the respective Glauber dynamics on the same set of random instances of SBM with parameters \(\alpha = 0.05\), \(\gamma = 5\), \(\beta = 10\) , and \(\Sigma  = V = 200\). We run the process for 20 iterations and averaged the coloring over the last 10 of them. We obtained the following results: 2 clusters were determined in every graph instance and the average \({\mathcal {E}}(\Pi ^{\text {true}}, \Pi ^{\text {test}})\) is 0.0057. The average \({\mathcal {E}} (\Pi ^{\text {true}}, \Pi ^{\text {test}})\) for the spectral clustering is 0.0252.
In order to validate further the method based on \(P^{\alpha ,\gamma }\)potential, we tried it on different sets of graphs of different clustering structures with the same algorithm parameters \(\alpha\), \(\gamma\) , and \(\beta\). On a set of 100 homogeneous Erdős–Rényi random graphs of 200 nodes with edge density 0.1, our algorithm ended up with a uniform coloring on 99 of them and on one graph it finished with 2 clusters where the smaller one contains only two nodes. Given a set of 100 graph instances of SBM with clusters of 50, 150, and 200 nodes, the algorithm correctly determined the number of clusters in each graph and provided on average \({\mathcal {E}} (\Pi ^{\text {true}}, \Pi ^{\text {test}}) = 0.006\), while spectral clustering provided on average \({\mathcal {E}} (\Pi ^{\text {true}}, \Pi ^{\text {test}}) = 0.026\). On a set of 100 graph instances containing 4 clusters of 50, 100, 150, and 200 nodes, the algorithm after 20 iterations determined 4 clusters in 90 graphs and 3 clusters in 10 graphs. The average \({\mathcal {E}} (\Pi ^{\text {true}}, \Pi ^{\text {test}})\) is 0.0335. However, if we increase the number of iterations to 50, we determine correctly 4 clusters for 95 graphs and 3 clusters for the others. The average \({\cal {E}} (\Pi ^{\text {true}}, \Pi ^{\text {test}})\) becomes 0.0185. The average \({\mathcal {E}} (\Pi ^{\text {true}}, \Pi ^{\text {test}})\) of the spectral clustering on the same set of graphs is 0.0375.
Realworld network with ground truth: Karate club
The authors of [15] divide the network into two groups of roughly equal size using modularity and hierarchical clustering tree. They show that this split corresponds almost perfectly with the actual division of the club members following the breakup. Only one node, node 3, is classified incorrectly by the method of [15].
We have plotted both \(Y_3(gR_3)\) and \(Y_3(gL_3 \cup \{3\})\) as functions of r in Fig. 9. If r is smaller than 0.231, node 3 has no incentive to move from coalition \(R_3\) to coalition \(L_3\). Recall that the modularitybased method of [15] would displace player 3 into the wrong coalition \(L_3\).
It is also interesting to investigate the imputations of the other two border nodes 9 and 10. If we plot the imputations for node 10: \(Y_{10}(gL_3)\) and \(Y_{10}(gR_3 \cup \{10\})\) (see Fig. 10), we observe that as for node 3, for smaller values of r (i.e., for \(r < 0.363\)), node 10 has no incentive to leave the coalition \(L_3\); whereas for the values of r greater than 0.363, node 10 has incentive to change the coalition.
As it is clear from Fig. 11, node 9 has no incentive to leave the coalition \(L_3\) with any value of r. Thus, we can conclude that the ground truth partition [49] is internally stable according to the Myerson value approach if \(r < 0.231\). This has a nice intuitive interpretation. Humans cannot count easily long paths and consequently one needs to apply heavy discounting to mimic humans’ decisions.
Let us now apply the hedonic game approach with Glauber dynamics to the karate club network. We started from a random partition into two clusters and run the algorithm using the potential (7) with \(\alpha = 0.046\), which corresponds to 1/3 of the edge density, and \(\beta = 20\). The algorithm stabilizes after around 5 iterations and the mean error after 10 iterations in 100 runs was 20.0%, which roughly corresponds 7 misclassified nodes. However, the partitioning results differ significantly from run to run.
By applying the spectral clustering algorithm from [47] to Zachary karate club network, we obtain an average error of 25.8%.
To reduce the variance of the Glauber dynamics and hence the clustering error, we computed the empirical generalized covariance matrix \(\hat{M}\) for the results of 10 independent runs of 10 iterations of the Glauber dynamics and then extracted the community structure using the PCA algorithm. Only node 9 was misclassified, which is a border node.
The application of the generalized covariance matrix in addition to the Gibbs sampling really helps to consistently obtain highquality results.
We would like to note that the application of the generalized covariance matrix to the spectral clustering method from [47] does not improve significantly its results since spectral clustering gives less noisy, however, more biased results compared to the hedonic game approach.
Realworld network with ground truth: Dolphins
We studied the Dolphins network using the hedonic game approach with Glauber dynamics in a similar way as we did for Zachary karate club. Note that because of a very large number of simple paths in this network, the application of the Myerson value approach was not feasible. The following parameter values were used: \(\alpha = 0.028\), which corresponds to 1/3 of the edge density, and \(\beta = 20\). The algorithm stabilizes after around 10 iterations and the mean error after 20 iterations in 100 runs was 24.8%. As with Zachary karate club, the partitioning results differ significantly from run to run.
By applying the spectral clustering algorithm from [47], we obtain an average error of 7.5%.
We computed the empirical generalized covariance matrix \(\hat{M}\) of the results of 10 independent runs of 20 iterations of the Glauber dynamics and then extracted the community structure using the PCA algorithm. Then, only one node, node 39, was misclassified. This is a border node connected to only two nodes of different clusters.
In contrast, computing the covariance matrix of 10 results of independent runs of spectral clustering algorithm from [47] led to 4 misclassified nodes: 22, 31, 48, 60.
Realworld network with many clusters and ground truth: Football
As was the case of the Dolphins network, we could not apply the Myerson value approach to the football network because of the difficulty in enumerating all simple paths. In contrast, the hedonic game approach can easily be applied.
One of the main advantages of the hedonic game approach with \(P^{\alpha , \gamma }\) potential (11) is the fact that it does not require the number of clusters as a parameter. Let us test on the football network, which consists of 12 clusters, how the hedonic game approach with \(P^{\alpha , \gamma }\) potential can perform without a priori knowledge of the number of clusters.
We set the following parameters of the potential: \(\alpha = 0.093\) (edge density), \(\gamma = 10\). We run the Glauber dynamics with random initial partition into 20 clusters and the inverse noise \(\beta = 10\) for 20 iterations. The clustering dynamics stabilizes after around 10 iterations. We performed 50 independent runs. The average number of detected clusters was 10.22 and the average percentage of misclassified nodes is 13.5%.
As with Zachary and Dolphins networks, we computed the empirical generalized covariance matrix of the clustering results. Since our goal was to determine the clusters without providing its number to the algorithm, we used a simple thresholdbased clustering algorithm instead of the PCA algorithm: we build a weighted graph using the generalized covariance matrix as its adjacency matrix and removed the edges with weights below 0.5; the connected components of the resulting graph indicate clusters in the original network.
The resulting graph contained 13 connected components, i.e., we identified 13 clusters in the initial network that is quite close to the ground truth value 12. The percentage of the misclassified nodes is 6.9%, which signifies that the generalized covariance matrix improved significantly the quality of the clustering results.
Large realworld network without ground truth: Coauthorships in MathNet.ru
Cluster sizes in MathNet.ru
\(\alpha\)  \(S_1\)  \(S_2\)  \(S_3\)  \(S_4\)  \(S_5\)  \(S_6\)  \(S_7\)  \(S_8\)  \(S_9\)  \(S_{10}\) 

0.000112  16,457  2820  2820  2820  2821  2821  2820  2821  2820  2820 
0.001124  4184  4184  4184  4185  4183  4184  4184  4184  4184  4184 
Large synthetic SBM network with ground truth
To continue testing scalability and efficiency of the hedonic game approach and in particular to confirm a rapid convergence of the Glauber dynamics to a good solution, we consider a large stochastic block model graph with known communities. Specifically, we have generated an SBM with two clusters of sizes 50,000 and 150,000 nodes. We have generated the intracluster links with probability 0.0002 and the intercluster links with probability 0.00005. We run the Glauber dynamics associated with the potential (7), setting \(\alpha = 0.0001\) and \(\beta = 10\). In a typical run, after 7 iterations, only 97 nodes from the smaller cluster were misclassified to the larger cluster and only 65 nodes from the larger cluster were misclassified to the smaller cluster. It is not surprising that by the “gravity” effect the larger cluster attracted more nodes. We find that 7 iterations of the Glauber dynamics are not at all a large cost for partitioning 200,000 node network.
Conclusion and future research
We have presented two cooperative game theorybased approaches for network partitioning. The first approach is based on the Myerson value for graph constrained cooperative game, whereas the second approach is based on hedonic games which explain coalition formation. We find the second approach especially interesting as it gives a very natural way to tune the clustering resolution and generalizes the modularity, ratio cut, and normalized cutbased approaches. Within the hedonic games framework, we have proposed two new methods which particularly well regularize clustering resolution and help to adjust the level of granularity. We have shown that normalized cut and ratio cut methods can be modified to avoid the requirement of the number of clusters. All approaches that can be represented as hedonic games with potentials can be very efficiently implemented using Gibbs sampling with Glauber dynamics and generalized covariance matrix. The application of the generalized covariance matrix significantly improves the quality and stability of the clustering results. Our research plans are to test and to compare our methods on more social networks and to study analytically the convergence rate of Gibbs sampling.
Notes
Authors’ contributions
The contribution of all four authors to the manuscript is quite balanced. All authors read and approved the final manuscript.
Acknowledgements
We would like to thank the editor and the referees for very useful remarks and suggestions that helped to significantly improve the presentation of the results. The work of the first and fourth authors is partly supported by the joint laboratory Inria—Nokia Bell Labs, the joint InriaUFRJ team THANES and by UCAJEDI Idex Grant “HGAPHS.” The second and the third authors are supported by Russian Fund for Basic Research (Projects 165155006, 160100183). The third author is supported by Russian Science Foundation (Project 171101709).
Competing interests
The authors declare that they have no competing interests.
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
References
 1.Abbe E. Community detection and stochastic block models: recent developments. J Mach Learn Res. 2018;18(177):1–86.MathSciNetzbMATHGoogle Scholar
 2.Fortunato S. Community detection in graphs. Phys Rep. 2010;486(3):75–174.MathSciNetCrossRefGoogle Scholar
 3.Fortunato S, Hric D. Community detection in networks: a user guide. Phys Rep. 2016;659:1–44.MathSciNetCrossRefGoogle Scholar
 4.Jonnalagadda A, Kuppusamy L. A survey on game theoretic models for community detection in social networks. Soc Netw Anal Mining. 2016;6(1):83.CrossRefGoogle Scholar
 5.Von Luxburg U. A tutorial on spectral clustering. Stat Comput. 2007;17(4):395–416.MathSciNetCrossRefGoogle Scholar
 6.Schaeffer SE. Graph clustering. Comput Sci Rev. 2007;1(1):27–64.zbMATHCrossRefGoogle Scholar
 7.Avrachenkov K, Dobrynin,V, Nemirovsky D, Pham SK, Smirnova E. Pagerank based clustering of hypertext document collections. In: Proceedings of the 31st annual international ACM SIGIR conference on research and development in information retrieval, SIGIR 2008, Singapore, July 20–24; 2008, p. 873–4.Google Scholar
 8.Avrachenkov K, Chamie ME, Neglia G. Graph clustering based on mixing time of random walks. In: IEEE international conference on communications, ICC 2014, Sydney, Australia, June 10–14. 2014. p. 4089–94.Google Scholar
 9.Dongen S. Performance criteria for graph clustering and Markov cluster experiments. Amsterdam: CWI (Centre for Mathematics and Computer Science); 2000.Google Scholar
 10.Meilă M, Shi J. A random walks view of spectral segmentation. In: The 8th international workshop on artifical intelligence and statistics (AISTATS). 2001.Google Scholar
 11.Newman ME. A measure of betweenness centrality based on random walks. Soc Netw. 2005;27(1):39–54.CrossRefGoogle Scholar
 12.Pons P, Latapy M. Computing communities in large networks using random walks. ISCIS. 2005;3733:284–93.zbMATHGoogle Scholar
 13.Blatt M, Wiseman S, Domany E. Clustering data through an analogy to the potts model. In: Advances in neural information processing systems 8, NIPS, Denver, CO, Nov 27–30. 1995. p. 416–22.Google Scholar
 14.Blondel VD, Guillaume JL, Lambiotte R, Lefebvre E. Fast unfolding of communities in large networks. J Stat Mech. 2008;10:10008.CrossRefGoogle Scholar
 15.Girvan M, Newman ME. Community structure in social and biological networks. Proc Natl Acad Sci. 2002;99(12):7821–6.MathSciNetzbMATHCrossRefGoogle Scholar
 16.Newman ME. Modularity and community structure in networks. Proc Natl Acad Sci. 2006;103(23):8577–82.CrossRefGoogle Scholar
 17.Raghavan UN, Albert R, Kumara S. Near linear time algorithm to detect community structures in largescale networks. Phys Rev E. 2007;76(3):036106.CrossRefGoogle Scholar
 18.Reichardt J, Bornholdt S. Statistical mechanics of community detection. Phys Rev E. 2006;74(1):016110.MathSciNetCrossRefGoogle Scholar
 19.Waltman L, van Eck NJ, Noyons EC. A unified approach to mapping and clustering of bibliometric networks. J Inform. 2010;4(4):629–35.CrossRefGoogle Scholar
 20.McSweeney PJ, Mehrotra K, Oh JC. A game theoretic framework for community detection. In: International conference on advances in social networks analysis and mining, ASONAM 2012, Istanbul, Turkey, 26–29 August 2012. p. 227–34.Google Scholar
 21.Mazalov VV, Trukhina LI. Generating functions and the myerson vector in communication networks. Discrete Math Appl. 2014;24(5):295–303.MathSciNetzbMATHCrossRefGoogle Scholar
 22.Mazalov VV, Avrachenkov K, Trukhina L, Tsynguev BT. Gametheoretic centrality measures for weighted graphs. Fund Inform. 2016;145(3):341–58.MathSciNetzbMATHCrossRefGoogle Scholar
 23.Gomez D, GonzálezArangüena E, Manuel C, Owen G, del Pozo M, Tejada J. Centrality and power in social networks: a game theoretic approach. Math Soc Sci. 2003;46(1):27–54.MathSciNetzbMATHCrossRefGoogle Scholar
 24.Suri NR, Narahari Y. Determining the topk nodes in social networks using the shapley value. In: Proceedings of the 7th international joint conference on autonomous agents and multiagent systems. International foundation for autonomous agents and multiagent systems, Vol. 3, p. 1509–12.Google Scholar
 25.Szczepański PL, Michalak T, Rahwan T. A new approach to betweenness centrality based on the shapley value. In: Proceedings of the 11th international conference on autonomous agents and multiagent systems, Vol 1, p. 239–46.Google Scholar
 26.Michalak TP, Aadithya KV, Szczepanski PL, Ravindran B, Jennings NR. Efficient computation of the shapley value for gametheoretic network centrality. J Artif Intell Res. 2013;46:607–50.MathSciNetzbMATHCrossRefGoogle Scholar
 27.Chen W, Teng SH. Interplay between social influence and network centrality: a comparative study on shapley centrality and singlenodeinfluence centrality. In: Proceedings of the 26th international conference on World Wide Web. International World Wide Web Conferences Steering Committee. 2017. pp. 967–6.Google Scholar
 28.Skibski O, Michalak TP, Rahwan T. Axiomatic characterization of gametheoretic centrality. J Artif Intell Res. 2018;62:33–68.MathSciNetzbMATHCrossRefGoogle Scholar
 29.Bogomolnaia A, Jackson MO. The stability of hedonic coalition structures. Games Econ Behav. 2002;38(2):201–30.MathSciNetzbMATHCrossRefGoogle Scholar
 30.Fortunato S, Barthélemy M. Resolution limit in community detection. Proc Natl Acad Sci. 2007;104(1):36–41.CrossRefGoogle Scholar
 31.Leskovec J, Lang KJ, Dasgupta A, Mahoney MW. Community structure in large networks: natural cluster sizes and the absence of large welldefined clusters. Internet Math. 2009;6(1):29–123.MathSciNetzbMATHCrossRefGoogle Scholar
 32.Hagen L, Kahng AB. New spectral methods for ratio cut partitioning and clustering. IEEE Trans Comput Aided Design Integ Circuits Syst. 1992;11(9):1074–85.CrossRefGoogle Scholar
 33.Shi J, Malik J. Normalized cuts and image segmentation. IEEE Trans Pattern Anal Mach Intell. 2000;22(8):888–905.CrossRefGoogle Scholar
 34.Zhou L, Cheng C, Lü K, Chen H. Using coalitional games to detect communities in social networks. In: International conference on webage information management. Berlin: Springer; 2013. p. 326–31.Google Scholar
 35.Zhou L, Lü K, Cheng C, Chen H. A game theory based approach for community detection in social networks. In: Proceedings Big Data—29th British national conference on databases, BNCOD 2013, Oxford, UK, July 8–10. 2013. p. 268–81.Google Scholar
 36.Basu S, Maulik U. Community detection based on strong nash stable graph partition. Soci Netw Anal Mining. 2015;5(1):61.CrossRefGoogle Scholar
 37.Avrachenkov KE, Kondratev AY, Mazalov VV. Cooperative game theory approaches for network partitioning. In: International computing and combinatorics conference (COCOON/CSoNet). Berlin: Springer; 2017. p. 591–602.Google Scholar
 38.Myerson RB. Game Theory. Cambridge: Harvard University Press; 2013.zbMATHGoogle Scholar
 39.Peleg B, Sudhölter P. Introduction to the theory of cooperative games, vol. 34. Berlin: Springer; 2007.zbMATHGoogle Scholar
 40.Mazalov V. Mathematical game theory and applications. New York: Wiley; 2014.zbMATHGoogle Scholar
 41.Myerson RB. Graphs and cooperation in games. Math Operat Res. 1977;2(3):225–9.MathSciNetzbMATHCrossRefGoogle Scholar
 42.Jackson MO. Allocation rules for network games. Games Econ Behav. 2005;51(1):128–54.MathSciNetzbMATHCrossRefGoogle Scholar
 43.Jackson MO. Social and economic networks. Princeton: Princeton University Press; 2010.zbMATHGoogle Scholar
 44.Levin DA, Peres Y, Wilmer EL. Markov chains and mixing times. Rhode Island: American Mathematical Soc., Providence; 2009.zbMATHGoogle Scholar
 45.Hajek B. Cooling schedules for optimal annealing. Math Operat Res. 1988;13(2):311–29.MathSciNetzbMATHCrossRefGoogle Scholar
 46.Berthet Q, Rigollet P, Srivastava P. Exact recovery in the ising blockmodel. Ann Stat. 2018;41:1780.zbMATHCrossRefGoogle Scholar
 47.Pedregosa F, Varoquaux G, Gramfort A, Michel V, Thirion B, Grisel O, Blondel M, Prettenhofer P, Weiss R, Dubourg V, Vanderplas J, Passos A, Cournapeau D, Brucher M, Perrot M, Duchesnay E. Scikitlearn: machine learning in python. J Mach Learn Res. 2011;12:2825–30.MathSciNetzbMATHGoogle Scholar
 48.Meilă M, Heckerman D. An experimental comparison of modelbased clustering methods. Mach Learn. 2001;42(1–2):9–29.zbMATHCrossRefGoogle Scholar
 49.Zachary WW. An information flow model for conflict and fission in small groups. J Anthropol Res. 1977;33(4):452–73.CrossRefGoogle Scholar
 50.Lusseau D, Schneider K, Boisseau OJ, Haase P, Slooten E, Dawson SM. The bottlenose dolphin community of doubtful sound features a large proportion of longlasting associations. Behav Ecol Sociobiol. 2003;54(4):396–405.CrossRefGoogle Scholar
 51.Zhizhchenko AB, Izaak AD. The information system MathNet.Ru. Application of contemporary technologies in the scientific work of mathematicians. Russian Math Surveys. 2007;62(5):943–966.zbMATHCrossRefGoogle Scholar
Copyright information
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.