Full text
Scalable Community Detection for Social Networks Arnau Prat P´erez PhD Thesis in Computer Architecture by the Universitat Polit`ecnica de Catalunya Advisor: Josep Llu ´ ıs Larriba Pey Co-Advisor: David Dom ´ ınguez Sal Barcelona, Catalonia 2015
Acknowledgements I would like to specially thank to all the people that has supported me in achieving this enormous goal, specially my parents Toni and Elena for all the love, education and guidance they have given to me since I was born, with out them this achievement would have been impossible. To my brother Adri`a, for all the good moments we have enjoyed together, and for always being a reference for me. To my girlfriend Raquel for bringing such amount of happiness and joy to my live. To my grandmother Montserrat, but also grandparents Josep and Joan, and grandmother Ramoneta, who are no longer with us. Special thanks to my uncle Ventura and Manel and my aunts Ester and Contxita, and my cousins Xell, Judit, Joan and Eva. I would also like to thank all my friends, specially Joan, Xavi M., Xavi A., Fran, Bruno i Mireia, V´ıctor, David and Jessica, Andreas, to all my online friends with whom I have played an endless amount of hours, specially Javi, Adri´an, David, ´ Alvaro, Dario, Jesus and Ferran. Also thanks to all the present and prior members of DAMA-UPC and Sparsity, specially Mike, Xavi S., Cesc, D´amaris, Norbert, V´ıctor M., Ariel, Mathew, Jordi, Carlos, Ricard and Jordi Nin. I would also like to thank my advisors Larri and David D. for their unvaluable guidance during all the thesis, Josep Maria Brunat for its contributions on the mathematical proofs, as well as Pedro, Andreas and Panayiotis for their warm welcome during my stay in Cyprus and their key contributions and support to my work about triangle counting. I would also thank all the people from the LDBC team, specially Alex, Andrey, Duc, Moritz, Peter and Orri, for all the things I can learn from them everyday.
iv Finally, I would also thank Generalitat de Catalunya for their SGR-890 grant as well as the Ministerio de Ciencia y Tecnologia for the various grants given to DAMA-UPC during my thesis, which were key for its development. Also to Oracle Labs for they financial support to many of the projects related to my work, as well as the European Comission for their funds to the LDBC, Tetracom and HiPEAC projects.
Contents 1 Introduction 1 1.1 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2 Related Work 9 2.1 Metric based community detection . . . . . . . . . . . . . . . . 12 2.2 Algorithmic community detection . . . . . . . . . . . . . . . . . 17 2.3 Parallel and distributed community detection . . . . . . . . . . 19 3 Weighted Community Clustering 21 3.1 Domain specific community detection . . . . . . . . . . . . . . 21 3.2 Problem Definition . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3 The Weighted Community Clustering . . . . . . . . . . . . . . 28 3.4 Formal analysis of WCC . . . . . . . . . . . . . . . . . . . . . . 32 4 Scalable Community Detection 47 4.1 Heuristic............................... 52 5 Experiments 57 v
vi 5.1 WCCsquality ........................... 58 5.2 SCD results quality . . . . . . . . . . . . . . . . . . . . . . . . . 63 5.3 Performance, scalability and memory consumption of SCD . . . 65 6 Ground-truth vs Synthetic Communities 71 6.1 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . 73 6.2 Results Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 73 7 Triangle counting in future many-core micro-architectures 83 7.1 The Intel SCC . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 7.2 Producer consumer implementation of triangle counting . . . . 84 7.3 Experiments............................. 86 8 Conclusions and Future Work 91 8.1 FutureWork ............................ 93 9 Appendix 95 9.1 Proof of Proposition 1 . . . . . . . . . . . . . . . . . . . . . . . 95 9.2 Proof of Proposition 2 . . . . . . . . . . . . . . . . . . . . . . . 96 9.3 Proof of Theorem 1 . . . . . . . . . . . . . . . . . . . . . . . . . 96 9.4 Proof of Theorem 2 . . . . . . . . . . . . . . . . . . . . . . . . . 97 9.5 Proof of Theorem 3 . . . . . . . . . . . . . . . . . . . . . . . . . 98 9.6 Proof of Theorem 4 . . . . . . . . . . . . . . . . . . . . . . . . . 100 9.7 Proof of Theorem 5 . . . . . . . . . . . . . . . . . . . . . . . . . 104 9.8 Proof of Theorem 6 . . . . . . . . . . . . . . . . . . . . . . . . . 104
vii 9.9 Proof of Theorem 7 . . . . . . . . . . . . . . . . . . . . . . . . . 105 9.10 Proof of Theorem 8 . . . . . . . . . . . . . . . . . . . . . . . . . 105 9.11 Distributions of Statistical Indicators . . . . . . . . . . . . . . . 109
List of Figures 2.1 A classification of the vertices of a graph into communities . . . 10 2.2 A graph partitioned into two groups of size ten. . . . . . . . . . 10 2.3 Three overlapping communities that overlap in a region. . . . . 11 3.1 A community formed by five vertices, and the statistics of each vertex................................. 30 3.2 Examples of communities from real graphs, sorted by W CCs. . 31 3.3 Example of the sensitivity of WCC against triangles . . . . . . 33 3.4 Consequences of the internal structure on the WCC . . . . . . 34 3.5 Example of the behavior of WCC against bridges . . . . . . . . 35 3.6 Example of WCC against vertex cuts . . . . . . . . . . . . . . 36 3.7 Examples showing the linear community cohesion of W CC . . 38 3.8 Empirical evaluation of Property 2. . . . . . . . . . . . . . . . . 39 3.9 Transition point for WCC and different values of pin and pout 41 3.10 Detectability of the proposed algorithm for the stochastic block model Graphs of different sizes with different configuration parameters ( pin and pout ). The closer to white is, the better the NMI between the detected partition and that expected by the model. The closer to black, the more different. . . . . . . . 43 ix
2 fundamental for the study of, for example, how epidemics spread and how to control them [59]. Being able to identify those persons connecting communities can be of high importance to control the spread of a disease. Also, persons within a community have a larger probability to be infected if one of them already is. Being able to effectively detect these persons and isolate them is also crucial to apply preventive measures. Similarly, in information networks communities help us to understand which members are more influential and can potentially control the information that others in the same community can access. The weak ties theory [18] states that the few links between members of different communities are more important for the spread of information than the internal links in a community. Entities connected by weak ties have a high control over what information is transmitted, and the presence of such links may indicate a weak structural point in a system such as a computer network. On the other hand, detecting communities allows inferring hidden information from the network’s structure. Missing edges between subjects belonging to the same community indicate potentially similar entities willing to be connected in the near future (link prediction). These have applications in recommendation systems (e.g. in social networks or product co-purchasing networks) [62], for targeting marketing campaigns, for finding proteins with similar metabolic functions in a protein-protein interaction network [9] or to identify spam in email and web networks [8,34]. Finally, communities can be used to ease the visualization of large networks in data exploration tools, by summarizing the structure of the network and reducing the complexity of its representation [12]. The amount of literature about community detection is huge. Most of the existing work aims at finding what are known as disjoint communities, that is, communities which do not overlap (do not share vertices). More concretely, the most widely accepted metric to detect disjoint communities is Modularity [37]. Modularity measures how relevant is the internal edge density of a set of vertices compared to that observed in a random graph with the same degree sequence (the null model). Due to its popularity, many algorithms based on its maximization have been proposed following different strategies, like greedy techniques [7], spectral theory [38], simulated annealing [19] or extremal optimization [13]. However, it has been shown that modularity has several problems. First, modularity has a resolution limit, meaning that it is not able to discern
3 communities smaller than a certain size, a size that depends on the total size of the network. This means that the larger the graph, the less effective modularity is [16]. Second, modularity has a paradoxical behavior, in the sense that it is easier for it to detect communities which are worsely defined than those that are better defined. Finally, maximizing modularity can lead to sets of vertices without an appreciable community structure [6]. Therefore, even though modularity works well under some circumstances, under other circumstances it provides undesirable results. Besides those methods based on modularity maximization, we find in the literature many other approaches. Some of them are those based on performing random walks. The rationale is that when performing a random walk, the probability of moving to a member of the same community is larger than moving to a different community. Walktrap [45] and Infomap [58] are examples of algorithms that fall into this category. Finally, another popular family of algorithms, with an increasing amount of popularity due to their simplicity and scalability, are those based on label propagation [54]. In label propagation, a unique label is initially assigned to each vertex of the graph. By means of an iterative process, each vertex acquires the label most seen in its neighbors, until the process converges where no vertex changes its label. The problem with these approaches is that they are affected by label epidemics, meaning that some labels plague the network leading to very large and meaningless communities. In general, existing community detection algorithms suffer from several problems: First, they are typically tailored after the informal definition of communities (sets of vertices more internally connected than externally), taking edges as sets but ignoring the structures that form the community either internally or externally. These algorithms and metrics aim at being generic, but ignore what characterize the communities of a given domain. As a consequence, existing algorithms fail to correctly capture the notion of a community under certain circumstances (for instance, when the graph is large for the case of modularity), and end up finding groups of vertices with a meaningless community structure. Second, existing work is not designed with parallelism in mind to perform well on current multi-core architectures, hindering their possibilities to scale to larger graphs.
4 In this thesis, we propose a new methodology for community detection design called domain specific community detection. This consists of defining a set of structural and behavioral properties any community detection metric or algorithm for a given domain should fulfill. On the one hand, structural properties are those that define how the the structural characteristics those communities found by an algorithm or those best ranked by a metric, should look like. That is, what internal and external structures communities should contain and form in order to be considered communities. On the other hand, behavioral properties are those properties that specify how a metric or algorithm should behave under different circumstances. For instance, how the metric/algorithm deals with graphs of different sizes, or whether it limits or not the growth of the communities. In our particular case, we focus on community detection for the specific domain of social networks. From an analysis of the problems and drawbacks of existing metrics and algorithms when it comes to properly detect the communities in a social network, we identify a set of three structural properties we think a community detection metric for social networks should fulfill: •Internal Structure Sensitive : The quality of a community should not depend only on the amount of internal edges but how these are internally structured, forming structures relevant for the application domain. •Bridge Resistant : A good community should never contain a bridge, as this is clearly a weak point in the community structure. •Cut Vertex Resistant : Similarly, a community detection metric for social networks should be resistant to containing vertex cuts. Similarly, we identify three behavioral properties we think any community detection metric for social networks should fulfill: •Scale Independent : A community detection metric should be scale independent, that is, it should be robust and accurate regardless of the size of the graph. •Linear Community Cohesion : The amount of connections between a vertex in a community and the other vertices of the same community should scale linearly with the size of the community.
5 •Adaptive : A community detection metric for social networks should adapt to the heterogeneous nature of the graph, and be able to identify relevant regions with an appreciable community structure compared to their surroundings. Thus, it should consider both the internal and the external connectivity of the community. Based on the aforementioned properties, we design a new community metric called Weighted Community Clustering( WCC ) aimed at finding communities in social network like graphs. WCC is based on taking the triangle as the basic motif that indicates the presence of an appreciable structure within vertices in the graph. Triangles emerge naturally in social networks due to the dynamics of link formation, which are influenced by the Homophily principle [33], which states that similar people have a higher probability to be connected. We formally prove that maximizing WCC fulfills the properties desired for a community detection metric for social networks. Moreover, as a side outcome of our formal analysis, we theoretically find the detectability threshold (the point at which WCC is able to discern the communities of a graph), giving more insight to the actual behavior of WCC , and we analytically show that WCC does not suffer from the so called community detection paradox. Finally, we experimentally show that communities with good WCC exhibit good characteristics using a set of statistical indicators in an extensive experimental analysis using real graphs. We also propose Scalable Community Detection(SCD), a community detection algorithm based on WCC maximization, designed to scale on SMP machines. We show that SCD achieves the best quality among all the existing algorithms in the state of the art, when it comes to find communities in real social network like graphs with ground truth communities created from the network’s metadata. Moreover, we also show that SCD achieves close to linear scalability on SMP machines, becoming the one of the fastest community detection algorithm developed so far, and being the fastest one when using all the cores in a SMP machine. In practice, we are able to process the Friendster graph, with almost 2 billion edges and more than 100 million vertices, in about 7 seven hours with an unprecedented quality using a commodity server with 8 cores. In order to better understand the characteristics of ground truth communities, and how these compare to the traditional community definition, we performed
6 a study of the distributions of the ground truth communities using several structural indicators. We observe that ground truth communities are far from the traditional community concept, not being isolated from the rest of the graph and not showing a so prominent internal edge density. However, we also observe that structures such as the triangle are considerably present in those ground truth communities. These results suggest that more complex structures such as the triangle, are important to discern the strong relations than the weak ones. We finally compare the distributions observed in ground truth communities to those output by synthetic graph generators, showing that some of the most widely used synthetic graph generators for community detection benchmarking generate communities significantly different from those observed in reality. Finally, we have studied the problem of triangle counting in a modern architecture such as the Intel Single-chip Cloud Computer [32]. The interconnection network is one of the bottlenecks that limits the scalability of many-core processors. As such, computer architects are thinking of new architectures with simpler cache hierarchies with incoherent caches that simplify the design of such processors. As a downside, this leads to more complex programs and more responsibility to the programmer when creating correct software. In our study we have revealed that the Producer-Consumer programming model is a suitable model for architectures with non-coherent caches and on-chip memory buffers, able to dynamically adapt to the load of the application and to get the most out of the available resources of the machine. We have also shown that modern social network applications such as triangle counting, which are memory bound and exhibit very non-local memory accesses, can greatly benefit from such architectures when implemented using the Producer-Consumer programming model. The rest of this document is structured as follows. In Chapter 2, we introduce the background and related work in community detection. In Chapter 3, we describe the design of WCC and in Chapter 4, we introduce SCD. In Chapter 5, we show the experimental results of our evaluation and in Chapter 6 we introduce a study of the real community distributions. In Chapter 7, we show our study on the implementation of triangle counting on an experimental many-core architecture and finally, in Chapter 8, we conclude the work and give some guidelines for future research.
7 1.1 Contributions In this thesis we make the following contributions: • We have proposed a new domain specific community detection design methodology. • We have proposed a novel community detection metric ( WCC ) based on triangle counting (CIKM 2012, TKDD). •We have introduced a set of community detection metric properties we think should be fulfilled by any community detection metric for social networks (CIKM 2012, TKDD). • We have experimentally evaluated WCC and compared different state of the art algorithms based on it. We show that WCC is able to correctly rank communities robustly, something not done by existing metrics like Modularity or Conductance (CIKM 2012, TKDD). • We have introduced the concepts of structural isolation and structural intraconnectivity and overall, presented a novel methodology to design community detection metrics based on the notion of structure (TKDD). • We have performed an extensive Detectability analysis of WCC , giving a better insight of how does WCC behaves, and also showing that it is not affected by the so called community detection paradox (TKDD). • We have proposed Scalable Community Detection (SCD) for SMP machines, which is an algorithm based on WCC. The algorithm has been designed with parallelism in mind, to take advantage of the resources of current architectures (WWW 2014, TKDD). • We have evaluated the performance of SCD and compared it to the most popular state of the art algorithms, showing that SCD is able to scale to billion edge graphs, and outperforms current state of the art methods both in terms of quality and execution time (WWW 2014, TKDD). • We have analyzed the structure of ground truth communities found in several real graphs and shown that they are not so well defined and
8 isolated as one would expect, but at the same time have a large number of triangles with a small number of bridges (GRADES 2014). • We have compared the community structure of synthetically generated graphs that output a community structure, the LDBC Datagen and LFR graph generators, to real graphs with ground truth communities. We have shown that the LDBC Datagen graph generator is able to produce graphs that better reproduce the characteristics of those communities found in real graphs. (GRADES 2014). • We have studied the viability of the Producer-Consumer model on future many-core architectures without coherent caches, using the problem of triangle counting (ARCS 2013).
Chapter 2 Related Work Community detection is a broad topic that has attracted the interest of many researchers over the last decade because of its applications in diverse domains such as biology, epidemics, social network analysis, marketing, recommendation systems etc., to just cite a few of them. Due to its complexity and the lack of a strict formalism of what a community is, the topic is subject to many interpretations and subtleties. As such, we start this section by clarifying some concepts to better delimit the spectrum of the problem covered by this thesis. Then, we make a review of the most widely used metrics and algorithms for community detection, to give the reader a broad view of the dimension of the topic. For a more comprehensive and detailed state of the art review, please refer to the following surveys [16,31,43]. Communities are informally defined as subsets of vertices of a graph with more internal connections than connections with vertices from other communities, and this is the definition most existing metrics are based on. Most of the work on community detection has traditionally focused on the disjoint community detection problem. The problem consists in classifying the vertices of a graph into disjoint cohesive sets, that is, each vertex can belong to just one community. Figure 2.1 shows a graph with three disjoint communities. Disjoint community detection is similar to the more traditional graph partitioning problem, but differs from the later in the fact that the number of communities and their size are driven by the structure of the network itself instead of being passed as a parameter by the user. Figure 2.2 shows the same graph of Figure 2.1 partitioned into two groups of size ten that minimize the cut, as in typical graph partition algorithms 9
10 Figure 2.1: A classification of the vertices of a graph into communities Figure 2.2: A graph partitioned into two groups of size ten. Application wise, graph partitioning is mostly motivated by the necessity of distributing data and load across the computing nodes of a distributed system [22], while community detection is used in data mining [63], visualization [12,57] and knowledge discovery [20]. However, community detection has also been used to obtain smarter ways to layout data in memory [46]. Besides disjoint communities, other types of communities exist that have recently attracted the interest of the research community. One of these types are overlapping communities, which are observed in many types of real networks and applications where it is natural to think of entities that can belong to more than one community. Figure 2 shows an example with three communities that overlap on a set of vertices. In general, detecting overlapping communities is a more complex problem than detecting disjoint communities. First, it is
11 Figure 2.3: Three overlapping communities that overlap in a region. not clear what characterizes the overlap between a set of communities, and which is the point when a set of overlapping communities ought to be merged into a single and larger one. Some work about trying to better understand what characterize the overlaps has been done by [65]. Second, the number of possible covers (classifications of vertices into subsets in such a way that can overlap) in a graph is much larger than the number of possible partitions, thus making the problem more computationally expensive. Nevertheless, the simpler disjoint community detection problem is still far from being solved and existing solutions still suffer from many issues in order to securely move to the more complex overlapping counterpart. Finally, there also exist other types of communities such as 2-mode communities, that is, communities that form bipartite subgraphs of two types of different entities [68]. Typically, most of the work on community detection is restricted to undirected graphs without weights on the edges. However, for some problems it is reasonable to think of links not to be equally strong, which is typically represented as a weight between zero and one representing the strength of the link (unweighted graphs can be seen as graphs where all edges have a weight of one). As such, some approaches have included this notion of strength [15]. Similarly, some researchers have worked on what they call fuzzy communities [35]. In this context, the notion of belonging to a community or not is not binary but a real value (weight) or probability between zero and one. Finally, some researchers have worked on detecting communities in directed networks [15].
18 is currently one of the most popular algorithms in the literature, and it has been shown that works very well using synthetically generated graphs of a few hundreds of thousands of edges. However, no formal guarantees have been given proving that it scales well to large graphs of millions of vertices, and as we will see in Chapter 5, its performance and quality decays for large graphs. The Label Propagation Algorithm (LPA) [54] stands as another algorithm (and actually, family of algorithms nowadays) that has recently gained a lot of popularity due to their simplicity and scalability. In label propagation, vertices are initially assigned with a unique label. Then, by means of an iterative process, each vertex changes its label to that most popular label out of those own by its neighbors. The process continues until the process converges where no vertex changes its label. One of the interesting characteristics of this method that makes it different from other existing proposals, and therefore making it worth to mention, is its performance. LPA suits very well the vertex centric programming model of many scalable graph programming frameworks like Pregel [30] or Giraph [3], and also graphic processing units (GPUs). However, label propagation is not exempted to problems but suffers from well-known issues such as “label epidemic”, where labels can “plague” the network leading to very large and meaningless communities. This makes label propagation unreliable as it does not guarantee a minimum quality of the communities found. 2.2.1 Algorithms for overlapping communities Although this is not the aim of this work, we think it is worth to mention some of the most popular algorithms for detecting overlapping communities. One of the most widely used and older methods to detect this type of communities is the clique percolation method [11]. The clique percolation defines communities as k-clique chains. A clique chain is defined as a group of k-cliques that overlap on k-1 of their vertices. Since a clique can overlap with a clique chain on less than k-1 vertices, overlaps between communities emerge naturally. Clique percolation is the base method that form the community detection framework used in biological networks CFinder [1]. Link clustering [2] is another popular overlapping community detection algorithm, which instead of trying to cluster vertices, it tries to cluster edges. Given two edges that share a vertex, the Jaccard coefficient of the adjacency lists
19 of the non shared vertices is computed. Given this measure, a dendogram of edge relations is computed, placing those edges with a larger Jaccard measure closer to the leaves. Then, the dendogram is cut at that level that maximize a metric called partition density, and those edges under the same branch in the dendogram are clustered together, forming a community. Since this methods cluster edges, overlapping communities emerge naturally as a vertex can be contained in multiple edges, which can belong to different communities. In [41], the authors propose a novel community detection metric for overlapping communities, based on a new operator they call the directed Laplacian. This operator operates on a graph representation of the community solution space (those possible communities that can exist), that is, a graph where each vertex is a community and two vertices are connected if and only if their size differ in just a single vertex (and the rest of vertices remain the same). Over this graph they define an euclidean distance based metric, which is then optimized. Finally, a recent work [66] has modeled communities as tiles in an adjacency matrix. The novel observation is that these tiles, tend to be denser in the parts that they overlap, in contrast with the common believe of overlapping communities denser in the non overlapping part. Based on this observation, the authors propose a graph generation model based on overlapping communities called the Affiliation Graph Model (AGM). Based on this model, they propose BigClam, an algorithm based on non-negative matrix factorization that looks for the parameters of the model that explain an observed graph structure. Since this method is build on top of well known parallel matrix computation algorithms, they are able to scale up to graph of 100 millions of vertices without a problem. 2.3 Parallel and distributed community detection There is some work on parallel community detection for SMP machines, mostly focused on parallel versions of known sequential community detection algorithms. In [29], the authors propose a parallel version of the Louvain algorithm, achieving an speedup of 16x on a machine with 32 threads. Similarly, in [56], the authors propose an agglomerative modularity optimization algorithm for the Cray XMT and Intel based machines. The authors report that their solution is able to analyze billion edge graphs (100 Million vertices, 3.3 Billion edges) in 500 seconds. Finally, in [4] the authors propose RelaxMap, a parallel
20 version of Infomap based on relaxing con currency assumptions of the original method, achieving a parallel efficiency of about 70%. The same authors proposed in [5] a distributed version of Infomap. Finally, the label propagation method described above fits very well the vertex centric computing model, therefore it can be easily distributed using a graph programming distributed framework.
Chapter 3 Weighted Community Clustering In this chapter, we describe the Weighted Community Clustering ( WCC ) [48,49], a novel community detection metric for social networks. We start by discussing the limitations of existing metrics and algorithms when it comes to discover the communities in social graphs, and argument that new metrics need to be more domain specific to better exploit the particular characteristics of each type of network. Out of the discussion, we derive a set of behavioral and structural properties we think any socially oriented community detection metric should fulfill. These properties define how the metric should behave, as well as what type of structures the communities resulting from its maximization should contain or avoid. Next, we formalize the problem of community detection and reduce it to the task of defining a function that measures the level of cohesion between a vertex x and a set of vertices S . Based on this formalization, we define WCC and back it up with an extensive formal analysis showing that it behaves as expected when optimized, not suffering from the limitations observed in existing approaches but fulfilling the desired properties. 3.1 Domain specific community detection Traditionally, existing community detection metrics and algorithms have been designed to be generic, built around the informal community definition that defines communities as sets of vertices more densely connected internally than externally. In other words, they assume that communities are an ubiquitous 21
22 concept whose characteristics do not depend on the domain of the network analyzed. However, when we run existing community detection algorithms in social networks, we observe limitations that affect the quality of the produced results. For instance, modularity suffers from the well known resolution limit, which makes communities undetectable as the size of the graph increases. In the context of a social network, this is counter-intuitive, as the existence of a community should be independent of the size of the graph, and just depend on its local characteristics. In other words, a community metric for social networks should be scale independent. Similarly, we see that existing community detection metrics (e.g. modularity, conductance, etc.), take edges as a set instead of looking for more complex yet domain specific structures. As a consequence, they end up finding tree-like communities in social networks, where people are loosely connected without a significantly relevant structure among them. However, in a computer network, communities with a tree-like structure make sense as this kind of network is structured in a more hierarchical way. Therefore, a community detection metric ought to be sensitive to the internal structure of the community instead of just counting edges, and the particular notion of structure ought to be dependent on the actual domain of the network. From these observations, we see that the informal community definition is too lax, leading to metrics with an undesired behavior. Thus, we think that we need to extend the community definition and link it to the actual domain of the applications where it is going to be used. With this objective in mind, we define a set of generic community detection properties that any community detection metric designed for social networks should fulfill. We classify them into two main categories: structural and behavioral properties. On the one hand, structural properties are those that refer to how structurally should or should not the communities found by maximizing a given metric be. In this category, we introduce, the internal structure, the bridges resistant and the cut vertex resistant properties. On the other hand, behavioral properties are those properties that specify how a metric should conceptually behave regardless of the structure of the community. In this category we have scale independent, linear community cohesion and adaptive properties. Properly defining these properties is very useful for two main reasons:
23 1. They set up a framework to design a robust community detection metric for social networks. 2. Provide the user with an insight into how the metric behaves, thus having enough information to decide whether the metric is suited or not for its application. In the following sections we introduce these properties and argument why they are required for a socially oriented community detection metric. For other domains, these properties might be completely different. 3.1.1 Structural properties 3.1.1.1 Internal structure sensitive One of the main characteristics of social networks and their communities is the significant presence of transitive relationships (triangles) among three vertices of the graph. The relevance of triangles in social networks has been confirmed in previous studies [36,39,60,61] and models describing the growth of social networks give triangle closing as a key factor of network evolution [27]. In social networks, triangles emerge naturally as a consequence of the Homophily principle [33], which states that similar people are more likely to be connected, forming transitive relations among them, which also translates into networks with a significantly larger clustering coefficient than that expected in a random graph [36,39]. Therefore, how the edges in a community are structurally connecting their vertices is important to determine whether these form a good community or not. The particular notion of structure then, depends on the actual domain of the network, which in the case of social networks one of such structures is the triangle. Therefore, we define the property as follows: ”A community detection metric is sensitive to the internal structure, if and only if it does not only take into account the number of internal/external edges, but also to how these connect vertices inside/outside the community, forming relevant structures for the specific domain”
24 Typically, existing community metrics consider all the internal edges of a community equally important without taking into account whether they form structures or not. The reason is that many of the existing metrics are too tightly adhered to the informal community definition, which attempts to be generic and domain agnostic. This is the case of some of the most popular metrics such as modularity or conductance. 3.1.1.2 Bridge resistant The connections in real graphs are known not to be local, they can connect distant vertices [28]. In a social network, people are typically connected to people with similar characteristics (e.g. their work mates, people they know from where they studied, family, people with similar interests, etc.), but also and less frequently, with people who are dissimilar and that they have met due to more sporadic interactions (i.e. random). A bridge is an edge that if it is removed from the induced subgraph of the community, it creates two separate connected components. A bridge is a very weak relation between two sets of vertices that are unrelated, because it only affects one member of each subset of vertices, and therefore, in a social network it clearly reveals two dissimilar subsets connected by one of such random links. Therefore, “A comunity detection metric is bridge resistant if and only if resulting communities from its maximization never contain a bridge” Most of the existing metrics like modularity or conductance are not bridge resistant as they rank as good a community sets of vertices with a tree-like structure, thus containing bridges. Actually, as a consequence of its resolution limit, modularity is not bridge resistant, as pairs of two cliques in a chain of cliques connected by a single edge (bridge) are identified as a community. 3.1.1.3 Cut vertex resistant In a social network, it is common to find situations where a person belongs to two or more different communities, such as that one formed by its football friends and the other formed by its family. In this particular situation, there is an overlap of two communities on that person. In the context of disjoint communities, however, if the two communities are not related enough, then
25 they should be split and the person placed into one of them (the more important one or relevant from the perspective of the person, as in the disjoint community detection problem a vertex can only belong to a single community). Note that it is not the aim of this work to consider the problem of overlapping communities. In such a situation, the person within the induced subgraph formed by the two communities it belongs to, is what is known in graph theory a cut vertex. His removal from the induced subgraph separates the two induced communities into two (or more) connected components, in a similar way as bridges do. Cut vertices are weak links in a community, because there are no edges between the connected components the cut vertex is connecting. If the connected components have a strong internal structure, then it is more natural to split the induced subgraph into several communities. Therefore, “A community detection metric is cut vertex resistant if and only if resulting communities do contain a cut vertex” 3.1.2 Behavioral properties 3.1.2.1 Scale Independent In a social network, the existence of a community (e.g. those persons interested in a given topic) is independent whether the network is formed by one or ten million people. Similarly, in a protein-protein interaction networks, the proteins in a community of protein have a large probability to have similar metabolic functions. Whether this is true or not, does not depend on whether there are one or ten million different proteins in the world. Therefore, a community detection metric or algorithm for social networks should work well at any scale and should not degrade as the size of the analyzed network increases. This means that the community definition should not depend on the size of the network, but only on local information. Otherwise, clearly defined communities would become undetectable as the size of the graph changes. Therefore, we define the property as follows: “A community detection metric is scale independent if and only if it does not depend on the total size of the graph”
26 Most of the existing community detection work does not formally guarantee to be scale independent. Actually, all those algorithms based on modularity maximization, which form the bulk of the literature, suffer from the so called resolution limit as explained in Chapter 2. This is because modularity computation depends on the total number of edges in the graph, and different alternatives aimed at solving this issue do not fix the problem entirely [64]. 3.1.2.2 Linear community cohesion In social networks, communities are formed by persons with a significant level of cohesion among them. This means that, as long as the size of the community increases, the number of connections between a person and its community has to increase proportionally to maintain the level of cohesion of the community. This simple restriction limits the community growth if there is not a significant cohesion among its members. For this reason, we define the following property: “A community detection metric has a linear community cohesion if and only if the number of connections between a vertex and a community grows linearly with the size of the community” If it grew sublinearly, the larger the community, the easier it would be for a person to join that community with respect to the size of that community. On the other hand, if it grew faster than linear, the communities would have a maximum possible size, since after a certain point, the number of necessary links between a person and the rest of the community would be larger than the possible number of links. Existing metrics such as Conductance, Flake ODF, Cut ratio or Expansion, do not fulfill this property. In these metrics, as long as the number of edges between communities is reduced, the value of the metric improves, thus they do not place any restriction on a minimum number of connections (just greater than zero) between a vertex and a community. More concretely, in such metrics a “hair” (a vertex connected to a community with a single edge) will always be included in that community regardless of its size.
27 3.1.2.3 Adaptive In a social network, different communities might have different degrees of cohesion or structure, depending on the how tight is the relation between the members of the community compared with other people not belonging to it. This relation between internal and external connectivity is what determines whether a set of vertices is a community or not. Finding communities is about finding relevant regions in a graph, that is, sets of vertices whose structure deviates significantly from what it is expected in a given part of the network. This is what indicates that some relevant structure is there, and thus it is worth to be analyzed in more detail. Thus, we define the property as follows: “A community detection metric is adaptive if and only if it establishes a relation between internal and external connectivity, and thus, adapts to the context of the community in the graph” Many existing community detection metrics (e.g. Edge Density, Cut Ratio and Expansion) are defined in such a way that they just look at either the internal or the external connectivity of a community, but not to both. In the first case, metrics end up missing sets of vertices that although they do not fulfill the internal criteria, they are so isolated from the rest of the graph that should be detected as a community. On the second case, these metrics end up missing groups of vertices that although they are not isolated enough to meet the criteria, their internal community structure is so strong that they should be considered a community as well. 3.2 Problem Definition Given a graph G = ( V, E ), the problem of disjoint community detection consists in classifying the |V| = n vertices of the graph into q1 non-empty pairwise disjoint cohesive sets, Si for 1 ≤i≤q . We call those q sets a partition of V, i.e. P={S1, . . . , Sq}, in such a way that S1∪···∪Sq=V. The criterion to measure the degree of cohesion of each set is formally obtained by defining a metric, that is, a function fs , that assigns a real number to each 1 We assume that q is a value determined by the nature of the graph rather than an arbitrary value determined by the user.
34 for WCC : the left factor in Equation 3.3 is the ratio between the number of triangles that vertex x closes with the vertices in S and the number of triangles that vertex x closes with the whole graph. Hence, this left factor is affected by the number of triangles inside the community. On the other hand, the right factor depends on the number of vertices that form triangles with vertex x . Therefore, the distribution of triangles inside the community affects the right factor. Figure 3.4 shows two examples of communities with the same number of vertices and edges, but distributed differently. While in Figure 3.4(a) we see two cliques with only three edges connecting them, in Figure 3.4(b) we see a more uniformly structured community closing more triangles. We see that WCCs scores Figure 3.4(b) higher, since the community is more structurally intraconnected, even though there are two cliques in Figure 3.4(a). (a) 0.444 (b) 0.511 Figure 3.4: Consequences of the internal structure on the WCC 3.4.2.2 Bridge resistant Optimal communities found by maximizing WCC never contain bridges. We show this based on the following observation: Theorem 1 Let S1 and S2 be two communities in a partition of graph G = (V, E)such that: (i) S1 and S2 are the set of vertices of two different connected components. (ii) WCCs(S1)>0. Then, the following inequality holds: WCC({S1, S2})> WCC({S1∪S2}).
35 When an edge does not close any triangle, it does not affect the computation of WCC . A bridge does not close any triangle, hence, a bridge is never accounted by WCC . Thus, sets of vertices connected by bridges are not merged into a community because of Theorem 1. In Figure 3.5 (a-b), we show an example of the application of Theorem 1. We see that having the two cliques separated is better than considering a single community with a bridge, in terms of WCC . (a) 0.444 (b) 1 Figure 3.5: Example of the behavior of WCC against bridges 3.4.2.3 Cut Vertex resistant In Figure 3.6(a-c), we show two cliques (note that the clique is the highest density graph structure) of size five sharing a vertex. Here, WCC is able to separate the communities for this particular case because the left and right sets of vertices have enough structural intraconnectivity and isolation to become separate communities, assigning the cut vertex to one of them. We prove this property for WCC for the case where communities have the highest possible density, which is the clique: Theorem 2 Let G = ( V, E )be a graph of order n which consists of two cliques Kr and Ks of orders r and s , respectively, that intersect in a vertex t . Assume r≥s≥4. (i) If P1={Kr∪Ks}, then n·WCC(P1) = (r−1)(r−1) r+s−2+1 r+s−2+(s−1)(s−1) r+s−2; (3.4)
36 (a) 0.556 (b) 0.722 (c) 0.444 Figure 3.6: Example of WCC against vertex cuts (ii) if P2={Kr, Ks\{t}}, then n·WCC(P2)=(r−1) + (r−1)(r−2) (r−1)(r−2) + (s−1)(s−2) (3.5) +(s−1)(s−2)(s−3) (s−1)(s−2) ; (3.6) (iii) if P3={Kr\{t},{t}, Ks\{t}, then n·WCC(P3) = (r−1)(r−2)(r−3) (r−1)(r−2) +(s−1)(s−2)(s−3) (s−1)(s−2) ; (3.7) (iv) WCC(P3)≤WCC(P2). (v) max{WCC(P1), W CC(P2), WCC(P3)}=WCC(P2). This theorem illustrates the fact that WCC avoids merging two very well defined communities (such as two cliques) because of a single vertex. The reason is that WCC is a metric that not only takes into account the vertices that are connected and forms triangles, but also the vertices that do not. Thus, if the triangles inside the community are not distributed evenly among all the vertices then the quality of the community is penalized. 3.4.3 Behavioral Properties 3.4.3.1 Linear Community Cohesion WCC is crafted to have a linear community cohesion by means of the following theorem:
37 Theorem 3 Let G = ( V, E )be a random graph of order r in which each edge occurs independently with probability p and closes at least one triangle. Let v6∈ V be a vertex connected to and forming at least one triangle with d≥ 2 vertices of V . Consider the two partitions P1 = {V∪{v}} and P2 = {V, {v}} . Then, (i) (r+ 1)WCC(P1)=(r−1)p+ 2dr−1. (ii) (r+ 1)WCC(P2)=(r−d)p+d r·((r−1)p+ 1)(r−1)(r−2)p2 (r−1)(r−2)p2+ 2(d−1) . (iii) For rlarge enough, WCC(P1)> WCC(P2)if and only if d > rp pp2+ 2p+ 9 −(1 + p)/4. For example, in the particular case of the clique (where p = 1), it is necessary to connect to roughly more than one third of the vertices to become a member of the community. Corollary 1 Let S be a clique of order r . Given a vertex v , there must exist at least 0 . 37 ·r edges between v and S to hold WCC ( {S∪{v}} ) > WCC ( {S, {v}} ). In Figure 3.7 we show an example of Theorem 3, where we represent four groups of examples: a-b, c-d, e-g and g-h. The left graph of each group (a,c,e and g), represents a partition with one single community, while the right graph assumes a partition with two distinct communities formed by a single vertex and a clique. We see that group a-b has a better WCC score for distinct communities while group c-d for one community. Note that WCC gives a better score for vertices connected to more than 0.37 vertices of a clique. The same happens in examples e-f (four connections are less than 0.37 vertices), and g-h (6 connections are more than 0.37 vertices). This example illustrates the linear community cohesion of WCC , where the number of connections required by a vertex to become part of a community, scales with its size. We empirically validated the linearity property of WCC . We generated instances of graphs formed by a vertex v and a community C , with a probability
38 (a) 0.810 (b) 0.831 (c) 0.857 (d) 0.786 (e) 0.897 (f) 0.907 (g) 0.923 (h) 0.885 Figure 3.7: Examples showing the linear community cohesion of WCC pin for an edge to exist between two vertices of C , and a probability pout for an edge to exist between v and a vertex of C . We generated two types of graphs: one with a community of size 100, and another one with a community of size 200. For each possible configuration of pin and pout (in steps of 0.01), we generated 100 instances of each type. Using the WCC based algorithm proposed in Chapter 4, we tested for which configurations the resulting partition was formed by a single community containing both the original community and the vertex, and which did not. Figure 3.8(a) and (b) show the theoretical threshold line of Theorem 3 for both sizes in dim white, and in grey scale the results obtained by the algorithm. White means that the algorithm opted to merge the communities into a single one for all the instances of that particular configuration, while black means that a non merging configuration was always returned. From the figure we can observe that the theoretical threshold is empirically observed, becoming sharper as the size of the graph increases. The black region at the bottom of Figure 3.8(b) becomes smaller as the graph grows (as opposed to Figure 3.8(a)), and as predicted in Theorem 3, it disappears for arbitrarily large graphs. For small graphs and small pin , the probability for a vertex to exist without closing any triangle is large, and therefore the community is shattered into smaller sub communities. 3.4.3.2 Detectability Analysis of WCC Recent studies have revealed the difficulties of existing community detection metrics, such as modularity, to detect communities if they are not well de-
39 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin n=100 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin n=200 (a) (b) Figure 3.8: Empirical evaluation of Property 2. fined [10]. Typically, these studies use simplified graph models, being the Stochastic Block Model one of the most widely used. This model assumes a graph with q communities, where there is an edge between two vertices with probability pin if both belong to the same community, and probability pout if they belong to different communities. The question is whether a given community detection metric is able to detect the communities of the model for a given set of configuration parameters ( pin , pout , n , and q ). In this section we analyze the level of detectability of WCC using the stochastic block model. This analysis will serve us to show that WCC is both context aware and scale independent, at least for the configurations embraced by the model. For the sake of simplicity, in our study we will stick to the case where we have a graph with n vertices, consisting of q= 2 communities of size n 2. Given a stochastic block model graph G of size n and two communities of size n 2 , we want to find the detectability threshold of WCC , that is, the point in the relation between pin and pout where maximizing WCC obtains the expected communities of the model. Actually, this can be also seen in terms of intraconnectivity and isolation: the value of pin models the intraconnectivity of the communities of the model (the larger pin , the better the intraconnectivity) while pout models the isolation of the communities (the lower pout is, the better
40 the isolation). The detectability threshold of WCC is defined in Theorem 4, whose proof can be found in Appendix 9.6. Theorem 4 Let Gbe a an arbitrarily large graph with n vertices with two communities A and B of size n 2 each. Let C ( x )be the community where vertex x is assigned. Two vertices x and y are connected with probability pin if C ( x ) = C ( y ), and with probability pout if C ( x ) 6 = C ( y ). Let P be any possible partition of the graph, being P1 = {A, B} and P2 = {A∪B} particular instances of that partition. Then: (i) WCC(P1) = (n 2−1)(n 2−2) ·p3 in ·((n 2−1) ·pin +n 2·pout) ((n 2−1)(n 2−2) ·p3 in + (n 2−1)n·pin ·p2 out)(n 2·pout +n 2−1) (ii) WCC(P2) = ((n 2−1) ·pin +n 2·pout) n−1 (iii) arg maxPW CC(P)∈ {P1,P2}if and only if pin > pout; (iv) WCC(P1)> WCC(P2)if and only if pin >p(2 −2·pout)(pout + 1) ·pout 1−pout (3.8) Theorem 4 states that the partition with optimal WCC for these particular graphs is either that containing the original communities ( {A, B} ) or that taking the graph as a single community ( {A∪B} ), and the transition point between the former and the later is that expressed by Equation 3.8. In other words, WCC is able to recover the original communities if and only if the condition in Equation 3.8 (the detectability threshold) holds.
41 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin Figure 3.9: Transition point for WCC and different values of pin and pout 3.4.3.3 WCC’s detectability discussion The question is whether the detectability threshold of WCC is good or not. Intuitively, according to the informal community definition, one would expect a community detection metric to detect communities whenever pin > pout . However, this definition is incomplete and, in practice, pin > pout is not a sufficient condition to define a community. As an example, suppose a clique of size n . Just removing an edge of the clique would imply a configuration with two communities of size n 2 , with pin = 1 > pout = n2−4 n2 , if we strictly adhere to the informal community definition. Therefore, a community metric with a detectability threshold of pin > pout would potentially only detect communities with a perfectly uniform edge distribution. Otherwise, these would break up into smaller subcommunities with a uniform density. Clearly, this is not practical in a real application, as real graphs are typically not uniform and situations such as that described above appear frequently. Therefore, the
42 actual transition point between detectable and non-detectable configurations for a given metric is a direct consequence of the community definition of that metric, and whether this is good or bad is determined by the application in use. In the case of WCC , we evaluate it using several graphs from social networks, proving that it outperforms existing methods in the literature, in Chapter 5. This analysis allows us to show that WCC is both adaptive and scale independent. First, we see that the balance between intraconnectivity and isolation is independent of the size of the network (Equation 3.8), which makes the metric scale independent. This is not the case, for instance, for modularity, whose detectability threshold is cin −cout ≥ 2 √cin +cout , where cin = n 2·pin and cout = n 2·pout . In this case, the smaller the graph, the larger cin needs to be compared to cout to be able to correctly identify the communities. This issue is related to the known resolution problems of modularity, which is unable to detect small and well defined communities once the size of the graph increases. Second, we see that WCC does not impose either a minimum level of intraconnectivity or isolation to a set of vertices to be detected as a community. This is better observed in Figure 3.9, where we plot three well defined regions, corresponding to the different configuration spaces where WCC is able to detect the communities, where it is not able to detect them and where communities do not exist ( pin ≤pout ). We also show the detectability threshold of WCC , which delimits the detectable and non-detectable regions. We see that the threshold establishes a relation between pin (intraconnectivity) and pout (isolation), in such a way that the more intraconnected the communities are (the larger pin is), the less isolated (the larger pout ) these can be and vice versa. This means that WCC is a metric that is adaptive and locally identifies relevant sets of vertices, thus adapting to the heterogeneous nature of real graphs. Finally, we see that WCC does not detect the original communities whenever they do not exist – i.e. when pin ≤pout –, which is desirable in a community detection metric, thus, not to detect false positives. In Figure 3.10 we show a numerical validation of the detectability threshold of WCC . We test different configurations of stochastic block model graphs ( pin and pout from 0 to 1 in steps of 0.01, for different values of n ) with two communities using the WCC maximization algorithm proposed in Chapter 4. We generated 100 graphs for each tested configuration, executed the algorithm, and compared the resulting partition with that expected from the model
43 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin n=10 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin n=50 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin n=100 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin n=500 Figure 3.10: Detectability of the proposed algorithm for the stochastic block model Graphs of different sizes with different configuration parameters ( pin and pout ). The closer to white is, the better the NMI between the detected partition and that expected by the model. The closer to black, the more different. using the Normalized Mutual Information (NMI) [15]. Each point in the graph corresponds to the average NMI of those 10 executions. The whiter the color, the closer to one the average NMI is (the algorithm finds the expected communities), and the darker the color, the closer to zero the NMI is (the communities found by the algorithm are very different from those expected from the model). We also draw the detectability threshold. We see the detectability threshold line fits very well with the empirical results obtained, with a very well defined transition point between the detectable and non-detectable regions. The larger the size of the graph, the better this fitness, because the larger the graph, and as a consequence, the larger the communities, the more uniform the internal edge density of these is. Furthermore, we also empirically confirm that when communities do not exist ( pin ≤pout ), WCC does not detect them. These empirical validation also suggests that the algorithm proposed in Chapter 4 is able to produce results close to the optimal, even though it does not formally guarantee to produce an optimal solution. 3.4.3.4 The community detection paradox and WCC Another issue that affects modularity maximization based algorithms is the so called community detection paradox [52]. Counter-intuitively, the paradox states that the worse defined the communities are, the easier it is for the algorithms to detect them, while the better defined they are, the harder it is. In order to test whether WCC is affected by this issue or not, we first need
50 •INSERT : insert a singleton community 1 into an existing community. Remove the empty community resulting from this movement. •REMOVE : remove the vertex from its current community and create a new singleton community containing the vertex. •TRANSFER : remove the vertex from its current community (source) and insert it into another one (destination). Note that bestMovement does not modify the current partition, and that the best movement of each vertex is computed independently from the others. This allows computing in parallel the best movements for all the vertices. Once we compute the best movement of all the vertices of the graph, we apply all of them simultaneously ( applyMovements Line 10). Finally, we update the WCC of the new partition (Line 11) and check whether it improved compared to the last iteration. Before describing function bestMovement in detail, we first introduce some auxiliary functions that are used in it. The proofs of the theorems introduced in this section can be found in the Appendix. •WCCI ( v, C, P ) computes the improvement of the WCC of a partition P when vertex v (which belongs to a singleton community of P ) is inserted into community C of P. Theorem 5 Let P = {C1, C2, . . . , Ck,{v}} and P0 = {C0 1, C2, . . . , Ck} be partitions of a graph G= (V, E)where C0 1=C1∪{v}. Then, W CC(P0)−W CC(P) = W CCI(v, C1, P ) = =1 |V|·Xx∈C1W CC(x, C0 1)−W CC(x, C1)+1 |V|·W CC(v, C0 1). •WCCR ( v, C, P ) computes the improvement of the WCC of a partition P when vertex v is removed from community C of P and placed as a singleton community. 1A singleton community is a community composed by a single vertex
51 ALGORITHM 2: Phase 2, refinement. Data: Given a graph G(V,E) and a partition P Result: A refined partition P’ 1bestP ←P; 2bestWCC ←computeWCC(P); 3triesRemaining ←lookAhead; 4repeat 5triesRemaining - -; 6M← ∅; 7foreach v in V do 8M.add( bestMovement(v,P) ); 9end 10 P←applyMovements(M,P); 11 newWCC ←computeWCC(P); 12 if (newWCC −bestWCC)/bestWCC ≥tthen 13 bestP ←P; 14 bestWCC ←newWCC; 15 triesRemaining ←lookAhead; 16 end 17 until triesRemaining > 0; 18 return bestP; Theorem 6 Let partitions P = {C1, C2, . . . , Ck} and P0 = {C0 1, C2, . . . , Ck,{v}} of a graph G= (V, E)where C1=C0 1∪{v}. Then, W CC(P0)−W CC(P) = W CCR(v, C1, P ) = −W CCI(v, C0 1, P 0). •WCCT ( v, C1, C2, P ) computes the improvement of the WCC of a partition when vertex vis transferred from community C1and to C2. Theorem 7 Let P = {C1, C2, . . . , Ck−1, Ck} , P0 = {C0 1, C2, . . . , Ck−1, Ck,{v}} and P00 = {C0 1, C2, . . . , Ck−1, C0 k} be partitions of a graph G = ( V, E ) where C1=C0 1∪{v}and C0 k=Ck∪{v}. Then, W CC(P00)−W CC(P) = W CCT(v, C1, Ck, P ) =W CCR(v, C1, P ) + W CCI(v, Ck, P ). =−W CCI(v, C0 1, P 0) + W CCI(v, Ck, P ).
52 From Theorem 5, we conclude that computing the improvement of WCC resulting from inserting a vertex v (i.e. a singleton community) into a community C , we only need to recompute the WCC of vertex v and those vertices in C . Therefore, when computing WCCI () for a vertex and a community, only a very local portion of the graph needs to be accessed, and the number of computations performed is small compared to computing the WCC of the whole partition. Furthermore, Theorems 6 and 7 show that we can express movements INSERT, REMOVE and TRANSFER, in terms of function WCCI(), which in turn simplifies the implementation of the algorithm. Algorithm 3 describes the bestMovement function. First, we compute the improvement of removing vertex v from its current community (Line 3). Then, we obtain the set of candidate communities, formed by those communities containing the neighbors of v (Line 6). After that, we calculate which is the candidate community where inserting or transferring vertex v (depending whether the v forms a singleton community or not) improve the WCC most (Lines 7 to 17). Finally, we select whether the best improvement is obtained from removing the vertex from its current community (REMOVE) or inserting/transferring it into a new community (INSERT/TRANSFER) (Lines 18 to 26). If neither of the two movements improves the WCC of the partition, we keep the vertex in the current community (NO ACTION) (Line 1). 4.1 Heuristic We have seen that we can express any movement by means of WCCI . Computing WCCI ( v, C, P ) requires computing the triangles that v and those vertices in C close with the other vertices in C and v . For a vertex, this operation is bound by the number of neighbors that have ( d ), which has a complexity of O ( d2 ) (for each neighbor in C∪ {v} we have to test against all of its other neighbors in C∪{v} ). Also, since real graphs typically have power law distributions, this cost is large for the highest degree vertices in the graph. Finally, considering that the number of times WCCI is called is bounded by the number of edges m of the graph, it quickly becomes the most time consuming part of the algorithm. In this section, we propose a model to
53 din dout r, δ G, ω b v C Figure 4.1: Model used for estimating the WCCI. estimate WCCI () with a constant time complexity function (given some easy to compute statistics) that we call WCC0 I(). WCC0 I () stands the approximated increment of WCC when vertex v is inserted into a community C . In Figure 4.1, we depict the simplified model on top of which WCC0 I () is built. For a given vertex v , we only record the number of edges that connect it to community C . For each community C , we keep the following statistics: the size of the community r ; the edge density of the community δ ; and the number of edges b that are in the boundary of the community. We also use the clustering coefficient of the graph ω , which is constant along all the community detection process and has been computed during the graph cleanup step. The clustering coefficient of the graph is equivalent as the observed probability that two given edges that share a vertex close a triangle. These statistics homogenize the community members and allow the computation of WCC0 I() as follows: Theorem 8 Consider the situation depicted in Figure 4.1, with the following assumptions: •Every edge in the graph closes at least one triangle. •The edge density inside community Cis homogeneous and equal to δ.
54 •The clustering coefficient of the whole graph equals to ω. Then, W CC(P0)−W CC(P)≈W CC0 I(v, C) =1 V·(din ·Θ1+ (r−din)·Θ2+ Θ3),(4.1) where, Θ1=(r−1)δ+1+q (r+q)·((r−1)(r−2)δ3+(din−1)δ+q(q−1)δω+q(q−1)ω+dout ω)·(din −1)δ; Θ2=−(r−1)(r−2)δ3 (r−1)(r−2)δ3+q(q−1)ω+q(r−1)δω ·(r−1)δ+q (r+q)(r−1+q); Θ3=din(din−1)δ din(din−1)δ+dout(dout−1)ω+doutdin ω·din +dout r+dcout ; and q= (b−din)/r. Conceptually, Θ 1 , Θ 2 and Θ 3 are the WCCv improvements of those vertices in C connected to v , those vertices in C not connected to v , and vertex v respectively, when v is added to community C . The evaluation of Equation 4.1 is O (1) given all the statistics. Also, the update of all statistics is only performed when all communities are updated, with a cost O ( m ) for the whole graph. Note that we use aggregated statistics to estimate the number of triangles, and thus we are not computing the triangles when we compute WCC0 I(). 4.1.1 Complexity of the Algorithm Let n be the number of vertices and m the number of edges in the graph. We assume that the average degree of the graph is d = m/n and that real graphs have a quasi-linear relation between vertices and edges O ( m ) = O ( n·log n ). Then, the complexity of each of the steps of the algorithm is the following: Graph Cleanup: In the graph cleanup phase, for each edge in the graph, we compute the triangles that each edge participates in. The triangles are found by intersecting the adjacency lists of the two connected vertices. Since we assume sorted adjacency lists, the complexity of computing the intersection is O ( d ). Finally, we compute the local clustering coefficient of each vertex and the number of triangles each vertex closes, which has a cost of O ( m ) once we have the triangles each edge participates in. Since the average degree is m/n , we have that the cost of the first phase is O(m·d+m) = O(m·log n+m).
55 Initial Partition: The cost of this step is the cost of sorting the vertices of the graph based on the local clustering coefficients computed in the previous phase, which is O(n·log(n)). Partition Refinement: Let α be the number of iterations required to find the best partition P’, which in our experiments is between 3 and 7. In each iteration, for each vertex v of the graph, we compute, in the worst case, d + 1 movements of type WCC0 ( I ) that have a cost O (1). Then, the computation of the best movement for all vertices in the graph in an iteration is O ( n· ( d + 1)) = O ( m ). The application of the all the movements is linear with respect to the number of vertices O ( n ). We also need to update, for each iteration of the second phase, the statistics δ , cout , din and dout for each vertex and community, which has a cost of O ( m ). Finally, the computation of the WCC for the current partition is performed by computing for each edge the triangles, which is O ( m·log n ) as already stated. Hence, the cost of the refinement phase becomes O ( α· ( m + n + m + m·log n )), which after simplification, becomes O(m·log n) assuming αas constant. Finally, The final cost of the algorithm is the sum of the three phases: O ( m· log n+n·log(n) + m·log n) = O(m·log n).
56 ALGORITHM 3: bestMovement. Data: Given a graph G(V,E) a partition P and a vertex v Result: Computes the best movement of v. 1m←[NO ACTION]; 2sourceC ←GetCommunity(v,P); 3wcc r ←W CCR(v,sourceC,P); 4wcc t ←0.0; 5bestC ← ∅; 6Candidates ←candidateCommunities(v,P); 7for c in Candidates do 8if size(sourceC) >1then 9aux ←WCCT(v,sourceC,c,P) ; 10 else 11 aux ←WCCI(v,c,P) ; 12 end 13 if aux > wcc t then 14 wcc t ←aux; 15 bestC ←c; 16 end 17 end 18 if wcc r > wcc t and wcc r > 0.0 then 19 m←[REMOVE]; 20 else if wcc t > 0.0 then 21 if size(sourceC) >1then 22 m←[TRANSFER , bestC]; 23 else 24 m←[INSERT , bestC]; 25 end 26 end 27 return m;
Chapter 5 Experiments In this Chapter, we conducted a set of experiments, aimed at empirically proving (i) that WCC is able to correctly measure whether a community is good or not, (ii) that communities found by maximizing WCC are better than those found by other existing methods, and (iii) that SCD is able to scale and process large graphs. With these goals in mind, the following algorithms of the state of the art were selected as baselines: Infomap [58], as a representative of the random-walk based family of algorithms and for being one of the best algorithms for detecting disjoint communities [23]; Louvain [7], as it is the fastest and one of the highest quality modularity maximization algorithms; and Label Propagation Method (LPM) [54], because it has become very popular due to its excellent scalability. We suggest reading the reference paper for each algorithm to understand them in detail. Our selection covers algorithms following diverse strategies to test the validity of WCC but it does not intend to be an evaluation survey of all community methods. Besides, other popular approaches in the literature, such as [2,24,41,42] among others, aim at overlapping communities which are also out of the scope of this thesis. The implementation of all the algorithms has been taken from their author’s web site. For the experimentation, we used six real networks covering different aspects of real world data, mostly social networks 1 . All chosen networks have ground truth communities associated with them. The first is a network representing 1 Downloaded from SNAP ( http://snap.stanford.edu ). We cleaned the original graphs by removing the self loops. 57
58 Table 5.1: Real-world graphs with ground truth data. Vertices Edges Communities Amazon 334,863 925,872 151,037 Dblp 317,080 1,049,866 13,477 Youtube 1,134,890 2,987,624 8,385 LiveJournal 3,997,962 34,681,189 287,512 Orkut 3,072,441 117,185,083 6,288,363 Friendster 65,608,366 1,806,067,135 957,154 which products from Amazon have been copurchased by clients. In this dataset, ground truth communities match the different categories of products. The second is a graph of the DBLP network representing coautorship relations between authors, where ground truth communities correspond to authors that have published in the same journals and conferences. The third graph is a graph of Youtube, where ground truth communities correspond to the groups of users in youtube. The fourth , fifth and sixth datasets are graphs of the Livejournal, Orkut and Friendster social networks, where ground truth communities correspond to the groups created by the users. The characteristics of these graphs are summarized in Table 5. For more information about how these graphs are created and their communities are generated please refer to [67]. We used a machine with the following characteristics: 2xIntel Xeon E5-2609 @ 2.40GHz, with 4 cores each making a total of 8 cores, 128 GB ram and Linux 2.6.32-5-amd64. The used disks are regular 1TB spinning disks at 7200 rpm. 5.1 W CCsquality The goal of the experiment is to show the correlation between communities with good WCCs and good statistical indicators including existing community detection metrics, structural and other characteristics such as: the average edge density, the triangle density, the triangle participation ratio , the expansion, the average inverse edge cut, the Flake ODF, the conductance, the modularity, the bridge ratio, the normalized diameter and the size of the communities. For formal definitions of these indicators please refer to [48].
59 We created a pool of communities by running Infomap,Louvain and LPM on the first four real world networks described above 2 . We sorted all the communities in the pool by their WCCs value decreasingly although they have not been found with such metric. Then, we divided the communities into 20 groups of five percentiles according to their WCCs and plotted for these 20 groups their corresponding statistical indicators in a boxplot, showing the minimum, the first, the second and the third quartiles, and the maximum for each of the groups. These results are shown in Figure 5.1. In all the charts, the x axis represents the group identifier (e.g. the leftmost group is always the 95 percentile that contains the top 5% communities in terms of their WCCs ) while the y axis shows the corresponding statistical value. The communities of size one and two, are omitted since their WCCs value is always zero. As shown in Figure 5.1(a), the leftmost communities have high WCCs values, and the rightmost communities have the lowest WCCs values. Since these communities were not computed with WCCs , we analyze both good and bad communities. Broadly speaking, we observe two sections in each plot of Figure 5.1: from groups 1 to 11, the trend for all statistical indicators show that communities with higher WCCs have better properties; from groups 12 to 20 this trend apparently changes in some statistical indicators. We focus first on groups 1-11 and we analyze groups 12-20 later. Groups 1-11: In Figures 5.1(b) and (c) we see that the larger the WCCs of a community, the larger the average edge density and the triangle density. The transitive relations between the vertices (Property 1) indicate the presence of communities with a defined homophilic structure. Note that these communities have been found with metrics that do not search for triangles and yet, they contain more such structures. Similarly, Figure 5.1(d) shows that the larger the WCCs , the larger the TPR. However, we see that TPR has precision limitations, since it scores as good communities (with scores close to one), some communities that might not be that good according to other metrics such as the average edge density (Figure 5.1(b)), the expansion (Figure 5.1(e)), the average inverse edge cut (Figure 5.1(f)) and the conductance (Figure 5.1(g)). Finally, in Figures 5.1(e), (f) and (g), we see that the larger the WCCs , the smaller the expansion, the larger the average inverse edge cut, and the 2 We used the first four as they where the only ones where all the algorithms succeeded to execute.
66 1 10 100 1000 10000 100000 1x106 Amz Dblp You Live Orkut Friend Execution Time (s) infomap louvain lpm scd Figure 5.5: Execution times of the different algorithms single threaded. graphs, and the fastest after LPM and Louvain when these become larger. However, the execution times are still competitive compared to the implementations of the state of the art algorithms used. Again, those missing bars belong to those executions that were unable to finish in less than a week or due to memory consumption. We parallelized SCD in order to exploit the resources of current multi-core and many-core processors. More concretely, we parallelized the two most time consuming parts of the algorithm: the computation of the global and local clustering coefficient of the vertices during the graph clean up phase and the whole refinement phase. In the former, we parallelized the loop that computes, for each edge, the number of triangles that the edge closes. In the later, we parallelized both the loop in Line 7 of Algorithm 2, which calls the function bestMovement for each of the vertices in the graph and the computation of WCC for the partition at the end of the iteration (which can be parallelized for each vertex). Since all the parallel code is in the form of loops, we used OpenMP with dynamic scheduling, using a chunk size of 32. Figure 5.6 shows the normalized execution times of SCD with different number of threads. In
67 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Amz Dblp You Live Orkut Friend Normalized Execution Time 1248 Figure 5.6: SCD normalized execution time with different number of threads. this experiment, we have excluded the time spent in I/O, which includes reading the graph file and printing the results. Broadly speaking, we see that with a simple OpenMP based parallelization, SCD is able to achieve very good scalability, specially for the larger graphs which are also those with a larger average degree. The larger the average degree of the graph, the larger the cost of those parts that have been parallelized: the larger the cost of computing WCC and the larger the number of movements to test between vertices and communities). These two parts quickly become dominant over the sequential ones. This means a better scalability due to a direct application of Ahmdal’s Law. We see that with a simple OpenMP based parallelization, SCD is able to achieve very good scalability, specially for the larger graphs which are also those with a larger average degree. The larger the average degree of the graph, the larger the cost of those parts that have been parallelized: the larger the cost of computing WCC and the larger the number of movements to test between vertices and communities). These two parts quickly become dominant over the sequential ones. This means a better scalability due to a direct application
68 1 10 100 1000 10000 100000 0.1 1 10 100 1000 10000 Amz Dblp You Live Orkut Friend Execution Time (s) Million Edges Figure 5.7: Execution time with eight threads vs number of edges. of Ahmdal’s Law. Finally, Figure 5.7 shows the execution time of SCD with respect to the number of edges of the graph. Each point represents the time spent by the eight thread version of SCD for the different graphs. We see that SCD shows a quasi linear scalability in practice, and that is able to process the Friendster graph, which contains almost two billions of edges, in about seven hours. In Table 5.3, we show the memory consumption in MB of SCD for each of the graphs divided into three categories: Graph, Storage of Triangles and Partitions. In general, the amount of memory consumed by SCD is dominated by the graph’s representation which mostly depends on the number of edges of the graph. On the other hand, the other data structures (array of triangles and partitions) built by SCD scale linearly with the number of vertices of the graph, and not with the number of edges. We see that the amount of memory consumed for the Friendster graph is roughly 18GB, showing that much larger
69 Table 5.2: SCD Memory consumption in MB. Graph Triangles Partitions Total Amazon 11.4 1.3 16.0 28.7 Dblp 12.2 1.3 14.9 28.4 Youtube 37.5 4.5 68.9 110.9 Livejournal 325.4 16.0 197.7 539.1 Orkut 974.3 12.3 124.4 1111.0 Friendster 15235.8 262.4 3317.6 18815.8 graphs could be processed with a commodity server with 128 GB of memory. This supports the idea of proposing an algorithm for in memory machines, as these can perfectly manage the structural information of massive graphs of the order of billions of edges.
Chapter 6 Ground-truth vs Synthetic Communities Most of the existing work in community detection is evaluated using synthetic graph generators, specially the LFR benchmark, which generates graphs with a power law degree distribution, and outputs communities based on the informal community definition (more internal edges than external) [25]. However, evaluating communities using LFR or other simple graph generators, has a very clear shortcoming. These benchmarks impose a community definition, which is usually very simplistic and it is not clear whether it corresponds or not to those structures found in real data. The result is that algorithms designed to work well with these graphs sink when they try to recover the communities observed in real datasets such as those with ground truth communities. Communities created based on network’s metadata (aka ground truth communities, metacommunities or user defined communities), are not necessarily characterized by the same features or structures as those assumed in structural communities. But on the other hand, it is clear that having synthetic data generators capable of reproducing the characteristics of real datasets is of high importance, not only for benchmarking community detection algorithms, but also for benchmarking database systems [14] or to model complex systems more accurately, as they provide a flexible way to obtain real data when this cannot be easily obtained from real sources. Therefore, there is a need to better understand which are the features that characterize the meta-communities found in real data, and whether existing community detection benchmarks are able to reproduce these characteristics or 71
72 not. For this reason, in [47] we analyze a set of real graphs with ground truth communities (Amazon, Dblp, Youtube and Livejournal) (see Chapter 5 for their particular characteristics), by means of their community distributions using several structural indicators (clustering coefficient, conductance, bridge ratio, tpr, size and diameter) (See Chapter 2 for their corresponding definitions), with the goal of understanding how the meta-communities in those datasets look like. Then, we compare those communities observed in real graphs to those generated by two synthetic graph generators with a community structure: the LFR benchmark and the LDBC Social Network Benchmark data generator (LDBC-DG). LFR was designed as a benchmark for evaluating community detection algorithms [26]. Compared to other graph generators, its principal characteristic is that the building procedure is based on creating a graph that connects communities. LFR starts by generating a set of communities of different sizes following a power law distribution. Then, the edges between the vertices in the graph are created in such a way, that they follow power law distributions and for each vertex the mixing factor is fulfilled. The mixing factor is a parameter indicating the percentages of neighbors of every vertex that belong to a different community than that the vertex belongs to. A recent study indicated that communities are too well defined, and do not capture the noise found in real data [40]. We downloaded the generator from the author’s web site. The LDBC-DG is a fork of the S3G2 graph generator [44], which is customized to build social network datasets, which is used in the LDBC benchmarking initiative [14]. The LDBC aims at designing realistic and meaningful benchmarks for linked database systems, namely RDF and graph databases. The LDBC generator generates complex synthetic social-networks with many attributes related to the users and its activities in the network. The resulting schema is similar to the contents available in Facebook. For example, users have attributes that indicate their personal description (name, born place, school/university, etc); the friends of a user; posts and photographs created by a user; groups created by users indicating interests... It starts by generating a set of users with attributes following distributions found in the real world. Then, they sort the users in successive Hadoop jobs by different correlated attributes (i.e. user interests, user universities, etc...) and create friendships between users using a sliding window procedure, where users close in the
73 window have a higher probability to be friends. Following this schema, we create the communities using a similar procedure to the one described in the ground truth, by setting as a community each connected component of users (using the friends relation) that belong to a group. We downloaded the latest available version of LDBC-DG from the Github repository of LDBC on 30th March 2014. 6.1 Experimental Setup Synthetic graph generators have several parameters that can be tuned to produce graphs of different characteristics. For both LFR and LDBC-DG, we generate a network with 150K users. In the case of LFR, we set the average and maximum degree to 10 and 400 respectively, and the minimum and maximum community size to 10 and 10000, respectively. One third of the vertices are set as overlapping vertices, and belong to three different communities instead of one. All these parameters have been set up as to mimic the characteristics found in the ground truth data. Finally, we have set the mixing factor of LFR from 0.1 to 0.5, therefore generating five networks named LFR1, LFR2, LFR3, LFR4 and LFR5, which in this range is expected to generate networks with communities [26]. For the LDBC-DG, we generate a single network using the default LDBC-DG parameters, which are fit to real data. The rest of the parameters for both generators are set to the default values, which are reported to generate realistic social network distributions [14,26]. For each community, we compute all six structural indicators. Then, we analyze each indicator individually. We take each community as a sample and draw a histogram distribution. Then, we study the correlation between all pairs of histograms, by computing the Spearman correlation rank for each pair of graphs. The Spearman correlation rank test is a non parametric test that quantifies if two variables are monotonically related. 6.2 Results Discussion Figure 6.1 shows the distributions of the statistical indicators for the Livejournal graph. We take the Livejournal graph as a representative of the rest of the graphs, which are reported in the Appendix. For the rest of the
74 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (a) Clustering Coefficient (b) TPR 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0 20 40 60 80 100 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (c) Bridge Ratio (d) Diameter 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0 1 2 3 4 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (e) Conductance (f) log10(Size) Figure 6.1: Distribution of the statistical indicators for the Livejournal graph. real graphs, the distributions show similar characteristics as shown by the Spearman correlation tests of Figure 6.2. Real Graphs: We start by analyzing the internal structure of Livejournal communities, hence we focus our attention on the clustering coefficient, the bridge ratio, the TPR and the diameter. Figure 6.1(a) shows a multimodal distribution. The largest peak contains 44% of the ground truth communities,
75 AMZ 0.63 0.46 0.78 0.46 −0.26 −0.31 −0.31 −0.35 −0.30 DBLP −0.18 0.20 −0.22 −0.70 −0.69 −0.66 −0.65 −0.66 YOU 0.82 0.90 0.58 0.55 0.53 0.50 0.53 LIVE 0.83 0.22 0.19 0.18 0.09 0.15 LDBC 0.59 0.55 0.52 0.42 0.51 LFR1 0.82 0.76 0.77 0.78 LFR2 0.93 0.82 0.92 LFR3 0.84 0.87 LFR4 0.83 LFR5 AMZ 0.92 0.67 0.94 0.94 −0.11 −0.19 −0.36 −0.43 −0.54 DBLP 0.41 0.78 0.94 −0.32 −0.41 −0.56 −0.58 −0.65 YOU 0.84 0.52 0.42 0.38 0.23 0.06 −0.09 LIVE 0.83 0.10 0.04 −0.14 −0.25 −0.39 LDBC −0.24 −0.31 −0.44 −0.45 −0.54 LFR1 0.68 0.64 0.40 0.30 LFR2 0.74 0.57 0.42 LFR3 0.75 0.67 LFR4 0.75 LFR5 (a) Clustering Coefficient (b) TPR AMZ 0.94 0.95 0.99 0.98 0.64 0.54 0.52 0.38 0.27 DBLP 0.87 0.95 0.93 0.64 0.57 0.50 0.29 0.18 YOU 0.93 0.90 0.65 0.60 0.59 0.47 0.37 LIVE 0.98 0.61 0.53 0.50 0.36 0.25 LDBC 0.59 0.48 0.45 0.30 0.21 LFR1 0.76 0.62 0.40 0.11 LFR2 0.73 0.53 0.25 LFR3 0.65 0.44 LFR4 0.59 LFR5 AMZ 0.82 0.58 0.80 0.75 0.51 0.48 0.48 0.51 0.51 DBLP 0.70 0.94 0.90 0.63 0.60 0.60 0.63 0.63 YOU 0.72 0.78 0.91 0.86 0.86 0.91 0.91 LIVE 0.93 0.65 0.62 0.62 0.65 0.65 LDBC 0.70 0.66 0.66 0.70 0.70 LFR1 0.96 0.96 1.00 1.00 LFR2 1.00 0.96 0.96 LFR3 0.96 0.96 LFR4 1.00 LFR5 (c) Bridges Ratio (d) Diameter AMZ 0.72 0.32 0.31 −0.44 0.36 0.42 0.55 0.57 0.49 DBLP 0.58 0.58 −0.06 0.13 0.27 0.46 0.58 0.58 YOU 0.95 0.63 −0.03 0.11 0.19 0.28 0.33 LIVE 0.62 −0.14 −0.00 0.16 0.30 0.38 LDBC −0.28 −0.25 −0.27 −0.25 −0.17 LFR1 0.63 0.35 0.12 −0.08 LFR2 0.57 0.31 0.04 LFR3 0.71 0.39 LFR4 0.67 LFR5 AMZ 0.84 0.93 0.99 0.90 0.40 0.39 0.36 0.37 0.39 DBLP 0.79 0.85 0.74 0.51 0.50 0.47 0.46 0.52 YOU 0.94 0.95 0.24 0.23 0.19 0.23 0.25 LIVE 0.90 0.39 0.40 0.38 0.38 0.40 LDBC 0.17 0.21 0.16 0.15 0.21 LFR1 0.71 0.62 0.70 0.68 LFR2 0.75 0.66 0.72 LFR3 0.68 0.65 LFR4 0.62 LFR5 (e) Conductance (f) log10(Size) Figure 6.2: Spearman rank correlation coefficient of the distributions between the different communities and structural indicators.
82 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (a) Clustering Coefficient (b) TPR 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0 20 40 60 80 100 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (c) Bridges Ratio (d) Diameter 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0 1 2 3 4 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (e) Conductance (f) log10(Size) Figure 6.6: Distribution of the indicators for the LFR3 graph.
Chapter 7 Triangle counting in future many-core micro-architectures As manufacturing processes evolve and more cores are added to a chip, the higher the pressure to the interconnection network and integrated memory controllers, higher synchronization costs and fewer shared resources. For this reason, computer architects are thinking of alternative architectures with simplified and non-coherent cache hierarchies, which can scale better (to tens or hundreds of cores), and at the same time save die area and power. As a downside, this comes at the cost of more complex programming models as the coherency of the caches have to be managed by the programmer. One of such architectures is the Intel SCC (Single-chip Cloud Computer) [32]. The Intel SCC is a 48-core chip with shared memory, but non-coherent caches. Since flushing caches to achieve data coherence between cores is prohibitively costly, the Intel SCC incorporates a set of message passing buffers that can be used as communication channels between any pair of cores or as on-chip local memories for the most accessed data. In this piece of work [51], we explored the suitability of the Producer-Consumer programming model for the Intel SCC, by means of the triangle counting problem. Counting triangles is a very important operation not only for the computation of WCC , but also for social networks and other types of network analysis in general. Furthermore, as many graph algorithms, triangle counting is a memory bound operation that also exhibits a very non-local memory access pattern. This makes triangle counting a good representative of a modern 83
84 application to test the suitability of the Producer-Consumer model on the Intel SCC. We implemented triangle counting for the Intel SCC, and showed that the Producer-Consumer model is able to exploit both data and task parallelism, maximizing the usage of resources and achieving high scalability and performance (running up to 9 times faster than a baseline working on main memory). 7.1 The Intel SCC The Intel SCC processor is a 48-core vehicle created by Intel Labs as a platform for many-core software research. This is a clustered architecture composed of P54C cores, grouped in tiles containing two cores each. Each tile (pair of two cores) has a router, forming a communication mesh within all the chip to access the four DDR3 memory controllers. The Intel SCC has an aggregated address space of 64 GB of memory. However, each P54C core is able to address 4 GB. In our experiments, each core has a private region of memory of total size divided by 48 assigned. What makes the Intel SCC special is its non-coherent memory hierarchy. Each core has a non coherent L1 and L2 caches, of 16KB and 256KB respectively, with a cache line size of 32 bytes. Since the caches are non-coherent, it is the programmer who is responsible for maintaining the coherency of the caches manually. For this reason, the Intel SCC provides a fast core-to-core communication, consisting on 384KB of on-chip memory (also called the Message Passing Buffer(MPB)). Each tile is assigned 16KB of the buffer (8KB for each core), which is addressable by any core. We will call each 8KB section assigned to each core, an MPB section. Finally, in order to synchronize the access to the MPB and the memory by all the cores, the system provides 48 globally accessible test-and-set registers. 7.2 Producer consumer implementation of triangle counting In the Producer-Consumer(P/C) model, the program is divided into tasks which adopt the role of a Producer, a Consumer or both. The Producers are
85 tasks that operate on the input data and produce the results, which are then sent to the Consumers. The Consumers are the tasks that receive the data from the Producers, operate on the data and then produce the results, which can be either stored in main memory or forwarded to the next Consumer in the P/C chain (and hence performing the Producer’s role too). The Producers and the Consumers can be executed independently and concurrently as long as they have available data to consume and available resources to store the results they produce. Hence, the task parallelism is exploited. Furthermore, the input data of the tasks, can be split and distributed among multiple instances of both Producers and Consumers, allowing the partitioning of the data and the execution of multiple tasks in parallel. This way, we are also exploiting the data parallelism. Given a graph G ( V, E ) (where V is the set of vertices and E is the set of edges), the Producers compute, for each edge e in E , the number of triangles the edge e belongs to. Given an edge e connecting two vertices a and b , the number of triangles of this edges corresponds to the size of the intersection between the adjacency lists of vertices a and b . In order to exploit data parallelism, different Producer instances are created, and each of them is assigned a subset of the edges to process. Then, the Consumers read the results produced by the Producers and accumulate, for each vertex, the number of triangles where the edges pointing to the vertex participate in. Several instances of Consumers are created, and each of them accumulates the result of a subset of the vertices of the graph. All the Producers and the Consumers are executed concurrently, as long as the data is produced and consumed. We implemented three strategies to exploit data and task parallelism using the P/C model. DataParallelMsg: It follows the data parallel paradigm and uses main memory to exchange the data between the tasks. In this strategy only one task is executed at a time, which means that all the cores execute the Producer step first, and when it is completed, all the cores execute the Consumer step. Each core is responsible for 1 /P of the computational work, and the results are stored in main memory. Once all the cores have finished executing the Producer step, the results are broadcast to the other cores, by storing their results into their MPB sections. The other cores read the results and store
86 them again into their addressable main memory. Once all the cores have all the data, the Consumer step starts. DataParallelMsgBlk: This implementation, follows the data parallel programming model like the previous implementation presented, but in this case, the results of the Producer step are iteratively produced in blocks of the size of the MPB section, instead of producing all the results and then broadcast them. Once all the Producers have finished to produce their chunk of data, the cores consume the data produced by the rest directly from the MPBs of the others, and execute the Consumers step. The process iterates until all the computations from the Producer step have been performed. The goal of this approach is to benefit from keeping all the data produced in the Producers’ step inside the chip, instead of copying it into the main memory and hence achieving better performance. Task&DataParallel: The goal of this implementation, is to fully benefit from the presence of the MPB, by implementing a version based on the task and data parallel paradigm. In this approach, we have k cores as Producers, and P−k cores as Consumers and all cores execute their task at the same time. The Producers produce the data and store them directly into their MPB section, while the Consumers consume these data to perform their computations. A Producer computes and produces data as long as there is space in its MPB section. Once the buffer is filled, it waits until the data is consumed by all the consumers and the buffer is freed. Once the Producer has performed all the computations, it finishes. On the other hand, a Consumer waits for the data to be in the buffer. Once the data is available, it consumes them and tells the corresponding Producer that the data has been consumed. In order to reduce the contention on the buffer between Producers and Consumers, a double buffering scheme is used in every MPB section. 7.3 Experiments We used the Intel Single Chip Cloud Computing (Intel SCC) experimental processor, RockyLake version configured with 32GB of main memory. The frequencies of the tiles, mesh and memory are 533, 800 and 800 Mhz respectively. The operating system used for the Intel SCC cores is the Linux kernel provided by the RCCE SCC Kit 1.3.0.
87 To test the performance of the different implementations proposed, for the P/C model, we have implemented the local triangle count problem described in as described above. The input graphs, are built with the LFR graph generator [25], which creates graphs with social network characteristics. We generate two graphs: one with 100K vertices and 1M edge (small), and another one with 1M vertices and 10M edges (big). Each measure is obtained by averaging five executions. We show the results for the big graph. For a complete description of the results, please refer to [51]. In Figure 7.1(a), we show the obtained speed-up using the different strategies for different number of cores. For the Task&DataParallel strategy we set the number of Producers and Consumers to 50% and 50% out of the total respectively. As a baseline, we use the DataParallelMsg strategy with one core. We see that the data parallel version does not scale well, with a speed-up limited to 2.6x regardless of the number of cores used. This limit is due to the time to communicate the producer’s results to the consumers, which become dominant as long as the number of cores increases. For the optimized version of the data parallel approach, the DataParallelMsgBlk implementation, it scales a bit better but it is still limited to 10x for the larger number of cores used. The main difference between this implementation and the DataParallelMsg is that instead of the Producers writing the results into their MPB sections and the Consumers copying them to main memory, the Consumers make the computations by directly reading from the MPB’s of the Producers. This does not change the communication pattern but does have an impact on the communication latency as the the main memory accesses are avoided. Consequently, we can observe that the speedup for this optimized version follows a similar trend to the DataParallelMsg implementation but the speedup achieved is higher as the communication fixed cost is smaller. Finally, while both data parallel implementations showed a limit in their speedup, the Task&DataParallel implementation shows a near linear speedup even for large number of cores (about 24x of speedup for 32 cores). The reason is that Producers and Consumers are executing at the same time in a pipelining way, thus, we are able to hide the communication cost with the Producer and Consumer computation. The reason for the speedup to be slightly below the ideal has to do with another fact which is related to load
88 0 5 10 15 20 25 30 35 0 5 10 15 20 25 30 35 DataParallelMsg DataParallelMsgBlk Task&DataParallel 50-50 Ideal Number of Cores Speed-up (a) 0 5 10 15 20 25 30 35 0 5 10 15 20 25 30 35 Task&DataParallel 50-50 Task&DataParallel Best Task&DataParallel Worst Ideal Number of Cores Speed-up (b) Figure 7.1: (a) Scalability using the different P/C strategies. (b) Scalability of the Task&DataParallel strategy for different assignments of cores to tasks. balancing and contention on the double buffer space used to exchange the results between Producers and Consumers. We also tested different assignment of cores to tasks for the Task&DataParallel strategy, in such a way that we executed the application on different configurations ranging from 2 up to 30 Producers and 2 up to 30 Consumers, with a maximum of 32 cores in total. Figure 7.1-(b) shows, for each fixed number of cores, the speedup for the worst, the best, the 50-50 and the ideal configurations. We observe that the 50-50 strategy performs well, close to the
89 Best and Ideal. It is also relevant to notice that the gap between the Best and Worst is quite large. This experiment illustrates the fact that with a smart dynamic scheduling for task assignment, we can potentially obtain a very good performance using the P/C model. In conclusion, we see that the Producer Consumer model is a potentially good model for future many-core architectures with on-chip memories and noncoherent caches. Moreover, we see that triangle counting is a good candidate to benefit from such architectures due to its data bound computation and non-local memory accesses.
Chapter 8 Conclusions and Future Work In this thesis, we have explored one of the hottest research topics in the past decade: the community detection problem. We have studied the existing approaches for community detection, and have detected the different shortcomings affecting them when it comes to detect communities in social networks. The problem is that existing methods try to be generic but ignore the specific characteristics that characterize the communities of each domain. As an outcome of this analysis, we have proposed a domain specific community detection design methodology, which consists of defining 1. a set of structural properties describing how the communities detected by a metric must be. 2. a set of behavioral properties describing how the metric must behave at different circumstances (e.g. at different scales). Both structural and behavioral properties must be tailored for a given application domain. In our case, we have focused on the particular case of social networks. As such, we have proposed three structural properties: 1. Internal structure sensitive : a community metric for social networks must be sensitive to the internal community structure. 2. Bridge resistant: communities do not contain bridges. 91
98 (iv) Define f1 ( r, s ) = n·WCC ( P1 ), f2 ( r, s ) = n·WCC ( P2 ), and f3 ( r, s ) = n·WCC ( P3 ). The expression of these functions are those in (3.4), (3.6) and (3.7), respectively. The goal is to show that for all integers values r , s with r≥s≥ 4 the inequality f3 ( r, s ) ≤f2 ( r, s ) holds. Clearly, the first summand of f3 ( r, s ) is smaller than the first summand of f2 ( r, s ), and the last summands are equal. As f2 ( r, s ) has the second summand ≥ 0, we have f3 ( r, s ) ≤f2 ( r, s ). (v) We shall prove f2 ( r, s ) −f1 ( r, s ) ≥ 0 for n≥ 7 and 4 ≤r≤n− 3. We have s=n−r+ 1 and f2(r, s)−f1(r, s)>n −4−(r−1)2+ (n−r)2 n−1 =−2r2+ (2 + 2n)r−5n+ 3 n−1. The sign of f2 ( r, s ) −f1 ( r, s ) is the sign of the polynomial function − 2 r2 + 2(n+ 1)r−5n+ 3, which is a convex function on rwith roots: r1=1 2(n+ 1 −pn2−8n+ 7); r2=1 2(n+1+pn2−8n+ 7). Now, for n≥ 7, we have r1≤ 4 and r2≥n− 3. Therefore, for each r∈ {4, . . . , n −3}we have f2(r, s)−f1(r, s)≥0. 9.5 Proof of Theorem 3 Proof. Let Nbe the set of neighbors of v. (i) For x∈V, we have WCCv(x, V ) = vt(x, V )/r. Now, vt(x, V ) = (r−1)pif x∈V\N; (r−1)p+ 1 if x∈N; dif x∈ {v}.
99 Then (r+ 1)WCC(P1) =(r−d)(r−1)p r+d(r−1)p+ 1 r+d r =(r−1)p+ 2d r. (ii) For x∈V\N, WCCv(x, V ) = vt(x, V ) r−1=(r−1)p r−1=p. (iii) For x∈N, we have t(x, V ) = r−1 2p3; t(x, V ∪{v}) = r−1 2p3+ (d−1)p; vt(x, V ∪{v})=(r−1)p+ 1; |V\{x}|−vt(x, V )=(r−1) −(r−1)p; WCCv(x, V ) = ((r−1)p+ 1)(r−1)(r−2)p2 ((r−1)(r−2)p2+ 2(d−1)) ·r. Moreover, WCCv(v, {v}) = 0. Then, (r+ 1)WCC(P2) = (r−d)p+d r·((r−1)p+ 1)(r−1)(r−2)p2 (r−1)(r−2)p2+ 2(d−1) . (iv) We have, (r+ 1) (WCC(P1)−WCC(P2)) = p(d−1) + 2d r−d r ((r−1)p+ 1)(r−1)(r−2)p2 (r−1)(r−2)p2+ 2(d−1) , and the condition WCC ( P1 ) −WCC ( P2 ) > 0 is equivalent to the condition ad2+bd +c > 0,(9.1)
100 where a=2(2 + pr), b=p2(p+ 1)r2−p(3p2+ 3p+ 4)r+ 2p3+ 2p2−4, c=−p3r3+ 3p3r2+ 2p(1 −p2)r. For short, let we denote by O ( rn ) a polynomial expression of degree at most n. Then, the greatest solution of (9.1) is, d2=−p2(1 + p)r2+O(r) + pp4(p2+ 2p+ 9)r4+O(r3) 4(2 + pr) and we get lim r→+∞ d2 r=−p2(1 + p) + p2pp2+ 2p+ 9 4p =ppp2+ 2p+ 9 −(1 + p) 4. Thus, for a large enough r, the condition d > rp pp2+ 2p+ 9 −(1 + p)/4, is equivalent to WCC(P1)> WCC(P2). Note that function p7→ ppp2+ 2p+ 9 −(1 + p)/ 4 is increasing in p . A large value of p means more edges in G , and then a large value of d/r is needed for WCC(P1) being greater than WCC(P2). In the case of Corollary 1, p= 1, thus d > √3−1/2=0.37. 9.6 Proof of Theorem 4 Proof. Let x be any vertex of the graph G ( V, E ), and S the community of vertex x . Let’s assume that all the edges of the graph close at least one triangle.
101 (i) For P1 t(x, S) = n 2−1 2!p3 in; t(x, V ) = n 2−1 2!p3 in + n 2 2!pin ·p2 out + n 2−1 1! n 2 1!pin ·p2 out; vt(x, V )=(n 2−1)pin +n 2pout; vt(x, V ) + |S\ {x}| − vt(x, S)=(n 2−1)pin +n 2pout n 2−1−(n 2−1)pin. Then, WCC(P1) = (n 2−1)(n 2−2)p3 in((n 2−1)pin +n 2pout) ((n 2−1)(n 2−2)p3 in + (n 2−1)n·pin ·p2 out)(n 2pout +n 2−1). (ii) For P2t(x, S) = n 2−1 2!p3 in + n 2 2!pin ·p2 out + n 2−1 1! n 2 1!pin ·p2 out; t(x, V ) = n 2−1 2!p3 in + n 2 2!pin ·p2 out + n 2−1 1! n 2 1!pin ·p2 out; vt(x, V )=(n 2−1)pin +n 2pout; vt(x, V ) + |S\ {x}| − vt(x, S) = n−1. Then, WCC(P2) = (n 2−1)pin +n 2pout n−1. (iii) We numerically proof this statement. First, we need to compute the WCC of Ps , which consist of those partitions where s vertices of each of the two communities have been correctly placed. More formally, let Ps = {A0, B0} be any partition of the graph with two communities A0 and B0 of size n 2 , where |A∩A0| = s and |B∩B0| = s . Let xa∈ {A∩A0} , xb∈ {B∩B0} , va∈ {A0\A} and vb∈ {B0\B} . That is, any partition with two communities of size n 2
102 where 2svertices have been well placed. t(xa, A0) = s−1 2!p3 in + s−1 1! n 2−s 1!pin ·pout2 + n 2−s 2!pin ·pout2; t(xb, B0) = t(xa, A0); t(xa, V ) = n 2−1 2!p3 in + n 2 2!pin ·p2 out + n 2−1 1! n 2 1!pin ·p2 out; t(xb, V ) = t(xa, V ); vt(xa, V )=(n 2−1)pin +n 2pout; vt(xb, V ) = vt(xa, V ); vt(xb, V ) + |A0\ {xa}| − vt(xa, A0)=(n 2−1)pin +n 2pout + (n 2−1−(s−1)pin −(n 2−s)pout); vt(xb, V ) + |B0\ {xb}| − vt(xb, B0) = vt(xb, V ) + |A0\ {xa}| − vt(xa, A0). t(va, A0) = n 2−s−1 2!p3 in + n 2−s−1 1! s 1!pin ·pout2 + s 2!pin ·pout2; t(vb, B0) = t(va, A0); t(va, V ) = n 2−1 2!p3 in + n 2 2!pin ·p2 out + n 2−1 1! n 2 1!pin ·p2 out; t(vb, V ) = t(va, V ); vt(va, V )=(n 2−1)pin +n 2pout; vt(vb, V ) = vt(va, V ); vt(vb, V ) + |A0\ {va}| − vt(va, A0)=(n 2−1)pin +n 2pout + (n 2−1−(s−1)pin −(n 2−s)pout); vt(vb, V ) + |B0\ {vb}| − vt(vb, B0) = vt(vb, V ) + |A0\ {va}| − vt(va, A0).
103 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin n=10 P 1 P 2 Ps 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin n=50 P 1 P 2 Ps 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin n=100 P 1 P 2 Ps 0.0 0.2 0.4 0.6 0.8 1.0 pout 0.0 0.2 0.4 0.6 0.8 1.0 pin n=500 P 1 P 2 Ps Figure 9.1: The best partition found for different configurations of pin , pout and n. All possible configurations of Pshave been tested Then, W CC(Ps) = 1 n·2·s·(s−1)(s−2)p3 in + (s−1)(n 2−s)pin ·p2 out + (n 2−s)(n 2−s−1)p2 out ·pin ((n 2−1)(n 2−2)p3 in + (n 2−1)n·pin ·p2 out)· (n 2−1)pin +n 2pout (n 2−1)pin +n 2pout + (n 2−1−(s−1)pin −(n 2−s)pout) + 1 n·2·(n 2−s)((n 2−s)−1)((n 2−s)−2)p3 in + ((n 2−s)−1)s·pin ·p2 out +s(s−1)p2 out ·pin ((n 2−1)(n 2−2)p3 in + (n 2−1)n·pin ·p2 out)· (n 2−1)pin +n 2pout (n 2−1)pin +n 2pout + (n 2−1−(n 2−s−1)pin −s·pout). Figure 9.1 shows, for each configuration of pin and pout , for different values of n , which partition P ∈ {P1,P2,Ps} is that with a maximum WCC . In the case of Ps , we tested for all possible values of s . We see that the statement is true, regardless of the the value of n. (iv) We are interested in the transition point between P1 and P2 , that is, we want to know for which values of pin and pout , WCC ( P1 ) −WCC ( P2 ) = 0. Since we are interested in arbitrarily large graphs, we compute the difference when ntends to infinitely large values : L= lim n→∞ W CC(P1)−W CC(P2) = −1 2 (p2 in ·pout + 2 ·p3 out −p2 in + 2 ·p2 out)(pin +pout) (pout + 1)(p2 in + 2 ·p2 out)
104 If we solve L= 0 for pin, we obtain the following solutions: −pout,−p(2 −2·pout)(pout + 1)pout 1−pout ,p(2 −2·pout)(pout + 1)pout 1−pout , being the third solution the only positive and valid one. 9.7 Proof of Theorem 5 Proof. WCC(P0)−WCC(P) = =1/|V||C1∪{v}|·WCC(C1∪{v}) + Xk i=2 |Ci|·WCC(Ci)− 1/|V||C1|·WCC(C1) + Xk i=2 |Ci|·WCC(Ci) + WCC({v}) =1/|V|(|C0 1|·WCC(C0 1)) −1/|V|(|C1|·WCC(C1) + 0) =1/|V|Xx∈C0 1 WCC(x, C0 1) + Xx∈C1 WCC(x, C1) =1/|V|Xx∈C1 WCC(x, C0 1) + WCC(v, C0 1)− Xx∈C1 WCC(x, C1) 9.8 Proof of Theorem 6 Proof. As stated in the theorem assumptions, the partition P0 is build by removing v from C1 . Alternatively, the partition P can be build by removing vertex vto C0 1in P0. Then, the two following equalities hold: WCC(P) + WCCR(v, C1) = WCC(P0), WCC(P) = WCC(P0) + W CCI(v, C0 1) and thus: W CCR(v, C1) = −WCCI(v, C0 1)
105 9.9 Proof of Theorem 7 Proof. Since WCC is a state function, all paths from P to P0 have the same differential. Then, we express the transfer operation as a combination of remove and insert: WCC(P) + WCCT(v, C1, Ck) = WCC(P0) WCC(P) + WCCR(v, C1) + WCCI(v, Ck) = WCC(P0) WCC(P0)−WCC(P) = −W CCI(v, C0 1) + WCCI(v, Ck) 9.10 Proof of Theorem 8 Proof. Consider the situation depicted in Figure 4.1. Let N ( x ) be the set of neighbors of x . Given that, we define sets F = N ( v ) ∩C which contains those vertices in C that are actual neighbors of v , and G = ( C\N ( x )), which contains those vertices in C that are not neighbors of v . Therefore, from Theorem 5 we have: WCCI(v, C) = =1/|V|Xx∈C(WCC(x, C ∪{v})−WCC(x, C))+ 1/|V|WCC(v, C ∪{v}) =1/|V|Xx∈F(WCC(x, C ∪{v})−WCC(x, C))+ 1/|V|Xx∈G(WCC(x, C ∪{v})−WCC(x, C))+ 1/|V|WCC(v, C ∪{v}) We know that |F| = din and |G| = r−din , then we can define WCC0 I ( v, C ) with respect to three variables Θ 1 , Θ 2 and Θ 3 , which represent the WCC improvement of a vertex of F, a vertex of Gand vrespectively. Then, WCC0 I(v, C) = 1/|V|(|F|·Θ1+|G|·Θ2+ Θ3). We define q = ( b−din ) /r as the number of edges connecting each vertex in C with the rest of the graph excluding v. Then,
106 (i) If x∈F, we have t(x, C) =(r−1)(r−2)δ3; t(x, C ∪{v}) =(r−1)(r−2)δ3+ (din −1)δ; t(x, V ) =(r−1)(r−2)δ3+ (din −1)δ+q(r−1)δω+ q(q−1)ω+doutω; vt(x, V ) =(r−1)δ+1+q; vt(x, V ) + |C∪{v}\{x}|−vt(x, {C∪{v}}) = r+q; vt(x, V ) + |C\{x}|−vt(x, C) = r−1 + q+ 1 = r+q; In t ( x, C ), we account for those triangles that x closes with two other vertices in C . Similarly, in t ( x, C ∪{v} ) we account for those triangles that x closes with two other vertices in C , and those triangles that x closes with v and another vertex in C . t ( x, V ) accounts for all triangles that vertex x closes with the graph, which are: t ( x, C ∪{v} ) plus those triangles that vertex x closes with another vertex of C and a vertex of V\C , plus those triangles that vertex x closes with two other vertices in V\C , plus those triangles vertex x closes with v and another vertex of V\C . Since we assume that every edge in the graph closes at least one triangle, vt ( x, V ) accounts for the number of vertices in C that are actual neighbors of x plus 1 (for vertex v ) and q vertices that are connected to x . Finally, we have that the union of vertices in C and those vertices in Vwith whom xcloses at least one triangle is r+q. Therefore, Θ1=WCC(x, C ∪{v})−WCC(x, C) =t(x,C∪{v}) t(x,V )·vt(x,V ) |C∪{v}\{x}|+vt(x,V \{C∪{v}})− t(x,C) t(x,V )·vt(x,V ) |C\{x}|+vt(x,V \C) =vt(x,V ) (r+q)·t(x,V )·(t(x, C ∪{v})−t(x, C)) =(r−1)δ+1+q (r+q)·((r−1)(r−2)δ3+(din−1)δ+q(r−1)δω+q(q−1)ω+doutω)· (din−1)δ.
107 (ii) If x∈B, we have t(x, C) =(r−1)(r−2)δ3; t(x, C ∪{v}) =(r−1)(r−2)δ3; t(x, V ) =(r−1)(r−2)δ3+q(q−1)ω+q(r−1)δω; vt(x, V ) =(r−1)δ+q; vt(x, V ) + |C∪{v}\{x}|−vt(x, {C∪{v}}) = r+q; vt(x, V ) + |C\{x}|−vt(x, C) = r−1 + q; t ( x, C ) accounts for those triangles that x closes with two other vertices in C . Since, x is not connected to v , we have that t ( x, C ) = t ( x, C ∪{v} ). t ( x, V ) accounts for the number of triangles that x closes with the rest of vertices in V . These are t ( x, C ) plus those triangles that vertex x closes with another vertex of C and a vertex of V\C , plus those triangles that vertex x closes with two other vertices in V\C . vt ( x, V ) accounts for the number of vertices in V with whom x closes at least one triangle, which are the neighbors of x in C and those t vertices with whom x is connected. Finally, we have that the union of vertices in C∪{v} and vertices in V with whom x closes at least one triangle is r + q , and the union of vertices in C and vertices in V with whom xcloses at least one triangle is r+q−1. Therefore, Θ2=WCC(x, C ∪{v})−WCC(x, C) =t(x,C∪{v}) t(x,V )·vt(x,V ) |C∪{v}\{x}|+vt(x,V \{C∪{v}})− t(x,C) t(x,V )·vt(x,V ) |C\{x}|+vt(x,V \C)= =−(r−1)(r−2)δ3 (r−1)(r−2)δ3+q(q−1)ω+q(r−1)δω ·(r−1)δ+q (r+q)(r−1+q). (iii) If x=vwe have t(x, C ∪{v}) = din(din −1)δ; t(x, V ) = din(din −1)δ+dout(dout −1)ω+doutdinω; vt(x, V ) = din +dout; vt(x, V ) + |C\{x}|−vt(x, C) = r+dout;
114 9.11.6 LFR 0.4 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (a) Clustering Coefficient (b) TPR 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0 20 40 60 80 100 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (c) Bridge Ratio (d) Diameter 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0 1 2 3 4 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (e) Conductance (f) log10(Size) Figure 9.7: Distribution of the statistical indicators for the LFR4 graph.
115 9.11.7 LFR 0.5 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (a) Clustering Coefficient (b) TPR 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0 20 40 60 80 100 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (c) Bridge Ratio (d) Diameter 0.0 0.2 0.4 0.6 0.8 1.0 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 0 1 2 3 4 density 0.001 0.005 0.01 0.05 0.1 0.5 1.0 (e) Conductance (f) log10(Size) Figure 9.8: Distribution of the statistical indicators for the LFR5 graph.
Bibliography [1] Bal´azs Adamcsek, Gergely Palla, Ill´es J Farkas, Imre Der´enyi, and Tam´as Vicsek. Cfinder: locating cliques and overlapping modules in biological networks. Bioinformatics, 22(8):1021–1023, 2006. 18 [2] Yong-Yeol Ahn, James P Bagrow, and Sune Lehmann. Link communities reveal multiscale complexity in networks. Nature, 466(7307):761–764, 2010. 18, 57 [3] Ching Avery. Giraph: Large-scale graph processing infrastructure on hadoop. Proceedings of the Hadoop Summit. Santa Clara, 2011. 18 [4] Seung-Hee Bae, Dan Halperin, Jevin West, Martin Rosvall, and Brandon Howe. Scalable flow-based community detection for large-scale network analysis. In Data Mining Workshops (ICDMW), 2013 IEEE 13th International Conference on, pages 303–310. IEEE, 2013. 19 [5] Seung-Hee Bae and Bill Howe. Gossipmap: a distributed community detection algorithm for billion-edge directed graphs. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, page 27. ACM, 2015. 20 [6] James P Bagrow. Communities and bottlenecks: Trees and treelike networks have high modularity. Physical Review E, 85(6):066118, 2012. 3, 15, 62 [7] Vincent D Blondel, Jean-Loup Guillaume, Renaud Lambiotte, and Etienne Lefebvre. Fast unfolding of communities in large networks. Journal of Statistical Mechanics: Theory and Experiment, 2008(10):P10008, 2008. 2, 13, 57 117
118 [8] Carlos Castillo, Debora Donato, Aristides Gionis, Vanessa Murdock, and Fabrizio Silvestri. Know your neighbors: Web spam detection using the web topology. In Proceedings of the 30th annual international ACM SIGIR conference on Research and development in information retrieval, pages 423–430. ACM, 2007. 2 [9] Jingchun Chen and Bo Yuan. Detecting functional modules in the yeast protein–protein interaction network. Bioinformatics, 22(18):2283–2290, 2006. 2 [10] Aurelien Decelle, Florent Krzakala, Cristopher Moore, and Lenka Zdeborov´a. Inference and phase transitions in the detection of modules in sparse networks. Physical Review Letters, 107(6):065701, 2011. 39 [11] Imre Der´enyi, Gergely Palla, and Tam´as Vicsek. Clique percolation in random networks. Physical review letters, 94(16):160202, 2005. 18 [12] Emilio Di Giacomo, Walter Didimo, Luca Grilli, and Giuseppe Liotta. Graph visualization techniques for web clustering engines. Visualization and Computer Graphics, IEEE Transactions on, 13(2):294–304, 2007. 2, 10 [13] Jordi Duch and Alex Arenas. Community detection in complex networks using extremal optimization. Physical review E, 72(2):027104, 2005. 2, 14 [14] Renzo et al. The linked data benchmark council: a graph and rdf industry benchmarking effort. In To appear in SIGMOD Record. ACM. 71, 72, 73 [15] Santo Fortunato. Community detection in graphs. Physics Reports, 486(3):75–174, 2010. 11, 16, 43, 64 [16] Santo Fortunato and Marc Barth´elemy. Resolution limit in community detection. Proceedings of the National Academy of Sciences, 104(1):36–41, 2007. 1, 3, 9, 14 [17] Clara Granell, Sergio Gomez, and Alex Arenas. Hierarchical multiresolution method to overcome the resolution limit in complex networks. International Journal of Bifurcation and Chaos, 22(07):1250171, 2012. 14 [18] Mark Granovetter. The strength of weak ties: A network theory revisited. Sociological theory, 1(1):201–233, 1983. 2
119 [19] Roger Guimera, Marta Sales-Pardo, and Lu´ıs A Nunes Amaral. Modularity from fluctuations in random graphs and complex networks. Physical Review E, 70(2):025101, 2004. 2, 14 [20] John Hopcroft, Omar Khan, Brian Kulis, and Bart Selman. Natural communities in large linked networks. In Proceedings of the ninth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 541–546. ACM, 2003. 10 [21] Ravi Kannan, Santosh Vempala, and Adrian Vetta. On clusterings: Good, bad and spectral. Journal of the ACM (JACM), 51(3):497–515, 2004. 16 [22] George Karypis and Vipin Kumar. Metis-unstructured graph partitioning and sparse matrix ordering system, version 2.0. 1995. 10 [23] A. Lancichinetti. Community detection algorithms: a comparative analysis. Phy. Rev. E, 80(5):056117, 2009. 57 [24] A. Lancichinetti, F. Radicchi, J.J. Ramasco, and S. Fortunato. Finding statistically significant communities in networks. PloS one, 6(4):e18961, 2011. 57 [25] Andrea Lancichinetti, Santo Fortunato, and Filippo Radicchi. Benchmark graphs for testing community detection algorithms. Physical review E, 78(4):046110, 2008. 71, 87 [26] Andrea Lancichinetti, Santo Fortunato, and Filippo Radicchi. Benchmark graphs for testing community detection algorithms. Phy. Rev. E, 78(4 Pt 2):6, 2008. 72, 73 [27] J. Leskovec, L. Backstrom, R. Kumar, and A. Tomkins. Microscopic evolution of social networks. In SIGKDD, pages 462–470. ACM, 2008. 23 [28] D. Liben-Nowell and J. Kleinberg. The link-prediction problem for social networks. ASIST, 58(7):1019–1031, 2007. 24 [29] Hao Lu, Mahantesh Halappanavar, and Ananth Kalyanaraman. Parallel heuristics for scalable community detection. Parallel Computing, 2015. 19 [30] Grzegorz Malewicz, Matthew H Austern, Aart JC Bik, James C Dehnert, Ilan Horn, Naty Leiser, and Grzegorz Czajkowski. Pregel: a system for
120 large-scale graph processing. In Proceedings of the 2010 ACM SIGMOD International Conference on Management of data, pages 135–146. ACM, 2010. 18 [31] Fragkiskos D Malliaros and Michalis Vazirgiannis. Clustering and community detection in directed networks: A survey. Physics Reports, 533(4):95– 142, 2013. 1, 9 [32] T.G. Mattson, M. Riepen, T. Lehnig, P. Brett, W. Haas, P. Kennedy, J. Howard, S. Vangal, N. Borkar, G. Ruhl, and S Dighe. he 48-core SCC processor: the Programmer’s view. In SC, pages 1–11. IEEE Computer Society, 2010. 6, 83 [33] Miller McPherson, Lynn Smith-Lovin, and James M Cook. Birds of a feather: Homophily in social networks. Annual review of sociology, pages 415–444, 2001. 5, 23 [34] Farnaz Moradi, Tomas Olovsson, and Philippas Tsigas. An evaluation of community detection algorithms on large-scale email traffic. In Experimental Algorithms, pages 283–294. Springer, 2012. 2 [35] Tam´as Nepusz, Andrea Petr´oczi, L´aszl´o N´egyessy, and F¨ ul¨ op Bazs´o. Fuzzy communities and the concept of bridgeness in complex networks. Physical Review E, 77(1):016107, 2008. 11 [36] Mark EJ Newman. The structure of scientific collaboration networks. Proceedings of the National Academy of Sciences, 98(2):404–409, 2001. 23 [37] Mark EJ Newman. Modularity and community structure in networks. Proceedings of the National Academy of Sciences, 103(23):8577–8582, 2006. 2, 13 [38] Mark EJ Newman. Spectral methods for community detection and graph partitioning. Physical Review E, 88(4):042822, 2013. 2, 14 [39] Mark EJ Newman and Juyong Park. Why social networks are different from other types of networks. Physical Review E, 68(3):036122, 2003. 23 [40] G¨ unce Keziban Orman and Vincent Labatut. A comparison of community detection algorithms on artificial networks. In Discovery Science, pages 242–256. Springer, 2009. 72
121 [41] A. Padrol-Sureda, G. Perarnau-Llobet, J. Pfeifle, and V. Munt´es-Mulero. Overlapping community search for social networks. In ICDE, pages 992–995, 2010. 19, 57 [42] G. Palla, I. Der´enyi, I. Farkas, and T. Vicsek. Uncovering the overlapping community structure of complex networks in nature and society. Nature, 435(7043):814–818, 2005. 57 [43] Symeon Papadopoulos, Yiannis Kompatsiaris, Athena Vakali, and Ploutarchos Spyridonos. Community detection in social media. Data Mining and Knowledge Discovery, 24(3):515–554, 2012. 1, 9 [44] Minh-Duc Pham, Peter Boncz, and Orri Erling. S3g2: A scalable structurecorrelated social graph generator. In TPCTC, pages 156–172. Springer, 2012. 72 [45] Pascal Pons and Matthieu Latapy. Computing communities in large networks using random walks. J. Graph Algorithms Appl., 10(2):191–218, 2006. 3, 17 [46] A. Prat-P´erez, D. Dominguez-Sal, and J.L. Larriba-Pey. Social Based Layouts for the Increase of Locality in Graph Operations. In DASFAA, pages 558–569, 2011. 10 [47] Arnau Prat-P´erez and David Dominguez-Sal. How community-like is the structure of synthetically generated graphs? In Proceedings of Workshop on GRAph Data management Experiences and Systems, pages 1–9. ACM, 2014. 72 [48] Arnau Prat-P´erez, David Dominguez-Sal, Josep M Brunat, and Josep- Lluis Larriba-Pey. Put three and three together: triangle driven community detection. In To be published in TKDD. ACM. 21, 47, 58 [49] Arnau Prat-P´erez, David Dominguez-Sal, Josep M Brunat, and Josep- Lluis Larriba-Pey. Shaping communities out of triangles. In Proceedings of the 21st ACM international conference on Information and knowledge management, pages 1677–1681. ACM, 2012. 21 [50] Arnau Prat-P´erez, David Dominguez-Sal, and Josep-LLuis Larriba-Pey. High quality, scalable and parallel community detection for large real
122 graphs. In Proceedings of the 23rd international conference on World wide web, pages 225–236. ACM, 2014. 47 [51] Arnau Prat-P´erez, David Dominguez-Sal, Josep-Lluis Larriba-Pey, and Pedro Trancoso. Producer-consumer: the programming model for future many-core processors. In Architecture of Computing Systems–ARCS 2013, pages 110–121. Springer, 2013. 83, 87 [52] Filippo Radicchi. A paradox in community detection. EPL (Europhysics Letters), 106(3):38001, 2014. 15, 43 [53] Filippo Radicchi, Claudio Castellano, Federico Cecconi, Vittorio Loreto, and Domenico Parisi. Defining and identifying communities in networks. Proceedings of the National Academy of Sciences of the United States of America, 101(9):2658–2663, 2004. 15, 16 [54] Usha Nandini Raghavan, R´eka Albert, and Soundar Kumara. Near linear time algorithm to detect community structures in large-scale networks. Physical Review E, 76(3):036106, 2007. 3, 18, 57 [55] J¨ org Reichardt and Stefan Bornholdt. Statistical mechanics of community detection. Physical Review E, 74(1):016110, 2006. 14 [56] Jason Riedy, David Bader, Henning Meyerhenke, et al. Scalable multithreaded community detection in social networks. In Parallel and Distributed Processing Symposium Workshops & PhD Forum (IPDPSW), 2012 IEEE 26th International, pages 1619–1628. IEEE, 2012. 19 [57] Jos´e F Rodrigues Jr, Hanghang Tong, Agma JM Traina, Christos Faloutsos, and Jure Leskovec. Gmine: a system for scalable, interactive graph visualization and mining. In Proceedings of the 32nd international conference on Very large data bases, pages 1195–1198. VLDB Endowment, 2006. 10 [58] Martin Rosvall and Carl T Bergstrom. Maps of random walks on complex networks reveal community structure. Proceedings of the National Academy of Sciences, 105(4):1118–1123, 2008. 3, 17, 57 [59] Marcel Salath´e and James H Jones. Dynamics and control of diseases in networks with community structure. PLoS Comput Biol, 6(4):e1000736, 2010. 2
123 [60] V. Satuluri, S. Parthasarathy, and Y. Ruan. Local graph sparsification for scalable clustering. In SIGMOD, pages 721–732. ACM, 2011. 23 [61] X. Shi, L.A. Adamic, and M.J. Strauss. Networks of strong ties. Physica A: Statistical Mechanics and its Applications, 378(1):33–47, 2007. 23 [62] Mauro Sozio and Aristides Gionis. The community-search problem and how to plan a successful cocktail party. In Proceedings of the 16th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 939–948. ACM, 2010. 2 [63] Lei Tang and Huan Liu. Community detection and mining in social media. Synthesis Lectures on Data Mining and Knowledge Discovery, 2(1):1–137, 2010. 10 [64] Ju Xiang and Ke Hu. Limitation of multi-resolution methods in community detection. Physica A: Statistical Mechanics and its Applications, 391(20):4995–5003, 2012. 14, 26 [65] J. Yang and J. Leskovec. Defining and evaluating network communities based on ground-truth. In ICDM, pages 745–754, 2012. 11, 15 [66] Jaewon Yang and Jure Leskovec. Overlapping community detection at scale: a nonnegative matrix factorization approach. In Proceedings of the sixth ACM international conference on Web search and data mining, pages 587–596. ACM, 2013. 19 [67] Jaewon Yang and Jure Leskovec. Defining and evaluating network communities based on ground-truth. Knowledge and Information Systems, 42(1):181–213, 2015. 17, 58 [68] Jaewon Yang, Julian McAuley, and Jure Leskovec. Detecting cohesive and 2-mode communities indirected and undirected networks. In Proceedings of the 7th ACM international conference on Web search and data mining, pages 323–332. ACM, 2014. 11