Instruction: Write an abstract for the following acadamic paper.

Input:
Paper: we have recorded the flight of a fly during take off and landing using digital high speed photography . it is shown that the dynamics of flexible wings are different for these procedures . during this observation fly flew freely in a big box and it was not tethered .
Abstract: in this fluid dynamics video , we demonstrated take off and landing of a fly . the deformation of wings is in focus in this video .

Paper: the origin of graph theory dates back to euler s solution of the puzzle of knigsberg s bridges in 1736  @xcite . since then a lot has been learned about graphs and their mathematical properties  @xcite . in the 20th century they have also become extremely useful as representation of a wide variety of systems in different areas . biological , social , technological , and information networks can be studied as graphs , and graph analysis has become crucial to understand the features of these systems . for instance , social network analysis started in the 1930 s and has become one of the most important topics in sociology  @xcite . in recent times , the computer revolution has provided scholars with a huge amount of data and computational resources to process and analyze these data . the size of real networks one can potentially handle has also grown considerably , reaching millions or even billions of vertices . the need to deal with such a large number of units has produced a deep change in the way graphs are approached  @xcite . graphs representing real systems are not regular like , e. g. , lattices . they are objects where order coexists with disorder . the paradigm of disordered graph is the random graph , introduced by p. erds and a. rnyi  @xcite . in it , the probability of having an edge between a pair of vertices is equal for all possible pairs ( see appendix ) . in a random graph , the distribution of edges among the vertices is highly homogeneous . for instance , the distribution of the number of neighbours of a vertex , or _ degree _ , is binomial , so most vertices have equal or similar degree . real networks are not random graphs , as they display big inhomogeneities , revealing a high level of order and organization . the degree distribution is broad , with a tail that often follows a power law : therefore , many vertices with low degree coexist with some vertices with large degree . furthermore , the distribution of edges is not only globally , but also locally inhomogeneous , with high concentrations of edges within special groups of vertices , and low concentrations between these groups . this feature of real networks is called _ community structure _  @xcite , or _ clustering _ , and is the topic of this review ( for earlier reviews see refs . communities , also called _ clusters _ or _ modules _ , are groups of vertices which probably share common properties and/or play similar roles within the graph . in fig . [ figure1 ] a schematic example of a graph with communities is shown .     a simple graph with three communities , enclosed by the dashed circles . reprinted figure with permission from ref .  @xcite . 2009 by springer . ] society offers a wide variety of possible group organizations : families , working and friendship circles , villages , towns , nations . the diffusion of internet has also led to the creation of virtual groups , that live on the web , like online communities . indeed , social communities have been studied for a long time  @xcite . communities also occur in many networked systems from biology , computer science , engineering , economics , politics , etc . in protein - protein interaction networks , communities are likely to group proteins having the same specific function within the cell  @xcite , in the graph of the world wide web they may correspond to groups of pages dealing with the same or related topics  @xcite , in metabolic networks they may be related to functional modules such as cycles and pathways  @xcite , in food webs they may identify compartments  @xcite , and so on . communities can have concrete applications . clustering web clients who have similar interests and are geografically near to each other may improve the performance of services provided on the world wide web , in that each cluster of clients could be served by a dedicated mirror server  @xcite . identifying clusters of customers with similar interests in the network of purchase relationships between customers and products of online retailers ( like , e. g. , www.amazon.com ) enables to set up efficient recommendation systems  @xcite , that better guide customers through the list of items of the retailer and enhance the business opportunities . clusters of large graphs can be used to create data structures in order to efficiently store the graph data and to handle navigational queries , like path searches  @xcite . _ ad hoc networks _ @xcite , i. e. self - configuring networks formed by communication nodes acting in the same region and rapidly changing ( because the devices move , for instance ) , usually have no centrally maintained routing tables that specify how nodes have to communicate to other nodes . grouping the nodes into clusters enables one to generate compact routing tables while the choice of the communication paths is still efficient  @xcite . community detection is important for other reasons , too . identifying modules and their boundaries allows for a classification of vertices , according to their structural position in the modules . so , vertices with a central position in their clusters , i.  e. sharing a large number of edges with the other group partners , may have an important function of control and stability within the group ; vertices lying at the boundaries between modules play an important role of mediation and lead the relationships and exchanges between different communities ( alike to csermely s `` creative elements ''  @xcite ) . such classification seems to be meaningful in social  @xcite and metabolic networks  @xcite . finally , one can study the graph where vertices are the communities and edges are set between clusters if there are connections between some of their vertices in the original graph and/or if the modules overlap . in this way one attains a coarse - grained description of the original graph , which unveils the relationships between modules  . recent studies indicate that networks of communities have a different degree distribution with respect to the full graphs  @xcite ; however , the origin of their structures can be explained by the same mechanism  @xcite . another important aspect related to community structure is the hierarchical organization displayed by most networked systems in the real world . real networks are usually composed by communities including smaller communities , which in turn include smaller communities , etc . the human body offers a paradigmatic example of hierarchical organization : it is composed by organs , organs are composed by tissues , tissues by cells , etc . another example is represented by business firms , who are characterized by a pyramidal organization , going from the workers to the president , with intermediate levels corresponding to work groups , departments and management . herbert a. simon has emphasized the crucial role played by hierarchy in the structure and evolution of complex systems  @xcite . the generation and evolution of a system organized in interrelated stable subsystems are much quicker than if the system were unstructured , because it is much easier to assemble the smallest subparts first and use them as building blocks to get larger structures , until the whole system is assembled . in this way it is also far more difficult that errors ( mutations ) occur along the process . the aim of community detection in graphs is to identify the modules and , possibly , their hierarchical organization , by only using the information encoded in the graph topology . the problem has a long tradition and it has appeared in various forms in several disciplines . the first analysis of community structure was carried out by weiss and jacobson  @xcite , who searched for work groups within a government agency . the authors studied the matrix of working relationships between members of the agency , which were identified by means of private interviews . work groups were separated by removing the members working with people of different groups , which act as connectors between them . this idea of cutting the bridges between groups is at the basis of several modern algorithms of community detection ( section  [ sec5 ] ) . research on communities actually started even earlier than the paper by weiss and jacobson . already in 1927 , stuart rice looked for clusters of people in small political bodies , based on the similarity of their voting patterns  @xcite . two decades later , george homans showed that social groups could be revealed by suitably rearranging the rows and the columns of matrices describing social ties , until they take an approximate block - diagonal form  @xcite . this procedure is now standard . meanwhile , traditional techniques to find communities in social networks are hierarchical clustering and partitional clustering ( sections  [ sec4_2 ] and  [ sec4_3 ] ) , where vertices are joined into groups according to their mutual similarity .    identifying graph communities is a popular topic in computer science , too . in parallel computing , for instance , it is crucial to know what is the best way to allocate tasks to processors so as to minimize the communications between them and enable a rapid performance of the calculation . this can be accomplished by splitting the computer cluster into groups with roughly the same number of processors , such that the number of physical connections between processors of different groups is minimal . the mathematical formalization of this problem is called _ graph partitioning _ ( section  [ sec4_1 ] ) . the first algorithms for graph partitioning were proposed in the early 1970 s .    in a seminal paper appeared in 2002 , girvan and newman proposed a new algorithm , aiming at the identification of edges lying between communities and their successive removal , a procedure that after some iterations leads to the isolation of the communities  @xcite . the intercommunity edges are detected according to the values of a centrality measure , the edge betweenness , that expresses the importance of the role of the edges in processes where signals are transmitted across the graph following paths of minimal length . the paper triggered a big activity in the field , and many new methods have been proposed in the last years . in particular , physicists entered the game , bringing in their tools and techniques : spin models , optimization , percolation , random walks , synchronization , etc . , became ingredients of new original algorithms . the field has also taken advantage of concepts and methods from computer science , nonlinear dynamics , sociology , discrete mathematics .        in this manuscript we try to cover in some detail the work done in this area . we shall pay a special attention to the contributions made by physicists , but we shall also give proper credit to important results obtained by scholars of other disciplines . section  [ sec2 ] introduces communities in real networks , and is supposed to make the reader acquainted with the problem and its relevance . in section  [ sec3 ] we define the basic elements of community detection , i. e. the concepts of community and partition . traditional clustering methods in computer and social sciences , i. e. graph partitioning , hierarchical , partitional and spectral clustering are reviewed in section  [ sec4 ] . modern methods , divided into categories based on the type of approach , are presented in sections  [ sec5 ] to  [ sub_sec6_2 ] . algorithms to find overlapping communities , multiresolution and hierarchical techniques , are separately described in sections  [ sec45 ] and [ sub_sec6_20 ] , respectively , whereas section  [ sec7_1_2 ] is devoted to the detection of communities evolving in time . we stress that our categorization of the algorithms is not sharp , because many algorithms may enter more categories : we tried to classify them based on what we believe is their main feature / purpose , even if other aspects may be present . sections  [ sec6_4 ] and [ sec6 ] are devoted to the issues of defining when community structure is significant , and deciding about the quality of algorithms performances . in sections [ sec7_1 ] and [ sec7_2 ] we describe general properties of clusters found in real networks , and specific applications of clustering algorithms . section  [ sec8 ] contains the summary of the review , along with a discussion about future research directions in this area . the review makes use of several concepts of graph theory , that are defined and explained in the appendix . readers not acquainted with these concepts are urged to read the appendix first . in this section we shall present some striking examples of real networks with community structure . in this way we shall see what communities look like and why they are important . social networks are paradigmatic examples of graphs with communities . the word community itself refers to a social context . people naturally tend to form groups , within their work environment , family , friends .    in fig . [ fig3 ] we show some examples of social networks . the first example ( fig . [ fig3]a ) is zachary s network of karate club members  @xcite , a well - known graph regularly used as a benchmark to test community detection algorithms ( section  [ sec6_1 ] ) . it consists of @xmath0 vertices , the members of a karate club in the united states , who were observed during a period of three years . edges connect individuals who were observed to interact outside the activities of the club . at some point , a conflict between the club president and the instructor led to the fission of the club in two separate groups , supporting the instructor and the president , respectively ( indicated by squares and circles ) . the question is whether from the original network structure it is possible to infer the composition of the two groups . indeed , by looking at fig . [ fig3]a one can distinguish two aggregations , one around vertices @xmath1 and @xmath0 ( @xmath0 is the president ) , the other around vertex @xmath2 ( the instructor ) . one can also identify several vertices lying between the two main structures , like @xmath3 , @xmath4 , @xmath5 ; such vertices are often misclassified by community detection methods . [ fig3]b displays the largest connected component of a network of collaborations of scientists working at the santa fe institute ( sfi ) . there are @xmath6 vertices , representing resident scientists at sfi and their collaborators . edges are placed between scientists that have published at least one paper together . the visualization layout allows to distinguish disciplinary groups . in this network one observes many cliques , as authors of the same paper are all linked to each other . there are but a few connections between most groups .    in fig . [ fig3]c we show the network of bottlenose dolphins living in doubtful sound ( new zealand ) analyzed by lusseau  @xcite . there are @xmath7 dolphins and edges were set between animals that were seen together more often than expected by chance . the dolphins separated in two groups after a dolphin left the place for some time ( squares and circles in the figure ) . such groups are quite cohesive , with several internal cliques , and easily identifiable : only six edges join vertices of different groups . due to this natural classification lusseau s dolphins network , like zachary s karate club , is often used to test algorithms for community detection ( section  [ sec6_1 ] ) . protein - protein interaction ( ppi ) networks are subject of intense investigations in biology and bioinformatics , as the interactions between proteins are fundamental for each process in the cell  @xcite . [ fig4 ] illustrates a ppi network of the rat proteome  @xcite . each interaction is derived by homology from experimentally observed interactions in other organisms . in our example , the proteins interact very frequently with each other , as they belong to metastatic cells , which have a high motility and invasiveness with respect to normal cells . communities correspond to functional groups , i.  e. to proteins having the same or similar functions , which are expected to be involved in the same processes . the modules are labeled by the overall function or the dominating protein class . most communities are associated to cancer and metastasis , which indirectly shows how important detecting modules in ppi networks is . community structure in technological networks . sample of the web graph consisting of the pages of a web site and their mutual hyperlinks , which are directed . communities , indicated by the colors , were detected with the algorithm of girvan and newman ( section  [ subsec5_1 ] ) , by neglecting the directedness of the edges . reprinted figure with permission from ref .  @xcite . 2004 by the american physical society . ]    relationships / interactions between elements of a system need not be reciprocal . in many cases they have a precise direction , that needs to be taken into account to understand the system as a whole . as an example we can cite predator - prey relationships in food webs . in fig .  [ fig5 ] we see another example , taken from technology . the system is the world wide web , which can be seen as a graph by representing web pages as vertices and the hyperlinks that make users move from one page to another as edges  @xcite . hyperlinks are directed : if one can move from page a to page b by clicking on a hyperlink of a , one usually does not find on b a hyperlink taking back to a. in fact , very few hyperlinks ( less than @xmath8 ) are reciprocal . communities of the web graph are groups of pages having topical similarities . detecting communities in the web graph may help to identify the artificial clusters created by link farms in order to enhance the pagerank  @xcite value of web sites and grant them a higher google ranking . in this way one could discourage this unfair practice . one usually assumes that the existence of a hyperlink between two pages implies that they are content - related , and that this similarity is independent of the hyperlink direction . therefore it is customary to neglect the directedness of the hyperlinks and to consider the graph as undirected , for the purpose of community detection . on the other hand , taking properly into account the directedness of the edges can considerably improve the quality of the partition(s ) , as one can handle a lot of precious information about the system . moreover , in some instances neglecting edge directedness may lead to strange results  @xcite . developing methods of community detection for directed graphs is a hard task . for instance , a directed graph is characterized by asymmetrical matrices ( adjacency matrix , laplacian , etc . ) , so spectral analysis is much more complex . only a few techniques can be easily extended from the undirected to the directed case . otherwise , the problem must be formulated from scratch . edge directedness is not the only complication to deal with when facing the problem of graph clustering . in many real networks vertices may belong to more than one group . in this case one speaks of _ overlapping communities _ and uses the term _ cover _ , rather than partition , whose standard definition forbids multiple memberships of vertices . classical examples are social networks , where an individual usually belongs to different circles at the same time , from that of work colleagues to family , sport associations , etc .. traditional algorithms of community detection assign each vertex to a single module . in so doing , they neglect potentially relevant information . vertices belonging to more communities are likely to play an important role of intermediation between different compartments of the graph . in fig . [ fig6 ] we show a network of word association derived starting from the word `` bright '' . the network builds on the university of south florida free association norms  @xcite . an edge between words @xmath9 and @xmath10 indicates that some people associate @xmath10 to the word @xmath9 . the graph clearly displays four communities , corresponding to the categories _ intelligence _ , _ astronomy _ , _ light _ and _ colors_. the word `` bright '' is related to all of them by construction . other words belong to more categories , e.g. `` dark '' ( colors and light ) . accounting for overlapping communities introduces a further variable , the membership of vertices in different communities , which enormously increases the number of possible covers with respect to standard partitions . therefore , searching for overlapping communities is usually much more computationally demanding than detecting standard partitions . overlapping communities in a network of word association . the groups , labeled by the colors , were detected with the clique percolation method by palla et al . ( section  [ sec45_1 ] ) . reprinted figure with permission from ref . 2005 by the nature publishing group . ]    so far we have discussed examples of unipartite graphs . however , it is not uncommon to find real networks with different classes of vertices , and edges joining only vertices of different classes . an example is a network of scientists and papers , where edges join scientists and the papers they have authored . here there is no edge between any pair of scientists or papers , so the graph is bipartite . for a multipartite network the concept of community does not change much with respect to the case of unipartite graphs , as it remains related to a large density of edges between members of the same group , with the only difference that the elements of each group belong to different vertex classes . multipartite graphs are usually reduced to unipartite projections of each vertex class . for instance , from the bipartite network of scientists and papers one can extract a network of scientists only , who are related by coauthorship . in this way one can adopt standard techniques of network analysis , in particular standard clustering methods , but a lot of information gets lost . detecting communities in multipartite networks can have interesting applications in , e.g. , marketing . large shopping networks , in which customers are linked to the products they have bought , allow to classify customers based on the types of product they purchase more often : this could be used both to organize targeted advertising , as well as to give recommendations about future purchases  @xcite . the problem of community detection in multipartite networks is not trivial , and usually requires _ ad hoc _ methodologies . [ fig7 ] illustrates the famous bipartite network of southern women studied by davis et al . there are @xmath11 vertices , representing @xmath12 women from the area of natchez , mississippi , and @xmath13 social events . edges represent the participation of the women in the events . from the figure one can see that the network has a clear community structure . community structure in multipartite networks . this bipartite graph refers to the southern women event participation data set . women are represented as open symbols with black labels , events as filled symbols with white labels . the illustrated vertex partition has been obtained by maximizing a modified version of the modularity by newman and girvan , tailored on bipartite graphs  @xcite ( section  [ sub_sec6_01 ] ) . reprinted figure with permission from ref . 2007 by the american physical society . ]    in some of the previous examples , edges have ( or can have ) weights . for instance , the edges of the collaboration network of fig . [ fig3]b could be weighted by the number of papers coauthored by pairs of scientists . similarly , the edges of the word association network of fig . [ fig6 ] are weighted by the number of times pairs of words have been associated by people . weights are precious additional information on a graph , and should be considered in the analysis . in many cases methods working on unweighted graphs can be simply extended to the weighted case . the problem of graph clustering , intuitive at first sight , is actually not well defined . the main elements of the problem themselves , i.  e. the concepts of community and partition , are not rigorously defined , and require some degree of arbitrariness and/or common sense . indeed , some ambiguities are hidden and there are often many equally legitimate ways of resolving them . therefore , it is not surprising that there are plenty of recipes in the literature and that people do not even try to ground the problem on shared definitions . it is important to stress that the identification of structural clusters is possible only if graphs are _ sparse _ , i.  e. if the number of edges @xmath14 is of the order of the number of nodes @xmath15 of the graph . if @xmath16 , the distribution of edges among the nodes is too homogeneous for communities to make sense . in this case the problem turns into something rather different , close to data clustering  @xcite , which requires concepts and methods of a different nature . the main difference is that , while communities in graphs are related , explicitly or implicitly , to the concept of edge density ( inside versus outside the community ) , in data clustering communities are sets of points which are `` close '' to each other , with respect to a measure of distance or similarity , defined for each pair of points . some classical techniques for data clustering , like _ hierarchical _ , _ partitional _ and _ spectral clustering _ will be discussed later in the review ( sections  [ sec4_2 ] , [ sec4_3 ] and  [ sec4_4 ] ) , as they are sometimes adopted for graph clustering too . other standard procedures for data clustering include _ neural network clustering _ techniques like , e. g. , _ self - organizing maps _ and _ multi - dimensional scaling _ techniques like , e. g. , _ singular value decomposition _ and _ principal component analysis _  @xcite .    in this section we shall attempt an ordered exposition of the fundamental concepts of community detection . after a brief discussion of the issue of computational complexity for the algorithms , we shall review the notions of community and partition . the massive amount of data on real networks currently available makes the issue of the efficiency of clustering algorithms essential . the _ computational complexity _ of an algorithm is the estimate of the amount of resources required by the algorithm to perform a task . this involves both the number of computation steps needed and the number of memory units that need to be simultaneously allocated to run the computation . such demands are usually expressed by their scalability with the size of the system at study . in the case of a graph , the size is typically indicated by the number of vertices @xmath15 and/or the number of edges @xmath14 . the computational complexity of an algorithm can not always be calculated . in fact , sometimes this is a very hard task , or even impossible . in these cases , it is however important to have at least an estimate of the _ worst - case _ complexity of the algorithm , which is the amount of computational resources needed to run the algorithm in the most unfavorable case for a given system size . the notation @xmath17 indicates that the computer time grows as a power of both the number of vertices and edges , with exponents @xmath18 and @xmath19 , respectively . ideally , one would like to have the lowest possible values for the exponents , which would correspond to the lowest possible computational demands . samples of the web graph , with millions of vertices and billions of edges , can not be tackled by algorithms whose running time grows faster than @xmath20 or @xmath21 . algorithms with polynomial complexity form the class * p*. for some important decision and optimization problems , there are no known polynomial algorithms . finding solutions of such problems in the worst - case scenario may demand an exhaustive search , which takes a time growing faster than any polynomial function of the system size , e.g. exponentially . problems whose solutions can be verified in a polynomial time span the class * np * of _ non - deterministic polynomial time _ problems , which includes * p*. a problem is * np*-hard if a solution for it can be translated into a solution for any * np*-problem . however , a * np*-hard problem needs not be in the class * np*. if it does belong to * np * it is called * np*-complete . the class of * np*-complete problems has drawn a special attention in computer science , as it includes many famous problems like the travelling salesman , boolean satisfiability ( sat ) , linear programming , etc . the fact that * np * problems have a solution which is verifiable in polynomial time does not mean that * np * problems have polynomial complexity , i. e. , that they are in * p*. in fact , the question of whether * np*=*p * is the most important open problem in theoretical computer science . * np*-hard problems need not be in * np * ( in which case they would be * np*-complete ) , but they are at least as hard as * np*-complete problems , so they are unlikely to have polynomial complexity , although a proof of that is still missing . many clustering algorithms or problems related to clustering are * np*-hard . in this case , it is pointless to use exact algorithms , which could be applied only to very small systems . moreover , even if an algorithm has a polynomial complexity , it may still be too slow to tackle large systems of interest . in all such cases it is common to use _ approximation algorithms _ , i.  e. methods that do not deliver an exact solution to the problem at hand , but only an approximate solution , with the advantage of a lower complexity . approximation algorithms are often non - deterministic , as they deliver different solutions for the same problem , for different initial conditions and/or parameters of the algorithm . the goal of such algorithms is to deliver a solution which differs by a constant factor from the optimal solution . in any case , one should give provable bounds on the goodness of the approximate solution delivered by the algorithm with respect to the optimal solution . in many cases it is not possible to approximate the solution within any constant , as the goodness of the approximation strongly depends on the specific problem at study . approximation algorithms are commonly used for optimization problems , in which one wants to find the maximum or minimum value of a given cost function over a large set of possible system configurations . the first problem in graph clustering is to look for a quantitative definition of community . no definition is universally accepted . as a matter of fact , the definition often depends on the specific system at hand and/or application one has in mind . from intuition and the examples of section  [ sec2 ] we get the notion that there must be more edges `` inside '' the community than edges linking vertices of the community with the rest of the graph . this is the reference guideline at the basis of most community definitions . but many alternative recipes are compatible with it . moreover , in most cases , communities are algorithmically defined , i.  e. they are just the final product of the algorithm , without a precise _ a priori _ definition . let us start with a subgraph @xmath22 of a graph @xmath23 , with @xmath24 and @xmath25 vertices , respectively . we define the _ internal _ and _ external _ degree of vertex @xmath26 , @xmath27 and @xmath28 , as the number of edges connecting @xmath29 to other vertices of @xmath22 or to the rest of the graph , respectively . if @xmath30 , the vertex has neighbors only within @xmath22 , which is likely to be a good cluster for @xmath29 ; if @xmath31 , instead , the vertex is disjoint from @xmath22 and it should better be assigned to a different cluster . the _ internal degree _ @xmath32 of @xmath22 is the sum of the internal degrees of its vertices . likewise , the _ external degree _ @xmath33 of @xmath22 is the sum of the external degrees of its vertices . the _ total degree _ @xmath34 is the sum of the degrees of the vertices of @xmath22 . by definition , @xmath35 . we define the _ intra - cluster density _ @xmath36 of the subgraph @xmath22 as the ratio between the number of internal edges of @xmath22 and the number of all possible internal edges , i.  e. @xmath37 similarly , the _ inter - cluster density _ @xmath38 is the ratio between the number of edges running from the vertices of @xmath22 to the rest of the graph and the maximum number of inter - cluster edges possible , i.  e. @xmath39 for @xmath22 to be a community , we expect @xmath36 to be appreciably larger than the average link density @xmath40 of @xmath23 , which is given by the ratio between the number of edges of @xmath23 and the maximum number of possible edges @xmath41 . on the other hand , @xmath38 has to be much smaller than @xmath40 . searching for the best tradeoff between a large @xmath36 and a small @xmath38 is implicitly or explicitly the goal of most clustering algorithms . a simple way to do that is , e. g. , maximizing the sum of the differences @xmath42 over all clusters of the partition$ ] , but essentially equivalent . ] @xcite . a required property of a community is _ connectedness_. we expect that for @xmath22 to be a community there must be a path between each pair of its vertices , running only through vertices of @xmath22 . this feature simplifies the task of community detection on disconnected graphs , as in this case one just analyzes each connected component separately , unless special constraints are imposed on the resulting clusters .    with these basic requirements in mind , we can now introduce the main definitions of community . social network analysts have devised many definitions of subgroups with various degrees of internal cohesion among vertices  @xcite . many other definitions have been introduced by computer scientists and physicists . we distinguish three classes of definitions : local , global and based on vertex similarity . other definitions will be given in the context of the algorithms for which they were introduced . communities are parts of the graph with a few ties with the rest of the system . to some extent , they can be considered as separate entities with their own autonomy . so , it makes sense to evaluate them independently of the graph as a whole . local definitions focus on the subgraph under study , including possibly its immediate neighborhood , but neglecting the rest of the graph . we start with a listing of the main definitions adopted in social network analysis , for which we shall closely follow the exposition of ref . @xcite . there , four types of criteria were identified : _ complete mutuality _ , _ reachability _ , _ vertex degree _ and the _ comparison of internal versus external cohesion_. the corresponding communities are mostly _ maximal subgraphs _ , which can not be enlarged with the addition of new vertices and edges without losing the property which defines them . social communities can be defined in a very strict sense as subgroups whose members are all `` friends '' to each other  @xcite ( complete mutuality ) . in graph terms , this corresponds to a _ clique _ , i.  e. a subset whose vertices are all adjacent to each other . in social network analysis , a clique is a maximal subgraph , whereas in graph theory it is common to call cliques also non - maximal subgraphs . triangles are the simplest cliques , and are frequent in real networks . but larger cliques are less frequent . moreover , the condition is really too strict : a subgraph with all possible internal edges except one would be an extremely cohesive subgroup , but it would not be considered a community under this recipe . another problem is that all vertices of a clique are absolutely symmetric , with no differentiation between them . in many practical examples , instead , we expect that within a community there is a whole hierarchy of roles for the vertices , with core vertices coexisting with peripheral ones . we remark that vertices may belong to more cliques simultaneously , a property which is at the basis of the clique percolation method of palla et al . @xcite ( see section  [ sec45_1 ] ) . from a practical point of view , finding cliques in a graph is an * np*-complete problem  @xcite . the bron - kerbosch method  @xcite runs in a time growing exponentially with the size of the graph . it is however possible to relax the notion of clique , defining subgroups which are still clique - like objects . a possibility is to use properties related to reachability , i.  e. to the existence ( and length ) of paths between vertices . an _ @xmath15-clique _ is a maximal subgraph such that the distance of each pair of its vertices is not larger than @xmath15  @xcite . for @xmath43 one recovers the definition of clique , as all vertices are adjacent , so each geodesic path between any pair of vertices has length @xmath2 . this definition , more flexible than that of clique , still has some limitations , deriving from the fact that the geodesic paths need not run on the vertices of the subgraph at study , but may run on vertices outside the subgraph . in this way , there may be two disturbing consequences . first , the diameter of the subgraph may exceed @xmath15 , even if in principle each vertex of the subgraph is less than @xmath15 steps away from any of the others . second , the subgraph may be disconnected , which is not consistent with the notion of cohesion one tries to enforce . to avoid these problems , mokken @xcite has suggested two possible alternatives , the _ @xmath15-clan _ and the _ @xmath15-club_. an @xmath15-clan is an @xmath15-clique whose diameter is not larger than @xmath15 , i.  e. a subgraph such that the distance between any two of its vertices , computed over shortest paths within the subgraph , does not exceed @xmath15 . an @xmath15-club , instead , is a maximal subgraph of diameter @xmath15 . the two definitions are quite close : the difference is that an @xmath15-clan is maximal under the constraint of being an @xmath15-clique , whereas an @xmath15-club is maximal under the constraint imposed by the length of the diameter . another criterion for subgraph cohesion relies on the adjacency of its vertices . the idea is that a vertex must be adjacent to some minumum number of other vertices in the subgraph . in the literature on social network analysis there are two complementary ways of expressing this . @xmath44-plex _ is a maximal subgraph in which each vertex is adjacent to all other vertices of the subgraph except at most @xmath44 of them  @xcite . similarly , a _ @xmath44-core _ is a maximal subgraph in which each vertex is adjacent to at least @xmath44 other vertices of the subgraph  @xcite . so , the two definitions impose conditions on the minimal number of absent or present edges . the corresponding clusters are more cohesive than @xmath15-cliques , just because of the existence of many internal edges . in any graph there is a whole hierarchy of cores of different order , which can be identified by means of a recent efficient algorithm  @xcite . a @xmath44-core is essentially the same as a _ @xmath45-quasi complete _ subgraph , which is a subgraph such that the degree of each vertex is larger than @xmath46 , where @xmath45 is a real number in @xmath47 $ ] and @xmath44 the order of the subgraph  @xcite . determining whether a graph includes a @xmath48-quasi complete subgraph of order at least @xmath44 is * np*-complete .    as cohesive as a subgraph can be , it would hardly be a community if there is a strong cohesion as well between the subgraph and the rest of the graph . therefore , it is important to compare the internal and external cohesion of a subgraph . in fact , this is what is usually done in the most recent definitions of community . the first recipe , however , is not recent and stems from social network analysis . an _ @xmath49-set _ @xcite , or _ strong community _ @xcite , is a subgraph such that the internal degree of each vertex is greater than its external degree . this condition is quite strict and can be relaxed into the so - called _ weak _ definition of community  @xcite , for which it suffices that the internal degree of the subgraph exceeds its external degree . an @xmath49-set is also a weak community , while the converse is not generally true . hu et al . @xcite have introduced alternative definitions of strong and weak communities : a community is strong if the internal degree of any vertex of the community exceeds the number of edges that the vertex shares with any other community ; a community is weak if its total internal degree exceeds the number of edges shared by the community with the other communities . these definitions are in the same spirit of the _ planted partition model _ ( section  [ sec6 ] ) . an @xmath49-set is a strong community also in the sense of hu et al .. likewise , a weak community according to radicchi et al . is also a weak community for hu et al .. in both cases the converse is not true , however . another definition focuses on the robustness of clusters to edge removal and uses the concept of _ edge connectivity_. the edge connectivity of a pair of vertices in a graph is the minimal number of edges that need to be removed in order to disconnect the two vertices , i.  e. such that there is no path between them . lambda set _ is a subgraph such that any pair of vertices of the subgraph has a larger edge connectivity than any pair formed by one vertex of the subgraph and one outside the subgraph  @xcite . however , vertices of a lambda - set need not be adjacent and may be quite distant from each other . communities can also be identified by a _ fitness measure _ , expressing to which extent a subraph satisfies a given property related to its cohesion . the larger the fitness , the more definite is the community . this is the same principle behind _ quality functions _ , which give an estimate of the goodness of a graph partition ( see section  [ sec3_2_2 ] ) . the simplest fitness measure for a cluster is its intra - cluster density @xmath36 . one could assume that a subgraph @xmath22 with @xmath44 vertices is a cluster if @xmath36 is larger than a threshold , say @xmath50 . finding such subgraphs is an * np*-complete problem , as it coincides with the * np*-complete clique problem when the threshold @xmath51 it is better to fix the size of the subgraph because , without this conditions , any clique would be one of the best possible communities , including trivial two - cliques ( simple edges ) . variants of this problem focus on the number of internal edges of the subgraph  @xcite . another measure of interest is the _ relative density _ @xmath52 of a subgraph @xmath22 , defined as the ratio between the internal and the total degree of @xmath22 . finding subgraphs of a given size with @xmath52 larger than a threshold is * np*-complete  @xcite . fitness measures can also be associated to the connectivity of the subgraph at study to the other vertices of the graph . a good community is expected to have a small cut size ( see section  [ sec1_1 ] ) , i.  e. a small number of edges joining it to the rest of the graph . this sets a bridge between community detection and graph partitioning , which we shall discuss in section  [ sec4_1 ] . communities can also be defined with respect to the graph as a whole . this is reasonable in those cases in which clusters are essential parts of the graph , which can not be taken apart without seriously affecting the functioning of the system . the literature offers many global criteria to identify communities . in most cases they are indirect definitions , in which some global property of the graph is used in an algorithm that delivers communities at the end . however , there is a class of proper definitions , based on the idea that a graph has community structure if it is different from a random graph . a random graph  la erds - rnyi ( section  [ sec1_3 ] ) , for instance , is not expected to have community structure , as any two vertices have the same probability to be adjacent , so there should be no preferential linking involving special groups of vertices . therefore , one can define a _ null model _ , i.  e. a graph which matches the original in some of its structural features , but which is otherwise a random graph . the null model is used as a term of comparison , to verify whether the graph at study displays community structure or not . the most popular null model is that proposed by newman and girvan and consists of a randomized version of the original graph , where edges are rewired at random , under the constraint that the expected degree of each vertex matches the degree of the vertex in the original graph  @xcite . this null model is the basic concept behind the definition of _ modularity _ , a function which evaluates the goodness of partitions of a graph into clusters . modularity will be discussed at length in this review , because it has the unique privilege of being at the same time a global criterion to define a community , a quality function and the key ingredient of the most popular method of graph clustering . in the standard formulation of modularity , a subgraph is a community if the number of edges inside the subgraph exceeds the expected number of internal edges that the same subgraph would have in the null model . this expected number is an average over all possible realizations of the null model . several modifications of modularity have been proposed ( section  [ sub_sec6_01 ] ) . a general class of null models , including modularity as a special case , has been designed by reichardt and bornholdt  @xcite ( section  [ sub_sec6_01 ] ) . it is natural to assume that communities are groups of vertices similar to each other . one can compute the similarity between each pair of vertices with respect to some reference property , local or global , no matter whether they are connected by an edge or not . each vertex ends up in the cluster whose vertices are most similar to it . similarity measures are at the basis of traditional methods , like hierarchical , partitional and spectral clustering , to be discussed in sections  [ sec4_2 ] , [ sec4_3 ] and [ sec4_4 ] . here we discuss some popular measures used in the literature . if it is possible to embed the graph vertices in an @xmath15-dimensional euclidean space , by assigning a position to them , one could use the _ distance _ between a pair of vertices as a measure of their similarity ( it is actually a measure of dissimilarity because similar vertices are expected to be close to each other ) . given the two data points @xmath53 and @xmath54 , one could use any norm @xmath55 , like the _ euclidean distance _ ( @xmath56-norm ) , @xmath57 the _ manhattan distance _ ( @xmath58-norm ) @xmath59 and the @xmath60-norm @xmath61}|a_k - b_k| . \label{eq5}\ ] ] another popular spatial measure is the _ cosine similarity _ , defined as @xmath62 where @xmath63 is the dot product of the vectors * a * and * b*. the variable @xmath64 is defined in the range @xmath65 .    if the graph can not be embedded in space , the similarity must be necessarily inferred from the adjacency relationships between vertices . a possibility is to define a distance  @xcite between vertices like @xmath66 where * a * is the adjacency matrix . this is a dissimilarity measure , based on the concept of structural equivalence  @xcite . two vertices are structurally equivalent if they have the same neighbors , even if they are not adjacent themselves . if @xmath67 and @xmath68 are structurally equivalent , @xmath69 . vertices with large degree and different neighbours are considered very `` far '' from each other . alternatively , one could measure the _ overlap _ between the neighborhoods @xmath70 and @xmath71 of vertices @xmath67 and @xmath68 , given by the ratio between the intersection and the union of the neighborhoods , i.  e. @xmath72 another measure related to structural equivalence is the pearson correlation between columns or rows of the adjacency matrix , @xmath73 where the averages @xmath74 and the variances @xmath75 . an alternative measure is the number of edge- ( or vertex- ) independent paths between two vertices . independent paths do not share any edge ( vertex ) , and their number is related to the maximum flow that can be conveyed between the two vertices under the constraint that each edge can carry only one unit of flow ( max - flow / min - cut theorem  @xcite ) . the maximum flow can be calculated in a time @xmath21 , for a graph with @xmath14 edges , using techniques like the augmenting path algorithm  @xcite . similarly , one could consider all paths running between two vertices . in this case , there is the problem that the total number of paths is infinite , but this can be avoided if one performs a weighted sum of the number of paths . for instance , paths of length @xmath76 can be weighted by the factor @xmath77 , with @xmath78 . another possibility , suggested by estrada and hatano  @xcite , is to weigh paths of length @xmath76 with the inverse factorial @xmath79 . in both cases , the contribution of long paths is strongly suppressed and the sum converges .    another important class of measures of vertex similarity is based on properties of random walks on graphs . one of this properties is the _ commute - time _ between a pair of vertices , which is the average number of steps needed for a random walker , starting at either vertex , to reach the other vertex for the first time and to come back to the starting vertex . saerens and coworkers  @xcite have extensively studied and used the commute - time ( and variants thereof ) as ( dis)similarity measure : the larger the time , the farther ( less similar ) the vertices . the commute - time is closely related  @xcite to the _ resistance distance _ introduced by klein and randic  @xcite , expressing the effective electrical resistance between two vertices if the graph is turned into a resistor network . white and smyth  @xcite and zhou  @xcite used instead the average first passage time , i. e. the average number of steps needed to reach for the first time the target vertex from the source . harel and koren  @xcite proposed to build measures out of quantities like the probability to visit a target vertex in no more than a given number of steps after it leaves a source vertex ) and in a recent analysis by nadler et al . @xcite , one defined a dissimilarity measure called `` diffusion distance '' , which is derived from the probability that the walker visits the target after a fixed number of steps . ] and the probability that a random walker starting at a source visits the target exactly once before hitting the source again . another quantity used to define similarity measures is the _ escape probability _ , defined as the probability that the walker reaches the target vertex before coming back to the source vertex  @xcite . the escape probability is related to the effective conductance between the two vertices in the equivalent resistor network . other authors have exploited properties of modified random walks . for instance , the algorithm by gori and pucci  @xcite and that by tong et al . @xcite used similarity measures derived from google s pagerank process  @xcite .        a _ partition _ is a division of a graph in clusters , such that each vertex belongs to one cluster . as we have seen in section  [ sec2 ] , in real systems vertices may be shared among different communities . a division of a graph into overlapping ( or _ fuzzy _ ) communities is called _ cover_. the number of possible partitions in @xmath44 clusters of a graph with @xmath15 vertices is the _ stirling number of the second kind _ @xmath80  @xcite . the total number of possible partitions is the _ n - th bell number _ @xmath81  @xcite . in the limit of large @xmath15 , @xmath82 has the asymptotic form  @xcite @xmath83^{n+1/2}e^{\lambda(n)-n-1 } , \label{eqpart1}\ ] ] where @xmath84 , @xmath85 being the _ lambert @xmath86 function _  @xcite . therefore , @xmath82 grows faster than exponentially with the graph size @xmath15 , which means that an enumeration and/or evaluation of all partitions of a graph is impossible , unless the graph consists of very few vertices . partitions can be _ hierarchically ordered _ , when the graph has different levels of organization / structure at different scales . in this case , clusters display in turn community structure , with smaller communities inside , which may again contain smaller communities , and so on ( fig . [ fig8 ] ) . as an example , in a social network of children living in the same town , one could group the children according to the schools they attend , but within each school one can make a subdivision into classes . hierarchical organization is a common feature of many real networks , where it is revealed by a peculiar scaling of the clustering coefficient for vertices having the same degree @xmath44 , when plotted as a function of @xmath44  @xcite .        a natural way to represent the hierarchical structure of a graph is to draw a _ dendrogram _ , like the one illustrated in fig . [ fig9 ] . here , partitions of a graph with twelve vertices are shown . at the bottom , each vertex is its own module ( the `` leaves '' of the tree ) . by moving upwards , groups of vertices are successively aggregated . mergers of communities are represented by horizontal lines . the uppermost level represents the whole graph as a single community . cutting the diagram horizontally at some height , as shown in the figure ( dashed line ) , displays one partition of the graph . the diagram is hierarchical by construction : each community belonging to a level is fully included in a community at a higher level . dendrograms are regularly used in sociology and biology . the technique of hierarchical clustering , described in section  [ sec4_2 ] , lends itself naturally to this kind of representation .     a dendrogram , or hierarchical tree . horizontal cuts correspond to partitions of the graph in communities . reprinted figure with permission from ref . 2004 by the american physical society . ]      reliable algorithms are supposed to identify _ good _ partitions . but what is a good clustering ? in order to distinguish between `` good '' and `` bad '' clusterings , it would be useful to require that partitions satisfy a set of basic properties , intuitive and easy to agree upon . in the wider context of data clustering , this issue has been studied by jon kleinberg  @xcite , who has proved an important _ impossibility theorem_. given a set @xmath87 of points , a _ distance function _ @xmath88 is defined , which is positive definite and symmetric ( the triangular inequality is not explicitly required ) . one wishes to find a clustering @xmath89 based on the distances between the points . kleinberg showed that no clustering satisfies at the same time the three following properties :    1 . _ scale - invariance _ : given a constant @xmath18 , multiplying _ any _ distance function @xmath88 by @xmath18 yields the same clustering . richness _ : any possible partition of the given point set can be recovered if one chooses a suitable distance function @xmath88 . consistency _ : given a partition , any modification of the distance function that does not decrease the distance between points of different clusters and that does not increase the distance between points of the same cluster , yields the same clustering . the theorem can not be extended to graph clustering because the distance function can not be in general defined for a graph which is not complete . for weighted complete graphs , like correlation matrices  @xcite , it is often possible to define a distance function . on a generic graph , except for the first property , which does not make sense without a distance function , the other two are quite well defined . the property of richness implies that , given a partition , one can set edges between the vertices in such a way that the partition is a natural outcome of the resulting graph ( e.g. , it could be achieved by setting edges only between vertices of the same cluster ) . consistency here implies that deleting inter - cluster edges and adding intra - cluster edges yields the same partition . many algorithms are able to identify a subset of meaningful partitions , ideally one or just a few , whereas some others , like techniques based on hierarchical clustering ( section  [ sec4_2 ] ) , deliver a large number of partitions . that does not mean that the partitions found are equally good . therefore it is helpful ( sometimes even necessary ) to have a quantitative _ criterion _ to assess the goodness of a graph partition . quality function _ is a function that assigns a number to each partition of a graph . in this way one can rank partitions based on their score given by the quality function . partitions with high scores are `` good '' , so the one with the largest score is by definition the best . nevertheless , one should keep in mind that the question of when a partition is better than another one is ill - posed , and the answer depends on the specific concept of community and/or quality function adopted .    a quality function @xmath90 is _ additive _ if there is an elementary function @xmath91 such that , for any partition @xmath92 of a graph @xmath93 where @xmath22 is a generic cluster of partition @xmath94 . .  [ eq10 ] states that the quality of a partition is given by the sum of the qualities of the individual clusters . the function @xmath95 could be any of the cluster fitness functions discussed in section  [ sec3_1_2 ] , for instance . most quality functions used in the literature are additive , although it is not a necessary requirement . an example of quality function is the _ performance _ @xmath96 , which counts the number of correctly `` interpreted '' pairs of vertices , i.  e. two vertices belonging to the same community and connected by an edge , or two vertices belonging to different communities and not connected by an edge . the definition of performance , for a partition @xmath94 , is @xmath97 by definition , @xmath98 . another example is _ coverage _ , i.  e. the ratio of the number of intra - community edges by the total number of edges : by definition , an ideal cluster structure , where the clusters are disconnected from each other , yields a coverage of @xmath2 , as all edges of the graph fall within clusters . the most popular quality function is the modularity of newman and girvan  @xcite . it is based on the idea that a random graph is not expected to have a cluster structure , so the possible existence of clusters is revealed by the comparison between the actual density of edges in a subgraph and the density one would expect to have in the subgraph if the vertices of the graph were attached regardless of community structure . this expected edge density depends on the chosen _ null model _ , i.  e. a copy of the original graph keeping some of its structural properties but without community structure . modularity can then be written as follows @xmath99 where the sum runs over all pairs of vertices , @xmath9 is the adjacency matrix , @xmath14 the total number of edges of the graph , and @xmath100 represents the expected number of edges between vertices @xmath67 and @xmath68 in the null model . the @xmath101-function yields one if vertices @xmath67 and @xmath68 are in the same community ( @xmath102 ) , zero otherwise . the choice of the null model graph is in principle arbitrary , and several possibilities exist . for instance , one could simply demand that the graph keeps the same number of edges as the original graph , and that edges are placed with the same probability between any pair of vertices . in this case ( bernoulli random graph ) , the null model term in eq . [ eq : mod_0 ] would be a constant ( i.  e. @xmath103 $ ] , @xmath104 ) . however this null model is not a good descriptor of real networks , as it has a poissonian degree distribution which is very different from the skewed distributions found in real networks . due to the important implications that broad degree distributions have for the structure and function of real networks  @xcite , it is preferable to go for a null model with the same degree distribution of the original graph . the standard null model of modularity imposes that the expected degree sequence ( after averaging over all possible configurations of the model ) matches the actual degree sequence of the graph . this is a stricter constraint than merely requiring the match of the degree distributions , and is essentially equivalent   to the _ configuration model _ , which has been subject of intense investigations in the recent literature on networks  @xcite . in this null model , a vertex could be attached to any other vertex of the graph and the probability that vertices @xmath67 and @xmath68 , with degrees @xmath105 and @xmath106 , are connected , can be calculated without problems . in fact , in order to form an edge between @xmath67 and @xmath68 one needs to join two _ stubs _ ( i.  e. half - edges ) , incident with @xmath67 and @xmath68 . the probability @xmath107 to pick at random a stub incident with @xmath67 is @xmath108 , as there are @xmath105 stubs incident with @xmath67 out of a total of @xmath109 . the probability of a connection between @xmath67 and @xmath68 is then given by the product @xmath110 , since edges are placed independently of each other . the result is @xmath111 , which yields an expected number @xmath112 of edges between @xmath67 and @xmath68 . so , the final expression of modularity reads @xmath113 since the only contributions to the sum come from vertex pairs belonging to the same cluster , we can group these contributions together and rewrite the sum over the vertex pairs as a sum over the clusters @xmath114 . \label{eq : mod1}\ ] ] here , @xmath115 is the number of clusters , @xmath116 the total number of edges joining vertices of module @xmath117 and @xmath118 the sum of the degrees of the vertices of @xmath117 . in eq . [ eq : mod1 ] , the first term of each summand is the fraction of edges of the graph inside the module , whereas the second term represents the expected fraction of edges that would be there if the graph were a random graph with the same expected degree for each vertex . a nice feature of modularity is that it can be equivalently expressed both in terms of the intra - cluster edges , as in eq . [ eq : mod1 ] , and in terms of the inter - cluster edges  @xcite . in fact , the maximum of modularity can be expressed as @xmath119\right\}\\ & = & \nonumber \frac{1}{m}\mbox{max}_{\cal p}\left\{\sum_{c=1}^{n_c}\big[l_c-\mbox{ex}(l_c)\big]\right\}\\ & = & -\frac{1}{m}\mbox{min}_{\cal p}\left\{-\sum_{c=1}^{n_c}\big[l_c-\mbox{ex}(l_c)\big]\right\ } , \label{eqr11}\end{aligned}\ ] ] where @xmath120 and @xmath121 indicates the maximum and the minimum over all possible graph partitions @xmath94 and @xmath122 indicates the expected number of links in cluster @xmath117 in the null model of modularity . by adding and subtracting the total number of edges @xmath14 of the graph one finally gets @xmath123\\ & = & -\frac{1}{m}\mbox{min}_{\cal p}(|\mbox{cut}_{\cal p}|-\mbox{excut}_{\cal p } ) . \label{eqr12}\end{aligned}\ ] ] in the last expression @xmath124 is the number of inter - cluster edges of partition @xmath94 , and @xmath125 is the expected number of inter - cluster edges of the partition in modularity s null model . according to eq . [ eq : mod1 ] , a subgraph is a module if the corresponding contribution to modularity in the sum is positive . the more the number of internal edges of the cluster exceeds the expected number , the better defined the community . so , large positive values of the modularity indicate good partitions . ] . the maximum modularity of a graph generally grows if the size of the graph and/or the number of ( well - separated ) clusters increase  @xcite . therefore , modularity should not be used to compare the quality of the community structure of graphs which are very different in size . the modularity of the whole graph , taken as a single community , is zero , as the two terms of the only summand in this case are equal and opposite . modularity is always smaller than one , and can be negative as well . for instance , the partition in which each vertex is a community is always negative : in this case the sum runs over @xmath15 terms , which are all negative as the first term of each summand is zero . this is a nice feature of the measure , implying that , if there are no partitions with positive modularity , the graph has no community structure . on the contrary , the existence of partitions with large negative modularity values may hint to the existence of subgroups with very few internal edges and many edges lying between them ( _ multipartite structure _ )  @xcite . holmstrm et al . @xcite have shown that the distribution of modularity values across the partitions of various graphs , real and artificial ( including random graphs with no apparent community structure ) , has some stable features , and that the most likely modularity values correspond to partitions in clusters of approximately equal size . modularity has been employed as quality function in many algorithms , like some of the divisive algorithms of section  [ sec5 ] . in addition , modularity optimization is itself a popular method for community detection ( see section  [ sub_sec6_0 ] ) . modularity also allows to assess the stability of partitions  @xcite ( section  [ sec6_4 ] ) , it can be used to design layouts for graph visualization  @xcite and to perform a sort of renormalization of a graph , by transforming a graph into a smaller one with the same community structure  @xcite . the problem of graph partitioning consists in dividing the vertices in @xmath126 groups of predefined size , such that the number of edges lying between the groups is minimal . the number of edges running between clusters is called _ cut size_. fig . [ figure5 ] presents the solution of the problem for a graph with fourteen vertices , for @xmath127 and clusters of equal size . graph partitioning . the dashed line shows the solution of the minimum bisection problem for the graph illustrated , i. e. the partition in two groups of equal size with minimal number of edges running between the groups . reprinted figure with permission from ref . 2009 by springer.,width=264 ]    specifying the number of clusters of the partition is necessary . if one simply imposed a partition with the minimal cut size , and left the number of clusters free , the solution would be trivial , corresponding to all vertices ending up in the same cluster , as this would yield a vanishing cut size . specifying the size is also necessary , as otherwise the most likely solution of the problem would consist in separating the lowest degree vertex from the rest of the graph , which is quite uninteresting . this problem can be actually avoided by choosing a different measure to optimize for the partitioning , which accounts for the size of the clusters . some of these measures will be briefly introduced at the end of this section . graph partitioning is a fundamental issue in parallel computing , circuit partitioning and layout , and in the design of many serial algorithms , including techniques to solve partial differential equations and sparse linear systems of equations . most variants of the graph partitioning problem are np - hard . there are however several algorithms that can do a good job , even if their solutions are not necessarily optimal  @xcite . many algorithms perform a bisection of the graph . partitions into more than two clusters are usually attained by iterative bisectioning . moreover , in most cases one imposes the constraint that the clusters have equal size . this problem is called _ minimum bisection _ and is np - hard .    the _ kernighan - lin algorithm _ @xcite is one of the earliest methods proposed and is still frequently used , often in combination with other techniques . the authors were motivated by the problem of partitioning electronic circuits onto boards : the nodes contained in different boards need to be linked to each other with the least number of connections . the procedure is an optimization of a benefit function @xmath90 , which represents the difference between the number of edges inside the modules and the number of edges lying between them . the starting point is an initial partition of the graph in two clusters of the predefined size : such initial partition can be random or suggested by some information on the graph structure . then , subsets consisting of equal numbers of vertices are swapped between the two groups , so that @xmath90 has the maximal increase . the subsets can consist of single vertices . to reduce the risk to be trapped in local maxima of @xmath90 , the procedure includes some swaps that decrease the function @xmath90 . after a series of swaps with positive and negative gains , the partition with the largest value of @xmath90 is selected and used as starting point of a new series of iterations . the kernighan - lin algorithm is quite fast , scaling as @xmath128 ( @xmath15 being as usual the number of vertices ) , if only a constant number of swaps are performed at each iteration . the most expensive part is the identification of the subsets to swap , which requires the computation of the gains / losses for any pair of candidate subsets . on sparse graphs , a slightly different heuristic allows to lower the complexity to @xmath129 . the partitions found by the procedure are strongly dependent on the initial configuration and other algorithms can do better . it is preferable to start with a good guess about the sought partition , otherwise the results are quite poor . therefore the method is typically used to improve on the partitions found through other techniques , by using them as starting configurations for the algorithm . the kernighan - lin algorithm has been extended to extract partitions in any number of parts  @xcite , however the run - time and storage costs increase rapidly with the number of clusters . another popular technique is the _ spectral bisection method _ @xcite , which is based on the properties of the spectrum of the laplacian matrix . spectral clustering will be discussed more thoroughly in section  [ sec4_4 ] , here we focus on its application to graph partitioning .    every partition of a graph with @xmath15 vertices in two groups can be represented by an index vector @xmath130 , whose component @xmath131 is @xmath132 if vertex @xmath67 is in one group and @xmath133 if it is in the other group . the cut size @xmath134 of the partition of the graph in the two groups can be written as @xmath135 where @xmath136 is the laplacian matrix and @xmath137 the transpose of vector @xmath130 . vector @xmath130 can be written as @xmath138 , where @xmath139 , @xmath140 are the eigenvectors of the laplacian . if @xmath130 is properly normalized , then @xmath141 where @xmath142 is the laplacian eigenvalue corresponding to eigenvector @xmath139 . it is worth remarking that the sum contains at most @xmath143 terms , as the laplacian has at least one zero eigenvalue . minimizing @xmath134 equals to the minimization of the sum on the right - hand side of eq . this task is still very hard . however , if the second lowest eigenvector @xmath144 is close enough to zero , a good approximation of the minimum can be attained by choosing @xmath130 parallel to the corresponding eigenvector @xmath145 , which is called _ fiedler vector _ @xcite : this would reduce the sum to @xmath144 , which is a small number . but the index vector can not be perfectly parallel to @xmath145 by construction , because all its components are equal in modulus , whereas the components of @xmath145 are not . the best choice is to match the signs of the components . so , one can set @xmath146 ( @xmath133 ) if @xmath147 ( @xmath148 ) . it may happen that the sizes of the two corresponding groups do not match the predefined sizes one wishes to have . in this case , if one aims at a split in @xmath149 and @xmath150 vertices , the best strategy is to order the components of the fiedler vector from the lowest to the largest values and to put in one group the vertices corresponding to the first @xmath149 components from the top or the bottom , and the remaining vertices in the second group . this procedure yields two partitions : the better solution is naturally the one that gives the smaller cut size . the spectral bisection method is quite fast . the first eigenvectors of the laplacian can be computed by using the lanczos method  @xcite . the time required to compute the first @xmath44 eigenvectors of a matrix with the lanczos method depends on the size of the eigengap @xmath151  @xcite . if the eigenvalues @xmath152 and @xmath153 are well separated , the running time of the algorithm is much shorter than the time required to calculate the complete set of eigenvectors , which scales as @xmath154 . the method gives in general good partitions , that can be further improved by applying the kernighan - lin algorithm . the well known max - flow min - cut theorem by ford and fulkerson  @xcite states that the minimum cut between any two vertices @xmath155 and @xmath156 of a graph , i.  e. any minimal subset of edges whose deletion would topologically separate @xmath155 from @xmath156 , carries the maximum flow that can be transported from @xmath155 to @xmath156 across the graph . in this context edges play the role of water pipes , with a given carrying capacity ( e.g. their weights ) , and vertices the role of pipe junctions . this theorem has been used to determine minimal cuts from maximal flows in clustering algorithms . there are several efficient routines to compute maximum flows in graphs , like the algorithm of goldberg and tarjan  @xcite . flake et al . @xcite have recently used maximum flows to identify communities in the graph of the world wide web . the web graph is directed but for the purposes of the calculation flake et at . treated the edges as undirected . web communities are defined to be `` strong '' ( ls - sets ) , i.  e. the internal degree of each vertex must not be smaller than its external degree  @xcite . an artificial sink @xmath156 is added to the graph and one calculates the maximum flows from a source vertex @xmath155 to the sink @xmath156 : the corresponding minimum cut identifies the community of vertex @xmath155 , provided @xmath155 shares a sufficiently large number of edges with the other vertices of its community , otherwise one could get trivial separations and meaningless clusters . other popular methods for graph partitioning include level - structure partitioning , the geometric algorithm , multilevel algorithms , etc . a good description of these algorithms can be found in ref . @xcite . graphs can be also partitioned by minimizing measures that are affine to the cut size , like _ conductance _ the conductance @xmath157 of the subgraph @xmath22 of a graph @xmath23 is defined as @xmath158 where @xmath159 is the cut size of @xmath22 , and @xmath160 , @xmath161 are the total degrees of @xmath22 and of the rest of the graph @xmath162 , respectively . cuts are defined only between non - empty sets , otherwise the measure would not be defined ( as the denominator in eq . [ eq3000 ] would vanish ) . the minimum of the conductance is obtained in correspondence of low values of the cut size and of large values for the denominator in eq . [ eq3000 ] , which peaks when the total degrees of the cluster and its complement are equal . in practical applications , especially on large graphs , close values of the total degrees correspond to clusters of approximately equal size . the problem of finding a cut with minimal conductance is * np*-hard  @xcite . similar measures are the _ ratio cut _  @xcite and the _ normalized cut _  @xcite . the ratio cut of a cluster @xmath22 is defined as @xmath163 where @xmath164 and @xmath165 are the number of vertices of the two subgraphs . the normalized cut of a cluster @xmath22 is @xmath166 where @xmath160 is again the total degree of @xmath22 . as for the conductance , minimizing the ratio cut and the normalized cut favors partitions into clusters of approximately equal size , measured in terms of the number of vertices or edges , respectively . on the other hand , graph partitioning requires preliminary assumptions on the cluster sizes , whereas the minimization of conductance , ratio cut and normalized cut does not . the ratio cut was introduced for circuit partitioning  @xcite and its optimization is an * np*-hard problem  @xcite . the normalized cut is frequently used in image segmentation  @xcite and its optimization is * np*-complete  @xcite . the cut ratio and the normalized cut can be quite well minimized via spectral clustering  @xcite ( section  [ sec4_4 ] ) . algorithms for graph partitioning are not good for community detection , because it is necessary to provide as input the number of groups and in some cases even their sizes , about which in principle one knows nothing . instead , one would like an algorithm capable to produce this information in its output . besides , from the methodological point of view , using iterative bisectioning to split the graph in more pieces is not a reliable procedure . for instance , a split into three clusters is necessarily obtained by breaking either cluster of the original bipartition in two parts , whereas in many cases a minimum cut partition is obtained if the third cluster is a merger of parts of both initial clusters .      in general , very little is known about the community structure of a graph . it is uncommon to know the number of clusters in which the graph is split , or other indications about the membership of the vertices . in such cases clustering procedures like graph partitioning methods can hardly be of help , and one is forced to make some reasonable assumptions about the number and size of the clusters , which are often unjustified . on the other hand , the graph may have a hierarchical structure , i.  e. may display several levels of grouping of the vertices , with small clusters included within large clusters , which are in turn included in larger clusters , and so on . social networks , for instance , often have a hierarchical structure ( section [ sec3_2_1 ] ) . in such cases , one may use _ hierarchical clustering algorithms _ @xcite , i.  e. clustering techniques that reveal the multilevel structure of the graph . hierarchical clustering is very common in social network analysis , biology , engineering , marketing , etc . the starting point of any hierarchical clustering method is the definition of a similarity measure between vertices . after a measure is chosen , one computes the similarity for each pair of vertices , no matter if they are connected or not . at the end of this process , one is left with a new @xmath167 matrix @xmath168 , the similarity matrix . in section  [ sec3_1_4 ] we have listed several possible definitions of similarity . hierarchical clustering techniques aim at identifying groups of vertices with high similarity , and can be classified in two categories :    1 . _ agglomerative algorithms _ , in which clusters are iteratively merged if their similarity is sufficiently high ; 2 . _ divisive algorithms _ , in which clusters are iteratively split by removing edges connecting vertices with low similarity . the two classes refer to opposite processes : agglomerative algorithms are bottom - up , as one starts from the vertices as separate clusters ( singletons ) and ends up with the graph as a unique cluster ; divisive algorithms are top - down as they follow the opposite direction . divisive techniques have been rarely used in the past ( meanwhile they have become more popular , see section  [ sec5 ] ) , so we shall concentrate here on agglomerative algorithms .    since clusters are merged based on their mutual similarity , it is essential to define a measure that estimates how similar clusters are , out of the matrix @xmath168 . this involves some arbitrariness and several prescriptions exist . in _ single linkage clustering _ , the similarity between two groups is the minimum element @xmath169 , with @xmath67 in one group and @xmath68 in the other . on the contrary , the maximum element @xmath169 for vertices of different groups is used in the procedure of _ complete linkage clustering_. in _ average linkage clustering _ one has to compute the average of the @xmath169 . the procedure can be better illustrated by means of dendrograms ( section [ sec3_2_1 ] ) , like the one in fig . [ fig9 ] . sometimes , stopping conditions are imposed to select a partition or a group of partitions that satisfy a special criterion , like a given number of clusters or the optimization of a quality function ( e.g. modularity ) . hierarchical clustering has the advantage that it does not require a preliminary knowledge on the number and size of the clusters . however , it does not provide a way to discriminate between the many partitions obtained by the procedure , and to choose that or those that better represent the community structure of the graph . the results of the method depend on the specific similarity measure adopted . the procedure also yields a hierarchical structure by construction , which is rather artificial in most cases , since the graph at hand may not have a hierarchical structure at all . moreover , vertices of a community may not be correctly classified , and in many cases some vertices are missed even if they have a central role in their clusters  @xcite . another problem is that vertices with just one neighbor are often classified as separated clusters , which in most cases does not make sense . finally , a major weakness of agglomerative hierarchical clustering is that it does not scale well . if points are embedded in space , so that one can use the distance as dissimilarity measure , the computational complexity is @xmath129 for single linkage , @xmath128 for the complete and average linkage schemes . for graph clustering , where a distance is not trivially defined , the complexity can become much heavier if the calculation of the chosen similarity measure is costly . _ partitional clustering _ indicates another popular class of methods to find clusters in a set of data points . here , the number of clusters is preassigned , say @xmath44 . the points are embedded in a metric space , so that each vertex is a point and a distance measure is defined between pairs of points in the space . the distance is a measure of dissimilarity between vertices . the goal is to separate the points in @xmath44 clusters such to maximize / minimize a given cost function based on distances between points and/or from points to _ centroids _ , i.  e. suitably defined positions in space . some of the most used functions are listed below :    * _ minimum k - clustering_. the cost function here is the _ diameter _ of a cluster , which is the largest distance between two points of a cluster . the points are classified such that the largest of the @xmath44 cluster diameters is the smallest possible . the idea is to keep the clusters very `` compact '' . * _ k - clustering sum_. same as minimum @xmath44-clustering , but the diameter is replaced by the average distance between all pairs of points of a cluster . * _ k - center_. for each cluster @xmath67 one defines a reference point @xmath170 , the centroid , and computes the maximum @xmath171 of the distances of each cluster point from the centroid . the clusters and centroids are self - consistently chosen such to minimize the largest value of @xmath171 . * _ k - median_. same as k - center , but the maximum distance from the centroid is replaced by the average distance . the most popular partitional technique in the literature is _ @xmath44-means clustering _  @xcite . here the cost function is the total intra - cluster distance , or squared error function @xmath172 where @xmath173 indicates the subset of points of the @xmath67-th cluster and @xmath174 its centroid . the @xmath44-means problem can be simply solved with the lloyd s algorithm  @xcite . one starts from an initial distribution of centroids such that they are as far as possible from each other . in the first iteration , each vertex is assigned to the nearest centroid . next , the centers of mass of the @xmath44 clusters are estimated and become a new set of centroids , which allows for a new classification of the vertices , and so on . after a small number of iterations , the positions of the centroids are stable , and the clusters do not change any more . the solution found is not optimal , and it strongly depends on the initial choice of the centroids . nevertheless , lloyd s heuristic has remained popular due to its quick convergence , which makes it suitable for the analysis of large data sets . the result can be improved by performing more runs starting from different initial conditions , and picking the solution which yields the minimum value of the total intra - cluster distance . extensions of @xmath44-means clustering to graphs have been proposed by some authors  @xcite . another popular technique , similar in spirit to @xmath44-means clustering , is _ fuzzy k - means clustering _  @xcite . this method accounts for the fact that a point may belong to two or more clusters at the same time and is widely used in pattern recognition . the associated cost function is @xmath175 where @xmath176 is the _ membership matrix _ , which measures the degree of membership of point @xmath67 ( with position @xmath177 ) in cluster @xmath68 , @xmath14 is a real number greater than @xmath2 and @xmath178 is the center of cluster @xmath68 @xmath179 the matrix @xmath176 is normalized so that the sum of the memberships of every point in all clusters yields @xmath2 . the membership @xmath176 is related to the distance of point @xmath67 from the center of cluster @xmath68 , as it is reasonable to assume that the larger this distance , the lower @xmath176 . this can be expressed by the following relation @xmath180 the cost function @xmath181 can be minimized by iterating eqs . [ eq3004 ] and  [ eq3005 ] . one starts from some initial guess for @xmath176 and uses eq . [ eq3004 ] to compute the centers , which are then plugged back into eqs . [ eq3005 ] , and so on . the process stops when the corresponding elements of the membership matrix in consecutive iterations differ from each other by less than a predefined tolerance . it can be shown that this procedure indeed delivers a local minimum of the cost function @xmath181 of eq . [ eq3003 ] . this procedure has the same problems of lloyd s algorithm for @xmath44-means clustering , i.  e. the minimum is a local minimum , and depends on the initial choice of the matrix @xmath176 . the limitation of partitional clustering is the same as that of the graph partitioning algorithms : the number of clusters must be specified at the beginning , the method is not able to derive it . in addition , the embedding in a metric space can be natural for some graphs , but rather artificial for others . let us suppose to have a set of @xmath15 objects @xmath182 with a pairwise similarity function @xmath87 defined between them , which is symmetric and non - negative ( i.  e. , @xmath183 , @xmath184 ) . _ spectral clustering _ includes all methods and techniques that partition the set into clusters by using the eigenvectors of matrices , like @xmath87 itself or other matrices derived from it . in particular , the objects could be points in some metric space , or the vertices of a graph . spectral clustering consists of a transformation of the initial set of objects into a set of points in space , whose coordinates are elements of eigenvectors : the set of points is then clustered via standard techniques , like @xmath44-means clustering ( section  [ sec4_3 ] ) . one may wonder why it is necessary to cluster the points obtained through the eigenvectors , when one can directly cluster the initial set of objects , based on the similarity matrix . the reason is that the change of representation induced by the eigenvectors makes the cluster properties of the initial data set much more evident . in this way , spectral clustering is able to separate data points that could not be resolved by applying directly @xmath44-means clustering , for instance , as the latter tends to deliver convex sets of points . the first contribution on spectral clustering was a paper by donath and hoffmann  @xcite , who used the eigenvectors of the adjacency matrix for graph partitions . in the same year , fiedler  @xcite realized that from the eigenvector of the second smallest eigenvalue of the laplacian matrix it was possible to obtain a bipartition of the graph with very low cut size , as we have explained in section  [ sec4_1 ] . for a historical survey see ref . @xcite . in this section we shall follow the nice tutorial by von luxburg  @xcite , with a focus on spectral graph clustering . the concepts and methods discussed below apply to both unweighted and weighted graphs . the laplacian is by far the most used matrix in spectral clustering . in section  [ sec1_2 ] we see that the unnormalized laplacian of a graph with @xmath44 connected components has @xmath44 zero eigenvalues . in this case the laplacian can be written in block - diagonal form , i.  e. the vertices can be ordered in such a way that the laplacian displays @xmath44 square blocks along the diagonal , with ( some ) entries different from zero , whereas all other elements vanish . each block is the laplacian of the corresponding subgraph , so it has the trivial eigenvector with components @xmath185 . therefore , there are @xmath44 degenerate eigenvectors with equal non - vanishing components in correspondence of the vertices of a block , whereas all other components are zero . in this way , from the components of the eigenvectors one can identify the connected components of the graph . for instance , let us consider the @xmath186 matrix , whose columns are the @xmath44 eigenvectors above mentioned . the @xmath67-th row of this matrix is a vector with @xmath44 components representing vertex @xmath67 of the graph . vectors representing vertices in the same connected component of the graph coincide , and their tip lies on one of the axes of a @xmath44-dimensional system of coordinates ( i. e. they are all vectors of the form @xmath187 ) . so , by drawing the vertex vectors one would see @xmath44 distinct points , each on a different axis , corresponding to the graph components .    if the graph is connected , but consists of @xmath44 subgraphs which are weakly linked to each other , the spectrum of the unnormalized laplacian will have one zero eigenvalue , all others being positive . now the laplacian can not be put in block - diagonal form : even if one enumerates the vertices in the order of their cluster memberships ( by listing first the vertices of one cluster , then the vertices of another cluster , etc . ) there will always be some non - vanishing entries outside of the blocks . however , the lowest @xmath188 non - vanishing eigenvalues are still close to zero , and the vertex vectors of the first @xmath44 eigenvectors should still enable one to clearly distinguish the clusters in a @xmath44-dimensional space . vertex vectors corresponding to the same cluster are now not coincident , in general , but still rather close to each other . so , instead of @xmath44 points , one would observe @xmath44 groups of points , with the points of each group localized close to each other and far from the other groups . techniques like @xmath44-means clustering ( section  [ sec4_3 ] ) can then easily recover the clusters . the scenario we have described is expected from perturbation theory  @xcite . in principle all symmetric matrices that can be put in block - diagonal form have a set of eigenvectors ( as many as the blocks ) , such that the elements of each eigenvector are different from zero on the vertices of a block and zero otherwise , just like the laplacian . the adjacency matrix itself has the same property , for example . this is a necessary condition for the eigenvectors to be successfully used for graph clustering , but it is not sufficient . in the case of the laplacian , for a graph with @xmath44 connected components , we know that the eigenvectors corresponding to the @xmath44 lowest eigenvalues come each from one of the components . in the case of the adjacency matrix @xmath189 ( or of its weighted counterpart @xmath190 ) , instead , it may happen that large eigenvalues refer to the same component . so , if one takes the eigenvectors corresponding to the @xmath44 largest eigenvalues , where @xmath191 is the diagonal matrix whose elements are the vertex degrees . ] , some components will be overrepresented , while others will be absent . therefore , using the eigenvectors of @xmath189 ( or @xmath190 ) in spectral graph clustering is in general not reliable . moreover , the elements of the eigenvectors corresponding to the components should be sufficiently far from zero . to understand why , suppose that we take a ( symmetric , block - diagonal ) matrix , and that one or more elements of one of the eigenvectors corresponding to the connected components are very close to zero . if one perturbs the graph by adding edges between different components , all entries of the perturbed eigenvectors will become non - zero and some may have comparable values as the lowest elements of the eigenvectors on the blocks . therefore distinguishing vertices of different components may become a problem , even when the perturbation is fairly small , and misclassifications are likely . on the other hand , the non - vanishing elements of the ( normalized ) eigenvectors of the unnormalized laplacian , for instance , are all equal to @xmath192 , where @xmath193 is the number of vertices in the @xmath67-th component . in this way , there is a gap between the lowest element ( here they are all equal for the same eigenvector ) and zero . this holds as well for the normalized laplacian @xmath194 ( section  [ sec1_2 ] ) . for the other normalized laplacian @xmath195 ( section  [ sec1_2 ] ) , the non - zero elements of the eigenvectors corresponding to the connected components are proportional to the square root of the degree of the corresponding vertex so , if degrees are very different from each other , and especially if there are vertices with very low degree , some eigenvector elements may be quite small . as we shall see below , in the context of the technique by ng et al . @xcite , a suitable normalization procedure is introduced to alleviate this problem . now that we have explained why the laplacian matrix is particularly suitable for spectral clustering , we proceed with the description of three popular methods : _ unnormalized spectral clustering _ and two _ normalized spectral clustering _ techniques , proposed by shi and malik  @xcite and by ng et al . @xcite , respectively . unnormalized spectral clustering uses the unnormalized laplacian @xmath136 . the inputs are the adjacency matrix @xmath189 ( @xmath190 for weighted graphs ) and the number @xmath44 of clusters to be recovered . the first step consists in computing the eigenvectors corresponding to the lowest @xmath44 eigenvalues of @xmath136 . then , one builds the @xmath186 matrix @xmath196 , whose columns are the @xmath44 eigenvectors . the @xmath15 rows of @xmath196 are used to represent the graph vertices in a @xmath44-dimensional euclidean space , through a cartesian system of coordinates . the points are then grouped in @xmath44 clusters by using @xmath44-means clustering or similar techniques ( section  [ sec4_3 ] ) . normalized spectral clustering works in the same way . in the version by shi and malik  @xcite , one uses the eigenvectors of the normalized laplacian @xmath194 ( section  [ sec1_2 ] ) . in the algorithm by ng et al . @xcite one adopts the normalized laplacian @xmath195 ( section  [ sec1_2 ] ) . here , however , the matrix @xmath196 is normalized by dividing the elements of each row by their sum , obtaining a new matrix @xmath197 , whose rows are then used to represent the vertices in space , as in the other methods . by doing so , it is much more unlikely that eigenvector components for a well - separated cluster are close to zero , a scenario which would make the classification of the corresponding vertices problematic , as we have said above . however , if the graph has some vertices with low degree , they may still be misclassified . spectral clustering is closely related to graph partitioning . relaxed versions of the minimization of ratio cut and normalized cut ( see section  [ sec4_1 ] ) can be turned into spectral clustering problems , by following similar procedures as in spectral graph partitioning . the measure to minimize can be expressed in matrix form , obtaining similar expressions as for the cut size ( see eq . [ eqr ] ) , with index vectors defining the partition of the graph in groups through the values of their entries . for instance , for the minimum cut bipartition of section  [ sec4_1 ] , there is only one index vector @xmath130 , whose components equal @xmath198 , where the signs indicate the two clusters . the relaxation consists in performing the minimization over all possible vectors @xmath130 , allowing for real - valued components as well . this version of the problem is exactly equivalent to spectral clustering . the relaxed minimization of ratio cut for a partition in @xmath44 clusters yields the @xmath15 @xmath44-dimensional vertex vectors of unnormalized spectral clustering  @xcite ; for normalized cut one obtains the @xmath15 @xmath44-dimensional vertex vectors of normalized spectral clustering , with the normalized laplacian @xmath194  @xcite . the problem is then to turn the resulting vectors into a partition of the graph , which can be done by using techniques like @xmath44-means clustering , as we have seen above . however , it is still unclear what is the relation between the original minimum cut problem over actual graph partitions and the relaxed version of it , in particular how close one can come to the real solution via spectral clustering . random walks on graphs are also related to spectral clustering . in fact , by minimizing the number of edges between clusters ( properly normalized for measures like , e.  g. , ratio cut and normalized cut ) one forces random walkers to spend more time within clusters and to move more rarely from one cluster to another . in particular , unnormalized spectral clustering with the laplacian @xmath194 has a natural link with random walks , because @xmath199 ( section  [ sec1_2 ] ) , where @xmath200 is the transfer matrix @xmath201 . this has interesting consequences . for instance , meil and shi have proven that the normalized cut for a bipartition equals the total probability that a random walker moves from one of the clusters to the other in either sense  @xcite . in this way , minimizing the normalized cut means looking for a partition minimizing the probability of transitions between clusters . spectral clustering requires the computation of the first @xmath44 eigenvectors of a laplacian matrix . if the graph is large , an exact computation of the eigenvectors is impossible , as it would require a time @xmath154 . fortunately there are approximate techniques , like the power method or krylov subspace techniques like the lanczos method  @xcite , whose speed depends on the size of the eigengap @xmath151 , where @xmath202 and @xmath152 are the @xmath44-th and @xmath203-th smallest eigenvalue of the matrix . the larger the eigengap , the faster the convergence . in fact , the existence of large gaps between pairs of consecutive eigenvalues could suggest the number of clusters of the graph , an information which is not delivered by spectral clustering and which has to be given as input . we know that , for a disconnected graph with @xmath44 components , the first @xmath44 eigenvalues of the laplacian matrix ( normalized or not ) are zero , whether the @xmath203-th is non - zero . if the clusters are weakly connected to each other , one expects that the first @xmath44 eigenvalues remain close to zero , and that the @xmath203-th is clearly different from zero . by reversing this argument , the number of clusters of a graph could be derived by checking whether there is an integer @xmath44 such that the first @xmath44 eigenvalues are small and the @xmath203-th is relatively large . however , when the clusters are very mixed with each other , it may be hard to identify significant gaps between the eigenvalues . the last issue we want to point out concerns the choice of the laplacian matrix to use in the applications . if the graph vertices have the same or similar degrees , there is no substantial difference between the unnormalized and the normalized laplacians . if there are big inhomogeneities among the vertex degrees , instead , the choice of the laplacian considerably affects the results . in general , normalized laplacians are more promising because the corresponding spectral clustering techniques implicitly impose a double optimization on the set of partitions , such that the intracluster edge density is high and , at the same time , the intercluster edge density is low . on the contrary , the unnormalized laplacian is related to the intercluster edge density only . moreover , unnormalized spectral clustering does not always converge , and sometimes yields trivial partitions in which one or more clusters consist of a single vertex . of the normalized laplacians , @xmath194 is more reliable than @xmath195 because the eigenvectors of @xmath194 corresponding to the lowest eigenvalues are cluster indicator vectors , i. e. , they have equal non - vanishing entries in correspondence of the vertices of each cluster , and zero elsewhere , if the clusters are disconnected . the eigenvectors of @xmath195 , instead , are obtained by ( left- ) multiplying those of @xmath194 by the matrix @xmath204 : in this way , eigenvector components corresponding to vertices of the same cluster are no longer equal , in general , a complication that may induce artefacts in the spectral clustering procedure . a simple way to identify communities in a graph is to detect the edges that connect vertices of different communities and remove them , so that the clusters get disconnected from each other . this is the philosophy of divisive algorithms . the crucial point is to find a property of intercommunity edges that could allow for their identification . divisive methods do not introduce substantial conceptual advances with respect to traditional techniques , as they just perform hierarchical clustering on the graph at study ( section  [ sec4_2 ] ) . the main difference with divisive hierarchical clustering is that here one removes inter - cluster edges instead of edges between pairs of vertices with low similarity and there is no guarantee _ a priori _ that inter - cluster edges connect vertices with low similarity . in some cases vertices ( with all their adjacent edges ) or whole subgraphs may be removed , instead of single edges . being hierarchical clustering techniques , it is customary to represent the resulting partitions by means of dendrograms . the most popular algorithm is that proposed by girvan and newman  @xcite . the method is historically important , because it marked the beginning of a new era in the field of community detection and opened this topic to physicists . here edges are selected according to the values of measures of _ edge centrality _ , estimating the importance of edges according to some property or process running on the graph . the steps of the algorithm are :    1 . computation of the centrality for all edges ; 2 . removal of edge with largest centrality : in case of ties with other edges , one of them is picked at random ; 3 . recalculation of centralities on the running graph ; 4 . iteration of the cycle from step 2 . girvan and newman focused on the concept of _ betweenness _ , which is a variable expressing the frequency of the participation of edges to a process . they considered three alternative definitions : geodesic edge betweenness , random - walk edge betweenness and current - flow edge betweenness . in the following we shall refer to them as edge betweenness , random - walk betweenness and current - flow betweenness , respectively .    edge betweenness is the number of shortest paths between all vertex pairs that run along the edge . it is an extension to edges of the popular concept of site betweenness , introduced by freeman in 1977  @xcite and expresses the importance of edges in processes like information spreading , where information usually flows through shortest paths . historically edge betweenness was introduced before site betweenness in a never published technical report by anthonisse  @xcite . it is intuitive that intercommunity edges have a large value of the edge betweenness , because many shortest paths connecting vertices of different communities will pass through them ( fig . [ figure6 ] ) . as in the calculation of site betweenness , if there are two or more geodesic paths with the same endpoints that run through an edge , the contribution of each of them to the betweenness of the edge must be divided by the multiplicity of the paths , as one assumes that the signal / information propagates equally along each geodesic path . edge betweenness is highest for edges connecting communities . in the figure , the edge in the middle has a much higher betweenness than all other edges , because all shortest paths connecting vertices of the two communities run through it . reprinted figure with permission from ref . 2009 by springer . ]    the betweenness of all edges of the graph can be calculated in a time that scales as @xmath205 , or @xmath129 on a sparse graph , with techniques based on breadth - first - search  @xcite .    in the context of information spreading , one could imagine that signals flow across random rather than geodesic paths . in this case the betweenness of an edge is given by the frequency of the passages across the edge of a random walker running on the graph ( random - walk betweenness ) . a random walker moving from a vertex follows each adjacent edge with equal probability . a pair of vertices is chosen at random , @xmath155 and @xmath156 . the walker starts at @xmath155 and keeps moving until it hits @xmath156 , where it stops . one computes the probability that each edge was crossed by the walker , and averages over all possible choices for the vertices @xmath155 and @xmath156 . it is meaningful to compute the _ net _ crossing probability , which is proportional to the number of times the walk crossed the edge in one direction . in this way one neglects back and forth passages that are accidents of the random walk and tell nothing about the centrality of the edge . calculation of random - walk betweenness requires the inversion of an @xmath167 matrix ( once ) , followed by obtaining and averaging the flows for all pairs of nodes . the first task requires a time @xmath154 , the second @xmath206 , for a total complexity @xmath207 $ ] , or @xmath154 for a sparse matrix . the complete calculation requires a time @xmath154 on a sparse graph . current - flow betweenness is defined by considering the graph a resistor network , with edges having unit resistance . if a voltage difference is applied between any two vertices , each edge carries some amount of current , that can be calculated by solving kirchoff s equations . the procedure is repeated for all possible vertex pairs : the current - flow betweenness of an edge is the average value of the current carried by the edge . it is possible to show that this measure is equivalent to random - walk betweenness , as the voltage differences and the random walks net flows across the edges satisfy the same equations  @xcite . therefore , the calculation of current - flow betweenness has the same complexity @xmath207 $ ] , or @xmath154 for a sparse graph . calculating edge betweenness is much faster than current - flow or random walk betweenness [ @xmath129 versus @xmath154 on sparse graphs ] . in addition , in practical applications the girvan - newman algorithm with edge betweenness gives better results than adopting the other centrality measures  @xcite . numerical studies show that the recalculation step 3 of girvan - newman algorithm is essential to detect meaningful communities . this introduces an additional factor @xmath14 in the running time of the algorithm : consequently , the edge betweenness version scales as @xmath208 , or @xmath154 on a sparse graph . on graphs with strong community structure , that quickly break into communities , the recalculation step needs to be performed only within the connected component including the last removed edge ( or the two components bridged by it if the removal of the edge splits a subgraph ) , as the edge betweenness of all other edges remains the same . this can help saving some computer time , although it is impossible to give estimates of the gain since it depends on the specific graph at hand . nevertheless , the algorithm is quite slow , and applicable to sparse graphs with up to @xmath209 vertices , with current computational resources . in the original version of girvan - newman s algorithm  @xcite , the authors had to deal with the whole hierarchy of partitions , as they had no procedure to say which partition is the best . in a successive refinement  @xcite , they selected the partition with the largest value of modularity ( see section  [ sec3_2_2 ] ) , a criterion that has been frequently used ever since . the method can be simply extended to the case of weighted graphs , by suitably generalizing the edge betweenness . the betweenness of a weighted edge equals the betweenness of the edge in the corresponding unweighted graph , divided by the weight of the edge  @xcite . there have been countless applications of the girvan - newman method : the algorithm is now integrated in well known libraries of network analysis programs . tyler et al . proposed a modification of the girvan - newman algorithm , to improve the speed of the calculation  @xcite . the gain in speed was required by the analysis of graphs of gene co - occurrences , which are too large to be analyzed by the algorithm of girvan and newman . algorithms computing site / edge betweenness start from any vertex , taken as center , and compute the contribution to betweenness from all paths originating at that vertex ; the procedure is then repeated for all vertices  @xcite . tyler et al . proposed to calculate the contribution to edge betweenness only from a limited number of centers , chosen at random , deriving a sort of monte carlo estimate . numerical tests indicate that , for each connected subgraph , it suffices to pick a number of centers growing as the logarithm of the number of vertices of the component . for a given choice of the centers , the algorithm proceeds just like that of girvan and newman . the stopping criterion is different , though , as it does not require the calculation of modularity on the resulting partitions , but relies on a particular definition of community . according to such definition , a connected subgraph with @xmath210 vertices is a community if the edge betweenness of any of its edges does not exceed @xmath211 . indeed , if the subgraph consists of two parts connected by a single edge , the betweenness value of that edge would be greater than or equal to @xmath211 , with the equality holding only if one of the two parts consists of a single vertex . therefore , the condition on the betweenness of the edges would exclude such situations , although other types of cluster structures might still be compatible with it . in this way , in the method of tyler et al . , edges are removed until all connected components of the partition are `` communities '' in the sense explained above . the monte carlo sampling of the edge betweenness necessarily induces statistical errors . as a consequence , the partitions are in general different for different choices of the set of center vertices . however , the authors showed that , by repeating the calculation many times , the method gives good results on a network of gene co - occurrences  @xcite , with a substantial gain of computer time . the technique has been also applied to a network of people corresponding via email  @xcite . in practical examples , only vertices lying at the boundary between communities may not be clearly classified , and be assigned sometimes to a group , sometimes to another . this is actually a nice feature of the method , as it allows to identify overlaps between communities , as well as the degree of membership of overlapping vertices in the clusters they belong to . the algorithm of girvan and newman , which is deterministic , is unable to accomplish this . another fast version of the girvan - newman algorithm has been proposed by rattigan et al . @xcite . here , a quick approximation of the edge betweenness values is carried out by using a _ network structure index _ , which consists of a set of vertex annotations combined with a distance measure  @xcite . basically one divides the graph into regions and computes the distances of every vertex from each region . in this way rattigan et al . showed that it is possible to lower the complexity of the algorithm to @xmath21 , by keeping a fair accuracy in the estimate of the edge betweenness values . this version of the girvan - newman algorithm gives good results on the benchmark graphs proposed by brandes et al . @xcite ( see also section  [ sec6_1 ] ) , as well as on a collaboration network of actors and on a citation network . chen and yuan have pointed out that counting all possible shortest paths in the calculation of the edge betweenness may lead to unbalanced partitions , with communities of very different size , and proposed to count only _ non - redundant _ paths , i.  e. paths whose endpoints are all different from each other : the resulting betweenness yields better results than standard edge betweenness for mixed clusters on the benchmark graphs of girvan and newman  @xcite . holme et al . have used a modified version of the algorithm in which vertices , rather than edges , are removed  @xcite . a centrality measure for the vertices , proportional to their site betweenness , and inversely proportional to their indegree , is chosen to identify boundary vertices , which are then iteratively removed with all their edges . this modification , applied to study the hierarchical organization of biochemical networks , is motivated by the need to account for reaction kinetic information , that simple site betweenness does not include . the indegree of a vertex is solely used because it indicates the number of substrates to a metabolic reaction involving that vertex ; for the purpose of clustering the graph is considered undirected , as usual . the algorithm of girvan and newman is unable to find overlapping communities , as each vertex is assigned to a single cluster . pinney and westhead have proposed a modification of the algorithm in which vertices can be split between communities  @xcite . to do that , they also compute the betweenness of all vertices of the graph . unfortunately the values of edge and site betweenness can not be simply compared , due to their different normalization , but the authors remarked that the two endvertices of an inter - cluster edge should have similar betweenness values , as the shortest paths crossing one of them are likely to reach the other one as well through the edge . so they take the edge with largest betweenness and remove it only if the ratio of the betweenness values of its endvertices is between @xmath18 and @xmath212 , with @xmath213 . otherwise , the vertex with highest betweenness ( with all its adjacent edges ) is temporarily removed . when a subgraph is split by vertex or edge removal , all deleted vertices belonging to that subgraph are `` copied '' in each subcomponent , along with all their edges . gregory  @xcite has proposed a similar approach , named conga ( cluster overlap newman - girvan algorithm ) , in which vertices are split among clusters if their site betweenness exceeds the maximum value of the betweenness of the edges . a vertex is split by assigning some of its edges to one of its duplicates , and the rest to the other . there are several possibilities to do that , gregory proposed to go for the split that yields the maximum of a new centrality measure , called _ split betweenness _ , which is the number of shortest paths that would run between two parts of a vertex if the latter were split . the method has a worst - case complexity @xmath214 , or @xmath154 on a sparse graph , like the algorithm of girvan and newman . the code can be found at http://www.cs.bris.ac.uk/@xmath215steve/networks/index . + html . another promising track to detect inter - cluster edges is related to the presence of cycles , i.  e. closed non - intersecting paths , in the graph . communities are characterized by a high density of edges , so it is reasonable to expect that such edges form cycles . on the contrary , edges lying between communities will hardly be part of cycles . based on this intuitive idea , radicchi et al . proposed a new measure , the edge clustering coefficient , such that low values of the measure are likely to correspond to intercommunity edges  @xcite . the edge clustering coefficient generalizes to edges the notion of clustering coefficient introduced by watts and strogatz for vertices  @xcite ( fig . [ edgeclus ] ) .     schematic illustration of the edge clustering coefficient introduced by radicchi et al . the two grey vertices have five and six other neighbors , respectively . of the five possible triangles based on the edge connecting the grey vertices , three are actually there , yielding an edge clustering coefficient @xmath216 . courtesy by f. radicchi . ] the clustering coefficient of a vertex is the number of triangles including the vertex divided by the number of possible triangles that can be formed ( section  [ sec1_1 ] ) . the edge clustering coefficient is defined as @xmath217 where @xmath67 and @xmath68 are the extremes of the edge , @xmath218 the number of cycles of length @xmath126 built upon edge @xmath219 and @xmath220 the possible number of cycles of length @xmath126 that one could build based on the existing edges of @xmath67 , @xmath68 and their neighbors . the number of actual cycles in the numerator is augmented by @xmath2 to enable a ranking among edges without cycles , which would all yield a coefficient @xmath221 equal to zero , independently of the degrees of the extremes @xmath67 and @xmath68 and their neighbors . usually , cycles of length @xmath222 ( triangles ) or @xmath223 are considered . the measure is ( anti)correlated with edge betweenness : edges with low edge clustering coefficient usually have high betweenness and vice versa , although the correlation is not perfect . the method works as the algorithm by girvan and newman . at each iteration , the edge with smallest clustering coefficient is removed , the measure is recalculated again , and so on . if the removal of an edge leads to a split of a subgraph in two parts , the split is accepted only if both clusters are ls - sets ( `` strong '' ) or `` weak '' communities ( see section  [ sec3_1_2 ] ) . the verification of the community condition on the clusters is performed on the full adjacency matrix of the initial graph . if the condition were satisfied only for one of the two clusters , the initial subgraph may be a random graph , as it can be easily seen that by cutting a random graph  la erds and rnyi in two parts , the larger of them is a strong ( or weak ) community with very high probability , whereas the smaller part is not . enforcing the community condition on both clusters , it is more likely that the subgraph to be split indeed has a cluster structure . therefore , the algorithm stops when all clusters produced by the edge removals are communities in the strong or weak sense , and further splits would violate this condition . the authors suggested to use the same stopping criterion for the algorithm of girvan and newman , to get structurally well - defined clusters . since the edge clustering coefficient is a local measure , involving at most an extended neighborhood of the edge , it can be calculated very quickly . the running time of the algorithm to completion is @xmath224 , or @xmath129 on a sparse graph , if @xmath126 is small , so it is much shorter than the running time of the girvan - newman method . the recalculation step becomes slow if @xmath126 is not so small , as in this case the number of edges whose coefficient needs to be recalculated may reach a sizeable fraction of the edges of the graph ; likewise , counting the number of cycles based on one edge becomes lengthier . if @xmath225 , where @xmath88 is the diameter of the graph ( which is usually a small number for real networks ) , the cycles span the whole graph and the measure becomes global and no more local . the computational complexity in this case exceeds that of the algorithm of girvan and newman , but it can come close to it for practical purposes even at lower values of @xmath126 . so , by tuning @xmath126 one can smoothly interpolate between a local and a global centrality measure . the software of the algorithm can be found in http://filrad.homelinux.org / data/. in a successive paper  @xcite the authors extended the method to the case of weighted networks , by modifying the edge clustering coefficient of eq . [ eq3010 ] , in that the number of cycles @xmath218 is multiplied by the weight of the edge @xmath219 . the definitions of strong and weak communities can be trivially extended to weighted graphs by replacing the internal / external degrees of the vertices / clusters with the corresponding strengths . more recently , the method has been extended to bipartite networks  @xcite , where only cycles of even length are possible ( @xmath226 , @xmath227 , @xmath228 , etc . ) . the algorithm by radicchi et al . may give poor results when the graph has few cycles , as it happens in some social and many non - social networks . in this case , in fact , the edge clustering coefficient is small and fairly similar for most edges , and the algorithm may fail to identify the bridges between communities .    an alternative measure of centrality for edges is information centrality . it is based on the concept of efficiency  @xcite , which estimates how easily information travels on a graph according to the length of shortest paths between vertices . the efficiency of a network is defined as the average of the inverse distances between all pairs of vertices . if the vertices are `` close '' to each other , the efficiency is high . the information centrality of an edge is the relative variation of the efficiency of the graph if the edge is removed . in the algorithm by fortunato et al . @xcite , edges are removed according to decreasing values of information centrality . the method is analogous to that of girvan and newman . computing the information centrality of an edge requires the calculation of the distances between all pairs of vertices , which can be done with breadth - first - search in a time @xmath205 . so , in order to compute the information centrality of all edges one requires a time @xmath208 . at this point one removes the edge with the largest value of information centrality and recalculates the information centrality of all remaining edges with respect to the running graph . since the procedure is iterated until there are no more edges in the network , the final complexity is @xmath229 , or @xmath230 on a sparse graph . the partition with the largest value of modularity is chosen as most representative of the community structure of the graph . the method is much slower than the algorithm of girvan and newman . partitions obtained with both techniques are rather consistent , mainly because information centrality has a strong correlation with edge betweenness . the algorithm by fortunato et al . gives better results when communities are mixed , i.  e. with a high degree of interconnectedness , but it tends to isolate leaf vertices and small loosely bound subgraphs . a measure of vertex centrality based on loops , similar to the clustering coefficient by watts and strogatz  @xcite , has been introduced by vragovi and louis  @xcite . the idea is that neighbors of a vertex well inside a community are `` close '' to each other , even in the absence of the vertex , due to the high density of intra - cluster edges . suppose that @xmath68 and @xmath44 are neighbors of a vertex @xmath67 : @xmath231 is the length of a shortest path between @xmath68 and @xmath44 , if @xmath67 is removed from the graph . naturally , the existence of alternative paths to @xmath232 implies the existence of loops in the graph . vragovi and louis defined the _ loop coefficient _ of @xmath67 as the average of @xmath233 over all pairs of neighbors of @xmath67 , somewhat reminding of the concept of information centrality used in the method by fortunato et al . high values of the loop coefficient are likely to identify core vertices of communities , whereas low values correspond to vertices lying at the boundary between communities . clusters are built around the vertices with highest values of the loop coefficient . the method has time complexity @xmath234 ; its results are not so accurate , as compared to popular clustering techniques . newman - girvan modularity @xmath90 ( section  [ sec3_2_2 ] ) , originally introduced to define a stopping criterion for the algorithm of girvan and newman , has rapidly become an essential element of many clustering methods . modularity is by far the most used and best known quality function . it represented one of the first attempts to achieve a first principle understanding of the clustering problem , and it embeds in its compact form all essential ingredients and questions , from the definition of community , to the choice of a null model , to the expression of the `` strength '' of communities and partitions . in this section we shall focus on all clustering techniques that require modularity , directly and/or indirectly . we will examine fast techniques that can be used on large graphs , but which do not find good optima for the measure  @xcite ; more accurate methods , which are computationally demanding  @xcite ; algorithms giving a good tradeoff between high accuracy and low complexity  @xcite . we shall also point out other properties of modularity , discuss some extensions / modifications of it , as well as highlight its limits .      by assumption , high values of modularity indicate good partitions . ] . so , the partition corresponding to its maximum value on a given graph should be the best , or at least a very good one . this is the main motivation for modularity maximization , by far the most popular class of methods to detect communities in graphs . an exhaustive optimization of @xmath90 is impossible , due to the huge number of ways in which it is possible to partition a graph , even when the latter is small . besides , the true maximum is out of reach , as it has been recently proved that modularity optimization is an np - complete problem  @xcite , so it is probably impossible to find the solution in a time growing polynomially with the size of the graph . however , there are currently several algorithms able to find fairly good approximations of the modularity maximum in a reasonable time . the first algorithm devised to maximize modularity was a greedy method of newman  @xcite . it is an agglomerative hierarchical clustering method , where groups of vertices are successively joined to form larger communities such that modularity increases after the merging . one starts from @xmath15 clusters , each containing a single vertex . edges are not initially present , they are added one by one during the procedure . however , the modularity of partitions explored during the procedure is always calculated from the full topology of the graph , as we want to find the modularity maximum on the space of partitions of the full graph . adding a first edge to the set of disconnected vertices reduces the number of groups from @xmath15 to @xmath143 , so it delivers a new partition of the graph . the edge is chosen such that this partition gives the maximum increase ( minimum decrease ) of modularity with respect to the previous configuration . all other edges are added based on the same principle . if the insertion of an edge does not change the partition , i.  e. the edge is internal to one of the clusters previously formed , modularity stays the same . the number of partitions found during the procedure is @xmath15 , each with a different number of clusters , from @xmath15 to @xmath2 . the largest value of modularity in this subset of partitions is the approximation of the modularity maximum given by the algorithm . at each iteration step , one needs to compute the variation @xmath235 of modularity given by the merger of any two communities of the running partition , so that one can choose the best merger . however , merging communities between which there are no edges can never lead to an increase of @xmath90 , so one has to check only the pairs of communities which are connected by edges , of which there can not be more than @xmath14 . since the calculation of each @xmath235 can be done in constant time , this part of the calculation requires a time @xmath21 . after deciding which communities are to be merged , one needs to update the matrix @xmath236 expressing the fraction of edges between clusters @xmath67 and @xmath68 of the running partition ( necessary to compute @xmath90 ) , which can be done in a worst - case time @xmath20 . since the algorithm requires @xmath143 iterations ( community mergers ) to run to completion , its complexity is @xmath237 , or @xmath129 on a sparse graph , so it enables one to perform a clustering analysis on much larger networks than the algorithm of girvan and newman ( up to an order of @xmath238 vertices with current computers ) . in a later paper @xcite , clauset et al . pointed out that the update of the matrix @xmath236 in newman s algorithm involves a large number of useless operations , due to the sparsity of the adjacency matrix . this operation can be performed more efficiently by using data structures for sparse matrices , like _ max - heaps _ , which rearrange the data in the form of binary trees . clauset et al . maintained the matrix of modularity variations @xmath239 , which is also sparse , a max - heap containing the largest elements of each row of the matrix @xmath239 as well as the labels of the corresponding communities , and a simple array whose elements are the sums of the elements of each row of the old matrix @xmath236 . the optimization of modularity can be carried out using these three data structures , whose update is much quicker than in newman s technique . the complexity of the algorithm is @xmath240 , where @xmath88 is the depth of the dendrogram describing the successive partitions found during the execution of the algorithm , which grows as @xmath241 for graphs with a strong hierarchical structure . for those graphs , the running time of the method is then @xmath242 , which allows to analyse the community structure of very large graphs , up to @xmath243 vertices . the greedy optimization of clauset et al . is currently one of the few algorithms that can be used to estimate the modularity maximum on such large graphs . the code can be freely downloaded from http://cs.unm.edu/@xmath215aaron/research/fastmodulari + ty.htm . this greedy optimization of modularity tends to form quickly large communities at the expenses of small ones , which often yields poor values of the modularity maxima . danon et al . suggested to normalize the modularity variation @xmath235 produced by the merger of two communities by the fraction of edges incident to one of the two communities , in order to favor small clusters  @xcite . this trick leads to better modularity optima as compared to the original recipe of newman , especially when communities are very different in size . wakita and tsurumi  @xcite have noticed that , due to the bias towards large communities , the fast algorithm by clauset et al . is inefficient , because it yields very unbalanced dendrograms , for which the relation @xmath244 does not hold , and as a consequence the method often runs at its worst - case complexity . to improve the situation they proposed a modification in which , at each step , one seeks the community merger delivering the largest value of the product of the modularity variation @xmath235 times a factor ( _ consolidation ratio _ ) , that peaks for communities of equal size . in this way there is a tradeoff between the gain in modularity and the balance of the communities to merge , with a big gain in the speed of the procedure , that enables the analysis of systems with up to @xmath245 vertices . interestingly , this modification often leads to better modularity maxima than those found with the version of clauset et al . , at least on large social networks . the code can be found at http://www.is.titech.ac.jp/@xmath215wakita/en/software + /community - analysis - software/. another trick to avoid the formation of large communities was proposed by schuetz and caflisch and consists in allowing for the merger of more community pairs , instead of one , at each iteration  @xcite . this generates several `` centers '' around which communities are formed , which grow simultaneously so that a condensation into a few large clusters is unlikely . this modified version of the greedy algorithm is combined with a simple refinement procedure in which single vertices are moved to the neighboring community that yields the maximum increase of modularity . the method has the same complexity of the fast optimization by clauset et al . , but comes closer to the modularity maximum . the software is available at http://www.biochem-caflisch.uzh.ch/public/5/net + work-clusterization-algorithm.html . the accuracy of the greedy optimization can be significantly improved if the hierarchical agglomeration is started from some reasonable intermediate configuration , rather than from the individual vertices  @xcite . xiang et al . suggested to start from a configuration obtained by merging the original isolated vertices into larger subgraphs , according to the values of a measure of topological similarity between subgraphs  @xcite . a similar approach has been described by ye et al . @xcite : here the initial partition is such that no single vertex can be moved from its cluster to another without decreasing @xmath90 . higher - quality modularities can be also achieved by applying refinement strategies based on local search at various steps of the greedy agglomeration  @xcite . such refinement procedures are similar to the technique proposed by newman to improve the results of his spectral optimization of modularity ( @xcite and section  [ sub_sec6_0_4 ] ) . another good strategy consists in alternating greedy optimization with stochastic perturbations of the partitions  @xcite . a different greedy approach has been introduced by blondel et al . @xcite , for the general case of weighted graphs . initially , all vertices of the graph are put in different communities . the first step consists of a sequential sweep over all vertices . given a vertex @xmath67 , one computes the gain in weighted modularity ( eq .  [ eq : mod2 ] ) coming from putting @xmath67 in the community of its neighbor @xmath68 and picks the community of the neighbor that yields the largest increase of @xmath90 , as long as it is positive . at the end of the sweep , one obtains the first level partition . in the second step communities are replaced by supervertices , and two supervertices are connected if there is at least an edge between vertices of the corresponding communities . in this case , the weight of the edge between the supervertices is the sum of the weights of the edges between the represented communities at the lower level . the two steps of the algorithm are then repeated , yielding new hierarchical levels and supergraphs ( fig . [ blondelmethod ] ) . we remark that modularity is always computed from the initial graph topology : operating on supergraphs enables one to consider the variations of modularity for partitions of the original graph after merging and/or splitting of groups of vertices . therefore , at some iteration , modularity can not increase anymore , and the algorithm stops . the technique is more limited by storage demands than by computational time . the latter grows like @xmath21 , so the algorithm is extremely fast and graphs with up to @xmath246 edges can be analyzed in a reasonable time on current computational resources . the software can be found at http://findcommunities.googlepages.com/. the modularity maxima found by the method are better than those found with the greedy techniques by clauset et al . @xcite and wakita and tsurumi  @xcite . however , closing communities within the immediate neighborhood of vertices may be inaccurate and yield spurious partitions in practical cases . so , it is not clear whether some of the intermediate partitions could correspond to meaningful hierarchical levels of the graph . moreover , the results of the algorithm depend on the order of the sequential sweep over the vertices . we conclude by stressing that , despite the improvements and refinements of the last years , the accuracy of greedy optimization is not that good , as compared with other techniques . simulated annealing  @xcite is a probabilistic procedure for global optimization used in different fields and problems . it consists in performing an exploration of the space of possible states , looking for the global optimum of a function @xmath247 , say its maximum . transitions from one state to another occur with probability @xmath2 if @xmath247 increases after the change , otherwise with a probability @xmath248 , where @xmath249 is the decrease of the function and @xmath19 is an index of stochastic noise , a sort of inverse temperature , which increases after each iteration . the noise reduces the risk that the system gets trapped in local optima . at some stage , the system converges to a stable state , which can be an arbitrarily good approximation of the maximum of @xmath247 , depending on how many states were explored and how slowly @xmath19 is varied . simulated annealing was first employed for modularity optimization by guimer et al . its standard implementation  @xcite combines two types of `` moves '' : local moves , where a single vertex is shifted from one cluster to another , taken at random ; global moves , consisting of mergers and splits of communities . splits can be carried out in several distinct ways . the best performance is achieved if one optimizes the modularity of a bipartition of the cluster , taken as an isolated graph . this is done again with simulated annealing , where one considers only individual vertex movements , and the temperature is decreased until it reaches the running value for the global optimization . global moves reduce the risk of getting trapped in local minima and they have proven to lead to much better optima than using simply local moves  @xcite . in practical applications , one typically combines @xmath250 local moves with @xmath15 global ones in one iteration . the method can potentially come very close to the true modularity maximum , but it is slow . the actual complexity can not be estimated , as it heavily depends on the parameters chosen for the optimization ( initial temperature , cooling factor ) , not only on the graph size . simulated annealing can be used for small graphs , with up to about @xmath251 vertices . extremal optimization ( eo ) is a heuristic search procedure proposed by boettcher and percus  @xcite , in order to achieve an accuracy comparable with simulated annealing , but with a substantial gain in computer time . it is based on the optimization of local variables , expressing the contribution of each unit of the system to the global function at study . this technique was used for modularity optimization by duch and arenas  @xcite . modularity can be indeed written as a sum over the vertices : the local modularity of a vertex is the value of the corresponding term in this sum . a fitness measure for each vertex is obtained by dividing the local modularity of the vertex by its degree , as in this case the measure does not depend on the degree of the vertex and is suitably normalized . one starts from a random partition of the graph in two groups with the same number of vertices . at each iteration , the vertex with the lowest fitness is shifted to the other cluster . the move changes the partition , so the local fitnesses of many vertices need to be recalculated . the process continues until the global modularity @xmath90 can not be improved any more by the procedure . this technique reminds one of the kernighan - lin  @xcite algorithm for graph partitioning ( section  [ sec4_1 ] ) , but here the sizes of the communities are determined by the process itself , whereas in graph partitioning they are fixed from the beginning . after the bipartition , each cluster is considered as a graph on its own and the procedure is repeated , as long as @xmath90 increases for the partitions found . the procedure , as described , proceeds deterministically from the given initial partition , as one shifts systematically the vertex with lowest fitness , and is likely to get trapped in local optima . better results can be obtained if one introduces a probabilistic selection , in which vertices are ranked based on their fitness values and one picks the vertex of rank @xmath91 with the probability @xmath252 ( @xmath253-eo , @xcite ) . the algorithm finds very good estimates of the modularity maximum , and performs very well on the benchmark of girvan and newman  @xcite ( section  [ sec6_1 ] ) . ranking the fitness values has a cost @xmath254 , which can be reduced to @xmath20 if heap data structures are used . choosing the vertex to be shifted can be done with a binary search , which amounts to an additional factor @xmath255 . finally , the number of steps needed to verify whether the running modularity maximum can be improved or not is also @xmath20 . the total complexity of the method is then @xmath128 . we conclude that eo represents a good tradeoff between accuracy and speed , although the use of recursive bisectioning may lead to poor results on large networks with many communities . modularity can be optimized using the eigenvalues and eigenvectors of a special matrix , the modularity matrix @xmath256 , whose elements are @xmath257 here the notation is the same used in eq . [ eq : mod ] . let @xmath130 be the vector representing any partition of the graph in two clusters @xmath258 and @xmath259 : @xmath260 if vertex @xmath67 belongs to @xmath258 , @xmath261 if @xmath67 belongs to @xmath259 . modularity can be written as @xmath262 the last expression indicates standard matrix products . the vector @xmath130 can be decomposed on the basis of eigenvectors @xmath263 ( @xmath140 ) of the modularity matrix @xmath256 : @xmath264 , with @xmath265 . by plugging this expression of @xmath130 into eq . [ eqr5 ] one finally gets @xmath266 where @xmath267 is the eigenvalue of @xmath256 corresponding to the eigenvector @xmath263 . [ eqr6 ] is analogous to eq . [ eqr1 ] for the cut size of the graph partitioning problem . this suggests that one can optimize modularity on bipartitions via spectral bisection ( section  [ sec4_1 ] ) , by replacing the laplacian matrix with the modularity matrix  @xcite . like the laplacian matrix , @xmath256 has always the trivial eigenvector @xmath268 with eigenvalue zero , because the sum of the elements of each row / column of the matrix vanishes . from eq . [ eqr6 ] we see that , if @xmath256 has no positive eigenvalues , the maximum coincides with the trivial partition consisting of the graph as a single cluster ( for which @xmath269 ) , i.  e. it has no community structure . otherwise , one has to look for the eigenvector of @xmath10 with largest ( positive ) eigenvalue , @xmath270 , and group the vertices according to the signs of the components of @xmath270 , just like in section  [ sec4_1 ] . here , however , one does not need to specify the sizes of the two groups : the vertices with positive components are all in one group , the others in the other group . if , for example , the component of @xmath270 corresponding to vertex @xmath67 is positive , but we set @xmath261 , the modularity is lower than by setting @xmath260 . the values of the components of @xmath270 are also informative , as they indicate the level of the participation of the vertices to their communities . in particular , components whose values are close to zero lie at the border between the two clusters and can be well considered as belonging to both of them . the result obtained from the spectral bipartition can be further improved by shifting single vertices from one community to the other , such to have the highest increase ( or lowest decrease ) of the modularity of the resulting graph partition . this refinement technique , similar to the kernighan - lin algorithm ( section  [ sec4_1 ] ) , can be also applied to improve the results of other optimization techniques ( e.g. greedy algorithms , extremal optimization , etc . ) . the procedure is repeated for each of the clusters separately , and the number of communities increases as long as modularity does . at variance with graph partitioning , where one needs to fix the number of clusters and their size beforehand , here there is a clear - cut stopping criterion , represented by the fact that cluster subdivisions are admitted only if they lead to a modularity increase . we stress that modularity needs to be always computed from the full adjacency matrix of the original graph . the drawback of the method is similar as for spectral bisection , i.  e. the algorithm gives the best results for bisections , whereas it is less accurate when the number of communities is larger than two . recently , sun et al . @xcite have added a step after each bipartition of a cluster , in that single vertices can be moved from one cluster to another and even form the seeds of new clusters . we remark that the procedure is different from the kernighan - lin - like refining steps , as here the number of clusters can change . this variant , which does not increase the complexity of the original spectral optimization , leads to better modularity maxima . moreover , one does not need to stick to bisectioning , if other eigenvectors with positive eigenvalues of the modularity matrix are used . given the first @xmath45 eigenvectors , one can construct @xmath15 @xmath45-dimensional vectors , each corresponding to a vertex , just like in spectral partitioning ( section  [ sec4_4 ] ) . the components of the vector of vertex @xmath67 are proportional to the @xmath45 entries of the eigenvectors in position @xmath67 . then one can define _ community vectors _ , by summing the vectors of vertices in the same community . it is possible to show that , if the vectors of two communities form an angle larger that @xmath271 , keeping the communities separate yields larger modularity than if they are merged ( fig .  [ qspectra_plane ] ) . in this way , in a @xmath45-dimensional space the modularity maximum corresponds to a partition in at most @xmath272 clusters . community vectors were used by wang et al . to obtain high - modularity partitions into a number of communities smaller than a given maximum  @xcite . in particular , if one takes the eigenvectors corresponding to the two largest eigenvalues , one can obtain a split of the graph in three clusters : in a recent work , richardson et al . presented a fast technique to obtain graph tripartitions with large modularity along these lines  @xcite . the eigenvectors with the most negative eigenvalues can also be used to extract useful information , like the presence of a possible multipartite structure of the graph , as they give the most relevant contribution to the modularity minimum . the spectral optimization of modularity is quite fast . the leading eigenvector of the modularity matrix can be computed with the power method , by repeatedly multiplying @xmath256 by an arbitrary vector ( not orthogonal to @xmath270 ) . the number of required iterations to reach convergence is @xmath20 . each multiplication seems to require a time @xmath129 , as @xmath256 is a complete matrix , but the peculiar form of @xmath256 allows for a much quicker calculation , taking time @xmath273 . so , a graph bipartition requires a time @xmath274 $ ] , or @xmath129 on a sparse graph . to find the modularity optimum one needs a number of subsequent bipartitions that equals the depth @xmath88 of the resulting hierarchical tree . in the worst - case scenario , @xmath275 , but in practical cases the procedure usually stops much before reaching the leaves of the dendrogram , so one could go for the average value @xmath276 , for a total complexity of @xmath128 . the algorithm is faster than extremal optimization and it is also slightly more accurate , especially for large graphs . the modularity matrix and the corresponding spectral optimization can be trivially extended to weighted graphs . spectral optimization of modularity by newman  @xcite . by using the first two eigenvectors of the modularity matrix , vertices can be represented as points on a plane . by cutting the plane with a line passing through the origin ( like the dashed line in the figure ) one obtains bipartitions of the graph with possibly high modularity values . reprinted figure with permission from ref . 2006 by the american physical society . ]    a different spectral approach had been previously proposed by white and smyth  @xcite . let @xmath190 indicate the weighted adjancency matrix of a graph @xmath23 . a partition of @xmath23 in @xmath44 clusters can be described through an @xmath186 assignment matrix @xmath277 , where @xmath278 if vertex @xmath67 belongs to cluster @xmath117 , otherwise @xmath279 . it can be easily shown that , up to a multiplicative constant , modularity can be rewritten in terms of the matrix @xmath277 as @xmath280= -\mbox{tr}[{\bf x}^t{\bf { l}_q}{\bf x } ] , \label{eqr7}\ ] ] where @xmath281 is a diagonal matrix with identical elements , equal to the sum of all edge weights , and the entries of @xmath282 are @xmath283 , where @xmath105 is the degree of vertex @xmath67 . the matrix @xmath284 is called the @xmath90-laplacian . finding the assignment matrix @xmath277 that maximizes @xmath90 is an @xmath285-complete problem , but one can get a good approximation by relaxing the constraint that the elements of @xmath277 have to be discrete . by doing so @xmath90 becomes a sort of continuous functional of @xmath277 and one can determine the extremes of @xmath90 by setting its first derivative ( with respect to @xmath277 ) to zero . this leads to the eigenvalue problem @xmath286 here @xmath287 is a diagonal matrix . [ eqr8 ] turns modularity maximization into a spectral graph partitioning problem ( section  [ sec4_4 ] ) , using the @xmath90-laplacian matrix . a nice feature of the @xmath90-laplacian is that , for graphs which are not too small , it can be approximated ( up to constant factors ) by the transition matrix @xmath288 , obtained by normalizing @xmath190 such that the sum of the elements of each row equals one . [ eqr8 ] is at the basis of the algorithms developed by white and smyth , which search for partitions with at most @xmath289 clusters , where @xmath289 is a predefined input parameter that may be suggested by preliminary information on the graph cluster structure . the first @xmath290 eigenvectors of the transition matrix @xmath288 ( excluding the trivial eigenvector with all equal components ) can be computed with a variant of the lanczos method  @xcite . since the eigenvector components are not integer , the eigenvectors do not correspond directly to a partition of the graph in clusters . however , as usual in spectral graph partitioning , the components of the eigenvectors can be used as coordinates of the graph vertices in an euclidean space and @xmath44-means clustering is applied to obtain the desired partition . white and smyth proposed two methods to derive the clustering after embedding the graph in space . both methods have a worst - case complexity @xmath291 , which is essentially linear in the number of vertices of the graph if the latter is sparse and @xmath292 . however , on large and sparse graphs , @xmath289 could scale with the number of vertices @xmath15 , so the procedure might become quite slow . in order to speed up calculations without losing much accuracy in the final estimates of the maximum modularity , ruan and zhang  @xcite have proposed an algorithm , called _ kcut _ , that applies recursively the method by white and smyth , in a slightly modified form : after a first application to the full graph , in the next iteration the method is applied to all clusters of the first partition , treated as independent networks , and so on . the procedure goes on as long as the modularity of the resulting partitions keeps growing . the advantage of _ kcut _ is that one can play with low values for the ( maximal ) number of clusters @xmath293 at each iteration ; if partitions are balanced , after @xmath294 levels of recursions , the number of clusters of the partition is approximately @xmath295 . therefore the complexity of _ kcut _ is @xmath296 $ ] for a final partition in ( at most ) @xmath289 clusters , which is much lower than the complexity of the algorithm by white and smyth . ruan and zhang tested _ kcut _ on artificial graphs generated with the planted @xmath293-partition model ( section  [ sec6 ] ) , and on real networks including zachary s karate club  @xcite , the american college football network  @xcite and two collaboration networks of jazz musicians  @xcite and physicists  @xcite : the accuracy of _ kcut _ is comparable to that of the algorithm by white and smyth , though generally lower . agarwal and kempe have suggested to maximize modularity within the framework of mathematical programming  @xcite . in fact , modularity optimization can be formulated both as a linear and as a quadratic program . in the first case , the variables are defined on the links : @xmath297 if @xmath67 and @xmath68 are in the same cluster , otherwise @xmath298 . the modularity of a partition , up to a multiplicative constant , can then be written as @xmath299 where @xmath256 is the modularity matrix defined by newman ( see section  [ sub_sec6_0_4 ] ) . [ eqr9 ] is linear in the variables @xmath300 , which must obey the constraint @xmath301 , because , if @xmath67 and @xmath68 are in the same cluster , and so are @xmath67 and @xmath44 , then @xmath68 and @xmath44 must be in that cluster too . maximizing the expression in eq . [ eqr9 ] under the above constraint is @xmath285-hard , if the variables have to be integer as required . however , if one relaxes this condition by using real - valued @xmath300 , the problem can be solved in polynomial time  @xcite . on the other hand , the solution does not correspond to an actual partition , as the @xmath302 variables are fractional . to get clusters out of the @xmath300 one needs a rounding step . the values of the @xmath302 variables are used as sort of distances in a metric space ( the triangular inequality is satisfied by construction ) : clusters of vertices `` close '' enough to each other ( i.  e. whose mutual @xmath302 variables are close to zero ) are formed and removed until each vertex is assigned to a cluster . the resulting partition is further refined with the same post - processing technique used by newman for the spectral optimization of modularity , i.  e. by a sequence of steps similar to those of the algorithm by kernighan and lin ( see section  [ sub_sec6_0_4 ] ) . quadratic programming can be used to get bisections of graphs with high modularity , that can be iterated to get a whole hierarchy of partitions as in newman s spectral optimization . one starts from one of the identities in eq . [ eqr5 ] @xmath303 where @xmath304 , depending on whether the vertex belongs to the first or the second cluster . since the optimization of the expression in eq . [ eqr10 ] is @xmath285-complete , one must relax again the constraint on the variables @xmath155 being integer . a possibility is to transform each @xmath155 into an @xmath15-dimensional vector @xmath305 and each product in the scalar product between vectors . the vectors are normalized so that their tips lie on the unit - sphere of the @xmath15-dimensional space . this vector problem is polynomially solvable , but one needs a method to associate a bipartition to the set of @xmath15 vectors of the solution . any @xmath306-dimensional hyperplane centered at the origin cuts the space in two halves , separating the vectors in two subsets . one can then choose multiple random hyperplanes and pick the one which delivers the partition with highest modularity . as in the linear program , a post - processing technique  la newman ( see section  [ sub_sec6_0_4 ] ) is used to improve the results of the procedure . the two methods proposed by agarwal and kempe are strongly limited by their high computational complexity , due mostly to the large storage demands , making graphs with more than @xmath251 vertices intractable . on the other hand , the idea of applying mathematical programming to graph clustering is promising . the code of the algorithms can be downloaded from http://www - scf.usc.edu/@xmath215gaurava/. in a recent work  @xcite , xu et al . have optimized modularity using mixed - integer mathematical programming , with both integer and continuous variables , obtaining very good approximations of the modularity optimum , at the price of high computational costs . chen et al . have used integer linear programming to transform the initial graph into an optimal target graph consisting of disjoint cliques , which effectively yields a partition  @xcite . berry et al . have formulated the problem of graph clustering as a _ facility location problem _ @xcite , consisting in the minimization of a cost function based on a local variation of modularity  @xcite . lehmann and hansen  @xcite optimized modularity via mean field annealing  @xcite , a deterministic alternative to simulated annealing  @xcite . the method uses gibbs probabilities to compute the conditional mean value for the variable of a vertex , which indicates its community membership . by making a mean field approximation on the variables of the other vertices in the gibbs probabilities one derives a self - consistent set of non - linear equations , that can be solved by iteration in a time @xmath307 $ ] . the method yields better modularity maxima than the spectral optimization by newman ( section  [ sub_sec6_0_4 ] ) , at least on artificial graphs with built - in community structure , similar to the benchmark graphs by girvan and newman ( section  [ sec6_1 ] ) . genetic algorithms  @xcite have also been used to optimize modularity . in a standard genetic algorithm one has a set of candidate solutions to a problem , which are numerically encoded as chromosomes , and an objective function to be optimized on the space of solutions . the objective function plays the role of biological fitness for the chromosomes . one usually starts from a random set of candidate solutions , which are progressively changed through manipulations inspired by biological processes regarding real chromosomes , like point mutation ( random variations of some parts of the chromosome ) and crossing over ( generating new chromosomes by merging parts of existing chromosomes ) . then , the fitness of the new pool of candidates is computed and the chromosomes with the highest fitness have the greatest chances to survive in the next generation . after several iterations only solutions with large fitness survive . in a work by tasgin et al . @xcite , partitions are the chromosomes and modularity is the fitness function . with a suitable choice of the algorithm parameters , like the number of chromosomes and the rates of mutation and crossing over , tasgin et al . could obtain results of comparative quality as greedy modularity optimization on zachary s karate club  @xcite , the college football network  @xcite and the benchmark by girvan and newman ( section  [ sec6_1 ] ) . genetic algorithms were also adopted by liu et al . @xcite . here the maximum modularity partition is obtained via successive bipartitions of the graph , where each bipartition is determined by applying a genetic algorithm to each subgraph ( starting from the original graph itself ) , which is considered isolated from the rest of the graph . a bipartition is accepted only if it increases the total modularity of the graph . in section  [ sec3_2_2 ] we have seen that the modularity maximum is obtained for the partition that minimizes the difference between the cut size and the expected cut size of the partition ( eq .  [ eqr12 ] ) . in the complete weighted graph @xmath308 such that the weight @xmath309 of an edge is @xmath310 , if @xmath67 and @xmath68 are connected in @xmath23 , and @xmath311 if they are not , the difference @xmath312 is simply the cut size of partition @xmath94 . so , maximizing modularity for @xmath313 is equivalent to the problem of finding the partition with minimal cut size of the weighted graph @xmath308 , i.  e. to a graph partitioning problem . the problem can then be efficiently solved by using existing software for graph partitioning  @xcite .      in the most recent literature on graph clustering several modifications and extensions of modularity can be found . they are usually motivated by specific classes of clustering problems and/or graphs that one may want to analyze . modularity can be easily extended to graphs with weighted edges  @xcite . one needs to replace the degrees @xmath105 and @xmath106 in eq . [ eq : mod ] with the strengths @xmath314 and @xmath315 of vertices @xmath67 and @xmath68 . we remind that the strength of a vertex is the sum of the weights of edges adjacent to the vertex ( section  [ sec1_1 ] ) . for a proper normalization , the number of edges @xmath14 in eq . [ eq : mod ] has to be replaced by the sum @xmath86 of the weights of all edges . the product @xmath316 is now the expected weight of the edge @xmath219 in the null model of modularity , which has to be compared with the actual weight @xmath317 of that edge in the original graph . this can be understood if we consider the case in which all weights are multiples of a unit weight , so they can be rewritten as integers . the weight of the connection between two nodes can then be replaced by as many edges between the nodes as expressed by the number of weight units . for the resulting multigraph we can use the same procedure as in the case of unweighted graphs , which leads to the formally identical expression @xmath318 which can be also written as a sum over the modules @xmath319 , \label{eq : mod20}\ ] ] where @xmath320 is the sum of the weights of the internal edges of module @xmath117 and @xmath321 is the sum of the strengths of the vertices of @xmath117 . if edge weights are not mutually commensurable , one can always represent them as integers with good approximation , provided a sufficiently small weight unit is adopted , so the expressions for weighted modularity of eqs . [ eq : mod2 ] , [ eq : mod20 ] are generally valid . in principle , weights can be assigned to the edges of an undirected graph , by using any measure of similarity / correlation between the vertices ( like , e. g. , the measures introduced in section  [ sec3_1_4 ] ) . in this way , one could derive the corresponding weighted modularity and use it to detect communities , with a potentially better exploitation of the structural information of the graph as compared to standard modularity  @xcite . modularity has also a straightforward extension to the case of directed graphs  @xcite . if an edge is directed , the probability that it will be oriented in either of the two possible directions depends on the in- and out - degrees of the end - vertices . for instance , taken two vertices @xmath9 and @xmath10 , where @xmath9 ( @xmath10 ) has a high ( low ) indegree and low ( high ) outdegree , in the null model of modularity an edge will be much more likely to point from @xmath10 to @xmath9 than from @xmath9 to @xmath10 . therefore , the expression of modularity for directed graphs reads @xmath322 where the factor @xmath323 in the denominator of the second summand has been dropped because the sum of the indegrees ( outdegrees ) equals @xmath14 , whereas the sum of the degrees of the vertices of an undirected graph equals @xmath109 ; the factor @xmath323 in the denominator of the prefactor has been dropped because the number of non - vanishing elements of the adjacency matrix is @xmath14 , not @xmath109 as in the symmetric case of an undirected graph . if a graph is both directed and weighted , formulas [ eq : mod2 ] and [ eq : mod3 ] can be combined as @xmath324 which is the most general ( available ) expression of modularity  @xcite . kim et al . @xcite have remarked that the directed modularity of eq . [ eq : mod3 ] may not properly account for the directedness of the edges ( fig . [ directedq ] ) , and proposed a different definition based on diffusion on directed graphs , inspired by google s pagerank algorithm  @xcite . rosvall and bergstrom raised similar objections  @xcite . problem of the directed modularity introduced by arenas et al . the two situations illustrated are equivalent for modularity , as vertices @xmath9 and @xmath325 , as well as @xmath10 and @xmath326 , have identical indegrees and outdegrees . in this way , the optimization of directed modularity is not able to distinguish a situation in which there is directed flow ( top ) or not ( bottom ) . reprinted figure with permission from ref . @xcite.,width=340 ]    if vertices may belong to more clusters , it is not obvious how to find a proper generalization of modularity . in fact , there is no unique recipe . shen et al . @xcite , for instance , suggested the simple definition @xmath327 here @xmath328 is the number of communities including vertex @xmath67 . the contribution of each edge to modularity is then the smaller , the larger the number of communities including its endvertices . nicosia et al . @xcite have made some more general considerations on the problem of extending modularity to the case of overlapping communities . they considered the case of directed unweighted networks , starting from the following general expression @xmath329 , \label{eq : mod8}\ ] ] where @xmath330 and @xmath331 are the indegree and outdegree of vertices @xmath67 and @xmath68 , the index @xmath117 labels the communities and @xmath332 , @xmath333 express the contributions to the sum corresponding to the edge @xmath219 in the network and in the null model , due to the multiple memberships of @xmath67 and @xmath68 . if there is no overlap between the communities , @xmath334 , where @xmath335 and @xmath336 correspond to the communities of @xmath67 and @xmath68 . in this case , the edge @xmath219 contributes to the sum only if @xmath337 , as in the original definition of modularity . for overlapping communities , the coefficients @xmath332 , @xmath333 must depend on the membership coefficients @xmath338 , @xmath339 of vertices @xmath67 and @xmath68 . one can assume that @xmath340 , where @xmath341 is some function . the term @xmath333 is related to the null model of modularity , and it must be handled with care . in modularity s original null model edges are formed by joining two random stubs , so one needs to define the membership of a random stub in the various communities . if we assume that there is no correlation _ a priori _ between the membership coefficients of any two vertices , we can assign to a stub originating from a vertex @xmath67 in community @xmath117 the average membership corresponding to all edges which can be formed with @xmath67 . on a directed graph we have to distinguish between outgoing and incoming stubs , so one has @xmath342 @xmath343 and one can write the following general expression for modularity @xmath344 . \label{eq : mod11}\ ] ] the question now concerns the choice of the function @xmath345 . if the formula of eq . [ eq : mod11 ] is to be an extension of modularity to the case of overlapping communities , it has to satisfy some general properties of classical modularity . for instance , the modularity value of a cover consisting of the whole network as a single cluster should be zero . it turns out that a large class of functions yield an expression for modularity that fulfills this requirement . otherwise , the choice of @xmath341 is rather arbitrary and good choices can be only tested _ a posteriori _ , based on the results of the optimization . membership coefficients are also present in an extension of modularity to overlapping communities proposed by shen et al . @xcite . here the membership coefficient of vertex @xmath29 in community @xmath117 is a sum over the edges of @xmath29 belonging to @xmath117 , where each edge has a weight proportional to the number of maximal cliques of @xmath117 containing the edge . gaertler et al . have introduced quality measures based on modularity s principle of the comparison between a variable relative to the original graph and the corresponding variable of a null model  @xcite . they remark that modularity is just the difference between the coverage of a partition and the expected coverage of the partition in the null model . we remind that the coverage of a partition is the ratio between the number of edges within clusters and the total number of edges ( section  [ sec3_2_2 ] ) . based on this observation , gaertler et al . suggest that the comparison between the two terms can be done with other binary operations as well . for instance , one could consider the ratio @xmath346 where the notation is the same as in eq . [ eq : mod1 ] . this can be done as well for any variable other than coverage . by using performance , for instance , ( section  [ sec3_2_2 ] ) one obtains two new quality functions @xmath347 and @xmath348 , corresponding to taking the difference or the ratio between performance and its null model expectation value , respectively . gaertler et al . compared the results obtained with the four functions @xmath349 , @xmath350 , @xmath347 and @xmath348 , on a class of benchmark graphs with built - in cluster structure ( section  [ sec6_1 ] ) and social networks . they found that the `` absolute '' variants @xmath351 and @xmath347 are better than the `` relative '' variants @xmath350 and @xmath348 on the artificial benchmarks , whereas @xmath348 is better on social networks . furthermore @xmath347 is better than the standard modularity @xmath351 . modifications of modularity s null model have been introduced by massen and doye  @xcite and muff et al . massen and doye s null model is still a graph with the same expected degree sequence as the original , and with edges rewired at random among the vertices , but one imposes the additional constraint that there can be neither multiple edges between a pair of vertices nor edges joining a vertex with itself ( loops or self - edges ) . this null model is more realistic , as multiple edges and loops are usually absent in real graphs . the maximization of the corresponding modified modularity yields partitions with smaller average cluster size than standard modularity . the latter tends to disfavor small communities , because the actual densities of edges inside small communities hardly exceed the null model densities , which are appreciably enhanced by the contributions from multiple connections and loops . muff et al . proposed a local version of modularity , in which the expected number of edges within a module is not calculated with respect to the full graph , but considering just a portion of it , namely the subgraph including the module and its neighbouring modules . their motivation is the fact that modularity s null model implicitly assumes that each vertex could be attached to any other , whereas in real cases a cluster is usually connected to few other clusters . on a directed graph , their _ localized modularity _ @xmath352 reads @xmath353 . \label{eqr16}\ ] ] in eq . [ eqr16 ] @xmath116 is the number of edges inside cluster @xmath117 , @xmath354 ( @xmath355 ) the total internal ( external ) degree of cluster @xmath117 and @xmath356 the total number of edges in the subgraph comprising cluster @xmath117 and its neighbor clusters . the localized modularity is not bounded by @xmath2 , but can take any value . its maximization delivers more accurate partitions than standard modularity optimization on a model network describing the social interactions between children in a school ( school network ) and on the metabolic and protein - protein interaction networks of _ e. coli_.    reichardt and bornholdt have shown that it is possible to reformulate the problem of community detection as the problem of finding the ground state of a spin glass model  @xcite . each vertex @xmath67 is labeled by a potts spin variable @xmath357 , which indicates the cluster including the vertex . the basic principle of the model is that edges should connect vertices of the same class ( i.  e. same spin state ) , whereas vertices of different classes ( i.  e. different spin states ) should be disconnected ( ideally ) . so , one has to energetically favor edges between vertices in the same class , as well as non - edges between vertices in different classes , and penalize edges between vertices of different classes , along with non - edges between vertices in the same class . the resulting hamiltonian of the spin model is @xmath358 where @xmath359 is a constant expressing the coupling strength , @xmath360 are the elements of the adjacency matrix of the graph , @xmath361 a parameter expressing the relative contribution to the energy from existing and missing edges , and @xmath362 is the expected number of links connecting @xmath67 and @xmath68 for a null model graph with the same total number of edges @xmath14 of the graph considered . the system is a spin glass  @xcite , as the couplings @xmath363 between spins are both ferromagnetic ( on the edges of the graph , provided @xmath364 ) and antiferromagnetic ( between disconnected vertices , as @xmath365 and @xmath366 ) . the multiplicative costant @xmath359 is irrelevant for practical purposes , so in the following we set @xmath367 . the range of the spin - spin interaction is infinite , as there is a non - zero coupling between any pair of spins . [ eqr13 ] bears a strong resemblance with the expression of modularity of eq . [ eq : mod ] . in fact , if @xmath368 and @xmath369 we recover exactly modularity , up to a factor @xmath370 . in this case , finding the spin configuration for which the hamiltonian is minimal is equivalent to maximizing modularity . [ eqr13 ] is much more general than modularity , though , as both the null model and the parameter @xmath371 can be arbitrarily chosen . in particular , the value of @xmath371 determines the importance of the null model term @xmath362 in the quality function . .  [ eqr13 ] can be rewritten as @xmath372=-\sum_{s=1}c_{ss}\\ & = & \sum_{s < r}\left[l_{rs}-\gamma(l_{rs})_{p_{ij}}\right]=\sum_{s < r}a_{rs}. \label{eqr14}\end{aligned}\ ] ] here , the sums run over the clusters : @xmath373 and @xmath374 indicate the number of edges within cluster @xmath155 and between clusters @xmath375 and @xmath155 , respectively ; @xmath376 and @xmath377 are the corresponding null model expectation values . [ eqr14 ] defines the coefficients @xmath378 of _ cohesion _ and @xmath379 of _ adhesion_. if a subset of a cluster @xmath155 has a larger coefficient of adhesion with another cluster @xmath375 than with its complement in @xmath155 , the energy can be reduced by merging the subset with cluster @xmath375 . in the particular case in which the coefficient of adhesion of a subset @xmath380 of a cluster @xmath155 with its complement in the cluster exactly matches the coefficient of adhesion of @xmath380 with another cluster @xmath375 , the partitions in which @xmath380 stays within @xmath155 or is merged with @xmath375 have the same energy . in this case one can say that clusters @xmath375 and @xmath155 are overlapping . in general , the partition with minimum energy has the following properties : 1 ) every subset of each cluster has a coefficient of adhesion with its complement in the cluster not smaller than with any other cluster ; 2 ) every cluster has non - negative coefficient of cohesion ; 3 ) the coefficient of adhesion between any two clusters is non - positive .    by tuning the parameter @xmath371 one can vary the number of clusters in the partition with minimum energy , going from a single cluster comprising all vertices ( @xmath381 ) , to @xmath15 clusters with a single vertex ( @xmath382 ) . so , @xmath371 is a resolution parameter that allows to explore the cluster structure of a graph at different scales ( see section  [ sub_sec6_1 ] ) . the authors used single spin heatbath simulated annealing algorithms to find the ground state of the hamiltonian of eq . [ eqr13 ] . another generalization of modularity was recently suggested by arenas et al . they remarked that the fundamental unit to define modularity is the edge , but that high edge densities inside clusters usually imply the existence of long - range topological correlations between vertices , which are revealed by the presence of _ motifs _ @xcite , i.  e. connected undirected subgraphs , like cycles ( section  [ sec1_1 ] ) . for instance , a high edge density inside a cluster usually means that there are also several triangles in the cluster , and comparatively few between clusters , a criterion that has inspired on its own popular graph clustering algorithms  @xcite . modularity can then be simply generalized by comparing the density of motifs inside clusters with the expected density in modularity s null model ( _ motif modularity _ ) . as a particular case , the _ triangle modularity _ of a partition @xmath22 reads @xmath383 where @xmath384 ( @xmath385 is the label of the cluster @xmath67 belongs to ) , @xmath386 ( @xmath105 is the degree of vertex @xmath67 ) and @xmath387 . if one chooses as motifs paths with even length , and removes the constraint that all vertices of the motif / path should stay inside the same cluster , maximizing motif modularity could reveal the existence of multipartite structure . for example , if a graph is bipartite , one expects to see many @xmath323-paths starting from one vertex class and returning to it from the other class . motif modularity can be trivially extended to the case of weighted graphs . several graphs representing real systems are built out of correlation data between elements . correlation matrices are very common in the study of complex systems : well - known examples are the correlations of price returns , which are intensively studied by economists and econophysicists  @xcite . correlations may be positive as well as negative , so the corresponding weighted edges indicate both attraction and repulsion between pairs of vertices . usually the correlation values are filtered or otherwise transformed such to eliminate the weakest correlations and anticorrelations and to maintain strictly positive weights for the edges , yielding graphs that can be treated with standard techniques . however , ignoring negative correlations means to give up useful information on the relationships between vertices . finding clusters in a graph with both positive and negative weights is called _ correlation clustering problem _ @xcite . according to intuition , one expects that vertices of the same cluster are linked by positive edges , whereas vertices of different clusters are linked by negative edges . the best cluster structure is the partition that maximizes the sum of the strengths ( in absolute value ) of positive edges within clusters and negative edges between clusters , or , equivalently , the partition that minimizes the sum of the strengths ( in absolute value ) of positive edges between clusters and negative edges within clusters . this can be formulated by means of modularity , if one accounts for the contribution of the negative edges . a natural way to proceed is to create two copies of the graph at study : in one copy only the weights of the positive edges are kept , in the other only the weights of the negative edges ( in absolute value ) . by applying eq . [ eq : mod2 ] to the same partition of both graphs , one derives the contributions @xmath388 and @xmath389 to the modularity of that partition for the original graph . gmez et al . define the global modularity as a linear combination of @xmath388 and @xmath389 , that accounts for the relative total strengths of positive and negative edge weights  @xcite . kaplan and forrest  @xcite have proposed a similar expression , with two important differences . first , they have used the total strength of the graph , i.  e. the sum of the absolute values of all weights , to normalize @xmath388 and @xmath389 ; gmez et al . instead have used the positive and the negative strengths , for @xmath388 and @xmath389 , respectively , which seems to be the more natural choice looking at eq . [ eq : mod2 ] . second , kaplan and forrest have given equal weight to the contributions of @xmath388 and @xmath389 to their final expression of modularity , which is just the difference @xmath390 . in another work , traag and bruggeman  @xcite have introduced negative links in the general spin glass formulation of modularity of reichardt and bornholdt  @xcite . here the relative importance of the contribution of positive and negative edge weights is a free parameter , the tuning of which allows to detect communities of various sizes and densities of positive / negative edges . some authors have pointed out that the original expression of modularity is not ideal to detect communities in bipartite graphs , which describe several real systems , like food webs  @xcite , scientific  @xcite and artistic  @xcite collaboration networks , etc .. expressions of modularity for bipartite graphs were suggested by guimer et al . @xcite and barber  @xcite . guimer et al . call the two classes of vertices actors and teams , and indicate with @xmath391 the degree of actor @xmath67 and @xmath392 the degree of team @xmath294 . the null model graphs are random graphs with the same expected degrees for the vertices , as usual . the bipartite modularity @xmath393 for a partition @xmath94 ( of the actors ) has the following expression @xmath394 . \label{eqr17}\ ] ] here , @xmath395 is the number of teams in which actors @xmath67 and @xmath68 are together and the sum @xmath396 gives the number of ordered pairs of actors in the same team . the second ratio of each summand is the null model term , indicating the expected ( normalized ) number of teams for pairs of actors in cluster @xmath117 . the bipartite modularity can also be applied to ( unipartite ) directed graphs : each vertex can be duplicated and assigned to both classes , based on its twofold role of source and target for the edges . another interesting alternative was introduced by barber  @xcite and is a simple extension of eq . [ eq : mod ] . let us suppose that the two vertex classes ( red and blue ) are made out of @xmath45 and @xmath91 vertices , respectively . the degree of a red vertex @xmath67 is indicated with @xmath105 , that of a blue vertex @xmath68 with @xmath397 . the adjacency matrix @xmath189 of the graph is in block off - diagonal form , as there are edges only between red and blue vertices . because of that , barber assumes that the null model matrix @xmath398 , whose element @xmath100 indicates as usual the expected number of edges between vertices @xmath67 and @xmath68 in the null model , also has the block off - diagonal form @xmath399 where the @xmath400 are square matrices with all zero elements and @xmath401 , as in the null model of standard modularity ( though other choices are possible ) . the modularity maximum can be computed through the modularity matrix @xmath402 , as we have seen in section  [ sub_sec6_0_4 ] . however , spectral optimization of modularity gives excellent results for bipartitions , while its performance worsens when the number of clusters is unknown , as it is usually the case . barber has proposed a different optimization technique , called bipartite recursively induced modules ( brim ) , based on the bipartite nature of the graph . the algorithm is based on the special expression of modularity for the bipartite case , for which once the partition of the red or the blue vertices is known , it is easy to get the partition of the other vertex class that yields the maximum modularity . therefore , one starts from an arbitrary partition in @xmath117 clusters of , say , the blue vertices , and recovers the partition of the red vertices , which is in turn used as input to get a better partition of the blue vertices , and so on until modularity converges . brim does not predict the number of clusters @xmath117 of the graph , but one can obtain good estimates for it by exploring different values with a simple bisection approach . typically , for a given @xmath117 the algorithm needs a few steps to converge , each step having a complexity @xmath21 . an expression of the number of convergence steps in terms of @xmath15 and/or @xmath14 still needs to be derived .      in this section we shall discuss some features of modularity , which are crucial to identify the domain of its applicability and ultimately to assess the issue of the reliability of the measure for the problem of graph clustering . an important question concerns the value of the maximum modularity @xmath403 for a graph . we know that it must be non - negative , as there is always at least a partition with zero modularity , consisting in a single cluster with all vertices ( section  [ sec3_2_2 ] ) . however , a large value for the modularity maximum does not necessarily mean that a graph has community structure . random graphs are supposed to have no community structure , as the linking probability between vertices is either constant or a function of the vertex degrees , so there is no bias _ a priori _ towards special groups of vertices . still , random graphs may have partitions with large modularity values  @xcite . this is due to fluctuations in the distribution of edges in the graph , which in many graph realizations is not homogeneous even if the linking probability is constant , like in erds - rnyi graphs . the fluctuations determine concentrations of links in some subsets of the graph , which then appear like communities . according to the definition of modularity , a graph has community structure with respect to a random graph with equal size and expected degree sequence . therefore , the modularity maximum of a graph reveals a significant community structure only if it is appreciably larger than the modularity maximum of random graphs of the same size and expected degree sequence . the significance of the modularity maximum @xmath403 for a graph can be estimated by calculating the maximum modularity for many realizations of the null model , obtained from the original graph by randomly rewiring its edges . one then computes the average @xmath404 and the standard deviation @xmath405 of the results . the statistical significance of @xmath403 is indicated by the distance of @xmath403 from the null model average @xmath404 in units of the standard deviation @xmath405 , i.  e. by the @xmath406-score @xmath407 if @xmath408 , @xmath403 indicates strong community structure . cutoff values of @xmath409 for the @xmath406-scores are customary . this approach has problems , though . it can generate both false positives and false negatives : a few graphs that most people would consider without a significant community structure have a large @xmath406-score ; on the other hand , some graphs that are agreed to display cluster structure have very low values for the @xmath406-score . besides , the distribution of the maximum modularity values of the null model , though peaked , is not gaussian . therefore , one can not attribute to the values of the @xmath406-score the significance corresponding to a gaussian distribution , and one would need instead to compute the statistical significance for the right distribution .    reichardt and bornholdt have studied the issue of the modularity values for random graphs in some depth  @xcite , using their general spin glass formulation of the clustering problem ( section  [ sub_sec6_01 ] ) . they considered the general case of a random graph with arbitrary degree distribution @xmath410 and without degree - degree correlations . they set @xmath368 , so that the energy of the ground state coincides with modularity ( up to a constant factor ) . for modularity s null model graphs , the modularity maximum corresponds to an equipartition of the graph , i.  e. the magnetization of the ground state of the spin glass is zero , a result confirmed by numerical simulations  @xcite . this is because the distribution of the couplings has zero mean , and the mean is only coupled to magnetization  @xcite . for a partition of any graph with @xmath15 vertices and @xmath14 edges in @xmath91 clusters with equal numbers of vertices , there is a simple linear relation between the cut size @xmath411 of the partition and its modularity @xmath412 : @xmath413 $ ] . we remind that the cut size @xmath411 is the total number of inter - cluster edges of the partition ( section  [ sec4_1 ] ) . in this way , the partition with maximum modularity is also the one with minimum cut size , and community detection becomes equivalent to graph partitioning . reichardt and bornholdt derived analytically the ground state energy for ising spins ( @xmath414 ) , which corresponds to the following expression of the expected maximum modularity @xmath415 for a bipartition  @xcite @xmath416 here @xmath417 and @xmath418 is the ground state energy of the sherrington - kirkpatrick model  @xcite . the most interesting feature of eq . [ eqr19 ] is the simple scaling with @xmath419 . numerical calculations show that this scaling holds for both erds - rnyi and scale - free graphs ( section  [ sec1_3 ] ) . interestingly , the result is valid for partitions in @xmath91 clusters , where @xmath91 is left free , not only for @xmath414 . the number of clusters of the partition with maximum modularity decreases if the average degree @xmath420 increases , and tends to @xmath421 for large values of @xmath420 , regardless of the degree distribution and the size of the graph . from eq . [ eqr19 ] we also see that the expected maximum modularity for a random graph increases when @xmath420 decreases , i. e. if the graph gets sparser . so it is particularly hard to detect communities in sparse graphs by using modularity optimization . as we shall see in section  [ sec6_4 ] , the sparsity of a graph is generally a serious obstacle for graph clustering methods , no matter if one uses modularity or not .    a more fundamental issue , raised by fortunato and barthlemy  @xcite , concerns the capability of modularity to detect `` good '' partitions . if a graph has a clear cluster structure , one expects that the maximum modularity of the graph reveals it . the null model of modularity assumes that any vertex @xmath67 `` sees '' any other vertex @xmath68 , and the expected number of edges between them is @xmath369 . similarly , the expected number of edges between two clusters @xmath258 and @xmath259 with total degrees @xmath422 and @xmath423 , respectively , is @xmath424 . the variation of modularity determined by the merger of @xmath258 and @xmath259 with respect to the partition in which they are separate clusters is @xmath425 , with @xmath426 number of edges connecting @xmath258 to @xmath259 . if @xmath427 , i.  e. there is a single edge joining @xmath258 to @xmath259 , we expect that the two subgraphs will often be kept separated . instead , if @xmath428 , @xmath429 . let us suppose for simplicity that @xmath430 , i.  e. that the two subgraphs are of about the same size , measured in terms of edges . we conclude that , if @xmath431 and the two subgraphs @xmath258 and @xmath259 are connected , modularity is greater if they are in the same cluster  @xcite . the reason is intuitive : if there are more edges than expected between @xmath258 and @xmath259 , there is a strong topological correlation between the subgraphs . if the subgraphs are sufficiently small ( in degree ) , the expected number of edges for the null model can be smaller than one , so even the weakest possible connection ( a single edge ) suffices to keep the subgraphs together . interestingly , this result holds independently of the structure of the subgraphs . in particular it remains true if the subgraphs are cliques , which are the subgraphs with the largest possible density of internal edges , and represent the strongest possible communities . resolution limit of modularity optimization . the natural community structure of the graph , represented by the individual cliques ( circles ) , is not recognized by optimizing modularity , if the cliques are smaller than a scale depending on the size of the graph . in this case , the maximum modularity corresponds to a partition whose clusters include two or more cliques ( like the groups indicated by the dashed contours ) . reprinted figure with permission from ref . 2007 from the national academy of science of the usa . ]    in fig . [ figure7 ] a graph is made out of @xmath115 identical cliques , with @xmath76 vertices each , connected by single edges . it is intuitive to think that the clusters of the best partition are the individual cliques : instead , if @xmath115 is larger than about @xmath432 , modularity would be higher for partitions in which the clusters are groups of cliques ( like the clique pairs indicated by the dashed lines in the figure ) . the conclusion is striking : modularity optimization has a resolution limit that may prevent it from detecting clusters which are comparatively small with respect to the graph as a whole , even when they are well defined communities like cliques . so , if the partition with maximum modularity includes clusters with total degree of the order of @xmath433 or smaller , one can not know _ a priori _ whether the clusters are single communities or combinations of smaller weakly interconnected communities . this resolution problem has a large impact in practical applications . real graphs with community structure usually contain communities which are very diverse in size  @xcite , so many ( small ) communities may remain undetected . besides , modularity is extremely sensitive to even individual connections . many real graphs , in biology and in the social sciences , are reconstructed through experiments and surveys , so edges may occasionally be false positives : if two small subgraphs happen to be connected by a few false edges , modularity will put them in the same cluster , inferring a relationship between entities that in reality may have nothing to do with each other . the resolution limit comes from the very definition of modularity , in particular from its null model . the weak point of the null model is the implicit assumption that each vertex can interact with every other vertex , which implies that each part of the graph knows about everything else . this is however questionable , and certainly wrong for large systems like , e.g. , the web graph . it is certainly more reasonable to assume that each vertex has a limited horizon within the graph , and interacts just with a portion of it . however , nobody knows yet how to define such local territories for the graph vertices . the null model of the localized modularity of muff et al . ( section  [ sub_sec6_01 ] ) is a possibility , since it limits the horizon of a vertex to a local neighborhood , comprising the cluster of the vertex and the clusters linked to it by at least one edge ( neighboring clusters ) . however , there are many other possible choices . in this respect , the null model of girvan and newman , though unrealistic , is the simplest one can think of , which partly explains its success . quality functions that , like modularity , are based on a null model such that the horizon of vertices is of the order of the size of the whole graph , are likely to be affected by a resolution limit  @xcite . the problem is more general , though . for instance , li et al . @xcite have introduced a quality function , called _ modularity density _ , which consists in the sum over the clusters of the ratio between the difference of the internal and external degrees of the cluster and the cluster size . the modularity density does not require a null model , and delivers better results than modularity optimization ( e. g. it correctly recovers the natural partition of the graph in fig . [ figure7 ] for any number / size of the cliques ) . however , it is still affected by a resolution limit . to avoid that , li et al . proposed a more general definition of their measure , including a tunable parameter that allows to explore the graph at different resolutions , in the spirit of the methods of section  [ sub_sec6_20 ] . a way to go around the resolution limit problem could be to perform further subdivisions of the clusters obtained from modularity optimization , in order to eliminate possible artificial mergers of communities . for instance , one could recursively optimize modularity for each single cluster , taking the cluster as a separate entity  @xcite . however , this is not a reliable procedure , for two reasons : 1 ) the local modularities used to find partitions within the clusters have different null models , as they depend on the cluster sizes , so they are inconsistent with each other ; 2 ) one needs to define a criterion to decide when one has to stop partitioning a cluster , but there is no obvious prescription , so any choice is necessarily based on arbitrary assumptions - score is sufficiently high , the subgraph is supposed to have community structure and one accepts the partition in smaller pieces . the procedure stops when none of the subgraphs of the running partitions has significant community structure , based on modularity . ] . resolution limits arise as well in the more general formulation of community detection by reichardt and bornholt  @xcite . here the limit scale for the undetectable clusters is @xmath434 . we remind that @xmath371 weighs the contribution of the null model term in the quality function . for @xmath368 one recovers the resolution limit of modularity . by tuning the parameter @xmath371 it is possible to arbitrarily vary the resolution scale of the corresponding quality function this in principle solves the problem of the resolution limit , as one could adjust the resolution of the method to the actual scale of the communities to detect . the problem is that usually one has no information about the community sizes , so it is not possible to decide _ a priori _ the proper value(s ) of @xmath371 for a specific graph . in the most recent literature on graph clustering quite a few _ multiresolution methods _ have been introduced , addressing this problem in several ways . we will discuss them in some detail in section  [ sub_sec6_20 ] . the resolution limit can be easily extended to the case of weighted graphs . in a recent paper  @xcite , berry et al . have considered the special case in which intracluster edges have weight @xmath2 , whereas intercluster edges have weight @xmath435 . by repeating the same procedure as in ref . @xcite , they conclude that clusters with internal strength ( i. e. sum of all weights of internal edges ) @xmath436 may remain undetected if @xmath437 , where @xmath86 is the total strength of the graph . so , the resolution limit decreases when @xmath435 decreases . berry et al . use this result to show that , by properly weighting the edges of a given unweighted graph , it becomes possible to detect clusters with very high resolution by still using modularity optimization . low - dimensional visualization of the modularity landscape for the metabolic network of the spirochete _ treponema pallidum_. the big degeneracy of suboptimal high - modularity partitions is revealed by the plateau ( whose shape is detailed in the inset ) , which is large and very irregular . modularity values in the plateau are very close to the absolute maximum , although they may correspond to quite different partitions . reprinted figure with permission from ref . @xcite . ]    very recently , good et al . @xcite have made a careful analysis of modularity and its performance . they discovered that the modularity landscape is characterized by an exponential number of distinct states / partitions , whose modularity values are very close to the global maximum ( fig . [ figterr ] ) . this problem is particularly dramatic if a graph has a hierarchical community structure , like most real networks . such enormous number of solutions explains why many heuristics are able to come very close to modularity s global maximum , but it also implies that the global maximum is basically impossible to find . in addition , high - modularity partitions are not necessarily similar to each other , despite the proximity of their modularity scores . the optimal partition from a topological point of view , which usually does not correspond to the modularity maximum due to the resolution limit , may however have a large modularity score . therefore the optimal partition is basically indistinguishable from a huge number of high - modularity partitions , which are in general structurally dissimilar from it . the large structural inhomogeneity of the high - modularity partitions implies that one can not rely on any of them , at least in principle , in the absence of additional information on the particular system at hand and its structure . in sections  [ sec4_1 ] and [ sec4_4 ] we have learned that spectral properties of graph matrices are frequently used to find partitions . a paradigmatic example is spectral graph clustering , which makes use of the eigenvectors of laplacian matrices ( section  [ sec4_4 ] ) . we have also seen that newman - girvan modularity can be optimized by using the eigenvectors of the modularity matrix ( section  [ sub_sec6_0_4 ] ) . most spectral methods have been introduced and developed in computer science and generally focus on data clustering , although applications to graphs are often possible as well . in this section we shall review recent spectral techniques proposed mostly by physicists explicitly for graph clustering . early works have shown that the eigenvectors of the _ transfer matrix _ @xmath438 ( section  [ sec1_2 ] ) can be used to extract useful information on community structure . the transfer matrix acts as a time propagator for the process of random walk on a graph . given the eigenvector @xmath439 of the transposed transfer matrix @xmath440 , corresponding to the eigenvalue @xmath441 , @xmath442 is the outgoing current flowing from vertex @xmath67 , corresponding to the eigenmode @xmath18 . the _ participation ratio _ ( pr ) @xmath443^{-1 } \label{eqm19}\ ] ] indicates the effective number of vertices contributing to eigenvector @xmath439 . if @xmath444 receives contributions only from vertices of the same cluster , i.  e. eigenvector @xmath439 is `` localized '' , the value of @xmath444 indicates the size of that cluster  @xcite . the significance of the cluster can be assessed by comparing @xmath444 with the corresponding participation ratio for a random graph with the same expected degree sequence as the original graph . eigenvectors of the adjacency matrix may be localized as well if the graph has a clear community structure  @xcite . a recent comprehensive analysis of spectral properties of modular graphs has been carried out by mitrovi and tadi  @xcite . donetti and muoz have devised an elegant method based on the eigenvectors of the laplacian matrix  @xcite . the idea is the same as in spectral graph clustering ( section  [ sec4_4 ] ) : since the values of the eigenvector components are close for vertices in the same community , one can use them as coordinates , such that vertices turn into points in a metric space . so , if one uses @xmath445 eigenvectors , one can embed the vertices in an @xmath445-dimensional space . communities appear as groups of points well separated from each other , as illustrated in fig . [ figure8 ] . the separation is the more visible , the larger the number of dimensions / eigenvectors @xmath445 . spectral algorithm by donetti and muoz . vertex @xmath67 is represented by the values of the @xmath67th components of laplacian eigenvectors . in this example , the graph has an ad - hoc division in four communities , indicated by the colours . the communities are better separated in two dimensions ( b ) than in one ( a ) . reprinted figure with permission from ref . 2004 by iop publishing and sissa . ]    the originality of the method consists in the procedure to group the points and to extract the partition . donetti and muoz used hierarchical clustering ( see section  [ sec4_2 ] ) , with the constraint that only pairs of clusters which have at least one interconnecting edge in the original graph are merged . among all partitions of the resulting dendrogram , the one with largest modularity is chosen . for the similarity measure between vertices , donetti and muoz used both the euclidean distance and the angle distance . the angle distance between two points is the angle between the vectors going from the origin of the @xmath445-dimensional space to either point . tests on the benchmark by girvan and newman ( section  [ sec6_1 ] ) show that the best results are obtained with complete - linkage clustering . the most computationally expensive part of the algorithm is the calculation of the laplacian eigenvectors . since a few eigenvectors suffice to get good partitions , one can determine them with the lanczos method  @xcite . the number @xmath445 of eigenvectors that are needed to have a clean separation of the clusters is not known _ a priori _ , but one can compute a number @xmath446 of them and search for the highest modularity partition among those delivered by the method for all @xmath447 . in a related work , simonsen has embedded graph vertices in space by using as coordinates the components of the eigenvectors of the right stochastic matrix  @xcite . eigenvalues and eigenvectors of the laplacian matrix have been used by alves to compute the effective conductances for pairs of vertices in a graph , assuming that the latter is an electric network with edges of unit resistance  @xcite . the conductances enable one to compute the transition probabilities for a random walker moving on the graph , and from the transition probabilities one builds a similarity matrix between vertex pairs . hierarchical clustering is applied to join vertices in groups . the method can be trivially extended to the case of weighted graphs . the algorithm by alves is rather slow , as one needs to compute the whole spectrum of the laplacian , which requires a time @xmath154 . moreover , there is no criterion to select which partition(s ) of the dendrogram is ( are ) the best . capocci et al . @xcite used eigenvector components of the right stochastic matrix @xmath448 ( section  [ sec1_2 ] ) , that is derived from the adjacency matrix by dividing each row by the sum of its elements . the right stochastic matrix has similar properties as the laplacian . if the graph has @xmath126 connected components , the largest @xmath126 eigenvalues are equal to @xmath2 , with eigenvectors characterized by having equal - valued components for vertices belonging to the same component . in this way , by listing the vertices according to the connected components they belong to , the components of any eigenvector of @xmath448 , corresponding to eigenvalue @xmath2 , display a step - wise profile , with plateaus indicating vertices in the same connected component . for connected graphs with cluster structure , one can still see plateaus , if communities are only loosely connected to each other ( fig . [ capoccifig ] ) . basic principle of the spectral algorithm by capocci et al . the bottom diagram shows the values of the components of the second eigenvector of the right stochastic matrix for the graph drawn on the top . the three plateaus of the eigenvector components correspond to the three evident communities of the graph . reprinted figures with permission from ref . 2005 by elsevier.,title="fig : " ] 0.4 cm   basic principle of the spectral algorithm by capocci et al . the bottom diagram shows the values of the components of the second eigenvector of the right stochastic matrix for the graph drawn on the top . the three plateaus of the eigenvector components correspond to the three evident communities of the graph . reprinted figures with permission from ref . 2005 by elsevier.,title="fig : " ]    here the communities can be immediately deducted by an inspection of the components of any eigenvector with eigenvalue @xmath2 . in practical cases , plateaus are not clearly visible , and one eigenvector is not enough . however , one expects that there should be a strong correlation between eigenvector components corresponding to vertices in the same cluster . capocci et al . derived a similarity matrix , where the similarity between vertices @xmath67 and @xmath68 is the pearson correlation coefficient between their corresponding eigenvector components , averaged over a small set of eigenvectors . the eigenvectors can be calculated by performing a constrained optimization of a suitable cost function . the method can be extended to weighted and directed graphs . it is useful to estimate vertex similarities , however it does not provide a well - defined partition of the graph . yang and liu  @xcite adopted a recursive bisectioning procedure . communities are subgraphs such that the external degree of each vertex does not exceed the internal degree ( _ strong communities _ or _ @xmath49-sets _ , see section  [ sec3_1_2 ] ) . in the first step of the algorithm , the adjacency matrix of the graph is put in approximately block - diagonal form . this is done by computing a new centrality measure for the vertices , called _ clustering centrality_. this measure is similar to bonacich s eigenvector centrality  @xcite , which is given by the eigenvector of the adjacency matrix corresponding to the largest eigenvalue . the clustering centrality of a vertex basically measures the probability that a random walker starting at that vertex hits a given target . such probability is larger if the origin and the target vertices belong to the same cluster than if they do not . if the graph has well - separated communities , the values of the clustering centrality would be similar for vertices in the same cluster . in this way , one can rearrange the original adjacency matrix by listing the vertices in non - decreasing order of their clustering centralities , and blocks would be visible . the blocks are then identified by iterative bisection : each cluster found at some step is split in two as long as the resulting parts are still communities in the strong sense , otherwise the procedure stops . the worst - case complexity of the method is @xmath449 $ ] , where @xmath289 is the number of clusters of the final partition and @xmath156 the ( average ) number of iterations required to compute the clustering centrality with the power method  @xcite . since @xmath156 is fairly independent of the graph size , the method scales quite well on sparse graphs [ @xmath254 ] . the main limit of this technique is the assumption that communities are defined in the strong sense , which is too restrictive . on the other hand , one could think of using alternative definitions . this section describes methods employing processes running on the graph , focusing on spin - spin interactions , random walks and synchronization . the potts model is among the most popular models in statistical mechanics  @xcite . it describes a system of spins that can be in @xmath91 different states . the interaction is ferromagnetic , i.  e. it favours spin alignment , so at zero temperature all spins are in the same state . if antiferromagnetic interactions are also present , the ground state of the system may not be the one where all spins are aligned , but a state where different spin values coexist , in homogeneous clusters . if potts spin variables are assigned to the vertices of a graph with community structure , and the interactions are between neighbouring spins , it is likely that the structural clusters could be recovered from like - valued spin clusters of the system , as there are many more interactions inside communities than outside . based on this idea , inspired by an earlier paper by blatt et al . @xcite , reichardt and bornholdt proposed a method to detect communities that maps the graph onto a zero - temperature @xmath91-potts model with nearest - neighbour interactions  @xcite . the hamiltonian of the model , i.  e. its energy , reads @xmath451 where @xmath360 is the element of the adjacency matrix , @xmath101 is kronecker s function , @xmath452 the number of spins in state @xmath155 , @xmath359 and @xmath371 are coupling parameters . the energy @xmath453 is the sum of two competing terms : the first is the classical ferromagnetic potts model energy , and favors spin alignment ; the second term instead peaks when the spins are homogeneously distributed . the ratio @xmath454 expresses the relative importance of the two terms : by tuning @xmath454 one can explore different levels of modularity of the system , from the whole graph seen as a single cluster to clusters consisting of individual vertices . if @xmath454 is set to the value @xmath40 of the average density of edges of the graph @xmath313 , the energy of the system is smaller if spins align within subgraphs such that their internal edge density exceeds @xmath40 , whereas the external edge density is smaller than @xmath40 , i.  e. if the subgraphs are clusters ( section  [ sec3_1_1 ] ) . the minimization of @xmath453 is carried out via simulated annealing ( @xcite and section  [ sub_sec6_0_2 ] ) , starting from a configuration where spins are randomly assigned to the vertices and the number of states @xmath91 is very high . the procedure is quite fast and the results do not depend on @xmath91 ( provided @xmath91 is sufficiently high ) . the method also allows to identify vertices shared between communities , from the comparison of partitions corresponding to global and local energy minima . the hamiltonian @xmath453 can be rewritten as @xmath455 which is the energy of an infinite - range potts spin glass , as all pairs of spins are interacting ( neighboring or not ) and there may be both positive and negative couplings . the method can be simply extended to the analysis of weighted graphs , by introducing spin couplings proportional to the edge weights , which amounts to replacing the adjacency matrix @xmath189 with the weight matrix @xmath190 in eq . [ eqspin1 ] . ispolatov et al . @xcite have adopted a similar hamiltonian as in eq . [ eqspin1 ] , with a tunable antiferromagnetic term interpolating between the corresponding term of eq . [ eqspin1 ] and the entropy term ( proportional to @xmath456 ) of the free energy , whose minimization is equivalent to finding the states of the finite - temperature potts model used by blatt et al .  @xcite . [ eqspin2 ] is at the basis of the successive generalization of modularity with arbitrary null models proposed by reichardt and bornholdt , that we have discussed in section  [ sub_sec6_01 ] .    in another work @xcite , son et al . have presented a clustering technique based on the ferromagnetic random field ising model ( frfim ) . given a weighted graph with weight matrix @xmath190 , the hamiltonian of the frfim on the graph is @xmath457 in eq . [ eqspin3 ] @xmath458 and @xmath459 are the spin and the random magnetic field of vertex @xmath67 , respectively . the frfim has been studied to understand the nature of the spin glass phase transition  @xcite and the disorder - driven roughening transition of interfaces in disordered media  @xcite . the behavior of the model depends on the choice of the magnetic fields . son et al . set to zero the magnetic fields of all vertices but two , say @xmath155 and @xmath156 , for which the field has infinite strength and opposite signs . this amounts to fix the spins of @xmath155 and @xmath156 to opposite values , introducing frustration in the system . the idea is that , if @xmath155 and @xmath156 are central vertices of different communities , they impose their spin state to the other community members . so , the state of minimum energy is a configuration in which the graph is polarized into a subgraph with all positive spins and a subgraph with all negative spins , coinciding with the communities , if they are well defined . finding the minimum of @xmath453 is equivalent to solving a maximum - flow / minimum - cut problem , which can be done through well known techniques of combinatorial optimization , like the augmenting path algorithm  @xcite . for a given choice of @xmath155 and @xmath156 , many ground states can be found . the vertices that end up in the same cluster in all ground states represent the cores of the clusters , which are called _ possible vertices not belonging to the coteries indicate that the two clusters overlap . in the absence of information about the cluster structure of the graph , one needs to repeat the procedure for any pair of vertices @xmath155 and @xmath156 . picking vertices of the same cluster , for instance , would not give meaningful partitions . son et al . distinguish relevant clusters if they are of about the same size . the procedure can be iteratively applied to each of the detected clusters , considered as a separate graph , until all clusters have no community structure any more . on sparse graphs , the algorithm has complexity @xmath460 , where @xmath461 , so it is very slow and can be currently used for graphs of up to few thousands vertices . if one happens to know which are the important vertices of the clusters , e.g. by computing appropriate centrality values ( like degree or site betweenness  @xcite ) , the choices for @xmath155 and @xmath156 are constrained and the complexity can become as low as @xmath462 , which enables the analysis of systems with millions of vertices . tests on barabsi - albert graphs ( section  [ sec1_3 ] ) show that the latter have no community structure , as expected . random walks  @xcite can also be useful to find communities . if a graph has a strong community structure , a random walker spends a long time inside a community due to the high density of internal edges and consequent number of paths that could be followed . here we describe the most popular clustering algorithms based on random walks . all of them can be trivially extended to the case of weighted graphs . zhou used random walks to define a distance between pairs of vertices  @xcite : the distance @xmath463 between @xmath67 and @xmath68 is the average number of edges that a random walker has to cross to reach @xmath68 starting from @xmath67 . close vertices are likely to belong to the same community . zhou defines a `` global attractor '' of a vertex @xmath67 to be a closest vertex to @xmath67 ( i.  e. any vertex lying at the smallest distance from @xmath67 ) , whereas the `` local attractor '' of @xmath67 is its closest neighbour . two types of communities are defined , according to local or global attractors : a vertex @xmath67 has to be put in the same community of its attractor and of all other vertices for which @xmath67 is an attractor . communities must be minimal subgraphs , i.  e. they can not include smaller subgraphs which are communities according to the chosen criterion . applications to real networks , like zachary s karate club  @xcite and the college football network compiled by girvan and newman  @xcite ( section  [ sec6_1 ] ) , along with artificial graphs like the benchmark by girvan and newman  @xcite ( section  [ sec6_1 ] ) , show that the method can find meaningful partitions . the method can be refined , in that vertex @xmath67 is associated to its attractor @xmath68 only with a probability proportional to @xmath464 , @xmath19 being a sort of inverse temperature . the computation of the distance matrix requires solving @xmath15 linear - algebra equations ( as many as the vertices ) , which requires a time @xmath154 . on the other hand , an exact computation of the distance matrix is not necessary , as the attractors of a vertex can be identified by considering only a localized portion of the graph around the vertex ; therefore the method can be applied to large graphs as well . in a successive paper  @xcite , zhou introduced a measure of dissimilarity between vertices based on the distance defined above . the measure resembles the definition of distance based on structural equivalence of eq . [ eq7 ] , where the elements of the adjacency matrix are replaced by the corresponding distances . graph partitions are obtained with a divisive procedure that , starting from the graph as a single community , performs successive splits based on the criterion that vertices in the same cluster must be less dissimilar than a running threshold , which is decreased during the process . the hierarchy of partitions derived by the method is representative of actual community structures for several real and artificial graphs , including zachary s karate club  @xcite , the college football network  @xcite and the benchmark by girvan and newman  @xcite ( section  [ sec6_1 ] ) . the time complexity of the procedure is again @xmath154 . the code of the algorithm can be downloaded from http://www.mpikg-golm.mpg.de/theory/people/zhou + /networkcommunity.html .    in another work  @xcite , zhou and lipowsky adopted biased random walkers , where the bias is due to the fact that walkers move preferentially towards vertices sharing a large number of neighbours with the starting vertex . they defined a proximity index , which indicates how close a pair of vertices is to all other vertices . communities are detected with a procedure called _ netwalk _ , which is an agglomerative hierarchical clustering method ( section  [ sec4_2 ] ) , where the similarity between vertices is expressed by their proximity . the method has a time complexity @xmath154 : however , the proximity index of a pair of vertices can be computed with good approximation by considering just a small portion of the graph around the two vertices , with a considerable gain in time . the performance of the method is comparable with that of the algorithm of girvan and newman ( section  [ subsec5_1 ] ) . a different distance measure between vertices based on random walks was introduced by latapy and pons  @xcite . the distance is calculated from the probabilities that the random walker moves from a vertex to another in a fixed number of steps . the number of steps has to be large enough to explore a significant portion of the graph , but not too long , as otherwise one would approach the stationary limit in which transition probabilities trivially depend on the vertex degrees . vertices are then grouped into communities through an agglomerative hierarchical clustering technique based on ward s method  @xcite . modularity ( section  [ sec3_2_2 ] ) is used to select the best partition of the resulting dendrogram . the algorithm runs to completion in a time @xmath465 on a sparse graph , where @xmath88 is the depth of the dendrogram . since @xmath88 is often small for real graphs [ @xmath255 ] , the expected complexity in practical computations is @xmath128 . the software of the algorithm can be found at http://www-rp.lip6.fr/@xmath215latapy/pp/walktrap.html . hu et al . @xcite designed a graph clustering technique based on a signaling process between vertices , somewhat resembling diffusion . initially a vertex @xmath155 is assigned one unit of signal , all the others have no signal . in the first step , the source vertex @xmath155 sends one unit of signal to each of its neighbors . next , all vertices send as many units of signals they have to each of their neighbors . the process is continued until a given number of iterations @xmath467 is reached . the intensity of the signal at vertex @xmath67 , normalized by the total amount of signal , is the @xmath67-th entry of a vector @xmath468 , representing the source vertex @xmath155 . the procedure is then repeated by choosing each vertex as source . in this way one can associate an @xmath15-dimensional vector to each vertex , which correspons to a point in an euclidean space . the vector @xmath468 is actually the @xmath155-th column of the matrix @xmath469 , where @xmath470 and @xmath189 are the identity and adjacency matrix , respectively . the idea is that the vector @xmath468 describes the influence that vertex @xmath155 exerts on the graph through signaling . vertices of the same community are expected to have similar influence on the graph and thus to correspond to vectors which are `` close '' in space . the vectors are finally grouped via fuzzy @xmath44-means clustering ( section  [ sec4_3 ] ) . the optimal number of clusters corresponds to the partition with the shortest average distance between vectors in the same community and the largest average distance between vectors of different communities . the signaling process is similar to diffusion , but with the important difference that here there is no flow conservation , as the amount of signal at each vertex is not distributed among its neighbors but transferred entirely to each neighbor ( as if the vertex sent multiple copies of the same signal ) . the complexity of the algorithm is @xmath471 $ ] , where @xmath420 is the average degree of the graph . like in the previous algorithm by latapy and pons  @xcite , finding an optimal value for the number of iterations @xmath467 is non - trivial . delvenne et al . @xcite have shown that random walks enable one to introduce a general quality function , expressing the persistence of clusters in time . a cluster is persistent with respect to a random walk after @xmath156 time steps if the probability that the walker escapes the cluster before @xmath156 steps is low . such probability is computed via the _ clustered autocovariance matrix _ @xmath472 , which , for a partition of the graph in @xmath117 clusters , is defined as @xmath473 here , @xmath474 is the @xmath475 membership matrix , whose element @xmath476 equals one if vertex @xmath67 is in cluster @xmath68 , zero otherwise ; @xmath477 is the transition matrix of the random walk ; @xmath478 the diagonal matrix whose elements are the stationary probabilities of the random walk , i. e. @xmath479 , @xmath105 being the degree of vertex @xmath67 ; @xmath480 is the vector whose entries are the diagonal elements of @xmath478 . the element @xmath481 expresses the probability for the walk to start in cluster @xmath67 and end up in cluster @xmath68 after @xmath156 steps , minus the stationary probability that two independent random walkers are in @xmath67 and @xmath68 . in this way , the persistence of a cluster @xmath67 is related to the diagonal element @xmath482 . delvenne et al . defined the _ stability of the clustering _ @xmath483 . \label{eqbarahona1}\ ] ] the aim is then , for a given time @xmath156 , finding the partition with the largest value for @xmath484 . for @xmath485 , the most stable partition is that in which all vertices are their own clusters . interestingly , for @xmath486 , maximizing stability is equivalent to maximizing newman - girvan modularity ( section  [ sec3_2_2 ] ) . the cut size of the partition ( section  [ sec4_1 ] ) equals @xmath487 $ ] , so it is also a one - step measure . in the limit @xmath488 , the most stable partition coincides with the fiedler partition  @xcite , i. e. the bipartition where vertices are put in the same class according to the signs of the corresponding component of the fiedler eigenvector ( section  [ sec4_1 ] ) . therefore , the measure @xmath484 is very general , and gives a unifying interpretation in the framework of the random walk of several measures that were defined in different contexts . in particular , modularity has a natural interpretation in this dynamic picture  @xcite . since the size of stable clusters increases with @xmath156 , time can be considered as a resolution parameter . resolution can be fine tuned by taking time as a continuous variable ( the extension of the formalism is straightforward ) ; the linearization of the stability measure at small ( continuous ) times delivers multiresolution versions of modularity  @xcite ( section  [ sub_sec6_201 ] ) .    in a method by weinan et al . @xcite , the best partition of a graph in @xmath44 clusters is such that the markov chain describing a random walk on the meta - graph , whose vertices are the clusters of the original graph , gives the best approximation of the full random walk dynamics on the whole graph . the quality of the approximation is given by the distance between the left stochastic matrices of the two processes , which thus needs to be minimized . the minimization is performed by using a variant of the @xmath44-means algorithm ( section  [ sec4_3 ] ) , and the result is the best obtained out of @xmath76 runs starting from different initial conditions , a strategy that considerably improves the quality of the optimum . the time complexity is @xmath489 $ ] , where @xmath156 is the number of steps required to reach convergence . the optimal number of clusters could in principle be determined by analyzing how the quality of the approximation varies with @xmath44 , but the authors do not give any general recipe . the method is rather accurate on the benchmark by girvan and newman  @xcite ( section  [ sec6_1 ] ) and on zachary s karate club network . the algorithm by weinan et al . is asymptotically equivalent to spectral graph partitioning ( section  [ sec4_4 ] ) when the markov chain describing the random walk presents a sizeable spectral gap between some of the largest eigenvalues of the transfer matrix ( section  [ sec1_2 ] ) , approximately equal to one , and the others . we conclude this section by describing the _ markov cluster algorithm ( mcl ) _ , which was invented by van dongen  @xcite . this method simulates a peculiar process of flow diffusion in a graph . one starts from the _ transfer matrix _ of the graph @xmath201 ( section  [ sec1_2 ] ) . the element @xmath490 of the transfer matrix gives the probability that a random walker , sitting at vertex @xmath68 , moves to @xmath67 . the sum of the elements of each column of @xmath438 is one . each iteration of the algorithm consists of two steps . in the first step , called _ expansion _ , the transfer matrix of the graph is raised to an integer power @xmath45 ( usually @xmath491 ) . the entry @xmath492 of the resulting matrix gives the probability that a random walker , starting from vertex @xmath68 , reaches @xmath67 in @xmath45 steps ( diffusion flow ) . the second step , which has no physical counterpart , consists in raising each single entry of the matrix @xmath477 to some power @xmath18 , where @xmath18 is now real - valued . this operation , called _ inflation _ , enhances the weights between pairs of vertices with large values of the diffusion flow , which are likely to be in the same community . next , the elements of each column must be divided by their sum , such that the sum of the elements of the column equals one and a new transfer matrix is recovered . after some iterations , the process delivers a stable matrix , with some remarkable properties . its elements are either zero or one , so it is a sort of adjacency matrix . most importantly , the graph described by the matrix is disconnected , and its connected components are the communities of the original graph . the method is really simple to implement , which is the main reason of its success : as of now , the mcl is one of the most used clustering algorithms in bioinformatics . the code can be downloaded from http://www.micans.org / mcl/. due to the matrix multiplication of the expansion step , the algorithm should scale as @xmath154 , even if the graph is sparse , as the running matrix becomes quickly dense after a few steps of the algorithm . however , while computing the matrix multiplication , mcl keeps only a maximum number @xmath44 of non - zero elements per column , where @xmath44 is usually much smaller than @xmath15 . so , the actual worst - case running time of the algorithm is @xmath493 on a sparse graph . a problem of the method is the fact that the final partition is sensitive to the parameter @xmath18 used in the inflation step . therefore several different partitions can be obtained , and it is not clear which are the most meaningful or representative . synchronization  @xcite is an emergent phenomenon occurring in systems of interacting units and is ubiquitous in nature , society and technology . in a synchronized state , the units of the system are in the same or similar state(s ) at every time . synchronization has also been applied to find communities in graphs . if oscillators are placed at the vertices , with initial random phases , and have nearest - neighbour interactions , oscillators in the same community synchronize first , whereas a full synchronization requires a longer time . so , if one follows the time evolution of the process , states with synchronized clusters of vertices can be quite stable and long - lived , so they can be easily recognized . this was first shown by arenas , daz - guilera and prez - vicente  @xcite . they used kuramoto oscillators  @xcite , which are coupled two - dimensional vectors endowed with a proper frequency of oscillations . in the kuramoto model , the phase @xmath494 of oscillator @xmath67 evolves according to the following dynamics @xmath495 where @xmath496 is the natural frequency of @xmath67 , @xmath289 the strength of the coupling between oscillators and the sum runs over all oscillators ( mean field regime ) . if the interaction coupling exceeds a threshold , depending on the width of the distribution of natural frequencies , the dynamics leads to synchronization . if the dynamics runs on a graph , each oscillator is coupled only to its nearest neighbors . in order to reveal the effect of local synchronization , arenas et al . introduced the local order parameter @xmath497\rangle , \label{eqsync2}\ ] ] measuring the average correlation between oscillators @xmath67 and @xmath68 . the average is computed over different initial conditions . by visualizing the correlation matrix @xmath498 at a given time @xmath156 , one may distinguish groups of vertices that synchronize together . the groups can be identified by means of the _ dynamic connectivity matrix _ @xmath499 , which is a binary matrix obtained from @xmath498 by thresholding its entries . the dynamic connectivity matrix embodies information about both the synchronization dynamics and the underlying graph topology . from the spectrum of @xmath499 it is possible to derive the number of disconnected components at time @xmath156 . by plotting the number of components as a function of time , plateaus may appear at some characteristic time scales , indicating structural scales of the graph with robust communities ( fig . [ syncarenas ] ) . partitions corresponding to long plateaus are characterized by high values of the modularity of newman and girvan ( section  [ sec3_2_2 ] ) on graphs with homogeneous degree distributions , whereas such correlation is poor in the presence of hubs  @xcite . indeed , it has been proven that the stability ( eq . [ eqbarahona1 ] ) of the dynamics associated to the standard laplacian matrix , which describes the convergence towards synchronization of the kuramoto model with equal intrinsic frequencies , coincides with modularity only for graphs whose vertices have the same degree  @xcite . the appearance of plateaus at different time scales hints to a hierarchical organization of the graph . after a sufficiently long @xmath156 all oscillators are synchronized and the whole system behaves as a single component . interestingly , arenas et al . found that the structural scales revealed by synchronization correspond to groups of eigenvalues of the laplacian matrix of the graph , separated by gaps ( fig . [ syncarenas ] ) . based on the same principle , boccaletti et al . designed a community detection method based on synchronization  @xcite . the synchronization dynamics is a variation of kuramoto s model , the opinion changing rate ( ocr ) model  @xcite . here the interaction coupling between adjacent vertices is weighted by a term proportional to a ( negative ) power of the betweenness of the edge connecting the vertices ( section  [ subsec5_1 ] ) , with exponent @xmath18 . the evolution equations of the model are solved by decreasing the value of @xmath18 during the evolution of the dynamics , starting from a configuration in which the system is fully synchronized ( @xmath500 ) . the graph tends to get split into clusters of synchronized elements , because the interaction strengths across inter - cluster edges get suppressed due to their high betweenness scores . by varying @xmath18 , different partitions are recovered , from the graph as a whole until the vertices as separate communities : the partition with the largest value of modularity is taken as the most relevant . the algorithm scales in a time @xmath205 , or @xmath129 on sparse graphs , and gives good results in practical examples , including zachary s karate club  @xcite and the benchmark by girvan and newman  @xcite ( section  [ sec6_1 ] ) . the method can be refined by homogeneizing the natural frequencies of the oscillators during the evolution of the system . in this way , the system becomes more stable and partitions with higher modularity values can be recovered .    in a recent paper by li et al . @xcite , it was shown that synchronized clusters in modular networks are characterized by interfacial vertices , whose oscillation frequency is intermediate between those of two or more clusters , so that they do not belong to a specific community . li et al . used this result to devise a technique able to detect overlapping communities . synchronization - based algorithms may not be reliable when communities are very different in size ; tests in this direction are still missing . _ statistical inference _  @xcite aims at deducing properties of data sets , starting from a set of observations and model hypotheses . if the data set is a graph , the model , based on hypotheses on how vertices are connected to each other , has to _ fit _ the actual graph topology . in this section we review those clustering techniques attempting to find the best fit of a model to the graph , where the model assumes that vertices have some sort of classification , based on their connectivity patterns . we mainly focus on methods adopting _ bayesian inference _ @xcite , in which the best fit is obtained through the maximization of a likelihood ( _ generative models _ ) , but we also discuss related techniques , based on _ blockmodeling _ @xcite , _ model selection _ @xcite and _ information theory _  @xcite . bayesian inference uses observations to estimate the probability that a given hypothesis is true . it consists of two ingredients : the evidence , expressed by the information @xmath501 one has about the system ( e.g. , through measurements ) ; a statistical model with parameters @xmath502 . bayesian inference starts by writing the likelihood @xmath503 that the observed evidence is produced by the model for a given set of parameters @xmath502 . the aim is to determine the choice of @xmath502 that maximizes the posterior distribution @xmath504 of the parameters given the model and the evidence . by using bayes theorem one has @xmath505 where @xmath506 is the prior distribution of the model parameters and @xmath507 unfortunately , computing the integral  [ eqstinf01 ] is a major challenge . moreover , the choice of the prior distribution @xmath506 is non - obvious . generative models differ from each other by the choice of the model and the way they address these two issues . bayesian inference is frequently used in the analysis and modeling of real graphs , including social  @xcite and biological networks  @xcite . graph clustering can be considered a specific example of inference problem . here , the evidence is represented by the graph structure ( adjacency or weight matrix ) and there is an additional ingredient , represented by the classification of the vertices in groups , which is a _ hidden _ ( or _ missing _ ) information that one wishes to infer along with the parameters of the model which is supposed to be responsible for the classification . this idea is at the basis of several recent papers , which we discuss here . in all these works , one essentially maximizes the likelihood @xmath503 that the model is consistent with the observed graph structure , with different constraints . we specify the set of parameters @xmath502 as the triplet @xmath508 , where @xmath509 indicates the community assignment of the vertices , @xmath510 the model parameters , and @xmath44 the number of clusters . in the following we shall stick to the notation of the papers , so the variables above may be indicated by different symbols . however , to better show what each method specifically does we shall refer to our general notation at the end of the section . hastings  @xcite chooses as a model of network with communities the _ planted partition model _ ( section  [ sec6 ] ) . in it , @xmath15 vertices are assigned to @xmath91 groups : vertices of the same group are linked with a probability @xmath511 , while vertices of different groups are linked with a probability @xmath512 . if @xmath513 , the model graph has a built - in community structure . the vertex classification is indicated by the set of labels @xmath514 . the probability that , given a graph , the classification @xmath514 is the right one according to the model is @xmath515\}^{-1 } , \label{eqstinf1}\ ] ] where @xmath516/[p_{out}(1-p_{in})]\}$ ] , @xmath517 $ ] and the first sum runs over nearest neighboring vertices . maximizing @xmath518 is equivalent to minimizing the argument of the exponential , which is the hamiltonian of a potts model with short- and long - range interactions . for @xmath513 , @xmath519 and @xmath520 , so the model is a spin glass with ferromagnetic nearest - neighbor interactions and antiferromagnetic long - range interactions , similar to the model proposed by reichardt and bornholdt to generalize newman - girvan modularity  @xcite ( section  [ sub_sec6_01 ] ) . hastings used belief propagation  @xcite to find the ground state of the spin model . on sparse graphs , the complexity of the algorithm is expected to be @xmath521 , where @xmath18 needs to be estimated numerically . in principle one needs to input the parameters @xmath511 and @xmath512 , which are usually unknown in practical applications . however , it turns out that they can be chosen rather arbitrarily , and that bad choices can be recognized and corrected . newman and leicht  @xcite have recently proposed a similar method based on a mixture model and the expectation - maximization technique  @xcite . the method bears some resemblance with an _ a posteriori _ blockmodel previously introduced by snijders and nowicki  @xcite . they start from a directed graph with @xmath15 vertices , whose vertices fall into @xmath117 classes . the group of vertex @xmath67 is indicated by @xmath522 , @xmath523 the fraction of vertices in group @xmath375 , and @xmath524 the probability that there is a directed edge from vertices of group @xmath375 to vertex @xmath67 . by definition , the sets @xmath525 and @xmath526 satisfy the normalization conditions @xmath527 and @xmath528 . apart from normalization , the probabilities @xmath526 are assumed to be independent of each other . the best classification of the vertices corresponds to the maximum of the average log - likelihood @xmath529 that the model , described by the values of the parameters @xmath525 and @xmath526 fits the adjacency matrix @xmath189 of the graph . the expression of the average log - likelihood @xmath529 requires the definition of the probability @xmath530 , that vertex @xmath67 belongs to group @xmath375 . by applying bayes theorem the probabilities @xmath531 can be computed in terms of the @xmath525 and the @xmath526 , as @xmath532 while the maximization of the average log - likelihood @xmath529 , under the normalization constraints of the model variables @xmath525 and @xmath526 , yields the relations @xmath533 where @xmath105 is the outdegree of vertex @xmath67 . equations  [ eqstinf2 ] and  [ eqstinf3 ] are self - consistent , and can be solved by iterating them to convergence , starting from a suitable set of initial conditions . convergence is fast , so the algorithm could be applied to fairly large graphs , with up to about @xmath243 vertices . the method , designed for directed graphs , can be easily extended to the undirected case , whereas an extension to weighted graphs is not straightforwad . a nice feature of the method is that it does not require any preliminary indication on what type of structure to look for ; the resulting structure is the most likely classification based on the connectivity patterns of the vertices . therefore , various types of structures can be detected , not necessarily communities . for instance , multipartite structure could be uncovered , or mixed patterns where multipartite subgraphs coexist with communities , etc .. in this respect , it is more powerful than most methods of community detection , which are bound to focus only on proper communities , i.  e. subgraphs with more internal than external edges . in addition , since partitions are defined by assigning probability values to the vertices , expressing the extent of their membership in a group , it is possible that some vertices are not clearly assigned to a group , but to more groups , so the method is able to deal with overlapping communities . the main drawback of the algorithm is the fact that one needs to specify the number of groups @xmath117 at the beginning of the calculation , a number that is typically unknown for real networks . it is possible to derive this information self - consistently by maximizing the probability that the data are reproduced by partitions with a given number of clusters . but this procedure involves some degree of approximation , and the results are often not good .    in a recent study it has been shown that the method by newman and leicht enables one to rank vertices based on their degree of influence on other vertices , which allows to identify the vertices responsible for the group structure and its stability  @xcite . a very similar technique has also been applied by vzquez  @xcite to the problem of population stratification , where animal populations and their attributes are represented as hypergraphs ( section  [ sec1_1 ] ) . vzquez also suggested an interesting criterion to decide the optimal number of clusters , namely picking the number @xmath534 whose solution has the greatest similarity with solutions obtained at different values of @xmath117 . the similarity between two partitions can be estimated in various ways , for instance by computing the normalized mutual information ( section  [ sec6 ] ) . in a successive paper  @xcite , vzquez showed that better results are obtained if the classification likelihood is maximized by using variational bayes  @xcite . ramasco and mungan  @xcite remarked that the normalization condition on the probabilities @xmath526 implies that each group @xmath375 must have non - zero outdegree and that therefore the method fails to detect the intuitive group structure of ( directed ) bipartite graphs ( fig . [ figramasco ] ) . problem of method by newman and leicht . by applying the method to the illustrated complete bipartite graph ( colors indicate the vertex classes ) the natural group structure c ) is not recovered ; instead , the most likely classifications are a ) and b ) . reprinted figure with permission from ref . @xcite.2008 by the american physical society . ]    to avoid this problem , they proposed a modification , that consists in introducing three sets for the edge probabilities @xmath526 , relative to edges going from group @xmath375 to vertex @xmath67 ( as before ) , from @xmath67 to @xmath375 and in both directions , respectively . furthermore , they used the average entropy of the classification @xmath535 , where the @xmath536 are the analogs of the probabilities in eq . [ eqstinf2 ] , to infer the optimal number of groups , that the method of newman and leicht is unable to provide . another technique similar to that by newman and leicht has been designed by ren et al . the model is based on the group fractions @xmath525 , defined as above , and a set of probabilities @xmath537 , expressing the relevance of vertex @xmath67 for group @xmath375 ; the basic assumption is that the probability that two vertices of the same group are connected by an edge is proportional to the product of the relevances of the two vertices . in this way , there is an explicit relation between group membership and edge density , and the method can only detect community structure . the community assignments are recovered through an expectation - maximization procedure that closely follows that by newman and leicht . maximum likelihood estimation has been used by opi et al . to define an axiomatization of the problem of graph clustering and its related concepts  @xcite . the starting point is again the planted partition model ( section  [ sec6 ] ) , with probabilities @xmath511 and @xmath512 . a novelty of the approach is the introduction of the _ size matrix _ @xmath538 , whose element @xmath539 indicates the maximum strength of interaction between vertices @xmath67 and @xmath68 . for instance , in a graph with unweighted connections , all elements of @xmath538 equal @xmath2 . in this case , the probability that the graph conceals a community structure coincides with the expression ( [ eqstinf1 ] ) by hastings . opi et al . used this probability as a quality function to define rankings between graph partitions ( _ likelihood rankings _ ) . the authors show that the likelihood rankings satisfy a number of general properties , which should be satisfied by any reasonable ranking . they also propose an algorithm to find the maximum likelihood partition , by using the auxiliary concept of _ pseudo - community structure _ , i. e. a grouping of the graph vertices in which it is specified which pairs of vertices stay in the same community and which pairs instead stay in different communities . a pseudo - community may not be a community because the transitive property is not generally valid , as the focus is on pairwise vertex relationships : it may happen that @xmath67 and @xmath68 are classified in the same group , and that @xmath68 and @xmath44 are classified in the same group , but that @xmath67 and @xmath44 are not classified as belonging to the same group . we believe that the work by opi et al . is an important first step towards a more rigorous formalization of the problem of graph clustering . zanghi et al . @xcite have designed a clustering technique that lies somewhat in between the method by hastings and that by newman and leicht . as in ref . @xcite , they use the planted partition model to represent a graph with community structure ; as in ref . @xcite , they maximize the classification likelihood using an expectation - maximization algorithm  @xcite . the algorithm runs for a fixed number of clusters @xmath91 , like that by newman and leicht ; however , the optimal number of clusters can be determined by running the algorithm for a range of @xmath91-values and selecting the solution that maximizes the integrated classification likelihood introduced by biernacki et al . the time complexity of the algorithm is @xmath129 . hofman and wiggins have proposed a general bayesian approach to the problem of graph clustering  @xcite . like hastings  @xcite , they model a graph with community structure as in the planted partition problem ( section  [ sec6 ] ) , in that there are two probabilities @xmath540 and @xmath541 that there is an edge between vertices of the same or different clusters , respectively . the unobserved community structure is indicated by the set of labels @xmath542 for the vertices ; @xmath523 is again the fraction of vertices in group @xmath375 . the conjugate prior distributions @xmath543 and @xmath544 are chosen to be beta and dirichlet distributions . the most probable number of clusters @xmath545 maximizes the conditional probability @xmath546 that there are @xmath289 clusters , given the matrix @xmath547 . like hastings , hofman and wiggins assume that the prior probability @xmath548 on the number of clusters is a smooth function , therefore maximizing @xmath546 amounts to maximizing the bayesian evidence @xmath549 , obtained by integrating the joint distribution @xmath550 , which is factorizable , over the model parameters @xmath551 and @xmath552 . the integration can be performed exactly only for small graphs . hofman and wiggins used variational bayes  @xcite , in order to compute controlled approximations of @xmath553 . the complexity of the algorithm was estimated numerically on synthetic graphs , yielding @xmath554 , with @xmath555 . in fact , the main limitation comes from high memory requirements . the method is more powerful than the one by hastings  @xcite , in that the edge probabilities @xmath551 are inferred by the procedure itself and need not be specified ( or guessed ) at the beginning . it also includes the expectation - maximization approach by newman and leicht  @xcite as a special case , with the big advantage that the number of clusters need not be given as an input , but is an output of the method . the software of the algorithm can be found at http://www.columbia.edu/@xmath215chw2/.    we conclude with a brief summary of the main techniques described above , coming back to our notation at the beginning of the section . in the method by hastings , one maximizes the likelihood @xmath556 over the set of all possible community assignments @xmath509 , given the number of clusters @xmath44 and the model parameters ( i.  e. the linking probabilities @xmath511 and @xmath512 ) . newman and leicht maximize the likelihood @xmath556 for a given number of clusters , over the possible choices for the model parameters and community assignments , by deriving the optimal choices for both variables with a self - consistent procedure . hofman and wiggins maximize the likelihood @xmath557 over the possible choices for the number of clusters . block modeling is a common approach in statistics and social network analysis to decompose a graph in classes of vertices with common properties . in this way , a simpler description of the graph is attained . vertices are usually grouped in classes of equivalence . there are two main definitions of topological equivalence for vertices : _ structural equivalence _ @xcite ( section  [ sec3_1_4 ] ) , in which vertices are equivalent if they have the same neighbors ; _ regular equivalence _ @xcite , in which vertices of a class have similar connection patterns to vertices of the other classes ( ex . parents / children ) . regular equivalence does not require that ties / edges are restricted to specific target vertices , so it is a more general concept than structural equivalence . indeed , vertices which are structurally equivalent are also regularly equivalent , but the inverse is not true . the concept of structural equivalence can be generalized to probabilistic models , in which one compares classes of graphs , not single graphs , characterized by a set of linking probabilities between the vertices . in this case , vertices are organized in classes such that the linking probabilities of a vertex with all other vertices of the graph are the same for vertices in the same class , which are called _ stochastically equivalent _  @xcite . a thorough discussion of blockmodeling is beyond the scope of this review : we point the reader to ref . @xcite . here we discuss a recent work by reichardt and white  @xcite . let us suppose to have a directed graph with @xmath15 vertices and @xmath14 edges . a classification of the graph is indicated by the set of labels @xmath558 , where @xmath559 is the class of vertex @xmath67 . the corresponding blockmodel , or _ image graph _ , is expressed by a @xmath560 adjacency matrix @xmath256 : @xmath561 if edges between classes @xmath562 and @xmath563 are allowed , otherwise it is zero . the aim is finding the classification @xmath558 and the matrix @xmath10 that best fits the adjacency matrix @xmath189 of the graph . the goodness of the fit is expressed by the quality function @xmath564 , \label{eqstinf4}\ ] ] where @xmath565 ( @xmath566 ) reward the presence ( absence ) of edges between vertices if there are edges ( non - edges ) between the corresponding classes , and @xmath14 is the number of edges of the graph , as usual . eq .  [ eqstinf4 ] can be rewritten as a sum over the classes @xmath567)b_{rs } , \label{eqstinf5}\ ] ] by setting @xmath568 and @xmath569=(1/m)\sum_{i\neq j}b_{ij}\delta_{\sigma_ir}\delta_{\sigma_js}$ ] . if one sets @xmath570 and @xmath571 , @xmath362 can be interpreted as the linking probability between @xmath67 and @xmath68 , in some null model . thereof , @xmath572 becomes the number of edges running between vertices of class @xmath375 and @xmath155 , and @xmath569 $ ] the expected number of edges in the null model . reichardt and white set @xmath573 , which defines the same null model of newman - girvan modularity for directed graphs ( section  [ sub_sec6_01 ] ) . in fact , if the image graph has only self - edges , i.  e. @xmath574 , the quality function @xmath575 exactly matches modularity . other choices for the image graph are possible , however . for instance , a matrix @xmath576 describes the classes of a @xmath91-partite graph ( section  [ sec1_1 ] ) . from eq . [ eqstinf5 ] we see that , for a given classification @xmath558 , the image graph that yields the largest value of the quality function @xmath575 is that in which @xmath577 when the term @xmath578 $ ] is non - negative , and @xmath579 when the term @xmath578 $ ] is non - positive . so , the best classification is the one maximizing the quality function @xmath580|| , \label{eqstinf6}\ ] ] where all terms of the sum are taken in absolute value . the function @xmath581 is maximized via simulated annealing . the absolute maximum @xmath403 is obtained by construction when @xmath91 matches the number @xmath582 of structural equivalence classes of the graph . however , the absolute maximum @xmath403 does not have a meaning by itself , as one can achieve fairly high values of @xmath581 also for null model instances of the original graph , i. e. if one randomizes the graph by keeping the same expected indegree and outdegree sequences . in practical applications , the optimal number of classes is determined by comparing the ratio @xmath583 [ @xmath584 is the maximum of @xmath581 for @xmath91 classes ] with the expected ratio for the null model . since classifications for different @xmath91-values are not hierarchically ordered , overlaps between classes may be detected . the method can be trivially extended to the case of weighted graphs . model selection  @xcite aims at finding models which are at the same time simple and good at describing a system / process . a basic example of a model selection problem is curve fitting . there is no clear - cut recipe to select a model , but a bunch of heuristics , like akaike information criterion ( aic )  @xcite , bayesian information criterion ( bic )  @xcite , minimum description length ( mdl )  @xcite , minimum message length ( mml )  @xcite , etc ..    the modular structure of a graph can be considered as a compressed description of the graph to approximate the whole information contained in its adjacency matrix . based on this idea , rosvall and bergstrom  @xcite envisioned a communication process in which a partition of a graph in communities represents a synthesis @xmath585 of the full structure that a signaler sends to a receiver , who tries to infer the original graph topology @xmath168 from it ( fig . [ rosvall1 ] ) . the same idea is at the basis of an earlier method by sun et al . @xcite , which was originally designed for bipartite graphs evolving in time and will be described in section  [ sec7_1_2 ] . the best partition corresponds to the signal @xmath585 that contains the most information about @xmath168 . this can be quantitatively assessed by the minimization of the conditional information @xmath586 of @xmath168 given @xmath585 , @xmath587 , \label{eqstinf7}\ ] ] where @xmath91 is the number of clusters , @xmath193 the number of vertices in cluster @xmath67 , @xmath588 the number of edges between clusters @xmath67 and @xmath68 . we remark that , if one imposes no constraints on @xmath91 , @xmath586 is minimal in the trivial case in which @xmath589 ( @xmath590 ) . this solution is not acceptable because it does not correspond to a compression of information with respect to the original data set . one has to look for the ideal tradeoff between a good compression and a small enough information @xmath586 . the minimum description length ( mdl ) principle  @xcite provides a solution to this problem , which amounts to the minimization of a function given by @xmath586 plus a function of the number @xmath15 of vertices , @xmath14 of edges and @xmath91 of clusters . the optimization is performed by simulated annealing , so the method is rather slow and can be applied to graphs with up to about @xmath251 vertices . however , faster techniques may in principle be used , even if they imply a loss in accuracy . the method appears superior than modularity optimization , especially when communities are of different sizes . this comes from tests performed on the benchmark of girvan and newman  @xcite ( section  [ sec6_1 ] ) , both in its original version and in asymmetric versions , proposed by the authors , where the clusters have different sizes or different average degrees . in addition , it can detect other types of vertex classifications than communities , as in eq . [ eqstinf7 ] there are no constraints on the relative importance of the edge densities within communities with respect to the edge densities between communities . the software of the algorithm can be found at http://www.tp.umu.se/@xmath215rosvall/code.html .    in a recent paper  @xcite , rosvall and bergstrom pursued the same idea of describing a graph by using less information than that encoded in the full adjacency matrix . the goal is to optimally compress the information needed to describe the process of information diffusion across the graph . random walk is chosen as a proxy of information diffusion . a two - level description , in which one gives unique names to important structures of the graph and to vertices within the same structure , but the vertex names are recycled among different structures , leads to a more compact description than by simply coding all vertices with different names . this is similar to the procedure usually adopted in geographic maps , where the structures are cities and one usually chooses the same names for streets of different cities , as long as there is only one street with a given name in the same city . huffman coding  @xcite is used to name vertices . for the random walk , the above - mentioned structures are communities , as it is intuitive that walkers will spend a lot of time within them , so they play a crucial role in the process of information diffusion . graph clustering turns then into the following coding problem : finding the partition that yields the minimum description length of an infinite random walk . such description length consists of two terms , expressing the shannon entropy of the random walk within and between clusters . every time the walker steps to a different cluster , one needs to use the codeword of that cluster in the description , to inform the decoder of the transition . clearly , if clusters are well separated from each other , transitions of the random walker between clusters will be unfrequent , so it is advantageous to use the map , with the clusters as regions , because in the description of the random walk the codewords of the clusters will not be repeated many times , while there is a considerable saving in the description due to the limited length of the codewords used to denote the vertices . instead , if there are no well - defined clusters and/or if the partition is not representative of the actual community structure of the graph , transitions between the clusters of the partition will be very frequent and there will be little or no gain by using the two - level description of the map . the minimization of the description length is carried out by combining greedy search with simulated annealing . in a successive paper  @xcite , the authors adopted the fast greedy technique designed by blondel et al . for modularity optimization  @xcite , with some refinements . the method can be applied to weighted graphs , both undirected and directed . in the latter case , the random walk process is modified by introducing a teleportation probability @xmath253 , to guarantee ergodicity , just like in google s pagerank algorithm  @xcite . the partitions of directed graphs obtained by the method differ from those derived by optimizing the directed version of newman - girvan modularity ( section  [ sub_sec6_01 ] ) : this is due to the fact that modularity focuses on pairwise relationships between vertices , so it does not capture flows . the code of the method is available at http://www.tp.umu.se/@xmath215rosvall/code.html . chakrabarti  @xcite has applied the mdl principle to put the adjacency matrix of a graph into the ( approximately ) block diagonal form representing the best tradeoff between having a limited number of blocks , for a good compression of the graph topology , and having very homogeneous blocks , for a compact description of their structure . the total encoding cost @xmath467 includes the information on the total number of vertices of the graph , on the number of blocks and the number of vertices and edges in each block , along with the adjacency matrices of the blocks . the minimization of @xmath467 is carried out by starting from the partition in which the graph is a single cluster . at each step , one operates a bipartition of the cluster of the partition with the maximum shannon entropy per vertex . the split is carried out in order to remove from the original cluster those vertices carrying the highest contribution to the entropy per vertex of the cluster . then , starting from the resulting partition , which has one more cluster than the previous one , @xmath467 is optimized among those partitions with the same number of clusters . the procedure continues until one reaches a number of clusters @xmath591 , for which @xmath467 can not be further decreased . the method by chakrabarti has complexity @xmath592 $ ] , where @xmath593 is the number of iterations required for the convergence of the optimization for a given number of clusters , which is usually small ( @xmath594 in the experiments performed by the author ) . therefore the algorithm can be applied to fairly large graphs . information theory has also been used to detect communities in graphs . ziv et al . @xcite have designed a method in which the information contained in the graph topology is compressed such to preserve some predefined information . this is the basic principle of the information bottleneck method  @xcite . to understand this criterion , we need to introduce an important measure , the _ mutual information _ @xmath595  @xcite of two random variables @xmath168 and @xmath585 . it is defined as @xmath596 where @xmath597 indicates the probability that @xmath598 ( similarly for @xmath599 ) and @xmath600 is the joint probability of @xmath168 and @xmath585 , i. e. @xmath601 . the measure @xmath595 tells how much we learn about @xmath168 if we know @xmath585 , and viceversa . if @xmath168 is the input variable , @xmath602 the variable specifying the partition and @xmath585 the variable encoding the information we want to keep , which is called _ relevant variable _ , the goal is to minimize the mutual information between @xmath168 and @xmath602 ( to achieve the largest possible data compression ) , under the constraint that the information on @xmath585 extractable from @xmath602 be accurate . the optimal tradeoff between the values of @xmath603 and @xmath604 ( i.  e. compression versus accuracy ) is expressed by the minimization of a functional , where the relative weight of the two contributions is given by a parameter playing the role of a temperature . in the case of graph clustering , the question is what to choose as relevant information variable . ziv et al . proposed to adopt the structural information encoded in the process of diffusion on the graph . they also introduce the concept of _ network modularity _ , which characterizes the graph as a whole , not a specific partition like the modularity by newman and girvan ( section  [ sec3_2_2 ] ) . the network modularity is defined as the area under the _ information curve _ , which essentially represents the relation between the extent of compression and accuracy for all solutions found by the method and all possible numbers of clusters . the software of the algorithm by ziv et al . can be found at http://www.columbia.edu/@xmath215chw2/. in this section we describe some algorithms that do not fit in the previous categories , although some overlap is possible . raghavan et al . @xcite have designed a simple and fast method based on _ label propagation_. vertices are initially given unique labels ( e.g. their vertex labels ) . at each iteration , a sweep over all vertices , in random sequential order , is performed : each vertex takes the label shared by the majority of its neighbors . if there is no unique majority , one of the majority labels is picked at random . in this way , labels propagate across the graph : most labels will disappear , others will dominate . the process reaches convergence when each vertex has the majority label of its neighbors . communities are defined as groups of vertices having identical labels at convergence . by construction , each vertex has more neighbors in its community than in any other community . this resembles the strong definition of community we have discussed in section  [ sec3_1_2 ] , although the latter is stricter , in that each vertex must have more neighbors in its community than in the rest of the graph . the algorithm does not deliver a unique solution . due to the many ties encountered along the process it is possible to derive different partitions starting from the same initial condition , with different random seeds . tests on real graphs show that all partitions found are similar to each other , though . the most precise information that one can extract from the method is contained by aggregating the various partitions obtained , which can be done in various ways . the authors proposed to label each vertex with the set of all labels it has in different partitions . aggregating partitions enables one to detect possible overlapping communities . the main advantage of the method is the fact that it does not need any information on the number and the size of the clusters . it does not need any parameter , either . the time complexity of each iteration of the algorithm is @xmath21 , the number of iterations to convergence appears independent of the graph size , or growing very slowly with it . so the technique is really fast and could be used for the analysis of large systems . in a recent paper  @xcite , tibly and kertsz showed that the method is equivalent to finding the local energy minima of a simple zero - temperature kinetic potts model , and that the number of such energy minima is considerably larger than the number of vertices of the graph . aggregating partitions as raghavan et al . suggest leads to a fragmentation of the resulting partition in clusters that are the smaller , the larger the number of aggregated partitions . this is potentially a serious problem of the algorithm by raghavan et al . , especially when large graphs are investigated . in order to eliminate undesired solutions , barber and clark introduced some constraints in the optimization process  @xcite . this amounts to adding some terms to the objective function @xmath605 whose maximization is equivalent to the original label propagation algorithm , where @xmath189 is the adjacency matrix of the graph and @xmath101 is kronecker s function . it is just the negative of the energy of a zero - temperature potts model , as found by tibly and kertsz  @xcite ] . interestingly , if one imposes the constraint that partitions have to be balanced , i. e. that clusters have similar total degrees , the objective function becomes formally equivalent to newman - girvan modularity @xmath90 ( section  [ sec3_2_2 ] ) , so the corresponding version of the label propagation algorithm is essentially based on a local optimization of modularity . leung et al . have found that the original algorithm by raghavan et al . , applied on online social networks , often yields partitions with one giant community together with much smaller ones  @xcite . in order to avoid this disturbing feature , which is an artefact of the algorithm , leung et al . proposed to modify the method by introducing a score for the labels , which decreases as the label propagates far from the vertex to which the label was originally assigned . when choosing the label of a vertex , the labels of its neighbors are weighted by their scores , therefore a single label can not span too large portions of the graph ( as its weight fades away with the distance from the origin ) , and no giant communities can be recovered . tests of the modified algorithm on the lfr benchmark  @xcite ( section  [ sub_sec6_201 ] ) give good results and encourage further investigations . bagrow and bollt designed an agglomerative technique , called _ l - shell method _ @xcite . it is a procedure that finds the community of any vertex , although the authors also presented a more general procedure to identify the full community structure of the graph . communities are defined locally , based on a simple criterion involving the number of edges inside and outside a group of vertices . one starts from a vertex - origin and keeps adding vertices lying on successive shells , where a shell is defined as a set of vertices at a fixed geodesic distance from the origin . the first shell includes the nearest neighbours of the origin , the second the next - to - nearest neighbours , and so on . at each iteration , one calculates the number of edges connecting vertices of the new layer to vertices inside and outside the running cluster . if the ratio of these two numbers ( `` emerging degree '' ) exceeds some predefined threshold , the vertices of the new shell are added to the cluster , otherwise the process stops the idea of closing a community by expanding a shell has been previously introduced by costa  @xcite , in which shells are centered on hubs . however , in this procedure the number of clusters is preassigned and no cluster can contain more than one hub . because of the local nature of the process , the l - shell method is very fast and can identify communities very quickly . unfortunately the method works well only when the source vertex is approximately equidistant from the boundary of its community . to overcome this problem , bagrow and bollt suggested to repeat the process starting from every vertex and derive a _ membership matrix _ @xmath445 : the element @xmath492 is one if vertex @xmath68 belongs to the community of vertex @xmath67 , otherwise it is zero . the membership matrix can be rewritten by suitably permutating rows and columns based on their mutual distances . the distance between two rows ( or columns ) is defined as the number of entries whose elements differ . if the graph has a clear community structure , the membership matrix takes a block - diagonal form , where the blocks identify the communities . the method enables one to detect overlaps between communities as well  @xcite . unfortunately , the rearrangement of the matrix requires a time @xmath154 , so it is quite slow . a variant of the algorithm by bagrow and bollt , in which boundary vertices are examined separately and both first and second nearest neighbors of the running community are simultaneously investigated , was suggested by rodrigues et al . @xcite .    a recent methodology introduced by papadopoulos et al . @xcite , called _ bridge bounding _ , is similar to the l - shell algorithm , but here the cluster around a vertex grows until one `` hits '' the boundary edges . such edges can be recognized from the values of various measures , like betweenness  @xcite or the edge clustering coefficient  @xcite . the problem is that there are often no clear gaps in the distributions of the values of such measures , so one is forced to set a threshold to automatically identify the boundary edges from the others , and there is no obvious way to do it . the best results of the algorithm are obtained by using a measure consisting of a weighted sum of the edge clustering coefficient over a wider neighborhood of the given edge . this version of the method has a time complexity @xmath606 , where @xmath420 is the average degree of the graph .    in another algorithm by clauset , local communities are discovered through greedy maximization of a local modularity measure  @xcite . given a community @xmath22 , the boundary @xmath259 is the set of vertices of @xmath22 with at least one neighbor outside @xmath22 ( fig . [ clausetloc ] ) .     schematic picture of a community @xmath22 used in the definition of local modularity by clauset  @xcite . the black area indicates the subgraph of @xmath22 including all vertices of @xmath22 , whose neighbors are also in @xmath22 . the boundary @xmath259 entails the vertices of @xmath22 with at least one neighbor outside the community . reprinted figure with permission from ref . 2005 by the american physical society.,width=340 ]    the local modularity @xmath134 by clauset is the ratio of the number of edges having both endpoints in @xmath22 ( but at least one in @xmath259 ) , with the number of edges having at least one endpoint in @xmath259 . it is a measure of the sharpness of the community boundary . its optimization consists of a local exploration of the community starting from a source vertex : at each step the neighboring vertex yielding the largest increase ( smallest decrease ) of @xmath134 is added , until the community has reached a predefinite size @xmath115 . this greedy optimization takes a time @xmath607 , where @xmath420 is the average degree of the graph . the local modularity @xmath134 has been used in a paper by hui et al . @xcite , where methods to find communities in networks of mobile devices are designed . another method , where communities are defined based on a local criterion , was presented by eckmann and moses  @xcite . the idea is to use the clustering coefficient  @xcite of a vertex as a quantity to distinguish tightly connected groups of vertices . many edges mean many loops inside a community , so the vertices of a community are likely to have a large clustering coefficient . the latter can be related to the average distance between pairs of neighbours of the vertex . the possible values of the distance are @xmath2 ( if neighbors are connected ) or @xmath323 ( if they are not ) , so the average distance lies between @xmath2 and @xmath323 . the more triangles there are in the subgraph , the shorter the average distance . since each vertex always has distance @xmath2 from its neighbours , the fact that the average distance between its neighbours is different from @xmath2 reminds what happens when one measures segments on a curved surface . endowed with a metric , represented by the geodesic distance between vertices / points , and a curvature , the graph can be embedded in a geometric space . communities appear as portions of the graph with a large curvature . the algorithm was applied to the graph representation of the world wide web , where vertices are web pages and edges are the hyperlinks that take users from a page to the other . the authors found that communities correspond to web pages dealing with the same topic . long et al . have devised an interesting technique that is able to detect various types of vertex groups , not necessarily communities  @xcite . the method is based on graph approximation , as it tries to match the original graph topology onto a coarse type of graph , the _ community prototype graph _ , which has a clear group structure ( block - diagonal for clusters , block - off - diagonal for classes of multipartite graphs , etc . ) . the goal is to determine the community prototype graph that best approximates the graph at study , where the goodness of the approximation is expressed by the distance between the corresponding matrices . in this way the original problem of finding graph subsets becomes an optimization problem . long et al . called this procedure _ community learning by graph approximation _ sometimes the minimization of the matrix distance can be turned into the maximization of the trace of a matrix . measures like cut size or ratio cut can be also formulated as the trace of matrices ( see for instance eq . [ eqr ] ) . in fact , clga includes traditional graph partitioning as a special case ( section  [ sec4_1 ] ) . long et al . designed three algorithms for clga : two of them seek for divisions of the graph into overlapping or non - overlapping groups , respectively ; in the third one an additional constraint is introduced to produce groups of comparable size . the complexity of these algorithms is @xmath608 , where @xmath156 is the number of iterations until the optimization converges and @xmath44 the number of groups . the latter has to be given as an input , which is a serious limit of clga .    a fast algorithm by wu and huberman identifies communities based on the properties of resistor networks  @xcite . it is essentially a method for partitioning graphs in two parts , similar to spectral bisection , although partitions in an arbitrary number of communities can be obtained by iterative applications . the graph is transformed into a resistor network where each edge has unit resistance . a unit potential difference is set between two randomly chosen vertices . the idea is that , if there is a clear division in two communities of the graph , there will be a visible gap between voltage values for vertices at the borders between the clusters . the voltages are calculated by solving kirchoff s equations : an exact solution would be too time consuming , but it is possible to find a reasonably good approximation in a linear time for a sparse graph with a clear community structure , so the more time consuming part of the algorithm is the sorting of the voltage values , which takes time @xmath254 . any possible vertex pair can be chosen to set the initial potential difference , so the procedure should be repeated for all possible vertex pairs . the authors showed that this is not necessary , and that a limited number of sampling pairs is sufficient to get good results , so the algorithm scales as @xmath254 and is very fast . an interesting feature of the method is that it can quickly find the natural community of any vertex , without determining the complete partition of the graph . for that , one uses the vertex as source voltage and places the sink at an arbitrary vertex . the same feature is present in an older algorithm by flake et al . @xcite , where one uses max - flow instead of current flow ( section  [ sec4_1 ] ) . an algorithm by orponen and schaeffer  @xcite is based on the same principle , but it does not need the specification of target sources as it is based on diffusion in an unbounded medium . the limit of such methods is the fact that one has to give as input the number of clusters , which is usually not known beforehand . ohkubo and tanaka  @xcite pointed out that , since communities are rather compact structures , they should have a small volume , where the volume of a community is defined as the ratio of the number of vertices by the internal edge density of the community . ohkubo and tanaka assumed that the sum @xmath609 of the volumes of the communities of a partition is a reliable index of the goodness of the partition . so , the most relevant partition is the one minimizing @xmath609 . the optimization is carried out with simulated annealing . zarei and samani  @xcite remarked that there is a symmetry between community structure and anti - community ( multipartite ) structure , when one considers a graph and its complement , whose edges are the missing edges of the original graph . in fact , if a graph has a well identified communities , the same groups of vertices would be strong anti - communities in the complement graph , i. e. they should have a few intra - cluster edges and many inter - cluster edges . based on this remark , the communities of a graph can be identified by looking for anticommunities in the complement graph , which can sometimes be easier . zarei and samani devised a spectral method using matrices of the complement graph . the results of this technique appear good as compared to other spectral methods on artificial graphs generated with the planted @xmath293-partition model  @xcite , as well as on zachary s karate club  @xcite , lusseau s dolphins network  @xcite and a network of protein - protein interactions . however , the authors have used very small graphs for testing . communities make sense on sparse graphs , but the complements of large sparse graphs would not be sparse , but very dense , and their community ( multipartite ) structure basically invisible . gudkov and montealegre detected communities by means of dynamical simplex evolution  @xcite . graph vertices are represented as points in an @xmath306-dimensional space . each point initially sits on the @xmath15 vertices of a simplex , and then moves in space due to forces exerted by the other points . if vertices are neighbors , the mutual force acting on their representative points is attractive , otherwise it is repulsive . if the graph has a clear community structure , the corresponding spatial clusters repel each other because of the few connections between them ( repulsion dominates over attraction ) . if communities are more mixed with each other , clusters are not well separated and they could be mistakenly aggregated in larger structures . to avoid that , gudkov and montealegre defined clusters as groups of points such that the distance between each pair of points does not exceed a given threshold , which can be arbitrarily tuned , to reveal structures at different resolutions ( section  [ sub_sec6_201 ] ) . the algorithm consists in solving first - order differential equations , describing the dynamics of mass points moving in a viscous medium . the complexity of the procedure is @xmath129 . differential equations are also at the basis of a recent method designed by krawczyk and kuakowski  @xcite . here the equations describe a dynamic process , in which the original graph topology evolves to a disconnected graph , whose components are the clusters of the original graph .    despite the significant improvements in computational complexity , it is still problematic to apply clustering algorithms to many large networks available today . therefore narasimhamurthy et al . @xcite proposed a two - step procedure : first , the graph at study is decomposed in smaller pieces by a fast graph partitioning technique ; then , a clustering method is applied to each of the smaller subgraphs obtained [ narasimhamurthy et al . used the clique percolation method ( section  [ sec45_1 ] ) ] . the initial decomposition of the graph is carried out through the multilevel method by dhillon et al . it is crucial to verify that the initial partitioning does not split the communities of the graph among the various subgraphs of the decomposition . this can be done by comparing , on artificial graphs , the final clusters obtained with the two - step method with those detected by applying the chosen clustering technique to the entire graph . most of the methods discussed in the previous sections aim at detecting standard partitions , i.  e. partitions in which each vertex is assigned to a single community . however , in real graphs vertices are often shared between communities ( section  [ sec2 ] ) , and the issue of detecting overlapping communities has become quite popular in the last few years . we devote this section to the main techniques to detect overlapping communities . the most popular technique is the clique percolation method ( cpm ) by palla et al .  @xcite . it is based on the concept that the internal edges of a community are likely to form cliques due to their high density . on the other hand , it is unlikely that intercommunity edges form cliques : this idea was already used in the divisive method of radicchi et al . ( section  [ subsec5_2 ] ) . palla et al . use the term @xmath44-clique to indicate a complete graph with @xmath44 vertices vertices ( section  [ sec1_1 ] ) . ] . notice that a @xmath44-clique is different from the @xmath15-clique ( see section  [ sec3_1_2 ] ) used in social science . if it were possible for a clique to move on a graph , in some way , it would probably get trapped inside its original community , as it could not cross the bottleneck formed by the intercommunity edges . palla et al . introduced a number of concepts to implement this idea . two @xmath44-cliques are _ adjacent _ if they share @xmath188 vertices . the union of adjacent @xmath44-cliques is called _ @xmath44-clique chain_. two @xmath44-cliques are connected if they are part of a @xmath44-clique chain . finally , a _ @xmath44-clique community _ is the largest connected subgraph obtained by the union of a @xmath44-clique and of all @xmath44-cliques which are connected to it . examples of @xmath44-clique communities are shown in fig . [ figure10 ] .     clique percolation method . the example shows communities spanned by adjacent 4-cliques . overlapping vertices are shown by the bigger dots . reprinted figure with permission from ref . 2005 by the nature publishing group . ]    one could say that a @xmath44-clique community is identified by making a @xmath44-clique `` roll '' over adjacent @xmath44-cliques , where rolling means rotating a @xmath44-clique about the @xmath188 vertices it shares with any adjacent @xmath44-clique . by construction , @xmath44-clique communities can share vertices , so they can be overlapping . there may be vertices belonging to non - adjacent @xmath44-cliques , which could be reached by different paths and end up in different clusters . unfortunately , there are also vertices that can not be reached by any @xmath44-clique , like , e. g. vertices with degree one ( `` leaves '' ) . in order to find @xmath44-clique communities , one searches first for maximal cliques . then a clique - clique overlap matrix @xmath400 is built  @xcite , which is an @xmath610 matrix , @xmath115 being the number of cliques ; @xmath611 is the number of vertices shared by cliques @xmath67 and @xmath68 . to find @xmath44-cliques , one needs simply to keep the entries of @xmath400 which are larger than or equal to @xmath188 , set the others to zero and find the connected components of the resulting matrix . detecting maximal cliques is known to require a running time that grows exponentially with the size of the graph . however , the authors found that , for the real networks they analyzed , the procedure is quite fast , due to the fairly limited number of cliques , and that ( sparse ) graphs with up to @xmath612 vertices can be analyzed in a reasonably short time . the actual scalability of the algorithm depends on many factors , and can not be expressed in closed form . an interesting aspect of @xmath44-clique communities is that they allow to make a clear distinction between random graphs and graphs with community structure . this is a rather delicate issue : we have seen in section  [ sub_sec6_1 ] that newman - girvan modularity can attain large values on random graphs . dernyi et al . @xcite have studied the percolation properties of @xmath44-cliques on random graphs , when the edge probability @xmath45 varies . they found that the threshold @xmath613 for the emergence of a giant @xmath44-clique community , i.  e. a community occupying a macroscopic portion of the graph , is @xmath614^{-1/(k-1)}$ ] , @xmath15 being the number of vertices of the graph , as usual . for @xmath615 , for which the @xmath44-cliques reduce to edges , one recovers the known expression for the emergence of a giant connected component in erds - rnyi graphs ( section  [ sec1_3 ] ) . this percolation transition is quite sharp : if the edge probability @xmath616 , @xmath44-clique communities are rather small ; if @xmath617 there is a giant component and many small communities . to assess the significance of the clusters found with the cpm , one can compare the detected cover with the cover found on a null model graph , which is random but preserves the expected degree sequence of the original graph . the modularity of newman and girvan is based on the same null model ( section  [ sec3_2_2 ] ) . the null models of real graphs seem to display the same two scenarios found for erds - rnyi graphs , characterized by the presence of very small @xmath44-clique communities , with or without a giant cluster . therefore , covers with @xmath44-clique communities of large or appreciable size can hardly be due to random fluctuations . palla and coworkers  @xcite have designed a software package implementing the cpm , called _ cfinder _ , which is freely available ( www.cfinder.org ) . the algorithm has been extended to the analysis of weighted , directed and bipartite graphs . for weighted graphs , in principle one can follow the standard procedure of thresholding the weights , and apply the method on the resulting graphs , treating them as unweighted . farkas et al . @xcite proposed instead to threshold the weight of cliques , defined as the geometric mean of the weights of all edges of the clique . the value of the threshold is chosen slightly above the critical value at which a giant @xmath44-clique community emerges , in order to get the richest possible variety of clusters . on directed graphs , palla et al . defined _ directed @xmath44-cliques _ as complete graphs with @xmath44 vertices , such that there is an ordering among the vertices , and each edge goes from a vertex with higher order to one with lower order . the ordering is determined from the _ restricted outdegree _ of the vertex , expressing the fraction of outgoing edges pointing to the other vertices of the clique versus the total outdegree . the method has been extended to bipartite graphs by lehmann et al .  @xcite . in this case one uses bipartite cliques , or _ bicliques _ : a subgraph @xmath618 is a biclique if each of @xmath294 vertices of one class are connected with each of @xmath619 vertices of the other class . two cliques @xmath618 are adjacent if they share a clique @xmath620 , and a @xmath618 clique community is the union of all @xmath618 cliques that can be reached from each other through a path of adjacent @xmath618 cliques . finding all @xmath621 bicliques of a graph is an @xmath622-complete problem  @xcite , mostly because the number of bicliques tends to grow exponentially with the size of the graph . the algorithm designed by lehmann et al . to find biclique communities is similar to the original cpm , and has a total complexity of @xmath623 . on sparse graphs , @xmath621 often grows linearly with the number of edges @xmath14 , yielding a time complexity @xmath624 . bicliques are also the main ingredients of _ bitector _ , a recent algorithm to detect community structure in bipartite graphs  @xcite . kumpula et al . have developed a fast implementation of the cpm , called sequential clique percolation algorithm ( scp )  @xcite . it consists in detecting @xmath44-clique communities by sequentially inserting the edges of the graph at study , one by one , starting from an initial empty graph . whenever a new edge is added , one checks whether new @xmath44-cliques are formed , by searching for @xmath625-cliques in the subset of neighboring vertices of the endpoints of the inserted edge . the procedure requires to build a graph @xmath626 , in which the vertices are @xmath627-cliques and edges are set between vertices corresponding to @xmath627-cliques which are subgraphs of the same @xmath44-clique . at the end of the process , the connected components of @xmath626 correspond to the searched @xmath44-clique communities . the technique has a time complexity which is linear in the number of @xmath44-cliques of the graph , so it can vary a lot in practical applications . nevertheless , it turns out to be much faster than the original implementation of the cpm . the big advantage of the scp , however , consists of its implementation for weighted graphs . by inserting edges in decreasing order of weight , one recovers in a single run the community structure of the graph for all possible weight thresholds , by storing every cover detected after the addition of each edge . the standard cpm , instead , needs to be applied once for each threshold . if , instead of edge weight thresholding , one performs @xmath44-clique weight thresholding , as prescribed by farkas et al . @xcite , the scp remains much faster than the cpm , if one applies a simple modification to it , consisting in detecting and storing all @xmath44-cliques on the full graph , sorting them based on their weights , and finding the communities by sequentially adding the @xmath44-cliques in decreasing order of weight . the cpm has the same limit as the algorithm of radicchi et al . @xcite ( section  [ subsec5_2 ] ) : it assumes that the graph has a large number of cliques , so it may fail to give meaningful covers for graphs with just a few cliques , like technological networks and some social networks . on the other hand , if there are many cliques , the method may deliver trivial community structure , like a cover consisting of the whole graph as a single cluster . a more fundamental issue is the fact that the method does not look for actual communities , consistent with the shared notion of dense subgraphs , but for subgraphs `` containing '' many cliques , which may be quite different objects than communities ( for instance , they could be `` chains '' of cliques with low internal edge density ) . another big problem is that on real networks there is a considerable fraction of vertices that are left out of the communities , like leaves . one could think of some post - processing procedure to include them in the communities , but for that it is necessary to introduce a new criterion , outside the framework that inspired the method . furthermore it is not clear _ a priori _ which value of @xmath44 one has to choose to identify meaningful structures . finally , the criterion to choose the threshold for weighted graphs and the definition of directed @xmath44-cliques are rather arbitrary . one of the first methods to find overlapping communities was designed by baumes et al . a community is defined as a subgraph which locally optimizes a given function @xmath86 , typically some measure related to the edge density of the cluster ) . ] . different overlapping subsets may all be locally optimal , so vertices can be shared between communities . detecting the cluster structure of a graph amounts to finding the set of all locally optimal clusters . two efficient heuristics are proposed , called iterative scan ( @xmath628 ) and rank removal ( @xmath629 ) . @xmath628 performs a greedy optimization of the function @xmath86 . one starts from a random seed vertex / edge and adds / deletes vertices one by one as long as @xmath86 increases . then another seed is randomly picked and the procedure is repeated . the algorithm stops when , by picking any seed , one recovers a previously identified cluster . @xmath629 consists in removing important vertices such to disconnect the graphs in small components representing the cores of the clusters . the importance of vertices is determined by their centrality scores ( e.g. degree , betweenness centrality  @xcite ) , pagerank  @xcite ) . vertices are removed until one fragments the graph into components of a given size . after that , the removed vertices are added again to the graph , and are associated to those clusters for which doing so increases the value of the function @xmath86 . the complexity of @xmath628 and @xmath629 is @xmath129 on sparse graphs . the best performance is achieved by using @xmath628 to refine results obtained from @xmath629 . in a successive paper  @xcite , baumes et al . further improved such two - step procedure , in that the removed vertices in @xmath629 are reinserted in decreasing order of their centrality scores , and the optimization of @xmath86 in @xmath628 is only extended to neighboring vertices of the running cluster . the new recipe maintains time complexity @xmath129 , but on sparse graphs it requires a time lower by an order of magnitude than the old one , while the quality of the detected clustering is comparable .    a different method , combining spectral mapping , fuzzy clustering and the optimization of a quality function , has been presented by zhang et al . the membership of vertex @xmath67 in cluster @xmath44 is expressed by @xmath630 , which is a number between @xmath631 and @xmath2 . the sum of the @xmath630 over all communities @xmath44 of a cover is @xmath2 , for every vertex . this normalization is suggested by the fact that the entry @xmath630 can be thought of as the probability that @xmath67 belongs to community @xmath44 , so the sum of the @xmath630 represents the probability that the vertex belongs to any community of the cover , which is necessarily @xmath2 . if there were no overlaps , @xmath632 , where @xmath105 represents the unique community of vertex @xmath67 . the algorithm consists of three phases : 1 ) embedding vertices in euclidean space ; 2 ) grouping the corresponding vertex points in a given number @xmath115 of clusters ; 3 ) maximizing a modularity function over the set of covers found in step 2 ) , corresponding to different values of @xmath115 . this scheme has been used in other techniques as well , like in the algorithm of donetti and muoz  @xcite ( section  [ sec43 ] ) . the first step builds upon a spectral technique introduced by white and smyth  @xcite , that we have discussed in section  [ sub_sec6_0_4 ] . graph vertices are embedded in a @xmath88-dimensional euclidean space by using the top @xmath88 eigenvectors of the right stochastic matrix @xmath190 ( section  [ sec1_2 ] ) , derived from the adjacency matrix @xmath189 by dividing each element by the sum of the elements of the same row . the spatial coordinates of vertex @xmath67 are the @xmath67-th components of the eigenvectors . in the second step , the vertex points are associated to @xmath115 clusters by using fuzzy @xmath44-means clustering  @xcite ( section  [ sec4_3 ] ) . the number of clusters @xmath115 varies from @xmath323 to a maximum @xmath289 , so one obtains @xmath290 covers . the best cover is the one that yields the largest value of the modularity @xmath633 , defined as @xmath634 , \label{eq : mod5}\ ] ] where @xmath635 and @xmath636 the sets @xmath637 and @xmath638 include the vertices of module @xmath117 and of the whole network , respectively . [ eq : mod5 ] is an extension of the weighted modularity in eq . [ eq : mod20 ] , obtained by weighing the contribution of the edges weights to the sums in @xmath320 and @xmath321 by the ( average ) membership coefficients of the vertices of the edge . the determination of the eigenvectors is the most computationally expensive part of the method , so the time complexity is the same as that of the algorithm by white and smyth ( see section  [ sub_sec6_0_4 ] ) , i.  e. @xmath291 , which is essentially linear in @xmath15 if the graph is sparse and @xmath639 . nepusz et al . proposed a different approach based on vertex similarity  @xcite . one starts from the membership matrix @xmath197 , defined as in the previous method by zhang et al . from @xmath197 a matrix @xmath538 is built , where @xmath640 , expressing the similarity between vertices ( @xmath115 is the number of clusters ) . if one assumes to have information about the actual vertex similarity , corresponding to the matrix @xmath641 , the best cover is obtained by choosing @xmath197 such that @xmath538 approximates as closely as possible @xmath641 . this amounts to minimize the function @xmath642 where the @xmath309 weigh the importance of the approximation for each entry of the similarity matrices . in the absence of any information on the community structure of the graph , one sets @xmath643 , @xmath104 ( equal weights ) and @xmath641 equal to the adjacency matrix @xmath189 , by implicitly assuming that vertices are similar if they are neighbors , dissimilar otherwise . on weighted graphs , one can set the @xmath309 equal to the edge weights . minimizing @xmath644 is a nonlinear constrained optimization problem , that can be solved with a gradient - based iterative optimization method , like simulated annealing . the optimization procedure adopted by nepusz et al . , for a fixed number of clusters @xmath115 , has a time complexity @xmath645 , where @xmath646 is the number of iterations leading to convergence , so the method can only be applied to fairly small graphs . if @xmath115 is unknown , as it usually happens , the best cover is the one corresponding to the largest value of the modularity @xmath647 eq . [ eqoverl2 ] is very similar to the expression of newman - girvan modularity ( eq .  [ eq : mod_0 ] ) : the difference is that the kronecker s @xmath101 is replaced by the vertices similarity , to account for overlapping communities . once the best cover is identified , one can use the entries of the partition matrix @xmath197 to evaluate the participation of each vertex in the @xmath115 clusters of the cover . nepusz et al . defined the _ bridgeness _ @xmath648 of a vertex @xmath67 as @xmath649 if @xmath67 belongs to a single cluster , @xmath650 . if , for a vertex @xmath67 , @xmath651 , @xmath652 , @xmath653 and @xmath67 is a perfect _ bridge _ , as it lies exactly between all clusters however , a vertex with low @xmath654 may be simply an outlier , not belonging to any cluster . since real bridges are usually rather central vertices , one can identify them by checking for large values of the _ centrality - corrected bridgeness _ , obtained by multiplying the bridgeness of eq .  [ eqoverl3 ] by the centrality of the vertex ( expressed by , e.g. , degree , betweenness  @xcite , etc . ) . a variant of the algorithm by nepusz et al can be downloaded from http://www.cs.rhul.ac.uk/home/tamas/assets/file + s / fuzzyclust - static.tar.gz .    in real networks it is often easier to discriminate between intercluster and intracluster edges than recognizing overlapping vertices . for instance , in social networks , even though many people may belong to more groups , their social ties within each group can be easily spotted . besides , it may happen that communities are joined to each other through their overlapping vertices ( fig . [ figlink ] ) , without intercluster edges . for these reasons , it has been recently suggested that defining clusters as sets of edges , rather than vertices , may be a promising strategy to analyze graphs with overlapping communities  @xcite . one has to focus on the _ line graph _ @xcite , i. e. the graph whose vertices are the edges of the original graph ; vertices of the line graph are linked if the corresponding edges in the original graph are adjacent , i. e. if they share one of their endvertices . partitioning the line graph means grouping the edges of the starting graph . evans and lambiotte  @xcite introduced a set of quality functions , similar to newman - girvan modularity ( eq .  [ eq : mod_0 ] ) , expressing the stability of partitions against random walks taking place on the graph , following the work of delvenne et al . @xcite [ section  [ sec44_2 ] ] . they considered a projection of the traditional random walk on the line graph , along with two other diffusion processes , where walkers move between adjacent edges ( rather than between neighboring vertices ) . evans and lambiotte optimized the three corresponding modularity functions to look for partitions in two real networks , zachary s karate club  @xcite ( section  [ sec6_1 ] ) and the network of word associations derived from the university of south florida free association norms  @xcite ( section  [ sec2 ] ) . the optimization was carried out with the hierarchical technique by blondel et al . @xcite and the multi - level algorithm by noack and rotta  @xcite . while the results for the word association network are reasonable , the test on the karate club yields partitions in more than two clusters . however , the modularities used by evans et lambiotte can be modified to include longer random walks ( just like in ref . @xcite ) , and the length of the walk represents a resolution parameter that can be tuned to get better results . ahn et al . @xcite proposed to group edges with an agglomerative hierarchical clustering technique , called _ hierarchical link clustering _ ( section  [ sec4_2 ] ) . they use a similarity measure for a pair of ( adjacent ) edges that expresses the size of the overlap between the neighborhoods of the non - coincident endvertices , divided by the total number of ( different ) neighbors of such endvertices . groups of edges are merged pairwise in descending order of similarity , until all edges are together in the same cluster . the resulting dendrogram provides the most complete information on the community structure of the graph . however , as usual , most of this information is redundant and is an artefact of the procedure itself . so , ahn et al . introduced a quality function to select the most meaningful partition(s ) , called _ partition density _ , which is essentially the average edge density within the clusters . the method is able to find meaningful clusters in biological networks , like protein - protein and metabolic networks , as well as in a social network of mobile phone communications . it can also be extended to multipartite and weighted graphs . the idea of grouping edges is surely interesting . however it is not _ a priori _ better than grouping vertices . in fact , the two situations are somewhat symmetric . edges connecting vertices of different clusters are `` overlapping '' , but they will be assigned just to one cluster ( or else the clusters would be merged ) .     communities as sets of edges . in the figure , the graph has a natural division in two triangles , with the central vertex shared between them . if communities are identified by their internal edges , detecting the triangles and their overlapping vertex becomes easier than by using methods that group vertices . reprinted figure with permission from ref . 2009 by the american physical society.,width=264 ]    the possibility of having overlapping communities makes most standard clustering methods inadequate , and enforces the design of new _ ad hoc _ techniques , like the ones we have described so far . on the other hand , if it were possible to identify the overlapping vertices and `` separate '' them among the clusters they belong to , the overlaps would be removed and one could then apply any of the traditional clustering methods to the resulting graph . this idea is at the basis of a recent method proposed by gregory  @xcite . it is a three - stages procedure : first , one transforms the graph into a larger graph without overlapping vertices ; second , a clustering technique is applied to the resulting graph ; third , one maps the partition obtained into a cover by replacing the vertices with those of the original graph . the transformation step , called _ peacock _ , is performed by identifying the vertices with highest _ split betweenness _ ( section  [ subsec5_1 ] ) and splitting them in multiple parts , connected by edges . this is done as long as the split betweenness of the vertices is sufficiently high , which is determined by a parameter @xmath155 . in this way , most vertices of the resulting graph are exactly the same one had initially , the others are multiple copies of the overlapping vertices of the initial graph . the overlaps of the final cover are obtained by checking if copies of the same initial vertex end up in different disjoint clusters . the complexity is dominated by the peacock algorithm , if one computes the exact values of the split betweenness for the vertices , which requires a time @xmath154 on a sparse graph . gregory proposed an approximate local computation , which scales as @xmath254 : in this way the total complexity of the method becomes competitive , if one chooses a fast algorithm for the identification of the clusters . the goodness of the results depends on the specific method one uses to find the clusters after the graph transformation . the software of the version of the method used by gregory in his applications can be found at http://www.cs.bris.ac.uk/@xmath215steve/networks/peaco + ckpaper/. the idea of gregory is interesting , as it allows to exploit traditional methods even in the presence of overlapping communities . the choice of the parameter @xmath155 , which determines whether a vertex is overlapping or not , does not seem to affect significantly the results , as long as @xmath155 is taken sufficiently small . the existence of a resolution limit for newman - girvan modularity ( section  [ sub_sec6_1 ] ) implies that the straight optimization of quality functions yields a coarse description of the cluster structure of the graph , at a scale which has _ a priori _ nothing to do with the actual scale of the clusters . in the absence of information on the cluster sizes of the graph , a method should be able to explore all possible scales , to make sure that it will eventually identify the right communities . multiresolution methods are based on this principle . however , many real graphs display _ hierarchical _ cluster structures , with clusters inside other clusters  @xcite . in these cases , there are more levels of organization of vertices in clusters , and more relevant scales . in principle , clustering algorithms should be able to identify them . multiresolution methods can do the trick , in principle , as they scan continuously the range of possible cluster scales . recently other methods have been developed , where partitions are by construction hierarchically nested in each other . in this section we discuss both classes of techniques .      in general , multiresolution methods have a freely tunable parameter , that allows to set the characteristic size of the clusters to be detected . the general spin glass framework by reichardt and bornholdt ( @xcite and section  [ sub_sec6_01 ] ) is a typical example , where @xmath371 is the resolution parameter . the extension of the method to weighted graphs has been recently discussed  @xcite . pons has proposed a method  @xcite consisting of the optimization of multiscale quality functions , including the _ multiscale modularity _ @xmath655 , \label{eq : mult0}\ ] ] and two other additive quality functions , derived from the _ performance _ ( eq . [ eq10_perf ] ) and a measure based on the similarity of vertex pairs . in eq . [ eq : mult0 ] @xmath656 is the resolution parameter and the notation is otherwise the same as in eq . [ eq : mod ] . we see that , for @xmath657 , one recovers standard modularity . however , since multiplicative factors in @xmath658 do not change the results of the optimization , we can divide @xmath658 by @xmath18 , recovering the same quality function as in eq . [ eqr13 ] , with @xmath659 , up to an irrelevant multiplicative constant . to evaluate the relevance of the partitions , for any given multiscale quality function , pons suggested that the length of the @xmath18-range @xmath660 $ ] , for which a community @xmath22 `` lives '' in the maximum modularity partition , is a good indicator of the stability of the community . he then defined the _ relevance function _ of a community @xmath22 at scale @xmath18 as @xmath661 the relevance @xmath662 of a partition @xmath94 at scale @xmath18 is the average of the relevances of the clusters of the partition , weighted by the cluster sizes . peaks in @xmath18 of @xmath662 reveal the most meaningful partitions .    another interesting technique has been devised by arenas et al . @xcite , and consists of a modification of the original expression of modularity . the idea is to make vertices contribute as well to the computation of the edge density of the clusters , by adding a self - loop of strength @xmath375 to each vertex . arenas et al . remarked that the parameter @xmath375 does not affect the structural properties of the graph in most cases , which are usually determined by an adjacency matrix without diagonal elements . with the introduction of the vertex strength @xmath375 , modularity reads @xmath663 , \label{eq : mult1}\ ] ] for the general case of a weighted graph . the notation is the same as in eq . [ eq : mod20 ] , @xmath621 is the number of vertices in cluster @xmath117 . we see that now the relative importance of the two terms in each summand depends on @xmath375 , which can take any value in @xmath664 - 2w / n , \infty[$ ] . arenas et al . made a sweep in the range of @xmath375 , and determined for each @xmath375 the maximum modularity with extremal optimization ( section  [ sub_sec6_0_3 ] ) and _ tabu search _ meaningful cluster structures correspond to plateaus in the plot of the number of clusters versus @xmath375 ( fig .  [ figarenasplat ] ) . the length of a plateau gives a measure of the _ stability _ of the partition against the variation of @xmath375 . the procedure is able to disclose the community structure of a number of real benchmark graphs . as expected , the most relevant partitions can be found in intervals of @xmath375 not including the value @xmath665 , which corresponds to the case of standard modularity ( fig .  [ figarenasplat ] ) . analysis of zachary s karate club with the multiresolution method by arenas et al . the plot shows the number of clusters obtained in correspondence of the resolution parameter @xmath375 . the longest plateau @xmath666 indicates the most stable partition , which exactly matches the social fission observed by zachary . the partition obtained with straight modularity optimization ( @xmath665 ) consists of four clusters and is much less stable with respect to @xmath666 , as suggested by the much shorter length of its plateau . reprinted figure with permission from ref . 2008 by iop publishing . ]    a drawback of the method is that it is very slow , as one has to compute the modularity maximum for many values of @xmath375 in order to discriminate between relevant and irrelevant partitions . if the modularity maximum is computed with precise methods like simulated annealing and/or extremal optimization , as in ref . @xcite , only graphs with a few hundred vertices can be analyzed on a single processor . on the other hand the algorithm can be trivially parallelized by running the optimization for different values of @xmath375 on different processors . this is a common feature of all multiresolution methods discussed in this section . in spite of the different formal expressions of modularity , the methods by arenas et al . and reichardt and bornholdt are somewhat related to each other and yield similar results  @xcite on zachary s karate club  @xcite ( section  [ sec6_1 ] ) , synthetic graphs  la ravasz - barabsi  @xcite and on a model graph with the properties of real weighted social networks . in fact , their modularities can be both recovered from the continuous - time version of the stability of clustering under random walk , introduced by delvenne et al . @xcite ( section  [ sec44_2 ] ) . lancichinetti et al . have designed a multiresolution method which is capable of detecting both the hierarchical structure of graphs and overlapping communities  @xcite . it is based on the optimization of a fitness function , which estimates the strength of a cluster and entails a resolution parameter @xmath18 . the function could in principle be arbitrary , in their applications the authors chose a simple ansatz based on the tradeoff between the internal and the total degree of the cluster . the optimization procedure starts from a cluster with a single vertex , arbitrarily selected . given a cluster core , one keeps adding and removing neighboring vertices of the cluster as long as its fitness increases . the fitness is recalculated after each addition / removal of a vertex . at some point one reaches a local maximum and the cluster is `` closed '' . then , another vertex is chosen at random , among those not yet assigned to a cluster , a new cluster is built , and so on , until all vertices have been assigned to clusters . during the buildup of a cluster , vertices already assigned to other clusters may be included , i.  e. communities may overlap . the computational complexity of the algorithm , estimated on sparse erds - rnyi random graphs , is @xmath667 , with @xmath668 for small values of the resolution parameter @xmath18 , and @xmath669 if @xmath18 is large . for a complete analysis , the worst - case computational complexity is @xmath128 , where the factor @xmath241 comes from the minimum number of different @xmath18-values which are needed to resolve the actual community structure of the graph . relevant partitions are revealed by pronounced spikes in the histogram of the fitness values of covers obtained for different @xmath18-values , where the fitness of a cover is defined as the average fitness of its clusters .    a technique based on the potts model , similar to that of reichardt and bornholdt  @xcite , has been suggested by ronhovde and nussinov  @xcite . the energy of their spin model is @xmath670\delta(\sigma_i,\sigma_j ) . \label{eq : mult2}\ ] ] the big difference with eq . [ eqr13 ] is the absence of a null model term . the model considers pairs of vertices in the same community : edges between vertices are energetically rewarded , whereas missing edges are penalized . the parameter @xmath371 fixes the tradeoff between the two contributions . the energy is minimized by sequentially shifting single vertices / spins to the communities which yield the largest decrease of the system s energy , until convergence . if , for each vertex , one just examines the communities of its neighbors , the energy is minimized in a time @xmath671 , where @xmath19 turns out to be slightly above @xmath2 in most applications , allowing for the analysis of large graphs . this essentially eliminates the problem of limited resolution , as the criterion to decide about the merger or the split of clusters only depends on local parameters . still , for the detection of possible hierarchical levels tuning @xmath371 is mandatory . in a successive paper  @xcite , the authors have introduced a new stability criterion for the partitions , consisting of the computation of the similarity of partitions obtained for the same @xmath371 and different initial conditions . the idea is that , if a partition is robust in a given range of @xmath371-values , most replicas delivered by the algorithm will be very similar . on the other hand , if one explores a region of resolutions in between two strong partitions , the algorithm will deliver the one or the other partition and the individual replicas will be , on average , not so similar to each other . so , by plotting the similarity as a function of the resolution parameter @xmath371 , stable communities are revealed by peaks . ronhovde and nussinov adopted similarity measures borrowed from information theory ( section  [ sec6_2 ] ) . their criterion of stability can be adopted to determine the relevance of partitions obtained with any multiresolution algorithm . a general problem of multiresolution methods is how to assess the stability of partitions for large graphs . the rapidly increasing number of partitions , obtained by minimal shifts of vertices between clusters , introduces a large amount of noise , that blurs signatures of stable partitions like plateaus , spikes , etc . that one can observe in small systems . in this respect , it seems far more reliable focusing on correlations between partitions ( like the average similarity used by ronhovde and nussinov  @xcite ) than on properties of the individual partitions ( like the measures of occurrence used by arenas et al . @xcite and by lancichinetti et al . @xcite ) . the natural procedure to detect the hierarchical structure of a graph is hierarchical clustering , that we have discussed in section  [ sec4_2 ] . there we have emphasized the main weakness of the procedure , which consists of the necessity to introduce a criterion to identify relevant partitions ( hierarchical levels ) out of the full dendrogram produced by the given algorithm . furthermore , there is no guarantee that the results indeed reflect the actual hierarchical structure of the graph , and that they are not mere artefacts of the algorithm itself . scholars have just started to deal with these problems . sales - pardo et al . have proposed a top - down approach  @xcite . their method consists of two steps : 1 ) measuring the similarity between vertices ; 2 ) deriving the hierarchical structure of the graph from the similarity matrix . the similarity measure , named _ node affinity _ , is based on newman - girvan modularity . basically the affinity between two vertices is the frequency with which they coexist in the same community in partitions corresponding to local optima of modularity . the latter are configurations for which modularity is stable , i.  e. it can not increase if one shifts one vertex from one cluster to another or by merging or splitting clusters . the set of these partitions is called @xmath672 . before proceeding with the next step , one verifies whether the graph has a significant community structure or not . this is done by calculating the @xmath406-score ( eq .  [ eq : zscore ] ) for the average modularity of the partitions in @xmath672 with respect to the average modularity of partitions with local modularity optima of the equivalent ensemble of null model graphs , obtained as usual by randomly rewiring the edges of the original graph under the condition that the expected degree sequence is the same as the degree sequence of the graph . large @xmath406-scores indicate meaningful cluster structure : sales - pardo et al . used a threshold corresponding to the @xmath673 significance level - score has to be computed with respect to the actual distribution of the maximum modularity for the null model graphs , as the latter is not gaussian ( section  [ sub_sec6_1 ] ) . ] . if the graph has a relevant cluster structure , one proceeds with the second step , which consists in putting the affinity matrix in a form as close as possible to block - diagonal , by minimizing a cost function expressing the average distance of connected vertices from the diagonal . the blocks correspond to the communities and the recovered partition represents the uppermost organization level . to determine lower levels , one iterates the procedure for each subgraph identified at the previous level , which is treated as an independent graph . the procedure stops when all blocks found do not have a relevant cluster structure , i.  e. their @xmath406-scores are lower than the threshold . the partitions delivered by the method are hierarchical by construction , as communities at each level are nested within communities at higher levels . however , the method may find no relevant partition ( no community structure ) , a single partition ( community structure but no hierarchy ) or more ( hierarchy ) and in this respect it is better than most existing methods . the algorithm is not fast , as both the search of local optima for modularity and the rearrangement of the similarity matrix are performed with simulated annealing , but delivers good results for computer generated networks , and meaningful partitions for some real networks , like the world airport network  @xcite , an email exchange network of a catalan university  @xcite , a network of electronic circuits  @xcite and metabolic networks of _ e. coli _  @xcite . clauset et al . @xcite described the hierarchical organization of a graph by introducing a class of _ hierarchical random graphs_. a hierarchical random graph is defined by a dendrogram @xmath674 , which is the natural representation of the hierarchy , and by a set of probabilities @xmath675 associated to the @xmath143 internal nodes of the dendrogram . ancestor _ of a vertex @xmath67 is any internal node of the dendrogram that is encountered by starting from the `` leaf '' vertex @xmath67 and going all the way up to the top of the dendrogram . the probability that vertices @xmath67 and @xmath68 are linked to each other is given by the probability @xmath676 of the lowest common ancestor of @xmath67 and @xmath68 . clauset et al . searched for the model @xmath677 that best fits the observed graph topology , by using bayesian inference ( section  [ subsec_statinf1 ] ) . the probability that the model fits the graph is proportional to the likelihood @xmath678 here , @xmath679 is the number of edges connecting vertices whose lowest common ancestor is @xmath375 , @xmath680 and @xmath681 are the numbers of graph vertices in the left and right subtrees descending from the dendrogram node @xmath375 , and the product runs over all internal dendrogram nodes . for a given dendrogram @xmath674 , the maximum likelihood @xmath682 corresponds to the set of probabilities @xmath683 , where @xmath684 equals the actual density of edges @xmath685 between the two subtrees of @xmath375 ( fig . [ clausethier ] ) . hierarchical random graphs by clauset et al . the picture shows two possible dendrograms for the simple graph on the top . the linking probabilities on the internal nodes of the dendrograms yield the best fit of the model graphs to the graph at study . reprinted figure with permission from ref . 2008 by the nature publishing group . ]    one can define the statistical ensemble of hierarchical random graphs describing a given graph @xmath23 , by assigning to each model graph @xmath686 a probability proportional to the maximum likelihood @xmath682 . the ensemble can be sampled by a markov chain monte carlo method  @xcite . the procedure suggested by clauset et al . seems to converge to equilibrium roughly in a time @xmath129 , although the actual complexity may be much higher . still , the authors were able to investigate graphs with a few thousand vertices . from sufficiently large sets of model configurations sampled at equilibrium , one can compute average properties of the model , e. g. degree distributions , clustering coefficients . etc . , and compare them with the corresponding properties of the original graph . tests on real graphs reveal that the model is indeed capable to describe closely the graph properties . furthermore , the model enables one to predict missing connections between vertices of the original graph . this is a very important problem  @xcite : edges of real graphs are the result of observations / experiments , that may fail to discover some relationships between the units of the system . from the ensemble of the hierarchical random graphs one can derive the average linking probability between all pairs of graph vertices . by ranking the probabilities corresponding to vertex pairs which are disconnected in the original graph , one may expect that the pairs with highest probabilities are likely to be connected in the system , even if such connections are not observed . clauset et al . pointed out that their method does not deliver a sharp hierarchical organization for a given graph , but a class of possible organizations , with well - defined probabilities . it is certainly reasonable to assume that many structures are compatible with a given graph topology . in the case of community structure , it is not clear which information one can extract from averaging over the ensemble of hierarchical random graphs . moreover , since the hierarchical structure is represented by a dendrogram , it is impossible to rank partitions according to their relevance . in fact , the work by clauset et al . questions the concept of `` relevant partition '' , and opens a debate in the scientific community about the meaning itself of graph clustering . the software of the method can be found at http://www.santafe.edu/@xmath215aaronc / hierarchy/. the analysis of dynamic communities is still in its infancy . studies in this direction have been mostly hindered by the fact that the problem of graph clustering is already controversial on single graph realizations , so it is understandable that most efforts still concentrate on the `` static '' version of the problem . another difficulty is represented by the dearth of timestamped data on real graphs . recently , several data sets have become available , enabling to monitor the evolution in time of real systems  @xcite . so it has become possible to investigate how communities form , evolve and die . the main phenomena occurring in the lifetime of a community are ( fig . [ commevol ] ) : birth , growth , contraction , merger with other communities , split , death . possible scenarios in the evolution of communities . reprinted figure with permission from ref . 2007 by the nature publishing group . ]    the first study was carried out by hopcroft et al . @xcite , who analyzed several snapshots of the citation graph induced by the nec citeseer database  @xcite . the snapshots cover the period from @xmath687 to @xmath688 . communities are detected by means of ( agglomerative ) hierarchical clustering ( section  [ sec4_2 ] ) , where the similarity between vertices is the _ cosine similarity _ of the vectors describing the corresponding papers , a well known measure used in information retrieval  @xcite . in each snapshot hopcroft et al . identified the _ natural communities _ , defined as those communities of the hierarchical tree that are only slightly affected by minor perturbations of the graph , where the perturbation consists in removing a small fraction of the vertices ( and their edges ) . such natural communities are conceptually similar to the _ stable _ communities we will see in section  [ sec6_4 ] . hopcroft et al . found the best matching natural communities across different snapshots , and in this way they could follow the history of communities . in particular they could see the emergence of new communities , corresponding to new research topics . the main drawback of the method comes from the use of hierarchical clustering , which is unable to sort out meaningful communities out of the hierarchical tree , which includes many different partitions of the graph . more recently , palla et al . performed a systematic analysis of dynamic communities  @xcite . they studied two social systems : 1 ) a graph of phone calls between customers of a mobile phone company in a year s time ; 2 ) a collaboration network between scientists , describing the coauthorship of papers in condensed matter physics from the electronic e - print archive ( cond - mat ) maintained by cornell university library , spanning a period of 142 months . the first problem is identifying the image of a community @xmath689 at time @xmath690 among the communities of the graph at time @xmath156 . a simple criterion , used in other works , is to measure the relative overlap ( eq . [ eqt20 ] ) of @xmath689 with all communities at time @xmath156 , and pick the community which has the largest overlap with @xmath689 . this is intuitive , but in many cases it may miss the actual evolution of the community . for instance , if @xmath691 at time @xmath690 grows considerably and overlaps with another community @xmath692 ( which at the previous time step was disjoint from @xmath691 ) , the relative overlap between @xmath689 and @xmath693 may be larger than the relative overlap between @xmath689 and @xmath691 . it is not clear whether there is a general prescription to avoid this problem . palla et al . solved it by exploiting the features of the clique percolation method ( cpm ) ( section  [ sec45_1 ] ) , that they used to detect communities . the idea is to analyze the graph @xmath694 , obtained by merging the two snapshots @xmath695 and @xmath696 of the evolving graph , at times @xmath156 and @xmath690 ( i. e. , by putting together all their vertices and edges ) . any cpm community of @xmath695 and @xmath696 does not get lost , as it is included within one of the cpm communities of @xmath694 . for each cpm community @xmath697 of @xmath694 , one finds the cpm communities @xmath698 and @xmath699 ( of @xmath695 and @xmath696 , respectively ) which are contained in @xmath697 . the image of any community in @xmath699 at time @xmath156 is the community of @xmath698 that has the largest relative overlap with it . the age @xmath253 of a community is the time since its birth . it turns out that the age of a community is positively correlated with its size @xmath700 , i. e. that older communities are also larger ( on average ) . the time evolution of a community @xmath22 can be described by means of the relative overlap @xmath701 between states of the community separated by a time @xmath156 : @xmath702 one finds that , in both data sets , @xmath701 decays faster for larger communities , so the composition of large communities is rather variable in time , whether small communities are essentially static . another important question is whether it is possible to predict the evolution of communities from information on their structure or on their vertices . in fig . [ evolpred]a the probability @xmath703 that a vertex will leave the community in the next step of the evolution is plotted as a function of the relative external strength of the vertex , indicating how much of the vertex strength lies on edges connecting it to vertices outside its community . the plot indicates that there is a clear positive correlation : vertices which are only loosely connected to vertices of their community have a higher chance ( on average ) to leave the community than vertices which are more `` committed '' towards the other community members . the same principle holds at the community level too . relation between structural features and evolution of a community . a ) relation between the probability that a vertex will abandon the community in the next time step and its relative external strength . b ) relation between the probability of disintegration of a community in the next time step and its relative external strength . reprinted figure with permission from ref . 2007 by the nature publishing group . ]    fig . [ evolpred]b shows that the probability @xmath704 that a community will disintegrate in the next time step is positively correlated with the relative external strength of the community . finally , palla et al . have found that the probability for two communities to merge increases with the community sizes much more than what one expects from the size distribution , which is consistent with the faster dynamics observed for large communities . palla et al . analyzed two different real systems , a network of mobile phone communications and a coauthorship network , to be able to infer general properties of community evolution . however , communities were only found with the cpm , so their results need to be cross - checked by employing other clustering techniques . asur et al . @xcite explored the dynamic relationship between vertices and communities . communities were found with the mcl method by van dongen  @xcite ( section  [ sec44_2 ] ) , by analyzing the graph at different timestamps . asur et al . distinguished events involving communities and events involving the vertices . events involving communities are _ continue _ ( the community keeps most of its vertices in consecutive time steps ) , _ @xmath705-merge _ ( two clusters merge into another ) , _ @xmath705-split _ ( two clusters split in two parts ) , _ form _ ( no pair of vertices of the cluster at time @xmath690 were in the same cluster at time @xmath156 ) and _ dissolve _ ( opposite of _ form _ ) . events involving vertices are _ appear _ ( if a vertex joins the graph for the first time ) , _ disappear _ ( if a vertex of the graph at time @xmath156 is no longer there at time @xmath690 ) , _ join _ ( if a vertex of a cluster at time @xmath690 was not in that cluster at time @xmath156 ) and _ leave _ ( if a vertex which was in a cluster at time @xmath156 is not in that cluster at time @xmath690 ) . based on such events , four measures are defined in order to catch the behavioral tendencies of vertices contributing to the evolution of the graph : the _ stability index _ ( measuring the tendency of a vertex to interact with the same vertices over time ) , the _ sociability index _ ( measuring the number of different interactions of a vertex , basically the number of _ join _ and _ leave _ events ) , the _ popularity index _ ( measuring the number of vertices attracted by a cluster in a given time interval ) and the _ influence index _ ( measuring the influence a vertex has on the others , which is computed from the number of vertices that leave or join a cluster together with the vertex ) . applications on a coauthorship network of computer scientists and on a network of subjects for clinical trials show that the behavioral measures above enable one to make reliable predictions about the time evolution of such graphs ( including , e. g. , the inference of missing links  @xcite ) . dynamic communities can be as well detected with methods of information compression , such as some of those we have seen in section  [ subsec_statinf2 ] . sun et al . @xcite applied the minimum description length ( mdl ) principle  @xcite to find the minimum encoding cost for the description of a time sequence of graphs and their partitions in communities . the method is quite similar to that successively developed by rosvall and bergstrom  @xcite , which is however defined only for static graphs ( section  [ subsec_statinf2 ] ) . here one considers bipartite graphs evolving in time . the time sequence of graphs can be separated in segments , each containing some number of consecutive snapshots of the system . the graphs of each segment are supposed to have the same modular structure ( i. e. they represent the same phase in the history of the system ) , so they are characterized by the same partition of the two vertex classes . for each graph segment it is possible to define an encoding cost , which combines the encoding cost of the partition of the graphs of the segment with the entropy of compression of the segment in the subgraph segments induced by the partition . the total encoding cost @xmath706 of the graph series is given by the sum of the encoding costs of its segments . minimizing @xmath706 enables one to find not only the most modular partition for each graph segment ( high modularity corresponds to low encoding costs for a partition ) , but also the most compact subdivision of the snapshots into segments , such that graphs in the same segment are strongly correlated with each other . the latter feature allows to identify _ change points _ in the time history of the system , i. e. short periods in which the dynamics produces big changes in the graph structure ( corresponding to , e.g. , extreme events ) . the minimization of @xmath706 is @xmath622-hard , so the authors propose an approximation method called _ graphscope _ , which consists of two steps : first , one looks for the best partition of each graph segment ; second , one looks for the best division in segments . in both cases the `` best '' result corresponds to the minimal encoding cost . the best partition within a graph segment is found by local search . graphscope has the big advantage not to require any input , like the number and sizes of the clusters . it is also suitable to operate in a streaming environment , in which new graph configurations are added in time , following the evolution of the system : the computational complexity required to process a snapshot ( on average ) is stable over time . tests on real evolving data sets show that graphscope is able to find meaningful communities and change points .    since keeping track of communities in different time steps is not a trivial problem , as we have seen above , it is perhaps easier to adopt a vertex - centric perspective , in which one monitors the community of a given vertex at different times . for any method , given a vertex @xmath67 and a time @xmath156 , the community to which @xmath67 belongs at time @xmath156 is well defined . fenn et al . @xcite used the multiresolution method by reichardt et al . @xcite ( section  [ sub_sec6_01 ] ) and investigated a fully connected graph with time - dependent weights , representing the correlations of time series of hourly exchange rate returns . the resolution parameter @xmath371 is fixed to the value that occurs in most stability plateaus of the system at different time steps . motivated by the work of guimer and amaral  @xcite ( section  [ sec7_1 ] ) , fenn et al . identify the role of individual vertices in their community through the pair @xmath707 , where @xmath708 is the @xmath406-score of the internal strength ( weighted degree , section  [ sec1_1 ] ) , defined in eq . [ eqtrol1 ] , and @xmath709 the @xmath406-score of the site betweenness , defined by replacing the internal degree with the site betweenness of freeman  @xcite in eq . [ eqtrol1 ] . we remind that the site betweenness is a measure of the number of shortest paths running through a vertex . the variable @xmath709 expresses the importance of a vertex in processes of information diffusion with respect to the other members of its community . another important issue regards the _ persistence _ of communities in time , i. e. how stable they are during the evolution . as a measure of persistence , fenn et al . introduced a vertex - centric version of the relative overlap of eq . [ eqtrol3 ] @xmath710 where @xmath67 is the vertex and @xmath711 , @xmath712 the communities of @xmath67 at times @xmath156 , @xmath713 , respectively . the decay of @xmath714 depends on the type of vertex . in particular , if the vertex is strongly connected to its community ( @xmath708 large ) , @xmath714 decays quite slowly , meaning that it tends to stay attached to a stable core of vertices . the methods described above are basically two - stage approaches , in which clusters are detected at each timestamp of the graph evolution , independently of the results at different times , and relationships between partitions at different times are inferred successively . however , this often produces significant variations between partitions close in time , especially when , as it usually happens , the datasets are noisy . in this case one would be forced to introduce _ ad hoc _ hypotheses on the graph evolution to justify the variability of the modular structure , whereas such variability is mostly an artefact of the approach . it would be desirable instead to have a unified framework , in which clusters are deduced both from the current structure of the graph and from the knowledge of the cluster structure at previous times . this is the principle of _ evolutionary clustering _ , a framework introduced by chakrabarti et al . @xcite and successively adopted and refined by other authors . let @xmath715 be the partition of the graph at time @xmath156 . the _ snapshot quality _ of @xmath715 measures the goodness of the partition with respect to the graph structure at time @xmath156 . the _ history cost _ is a measure of the distance / dissimilarity of @xmath715 with respect to the partition @xmath716 at the previous time step . the overall quality of @xmath715 is given by a combination of the snapshot quality and the history cost at each time step . ideally , a good partition should have high snapshot quality ( i. e. it should cluster well the data at time @xmath156 ) and low history cost ( i. e. it should be similar to the partition at the previous time step ) . in order to find @xmath715 from @xmath716 and the relational data at time @xmath156 chakrabarti et al . suggested to minimize the difference between the snapshot quality and the history cost , with a relative weight @xmath717 that is a tunable parameter . the input of the procedure consists in the sequence of adjacency / similarity matrices at different time steps . in practice , one could use modified versions of such matrices , obtained by performing ( weighted ) averages of the data over some time window , in order to make the relational data more robust against noise and the results of the clustering procedure more reliable . one can adopt arbitrary measures to compute the snapshot quality and the historical cost . besides , several known clustering techniques used for static graphs can be reformulated within this evolutionary framework . chakrabarti et al . derived evolutionary versions of hierarchical clustering ( section  [ sec4_2 ] ) and @xmath44-means clustering ( section  [ sec4_3 ] ) , whereas chi et al .  @xcite designed two implementations for spectral clustering ( section  [ sec4_4 ] ) . based on evolutionary clustering , lin et al . @xcite introduced a framework , called _ facetnet _ , that allows vertices to belong to more communities at the same time . here the snapshot cost is the kullback - leibler ( kl ) divergence  @xcite between the adjacency / similarity matrix at time @xmath156 and the matrix describing the community structure of the graph at time @xmath156 ; the history cost is the kl divergence between the matrices describing the community structure of the graph at times @xmath718 and @xmath156 . facetnet can be extended to handle adding and removing of vertices as well as variations of the number of clusters in consecutive time steps . however , it is not able to account for the creation and the disintegration of communities and not scalable to large systems due to the high number of iterations necessary for the matrix computations to reach convergence . these issues have been addressed in a recent approach by kim and han  @xcite . naturally , what one hopes to achieve at the end of the day is to see how real groups form and evolve in time . backstrom et al . @xcite have carried out an analysis of group dynamics in the free online community of livejournal ( http://www.livejournal.com/ ) and in a coauthorship network of computer scientists . here the groups are identified through the declared memberships of users ( for livejournal ) and conferences attended by computer scientists , respectively . backstrom and coworkers have found that the probability that an individual joins a community grows with the number of friends / coauthors who are already in the community and ( for livejournal ) with their degree of interconnectedness . moreover , the probability of growth of livejournal communities is positively correlated to a combination of factors including the community size , the number of friends of community members which are not in the community and the ratio of these two numbers . a high density of triads within a community appears instead to hinder its growth . given a network , many partitions could represent meaningful clusterings in some sense , and it could be difficult for some methods to discriminate between them . quality functions evaluate the goodness of a partition ( section  [ sec3_2_2 ] ) , so one could say that high quality corresponds to meaningful partitions . but this is not necessarily true . in section  [ sub_sec6_1 ] we have seen that high values of the modularity of newman and girvan do not necessarily indicate that a graph has a definite cluster structure . in particular we have seen that partitions of random graphs may also achieve considerably large values of @xmath90 , although we do not expect them to have community structure , due to the lack of correlations between the linking probabilities of the vertices . the optimization of quality functions , like modularity , delivers the best partition according to the criterion underlying the quality function . but is the optimal clustering also _ significant _ , i.  e. a relevant feature of the graph , or is it just a byproduct of randomness and basic structural properties like , e. g. , the degree sequence ? little effort has been devoted to this crucial issue , that we discuss here .    in some works the concept of significance has been related to that of _ robustness _ or _ stability _ of a partition against random perturbations of the graph structure . the basic idea is that , if a partition is significant , it will be recovered even if the structure of the graph is modified , as long as the modification is not too extensive . instead , if a partition is not significant , one expects that minimal modifications of the graph will suffice to disrupt the partition , so other clusterings are recovered . a nice feature of this approach is the fact that it can be applied for any clustering technique . gfeller et al . @xcite considered the general case of weighted graphs . a graph is modified , in that its edge weights are increased or decreased by a relative amount @xmath719 . this choice also allows to account for the possible effects of uncertainties in the values of the edge weights , resulting from measurements / experiments carried out on a given system . after fixing @xmath720 ( usually to @xmath721 ) , multiple realizations of the original graph are generated . the best partition for each realization is identified and , for each pair of adjacent vertices @xmath67 and @xmath68 , the _ in - cluster _ probability @xmath362 is computed , i.  e. the fraction of realizations in which @xmath67 and @xmath68 were classified in the same cluster . edges with in - cluster probability smaller than a threshold @xmath722 ( usually @xmath723 ) are called _ external edges_. the stability of a partition is estimated through the _ clustering entropy _ @xmath724 , \label{sign1}\ ] ] where @xmath14 is , as usual , the number of graph edges , and the sum runs over all edges . the most stable partition has @xmath725 along inter - cluster edges and @xmath726 along intra - cluster edges , which yields @xmath727 ; the most unstable partition has @xmath728 on all edges , yielding @xmath729 . the absolute value of @xmath87 is not meaningful , though , and needs to be compared with the corresponding value for a null model graph , similar to the original graph , but with supposedly no cluster structure . gfeller et al . adopted the same null model of newman - girvan modularity , i.  e. the class of graphs with expected degree sequence coinciding with that of the original graph . since the null model is defined on unweighted graphs , the significance of @xmath87 can be assessed only in this case , although it would not be hard to think of a generalization to weighted graphs . the approach enables one as well to identify _ unstable vertices _ , i.  e. vertices lying at the boundary between clusters . in order to do that , the external edges are removed and the connected components of the resulting disconnected graph are associated with the clusters detected in the original graph , based on their relative overlap ( computed through eq . [ eqt20 ] ) . unstable vertices end up in components that are not associated to any of the initial clusters . a weakness of the method by gfeller et al . is represented by the two parameters @xmath720 and @xmath722 , whose values are in principle arbitrary . more recently , karrer et al . @xcite adopted a similar strategy to unweighted graphs . here one performs a sweep over all edges : the perturbation consists in removing each edge with a probability @xmath18 and replacing it with another edge between a pair of vertices @xmath730 , chosen at random with probability @xmath369 , where @xmath105 and @xmath106 are the degrees of @xmath67 and @xmath68 . we recognize the probability of the null model of newman - girvan modularity . indeed , by varying the probability @xmath18 from @xmath631 to @xmath2 one smoothly interpolates between the original graph ( no perturbation ) and the null model ( maximal perturbation ) . the degree sequence of the graph remains invariant ( on average ) along the whole process , by construction . the idea is that the perturbation affects solely the organization of the vertices , keeping the basic structural properties . for a given value of @xmath18 , many realizations of the perturbed graph are generated , their cluster structures are identified with some method ( karrer et al . used modularity optimization ) and compared with the partition obtained from the original unperturbed graph . the partitions are compared by computing the variation of information @xmath638 ( section  [ sec6_2 ] ) . from the plot of the average @xmath731 versus @xmath18 one can assess the stability of the cluster structure of the graph . if @xmath732 changes rapidly for small values of @xmath18 the partition is likely to be unstable . as in the approach by gfeller et al . the behaviour of the function @xmath732 does not have an absolute meaning , but needs to be compared with the corresponding curve obtained for a null model . for consistency , the natural choice is again the null model of modularity , which is already used in the process of graph perturbation . the approaches by gfeller et al . and karrer et al . , with suitable modifications , can also be used to check for the stability of the cluster structure in parts of a graph , up to the level of individual communities . this is potentially important as it may happen that some parts of the graph display a strong community structure and other parts weak or no community structure at all . rosvall and bergstrom  @xcite defined the significance of clusters with the bootstrap method  @xcite , which is a standard procedure to check for the accuracy of a measurement / estimate based on resampling from the empirical data . the graph at study is supposed to be generated by a parametric model , which is used to create many samples . this is done by assigning to each edge a weight taken by a poisson distribution with mean equal to the original edge weight . for the initial graph and each sample one identifies the community structure with some method , that can be arbitrary . for each cluster of the partition of the original graph one determines the largest subset of vertices that are classified in the same cluster in at least @xmath733 of all bootstrap samples . identifying such cluster cores enables one to track the evolution in time of the community structure , as we explained in section  [ sec7_1_2 ] . a different approach has been proposed by massen and doye  @xcite . they analyzed an equilibrium canonical ensemble of partitions , with @xmath734 playing the role of the energy , @xmath90 being newman - girvan modularity . this means that the probability of occurrence of a partition at temperature @xmath467 is proportional to @xmath735 . the idea is that , if a graph has a significant cluster structure , at low temperatures one would recover essentially the same partition , corresponding to the modularity maximum , which is separated by an appreciable gap from the modularity values of the other partitions . on the contrary , graphs with no community structure , e. g. random graphs , have many competing ( local ) maxima , and the corresponding configurations will emerge already at low temperatures , since their modularity values are close to the absolute maximum , good et al . @xcite have actually shown that the modularity landscape has a huge degeneracy of states with high modularity values , close to the global maximum , especially on graphs with community structure . so the results of the method by massen and doye may be misleading . ] . these distinct behaviors can manifest themselves in various ways . for instance , if one considers the variation of the specific heat @xmath736 with @xmath467 , the gap in the modularity landscape is associated to a sharp peak of @xmath706 around some temperature value , like it happens in a phase transition . if the gap is small and there are many partitions with similar modularity values , the peak of @xmath706 becomes broad . another strategy to assess the significance of the maximum modularity partition consists of the investigation of the similarity between partitions recovered at a given temperature @xmath467 . this similarity can be expressed by the _ frequency matrix _ , whose element @xmath737 indicates the relative number of times vertices @xmath67 and @xmath68 have been classified in the same cluster . if the graph has a clear community structure , at low temperatures the frequency matrix can be put in block - diagonal form , with the blocks corresponding to the communities of the best partition ; if there is no significant community structure , the frequency matrix is rather homogeneous . the fiedler eigenvalue  @xcite @xmath144 , the second smallest eigenvalue of the laplacian matrix associated to the frequency matrix , allows to estimate how `` block - diagonal '' the matrix is ( see section  [ sec4_1 ] ) . at low temperatures @xmath738 if there is one ( a few ) partitions with maximum or near to maximum modularity ; if there are many ( almost ) degenerate partitions , @xmath144 is appreciably different from zero even when @xmath739 . a sharp transition from low to high values of @xmath144 by varying temperature indicates significant community structure . another clear signature of significant community structure is the observation of a rapid drop of the average community size with @xmath467 , as `` strong '' communities break up in many small pieces for a modest temperature increase , while the disintegration of `` weak '' communities takes place more slowly . in scale - free graphs ( section  [ sec1_3 ] ) clusters are often not well separated , due to the presence of the hubs ; in these cases the above - mentioned transitions of ensemble variables are not so sharp and take place over a broader temperature range . the canonical ensemble of partitions is generated through single spin heatbath simulated annealing  @xcite , combined with parallel tempering  @xcite . the approach by massen and doye could be useful to recognize graphs without cluster structure , if the modularity landscape is characterized by many maxima with close values ( but see footnote ) . however , it can happen that gaps between the absolute modularity maximum and the rest of the modularity values are created by fluctuations , and the method is unable to identify these situations . furthermore , the approach heavily relies on modularity and on a costly technique like simulated annealing : extensions to other quality functions and/or optimization procedures do not appear straightforward . in a recent work by bianconi et al .  @xcite the notion of entropy of graph ensembles  @xcite is employed to find out how likely it is for a cluster structure to occur on a graph with a given degree sequence . the entropy is computed from the number of graph configurations which are compatible with a given classification of the vertices in @xmath91 groups . the clustering is quantitatively described by fixing the number of edges @xmath740 running between clusters @xmath562 and @xmath563 , for all choices of @xmath741 . bianconi et al . proposed the following indicator of clustering significance @xmath742 where @xmath743 is the entropy of the graph configurations with given degree sequence @xmath744 and clustering @xmath745 ( with fixed numbers of inter - cluster edges @xmath740 ) , and @xmath746 is the average entropy of the configurations with the same degree sequence and a random permutation @xmath747 of the cluster labels . the absolute value of the entropy @xmath743 is not meaningful , so the comparison of @xmath743 and @xmath746 is crucial , as it tells how relevant the actual cluster structure is with respect to a random classification of the vertices . however , different permutations of the assignments @xmath745 yield different values of the entropy , which can fluctuate considerably . therefore one has to compute the standard deviation @xmath748 of the entropy corresponding to all random permutations @xmath747 , to estimate how significant the difference between @xmath743 and @xmath746 is . in this way , if @xmath749 , the entropy of the given cluster structure is of the same order as the entropy of some random permutation of the cluster labels , so it is not relevant . instead , if @xmath750 , the cluster structure is far more likely than a random classification of the vertices , so the clustering is relevant . the indicator @xmath751 can be simply generalized to the case of directed and weighted graphs . lancichinetti et al . @xcite as well addressed the issue by comparing the cluster structure of the graph with that of a random graph with similar properties . an important novelty of this approach is the fact that it estimates the significance of single communities , not of partitions . in fact , not all communities are equally significant , in general , so it makes a lot of sense to check them individually . in particular , it may happen that real networks are not fully modular , due to their particular history or generating mechanisms , and that only portions of them display community structure . the main idea is to verify how likely it is that a community @xmath22 is a subgraph of a random graph with the same degree sequence of the original graph . this likelihood is called @xmath22-score , and is computed by examining the vertex @xmath752 of @xmath22 , with the lowest internal degree @xmath753 in @xmath22 ( the `` worst '' vertex ) . the @xmath22-score is defined as the probability that the internal degree of the worst vertex in the corresponding community of the null model graphs is larger than or equal to @xmath753 . this probability is computed by using tools from extreme and order statistics  @xcite . a low value of the @xmath22-score ( @xmath754 ) is a strong indication that the group of vertices at study is a community and not the product of random fluctuations . in addition , the measure can be used to check whether a subgraph has an internal modular structure . for that , one removes the vertices of the subgraph one at a time , starting from the worst and proceeding in increasing order of the internal degree , and observes how the @xmath22-score varies at each vertex removal : sharp drops indicate the presence of dense subgraphs ( fig .  [ cscore ] ) . therefore , one could think of using the @xmath22-score as ingredient of new clustering techniques . as we have seen , the @xmath22-score is based on the behavior of the vertex with lowest internal degree of the subgraph . real networks are characterized by noise , which could strongly affect the structural relationships between vertices and clusters . for this reason , relying on the properties of a single vertex to evaluate the significance of a subgraph could be a problem for applications to real networks . lancichinetti et al . have shown that the @xmath22-score can be easily extended to consider the @xmath156 vertices with lowest internal degree , with @xmath755 ( @xmath259-score ) . the main limit of the @xmath22-score is the fact that its null model is the same as that of newman - girvan modularity . according to this null model , each vertex can in principle be connected to any other , no matter how large the system is . this is however not realistic , especially for large graphs , where it is much more reasonable to assume that each vertex has its own `` horizon '' , i.e. a subset of other vertices with which it can interact , which is usually much smaller than the whole system ( see section  [ sub_sec6_1 ] ) . how to define such `` horizons '' and , more in general , realistic null models is still an open problem . however , the @xmath22-score could be easily reformulated with any null model , so one could readily derive more reliable definitions . we conclude with a general issue which is related to the significance of community structure . the question is : given a cluster structure in a graph , can it be recovered _ a priori _ by an algorithm ? in a recent paper  @xcite , reichardt and leone studied under which conditions a special built - in cluster structure can be recovered . the clusters have equal size and a pair of vertices is connected with probability @xmath45 if they belong to the same cluster , with probability @xmath756 otherwise . in computer science this is known as the _ planted partitioning problem _ the goal is to propose algorithms that recover the planted partition for any choice of @xmath45 and @xmath375 . for dense graphs , i.  e. graphs whose average degree grows with the number @xmath15 of vertices , algorithms can be designed that find the solution with a probability which equals @xmath2 minus a term that vanishes in the limit of infinite graph size , regardless of the difference @xmath757 , which can then be chosen arbitrarily small . since many real networks are not dense graphs , as their average degree @xmath758 is usually much smaller than @xmath15 and does not depend on it , reichardt and leone investigated the problem in the case of fixed @xmath758 and infinite graph size . we indicate with @xmath91 the number of clusters and with @xmath511 the probability that a randomly selected edge of the graph lies within any of the @xmath91 clusters . in this way , if @xmath759 , the inter - cluster edge density matches the intra - cluster edge density ( i.  e. @xmath760 ) , and the planted partition would not correspond to a recoverable clustering , whereas for @xmath761 , there are no inter - cluster edges and the partition can be trivially recovered . the value of @xmath511 is in principle unknown , so one has to detect the cluster structure ignoring this information . reichardt and leone proposed to look for a minimum cut partition , i.  e. for the partition that minimizes the number of inter - cluster edges , as it is usually done in the graph partitioning problem ( discussed in section  [ sec4_1 ] ) . clearly , for @xmath761 the minimum cut partition trivially coincides with the planted partition , whereas for @xmath762 there should be some overlap , which is expected to vanish in the limit case @xmath759 . the minimum cut partition corresponds to the minimum of the following ferromagnetic potts model hamiltonian @xmath763 over the set of all spin configurations with zero magnetization . here the spin @xmath357 indicates the cluster vertex @xmath67 belongs to , and the coupling matrix @xmath363 is just the adjacency matrix of the graph . the constraint of zero magnetization ensures that the clusters have all the same size , as required by the planted partitioning problem . the energy of a spin configuration , expressed by eq . [ eq : mod12 ] , is the negative of the number of edges that lie within clusters : the minimum energy corresponds to the maximum number of intra - cluster edges , which is coupled to the minimum number of inter - cluster edges . the minimum energy can be computed with the cavity method , or belief propagation , at zero temperature  @xcite . the accuracy of the solution with respect to the planted partition is expressed by the fraction of vertices which are put in the same class in both partitions . the analysis yields a striking result : the planted clustering is accurately recovered for @xmath511 larger than a critical threshold @xmath764 . so , there is a range of values of @xmath511 , @xmath765 , in which the clustering is not recoverable , as the minimum cut partition is uncorrelated with it . the threshold @xmath766 depends on the degree distribution @xmath767 of the graph . when a clustering algorithm is designed , it is necessary to test its performance , and compare it with that of other methods . in the previous sections we have said very little about the performance of the algorithms , other than their computational complexity . indeed , the issue of testing algorithms has received very little attention in the literature on graph clustering . this is a serious limit of the field . because of that , it is still impossible to state which method ( or subset of methods ) is the most reliable in applications , and people rely blindly on some algorithms instead of others for reasons that have nothing to do with the actual performance of the algorithms , like . e.g. popularity ( of the method or of its inventor ) . this lack of control is also the main reason for the proliferation of graph clustering techniques in the last few years . virtually in any paper , where a new method is introduced , the part about testing consists in applying the method to a small set of simple benchmark graphs , whose cluster structure is fairly easy to recover . because of that , the freedom in the design of a clustering algorithm is basically infinite , whereas it is not clear what a new procedure is adding to the field , if anything .    in this section we discuss at length the issue of testing . first , we describe the fundamental ingredients of any testing procedure , i.  e. benchmark graphs with built - in community structure , that methods have to identify ( section  [ sec6_1 ] ) . we proceed by reviewing measures to compare graph partitions with each other ( section  [ sec6_2 ] ) . in section  [ sec6_3 ] we present the comparative evaluations of different methods that have been performed in the literature . testing an algorithm essentially means applying it to a specific problem whose solution is known and comparing such solution with that delivered by the algorithm . in the case of graph clustering , a problem with a well - defined solution is a graph with a clear community structure . this concept is not trivial , however . many clustering algorithms are based on similar intuitive notions of what a community is , but different implementations . so it is crucial that the scientific community agrees on a set of reliable benchmark graphs . this mostly applies to computer - generated graphs , where the built - in cluster structure can be arbitrarily designed . in the literature real networks are used as well , in those cases in which communities are well defined because of information about the system . we start our survey from computer - generated benchmarks . a special class of graphs has become quite popular in the last years . they are generated with the so - called _ planted @xmath293-partition model _ the model partitions a graph with @xmath768 vertices in @xmath293 groups with @xmath126 vertices each . vertices of the same group are linked with a probability @xmath511 , whereas vertices of different groups are linked with a probability @xmath512 . each subgraph corresponding to a group is then a random graph  la erds - rnyi with connection probability @xmath769 ( section  [ sec1_3 ] ) . the average degree of a vertex is @xmath770 . if @xmath513 the intra - cluster edge density exceeds the inter - cluster edge density and the graph has a community structure . this idea is quite intuitive and we have encountered it in several occasions in the previous sections . girvan and newman considered a special case of the planted @xmath293-partition model  @xcite . they set @xmath771 , @xmath772 ( so the number of graph vertices is @xmath773 ) and fixed the average total degree @xmath420 to @xmath774 . this implies that @xmath775 , so the probabilities @xmath511 and @xmath512 are not independent parameters . in calculation it is common to use as parameters @xmath776 and @xmath777 , indicating the expected internal and external degree of a vertex , respectively . these particular graphs have by now gained the status of standard benchmarks  @xcite ( fig . [ figure11 ] ) .        in the first applications of the graphs one assumed that communities are well defined when @xmath778 , corresponding to the situation in which the internal degree exceeds the external degree . however , the threshold @xmath779 implies @xmath780 and @xmath781 , so it is not the actual threshold of the model , where @xmath782 , corresponding to @xmath783 . so , one expects to be able to detect the planted partition up until @xmath783 .    testing a method against the girvan - newman benchmark consists in calculating the similarity between the partitions determined by the method and the natural partition of the graph in the four equal - sized groups . several measures of partitions similarity may be adopted ; we describe them in section  [ sec6_2 ] . one usually builds many graph realizations for a particular value of @xmath784 and computes the average similarity between the solutions of the method and the built - in solution . the procedure is then iterated for different values of @xmath784 . the results are usually represented in a plot , where the average similarity is drawn as a function of @xmath784 . most algorithms usually do a good job for small @xmath784 and start to fail when @xmath784 approaches @xmath228 . fan et al . @xcite have designed a weighted version of the benchmark of girvan and newman , in that one gives different weights to edges inside and between communities . one could pick just two values , one for intra- and the other for inter - community edges , or uniformly distributed values in two different ranges . for this benchmark there are then two parameters that can be varied : @xmath784 and the relative importance of the internal and the external weights . typically one fixes the topological structure and varies the weights . this is particularly insightful when @xmath785 , which delivers graphs without topological cluster structure : in this case , the question whether there are clusters or not depends entirely on the weights . as we have remarked above , the planted @xmath293-partition model generates mutually interconnected random graphs  la erds - rnyi . therefore , all vertices have approximately the same degree . moreover , all communities have exactly the same size by construction . these two features are at odds with what is observed in graph representations of real systems . degree distributions are usually skewed , with many vertices with low degree coexisting with a few vertices with high degree . a similar heterogeneity is also observed in the distribution of cluster sizes , as we shall see in section  [ sec7_1 ] . so , the planted @xmath293-partition model is not a good description of a real graph with community structure . however , the model can be modified to account for the heterogeneity of degrees and community sizes . a modified version of the model , called _ gaussian random partition generator _ , was designed by brandes et al . @xcite . here the cluster sizes have a gaussian distribution , so they are not the same , although they do not differ much from each other . the heterogeneity of the cluster sizes introduces a heterogeneity in the degree distribution as well , as the expected degree of a vertex depends on the number of vertices of its cluster . still , the variability of degree and cluster size is not appreciable . besides , vertices of the same cluster keep having approximately the same degree . a better job in this direction has been recently done by lancichinetti et al . ( lfr benchmark )  @xcite . they assume that the distributions of degree and community size are power laws , with exponents @xmath786 and @xmath787 , respectively . each vertex shares a fraction @xmath788 of its edges with the other vertices of its community and a fraction @xmath789 with the vertices of the other communities ; @xmath790 is the _ mixing parameter_. the graphs are built as follows :    1 . a sequence of community sizes obeying the prescribed power law distribution is extracted . this is done by picking random numbers from a power law distribution with exponent @xmath787 . each vertex @xmath67 of a community receives an internal degree @xmath791 , where @xmath105 is the degree of vertex @xmath67 , which is taken by a power law distribution with exponent @xmath786 . in this way , each vertex @xmath67 has a number of stubs @xmath791 . all stubs of vertices of the same community are randomly attached to each other , until no more stubs are `` free '' . in this way the sequence of internal degrees of each vertex in its community is maintained . each vertex @xmath67 receives now an additional number of stubs , equal to @xmath792 ( so that the final degree of the vertex is @xmath105 ) , that are randomly attached to vertices of different communities , until no more stub is `` free '' . numerical tests show that this procedure has a complexity @xmath21 , where @xmath14 is as usual the number of edges of the graph , so it can be used to create graphs of sizes spanning several orders of magnitude . [ fignewbench ] shows an example of a lfr benchmark graph . recently the lfr benchmark has been extended to directed and weighted graphs with overlapping communities  @xcite . the software to create the lfr benchmark graphs can be freely downloaded at http://santo.fortunato.googlepages.com/inthepre + ss2 . a class of benchmark graphs with power law degree distributions had been previously introduced by bagrow  @xcite . the construction process starts from a graph with a power - law degree distribution . bagrow used barabsi - albert scale free graphs  @xcite . then , vertices are randomly assigned to one of four equally - sized communities . finally , pairs of edges between two communities are rewired so that either edge ends up within the same community , without altering the degree sequence ( on average ) . this is straightforward : suppose that the edges join the vertex pairs @xmath793 , @xmath794 and @xmath795 , @xmath796 , where @xmath793 , @xmath795 belong to community @xmath9 and @xmath794 , @xmath796 to community @xmath10 . it the edges are replaced by @xmath793-@xmath795 and @xmath794-@xmath796 ( provided they do not exist already ) , all vertices keep their degrees . with this rewiring procedure one can arbitrarily vary the edge density within and , consequently , between clusters . in this class of benchmarks , however , communities are all of the same size by construction , although one can in principle relax this condition . a ( seemingly ) different benchmark is represented by the class of _ relaxed caveman graphs _ , which were originally introduced to explain the clustering properties of social networks  @xcite . the starting point is a set of disconnected cliques . with some probability edges are rewired to link different cliques . such model graphs are interesting as they are smooth variations of the ideal graph with `` perfect '' communities , i.  e. disconnected cliques . on the other hand the model is equivalent to the planted @xmath293-partition model , where @xmath797 and @xmath512 is proportional to @xmath45 , with coefficient depending on the size of the clusters . benchmark graphs have also been introduced to deal with special types of graphs and/or cluster structures . for instance , arenas et al . @xcite have introduced a class of benchmark graphs with embedded hierarchical structure , which extends the class of graphs by girvan and newman . here there are @xmath798 vertices and two hierarchical levels , corresponding to a partition in @xmath774 groups ( microcommunities ) with @xmath774 vertices and a partition in @xmath223 larger groups of @xmath799 vertices ( macrocommunities ) , comprising each @xmath223 of the smaller groups . the edge densities within and between the clusters are indicated by three parameters @xmath800 , @xmath801 and @xmath784 : @xmath800 is the expected internal degree of a vertex within its microcommunity ; @xmath801 is the expected number of edges that the vertex shares with the vertices of the other microcommunities within its macrocommunity ; @xmath784 is the expected number of edges connecting the vertex with vertices of the other three macrocommunities . the average degree @xmath802 of a vertex is fixed to @xmath12 . [ fig8 ] shows an example of hierarchical graph constructed based on the same principle , with @xmath803 vertices and an average degree of @xmath11 . guimer et al . @xcite have proposed a model of bipartite graphs with built - in communities . they considered a bipartite graph of actors and teams , here we describe how to build the benchmarks for general bipartite graphs . one starts from a bipartite graph whose vertex classes @xmath9 and @xmath10 are partitioned into @xmath115 groups , @xmath804 and @xmath805 ( @xmath806 ) . each cluster @xmath807 comprises all vertices of the subgroups @xmath804 and @xmath805 , respectively . with probability @xmath45 edges are placed between vertices of subgroups @xmath804 and @xmath805 ( @xmath806 ) , i.  e. within clusters . with probability @xmath808 , edges are placed between vertices of subgroups @xmath804 and @xmath809 , where @xmath67 and @xmath68 are chosen at random , so they can be equal or different . by construction , a non - zero value of the probability @xmath45 indicates a preference by vertices to share links with vertices of the same cluster , i.  e. for @xmath810 the graph has a built - in community structure . for @xmath811 there would be edges only within clusters , i. e. the graph has a perfect cluster structure .    finally , sawardecker et al . introduced a general model , that accounts for the possibility that clusters overlap  @xcite . the model is based on the reasonable assumption that the probability @xmath362 that two vertices are connected by an edge grows with the number @xmath210 of communities both vertices belong to . for vertices in different clusters , @xmath812 , if they are in the same cluster ( and only in that one ) @xmath813 , if they belong to the same two clusters @xmath814 , etc .. by hypothesis , @xmath815 . the planted @xmath293-partition model is recovered when @xmath816 . as we have seen , nearly all existing benchmark graphs are inspired by the planted @xmath293-partition model , to some extent . however , the model needs to be refined to provide a good description of real graphs with community structure . the hypothesis that the linking probabilities of each vertex with the vertices of its community or of the other communities are constant is not realistic . it is more plausible that each pair of vertices @xmath67 and @xmath68 has its own linking probability @xmath362 , and that such probabilities are correlated for vertices in the same cluster .    tests on real networks usually focus on a very limited number of examples , for which one has precise information about the vertices and their properties .    in section  [ sec2 ] we have introduced two popular real networks with known community structure , i. e. the social network of zachary s karate club and the social network of bottlenose dolphins living in doubtful sound ( new zealand ) , studied by lusseau . here , the question is whether the actual separation in two social groups could be predicted from the graph topology . zachary s karate club is by far the most investigated system . several algorithms are actually able to identify the two classes , modulo a few intermediate vertices , which may be misclassified . other methods are less successful : for instance , the maximum of newman - girvan modularity corresponds to a split of the network in four groups  @xcite . another well known example is the network of american college football teams , derived by girvan and newman  @xcite . there are @xmath817 vertices , representing the teams , and two vertices are connected if their teams play against each other . the teams are divided into @xmath818 conferences . games between teams in the same conference are more frequent than games between teams of different conferences , so one has a natural partition where the communities correspond to the conferences . when dealing with real networks , it is useful to resolve their community structure with different clustering techniques , to cross - check the results and make sure that they are consistent with each other , as in some cases the answer may strongly depend on the specific algorithm adopted . however , one has to keep in mind that there is no guarantee that `` reasonable '' communities , defined on the basis of non - structural information , must coincide with those detected by methods based only on the graph structure .      checking the performance of an algorithm involves defining a criterion to establish how `` similar '' the partition delivered by the algorithm is to the partition one wishes to recover . several measures for the similarity of partitions exist . in this section we present and discuss the most popular measures . a thorough introduction of similarity measures for graph partitions has been given by meil  @xcite and we will follow it closely . let us consider two generic partitions @xmath819 and @xmath820 of a graph @xmath313 , with @xmath821 and @xmath822 clusters , respectively . we indicate with @xmath15 the number of graph vertices , with @xmath823 and @xmath824 the number of vertices in clusters @xmath825 and @xmath826 and with @xmath827 the number of vertices shared by clusters @xmath825 and @xmath826 : @xmath828 .    in the first tests using the benchmark graphs by girvan and newman ( section  [ sec6_1 ] ) scholars used a measure proposed by girvan and newman themselves , the _ fraction of correctly classified vertices_. a vertex is correctly classified if it is in the same cluster with at least half of its `` natural '' partners . if the partition found by the algorithm has clusters given by the merging of two or more natural groups , all vertices of the cluster are considered incorrectly classified . the number of correctly classified vertices is then divided by the total size of the graph , to yield a number between @xmath631 and @xmath2 . the recipe to label vertices as correctly or incorrectly classified is somewhat arbitrary , though . apart from the fraction of correctly classified vertices , which is somewhat _ ad hoc _ and distinguishes the roles of the natural partition and of the algorithm s partition , most similarity measures can be divided in three categories : measures based on _ pair counting _ , _ cluster matching _ and _ information theory_.    measures based on pair counting depend on the number of pairs of vertices which are classified in the same ( different ) clusters in the two partitions . in particular @xmath829 indicates the number of pairs of vertices which are in the same community in both partitions , @xmath830 ( @xmath831 ) the number of pairs of elements which are put in the same community in @xmath832 ( @xmath833 ) and in different communities in @xmath833 ( @xmath832 ) and @xmath834 the number of pairs of vertices that are in different communities in both partitions . wallace  @xcite proposed the two indices @xmath835 @xmath836 and @xmath837 represent the probability that vertex pairs in the same cluster of @xmath832 are also in the same cluster for @xmath833 , and viceversa . these indices are asymmetrical , as the role of the two partitions is not the same . fowlkes and mallows  @xcite suggested to use the geometric mean of @xmath836 and @xmath837 , which is symmetric .    the _ rand index _ @xcite is the ratio of the number of vertex pairs correctly classified in both partitions ( i.  e. either in the same or in different clusters ) , by the total number of pairs @xmath838 a measure equivalent to the rand index is the _ mirkin metric _ @xcite @xmath839 . \label{eqt03}\ ] ] the _ jaccard index _ is the ratio of the number of vertex pairs classified in the same cluster in both partitions , by the number of vertex pairs which are classified in the same cluster in at least one partition , i.  e. @xmath840 adjusted versions of both the rand and the jaccard index exist , in that a null model is introduced , corresponding to the hypothesis of independence of the two partitions  @xcite . the null model expectation value of the measure is subtracted from the unadjusted version , and the result is normalized by the range of this difference , yielding @xmath2 for identical partitions and @xmath631 as expected value for independent partitions ( negative values are possible as well ) . unadjusted indices have the drawback that they are not local , i.  e. the result depends on how the whole graph is partitioned , even when the partitions differ only in a small region of the graph . similarity measures based on cluster matching aim at finding the largest overlaps between pairs of clusters of different partitions . for instance , the _ classification error _ @xmath841 is defined as  @xcite @xmath842 where @xmath843 is an injective mapping from the cluster indices of partition @xmath833 to the cluster indices of partition @xmath832 . the maximum is taken over all possible injections @xmath510 . in this way one recovers the maximum overlap between the clusters of the two partitions . an alternative measure is the _ normalized van dongen metric _ , defined as  @xcite @xmath844 . \label{eqt06}\ ] ] a common problem of this type of measures is that some clusters may not be taken into account , if their overlap with clusters of the other partition is not large enough . therefore if we compute the similarity between two partitions @xmath845 and @xmath846 and partition @xmath847 , with @xmath845 and @xmath846 differing from each other by a different subdivision of parts of the graph that are not used to compute the measure , one would obtain the same score . the third class of similarity measures is based on reformulating the problem of comparing partitions as a problem of message decoding within the framework of information theory  @xcite . the idea is that , if two partitions are similar , one needs very little information to infer one partition given the other . this extra information can be used as a measure of dissimilarity . to evaluate the shannon information content  @xcite of a partition , one starts by considering the community assignments @xmath848 and @xmath849 , where @xmath170 and @xmath850 indicate the cluster labels of vertex @xmath67 in partition @xmath832 and @xmath833 , respectively . one assumes that the labels @xmath302 and @xmath851 are values of two random variables @xmath168 and @xmath585 , with joint distribution @xmath852 , which implies that @xmath853 and @xmath854 . the _ mutual information _ @xmath595 of two random variables has been previously defined [ eq .  ( [ eqstinf8 ] ) ] , and can be applied as well to partitions @xmath832 and @xmath833 , since they are described by random variables . actually @xmath855 , where @xmath856 is the shannon entropy of @xmath168 and @xmath857 is the conditional entropy of @xmath168 given @xmath585 . the mutual information is not ideal as a similarity measure : in fact , given a partition @xmath832 , all partitions derived from @xmath832 by further partitioning ( some of ) its clusters would all have the same mutual information with @xmath832 , even though they could be very different from each other . in this case the mutual information would simply equal the entropy @xmath858 , because the conditional entropy would be systematically zero . to avoid that , danon et al . adopted the _ normalized mutual information _  @xcite @xmath859 which is currently very often used in tests of graph clustering algorithms . the normalized mutual information equals @xmath2 if the partitions are identical , whereas it has an expected value of @xmath631 if the partitions are independent . the measure , defined for standard partitions , in which each vertex belongs to only one cluster , has been recently extended to the case of overlapping clusters by lancichinetti et al . the extension is not straightforward as the community assignments of a partition are now specified by a vectorial random variable , since each vertex may belong to more clusters simultaneously . in fact , the definition by lancichinetti et al . is not a proper extension of the normalized mutual information , in the sense that it does not recover exactly the same value of the original measure for the comparison of proper partitions without overlap , even though the values are close . meil  @xcite introduced the _ variation of information _ @xmath860 which has some desirable properties with respect to the normalized mutual information and other measures . in particular , it defines a metric in the space of partitions as it has the properties of distance . it is also a local measure , i.  e. the similarity of partitions differing only in a small portion of a graph depends on the differences of the clusters in that region , and not on the partition of the rest of the graph . the maximum value of the variation of information is @xmath241 , so similarity values for partitions of graphs with different size can not be compared with each other . for meaningful comparisons one could divide @xmath861 by @xmath241 , as suggested by karrer et al . @xcite . a concept related to similarity is that of _ distance _ , which indicates basically how many operations need to be performed in order to transform a partition to another . gustafsson et al . defined two distance measures for partitions  @xcite . they are both based on the concept of _ meet _ of two partitions , which is defined as @xmath862 . \label{eqt1}\ ] ] the distance measures are @xmath863 and @xmath864 . in both cases they are determined by summing the distances of @xmath832 and @xmath833 from the meet @xmath865 . for @xmath863 the distance of @xmath832 ( @xmath833 ) from the meet is the minimum number of elements that must be moved between @xmath832 and @xmath833 so that @xmath832 ( @xmath833 ) and @xmath865 coincide  @xcite . for @xmath864 the distance of @xmath832 ( @xmath833 ) from the meet is the minimum number of divisions that must be done in @xmath832 ( @xmath833 ) so that @xmath832 ( @xmath833 ) and @xmath865 coincide  @xcite . such distance measures can easily be transformed in similarity measures , like @xmath866 identical partitions have zero mutual distance and similarity @xmath2 based on eqs . [ eqt2 ] . finally an important problem is how to define the similarity between clusters . if two partitions @xmath832 and @xmath833 of a graph are similar , each cluster of @xmath832 will be very similar to one cluster of @xmath833 , and viceversa , and it is important to identify the pairs of corresponding clusters . for instance , if one has information about the time evolution of a graph , one could monitor the dynamics of single clusters as well , by keeping track of each cluster at different time steps  @xcite . given clusters @xmath825 and @xmath826 , their similarity can be defined through the _ relative overlap _ @xmath867 @xmath868 in this way , looking for the cluster of @xmath833 corresponding to @xmath825 means finding the cluster @xmath826 that maximizes @xmath867 . the index @xmath867 can be used to define similarity measures for partitions as well  @xcite . an interesting discussion on the problem of comparing partitions , along with further definitions of similarity measures not discussed here , can be found in ref . @xcite . the first systematic comparative analysis of graph clustering techniques has been carried out by danon et al . they compared the performances of various algorithms on the benchmark graphs by girvan and newman ( section  [ sec6_1 ] ) . the algorithms examined are listed in table  [ table_orders ] , along with their complexity .    [ cols="^,^,^,^",options="header " , ]     fig . [ figdanon ] shows the performance of all algorithms . instead of showing the whole curves of the similarity versus @xmath784 ( section  [ sec6_1 ] ) , which would display a fuzzy picture with many strongly overlapping curves , difficult to appreciate , danon et al . considered three values for @xmath784 ( @xmath227 , @xmath869 and @xmath228 ) , and represented the result for each algorithm as a group of three columns , indicating the average value of the similarity between the planted partition and the partition found by the method for each of the three @xmath784-values . the similarity was measured in terms of the fraction of correctly classified vertices ( section  [ sec6_1 ] ) . the comparison shows that modularity optimization via simulated annealing ( section  [ sub_sec6_0_2 ] ) yields the best results , although it is a rather slow procedure , that can not be applied to graphs of size of the order of @xmath612 vertices or larger . on the other hand , we have already pointed out that the benchmark by girvan and newman is not a good representation of real graphs with community structure , which are characterized by heterogeneous distributions of degree and community sizes . in this respect , the class of graphs designed by lancichinetti et al . ( lfr benchmark )  @xcite ( section  [ sec6_1 ] ) poses a far more severe test to clustering techniques . for instance , many methods have problems to detect clusters of very different sizes ( like most methods listed in table  [ table_orders ] ) . for this reason , lancichinetti and fortunato have carried out a careful comparative analysis of community detection methods on the much more restrictive lfr benchmark  @xcite . the algorithms chosen are listed in table  [ table2 ] . in fig . [ companalysis ] the performances of the algorithms on the lfr benchmark are compared . whenever possible , tests on the versions of the lfr benchmark with directed edges , weighted edges and/or overlapping communities  @xcite were carried out . lancichinetti and fortunato also tested the methods on random graphs , to check whether they are able to notice the absence of community structure . from the results of all tests , the infomap method by rosvall and bergstrom  @xcite appears to be the best , but also the algorithms by blondel et al . @xcite and by ronhovde and nussinov  @xcite have a good performance . these three methods are also very fast , with a complexity which is essentially linear in the system size , so they can be applied to large systems . on the other hand , modularity - based methods ( with the exception of the method by blondel et al . ) have a rather poor performance , which worsens for larger systems and smaller communities , due to the well known resolution limit of modularity  @xcite . the performance of the remaining methods worsens considerably if one increases the system size ( dm and infomod ) or the community size ( cfinder , mcl and method by radicchi et al . ) . performances of several algorithms on the lfr benchmark  @xcite . the plots show the normalized mutual information ( in the version proposed in ref . @xcite ) as a function of the mixing parameter of the benchmark graphs . the different curves for each method refer to different system sizes ( @xmath870 and @xmath871 vertices ) and community size ranges [ ( s)=from @xmath5 to @xmath872 vertices , ( b)=from @xmath873 to @xmath874 vertices ] . for the gn algorithm only the smaller graph size was adopted , due to the high complexity of the method , whereas for the em method there are eight curves instead of four because for each set of benchmark graphs the algorithm was run starting from two different initial conditions . reprinted figure with permission from ref . 2009 by the american physical society.,title="fig:",width=302 ]   performances of several algorithms on the lfr benchmark  @xcite . the plots show the normalized mutual information ( in the version proposed in ref . @xcite ) as a function of the mixing parameter of the benchmark graphs . the different curves for each method refer to different system sizes ( @xmath870 and @xmath871 vertices ) and community size ranges [ ( s)=from @xmath5 to @xmath872 vertices , ( b)=from @xmath873 to @xmath874 vertices ] . for the gn algorithm only the smaller graph size was adopted , due to the high complexity of the method , whereas for the em method there are eight curves instead of four because for each set of benchmark graphs the algorithm was run starting from two different initial conditions . reprinted figure with permission from ref . 2009 by the american physical society.,title="fig:",width=302 ]   performances of several algorithms on the lfr benchmark  @xcite . the plots show the normalized mutual information ( in the version proposed in ref . @xcite ) as a function of the mixing parameter of the benchmark graphs . the different curves for each method refer to different system sizes ( @xmath870 and @xmath871 vertices ) and community size ranges [ ( s)=from @xmath5 to @xmath872 vertices , ( b)=from @xmath873 to @xmath874 vertices ] . for the gn algorithm only the smaller graph size was adopted , due to the high complexity of the method , whereas for the em method there are eight curves instead of four because for each set of benchmark graphs the algorithm was run starting from two different initial conditions . reprinted figure with permission from ref . 2009 by the american physical society.,title="fig:",width=302 ]    fan et al . have evaluated the performance of some algorithms to detect communities on weighted graphs  @xcite . the algorithms are : modularity maximization , carried out with extremal optimization ( weo ) ( section  [ sub_sec6_0_3 ] ) ; the girvan - newman algorithm ( wgn ) ( section  [ subsec5_1 ] ) ; the potts model algorithm by reichardt and bornholdt ( potts ) ( section  [ sec44_1 ] ) . all these techniques have been originally introduced for unweighted graphs , but we have shown that they can easily be extended to weighted graphs . the algorithms were tested on the weighted version of the benchmark of girvan and newman , that we discussed in section  [ sec6_1 ] . edge weights have only two values : @xmath875 for inter - cluster edges and @xmath876 for intra - cluster edges . such values are linked by the relation @xmath877 , so they are not independent . for testing one uses realizations of the benchmark with fixed topology ( i.  e. fixed @xmath784 ) and variable weights . in fig . [ fantest ] the comparative performance of the three algorithms is illustrated . the topology of the benchmark graphs corresponds to @xmath878 , i.  e. to graphs in which each vertex has approximately the same number of neighbors inside and outside its community . by varying @xmath875 from @xmath631 to @xmath323 one goes smoothly from a situation in which most of the weight is concentrated inside the clusters , to a situation in which instead the weight is concentrated between the clusters . from fig .  [ fantest ] we see that weo and potts are more reliable methods .     comparative evaluation of the performances of algorithms to find communities in weighted graphs . tests are carried out on a weighted version of the benchmark of girvan and newman . the two plots show how good the algorithms are in terms of the precision and accuracy with which they recover the planted partition of the benchmark . precision indicates how close the values of similarity between the planted and the model partition are after repeated experiments with the same set of parameters ; accuracy indicates how close the similarity values are to the ideal result ( 1 ) after repeated experiments with the same set of parameters . the similarity measure adopted here is based on the relative overlap of clusters of eq . [ eqt20 ] . we see that the maximization of modularity with extremal optimization ( weo ) and the potts model algorithm ( potts ) are both precise and accurate as long as the weight of the inter - cluster edges @xmath875 remains lower than the weight of the intra - cluster edges ( @xmath879 ) . reprinted figures with permission from ref . 2007 by elsevier.,title="fig : " ]   comparative evaluation of the performances of algorithms to find communities in weighted graphs . tests are carried out on a weighted version of the benchmark of girvan and newman . the two plots show how good the algorithms are in terms of the precision and accuracy with which they recover the planted partition of the benchmark . precision indicates how close the values of similarity between the planted and the model partition are after repeated experiments with the same set of parameters ; accuracy indicates how close the similarity values are to the ideal result ( 1 ) after repeated experiments with the same set of parameters . the similarity measure adopted here is based on the relative overlap of clusters of eq . [ eqt20 ] . we see that the maximization of modularity with extremal optimization ( weo ) and the potts model algorithm ( potts ) are both precise and accurate as long as the weight of the inter - cluster edges @xmath875 remains lower than the weight of the intra - cluster edges ( @xmath879 ) . reprinted figures with permission from ref . 2007 by elsevier.,title="fig : " ]    sawardecker et al . have tested methods to detect overlapping communities  @xcite . they considered three algorithms : modularity optimization , the clique percolation method ( cpm ) ( section  [ sec45_1 ] ) and the modularity landscape surveying method by sales - pardo et al . @xcite ( section  [ sub_sec6_202 ] ) . for testing , sawardecker et al . defined a class of benchmark graphs in which the linking probability between vertices is an increasing function of the number of clusters the vertices belong to . we have described this benchmark in section  [ sec6_1 ] . it turns out that the modularity landscape surveying method is able to identify overlaps between communities , as long as the fraction of overlapping vertices is small . curiously , the cpm , designed to find overlapping communities , has a poor performance , as the overlapping vertices found by the algorithm are in general different from the overlapping vertices of the planted partition of the benchmark . the authors also remark that , if the overlap between two clusters is not too small , it may be hard ( for any method ) to recognize whether the clusters are overlapping or hierarchically organized , i.  e. loosely connected clusters within a large cluster . we close the section with some general remarks concerning testing . we have seen that a testing procedure requires two crucial ingredients : benchmark graphs with built - in community structure and clustering algorithms that try to recover it . such two elements are not independent , however , as they are both based on the concept of community . if the underlying notions of community for the benchmark and the algorithm are very different , one can hardly expect that the algorithm will do a good job on the benchmark . furthermore , there is a third element , i.  e. the quality of a partition . all benchmarks start from a situation in which communities are clearly identified , i.  e. connected components of the graph , and introduce some amount of noise , that eventually leads to a scenario where clusters are hardly or no longer detectable . it is then important to keep track of how the quality of the natural partition of the benchmark worsens as the amount of noise increases , in order to distinguish configurations in which the graphs have a cluster structure , that an algorithm should then be able to resolve , from configurations in which the noise prevails and the natural clusters are not meaningful . moreover , quality functions are important to evaluate the performance of an algorithm on graphs whose community structure is unknown . quality functions are strongly related to the concept of community as well , as they are supposed to evaluate the goodness of the clusters , so they require a clear quantitative concept of what a cluster is . it is very important for any testing framework to check for the mutual dependencies between the benchmark , the quality function used to evaluate partitions , and the clustering algorithm to be tested . this issue has so far received very little attention  @xcite . finally , empirical tests are also very important , as one ultimately wishes to apply clustering techniques to real graphs . therefore , it is crucial to collect more data sets of graphs whose community structure is known or deducible from information on the vertices and their edges . what are the general properties of partitions and clusters of real graphs ? in many papers on graph clustering applications to real systems are presented . in spite of the variety of clustering methods that one could employ , in many cases partitions derived from different techniques are rather similar to each other , so the general properties of clusters do not depend much on the particular algorithm used . the analysis of clusters and their properties delivers a _ mesoscopic description _ of the graph , where the communities , and not the vertices , are the elementary units of the topology . the term mesoscopic is used because the relevant scale here lies between the scale of the vertices and that of the full graph . one of the first issues addressed was whether the communities of a graph are usually about of the same size or whether the community sizes have some special distribution . most clustering techniques consistently find skewed distributions of community sizes , with a tail described with good approximation by a power law ( at least , a sizeable portion of the curve ) with exponents in the range between @xmath2 and @xmath3  @xcite . so , there seems to be no characteristic size for a community : small communities usually coexist with large ones .     cumulative distribution of community sizes for the amazon purchasing network . the partition is derived by greedy modularity optimization . reprinted figure with permission from ref . 2004 by the american physical society.,width=302 ]    as an example , fig . [ figure13 ] shows the cumulative distribution of community sizes for a recommendation network of the online vendor amazon.com . vertices are products and there is a connection between item @xmath9 and @xmath10 if @xmath10 was frequently purchased by buyers of @xmath9 . recall that the cumulative distribution is the integral of the probability distribution : if the cumulative distribution is a power law @xmath880 , the probability distribution is also a power law with exponent @xmath881 . leskovec et al . @xcite have gone one step further . they carried out a systematic analysis of communities in large real networks , including traditional and on - line social networks , technological , information networks and web graphs . the main goal was to assess the quality of communities at various sizes . as a quality function the _ conductance _ of the cluster was chosen . we remind that the conductance of a cluster is the ratio between the cut size of the cluster and the minimum between the total degree of the cluster and that of the rest of the graph ( section  [ sec4_1 ] ) . so , if the cluster is much smaller than the whole graph , the conductance equals the ratio between the cut size and the total degree of the cluster . since a `` good '' cluster is characterized by a low cut size and a large internal density of edges , low values of the conductance indicate good clusters . for each real network leskovec derived the _ network community profile plot _ ( ncpp ) , showing the minimum conductance score among subgraphs of a given size as a function of the size . interestingly , they found that the ncpps of all networks they studied have a characteristic shape : they go downwards up until subgraphs with about @xmath874 vertices , and then they rise monotonically for larger subgraphs ( fig .  [ figlesk ] ) . this seems to suggest that communities are well defined only when they are fairly small in size . analysis of communities in large real networks by leskovec et al . ( left ) typical shape of the network community profile plot ( ncpp ) , showing how the minimum conductance of subgraphs of size @xmath15 varies with @xmath15 . the plot indicates that the `` best '' communities have a size of about @xmath874 vertices ( minimum of the curve ) , whereas communities of larger sizes are not well - defined . in the plot two other ncpps are shown : the one labeled _ rewired network _ corresponds to a randomized version of the network , where edges are randomly rewired by keeping the degree distribution ; the one labeled _ bag of whiskers _ gives the minimum conductance scores of clusters composed of disconnected pieces . ( right ) scheme of the core - periphery structure of large social and information networks derived by leskovec et al . based on the results of their empirical analysis . most of the vertices are in a central core , which does not have a clear community structure , whereas the best communities , which are rather small , are weakly connected to the core . reprinted figure with permission from ref . @xcite.,title="fig : " ] 0.5 cm   analysis of communities in large real networks by leskovec et al . ( left ) typical shape of the network community profile plot ( ncpp ) , showing how the minimum conductance of subgraphs of size @xmath15 varies with @xmath15 . the plot indicates that the `` best '' communities have a size of about @xmath874 vertices ( minimum of the curve ) , whereas communities of larger sizes are not well - defined . in the plot two other ncpps are shown : the one labeled _ rewired network _ corresponds to a randomized version of the network , where edges are randomly rewired by keeping the degree distribution ; the one labeled _ bag of whiskers _ gives the minimum conductance scores of clusters composed of disconnected pieces . ( right ) scheme of the core - periphery structure of large social and information networks derived by leskovec et al . based on the results of their empirical analysis . most of the vertices are in a central core , which does not have a clear community structure , whereas the best communities , which are rather small , are weakly connected to the core . reprinted figure with permission from ref . @xcite.,title="fig : " ]    such small clusters are weakly connected to the rest of the graph , often by a single edge ( in this case they are called _ whiskers _ ) , and form the _ periphery _ of the network . the other vertices form a big _ core _ , in which larger clusters are well connected to each other , and are therefore barely distinguishable ( fig . [ figlesk ] ) . leskovec et al . performed low - conductance cuts with several methods , to ensure that the result is not a simple artefact of a particular chosen technique . moreover , they have also verified that , for large real networks with known community structure ( such as , e.g. , the social network of the on - line blogging site _ livejournal _ , with its user groups ) , the ncpp has the same qualitative shape if one takes the real communities instead of low - conductance subgraphs . the analysis by leskovec et al . may shed new light on our understanding of community structure and its detection in large networks . the fact that the `` best '' communities appear to have a characteristic size of about @xmath874 vertices is consistent with dunbar conjecture that @xmath882 is the upper size limit for a working human community  @xcite . on the other hand , if large communities are very mixed with each other , as leskovec et al . claim , they could hardly be considered communities , and the alleged `` community structure '' of large networks would be limited to their peripheral region . the results by leskovec et al . may be affected by the properties of conductance , and need to be validated with alternative approaches . in any case , whatever the value of the quality score of a cluster may be ( low or high ) , it is necessary to estimate the significance of the cluster ( section  [ sec6_4 ] ) , before deciding whether it is a meaningful structure or not . if the community structure of a graph is known , it is possible to classify vertices according to their roles within their community , which may allow to infer individual properties of the vertices . a promising classification has been proposed by guimer and amaral  @xcite . the role of a vertex depends on the values of two indices , the _ within - module degree _ and the _ participation ratio _ ( though other variables may be chosen , in principle ) . the within - module degree @xmath883 of vertex @xmath67 is defined as @xmath884 where @xmath885 is the internal degree of @xmath67 in its cluster @xmath314 , @xmath886 and @xmath887 the average and standard deviation of the internal degrees for all vertices of cluster @xmath314 . the within - module degree is then defined as the @xmath406-score of the internal degree @xmath885 . large values of @xmath406 indicate that the vertex has many more neighbors within its community than most other vertices of the community . vertices with @xmath888 are classified as _ hubs _ , if @xmath889 they are _ non - hubs_. the participation ratio @xmath890 of vertex @xmath67 is defined as @xmath891 here @xmath892 is the internal degree of @xmath67 in cluster @xmath155 , @xmath105 the degree of @xmath67 . values of @xmath96 close to @xmath2 indicate that the neighbors of the vertex are uniformly distributed among all clusters ; if all neighbors are within the cluster of the vertex , instead , @xmath893 . based on the values of the pair @xmath894 , guimer and amaral distinguished seven roles for the vertices . non - hub vertices can be _ ultra - peripheral _ ( @xmath895 ) , _ peripheral _ ( @xmath896 ) , _ connectors _ ( @xmath897 ) and _ kinless vertices _ ( @xmath898 ) . hub vertices are classified in _ provincial hubs _ ( @xmath899 ) , _ connector hubs _ ( @xmath900 ) and _ kinless hubs _ ( @xmath901 ) . the regions of the @xmath902 plane corresponding to the seven roles are highlighted in fig . [ figroles ] . we stress that the actual boundaries of the regions can be chosen rather arbitrarily . regions of the @xmath902 plane defining the roles of vertices in the modular structure of a graph , according to the scheme of guimer and amaral  @xcite . reprinted figure with permission from ref . 2005 by the nature publishing group . ]    on graphs without community structure , like erds - rnyi  @xcite random graphs and barabsi - albert  @xcite graphs ( section  [ sec1_3 ] ) , non - hubs are mostly kinless vertices . in addition , if there are hubs , like in barabsi - albert graphs , they are kinless hubs . kinless hubs ( non - hubs ) vertices have less than half ( one third ) of their neighbors inside any cluster , so they are not clearly associated to a cluster . on real graphs , the topological roles can be correlated to functions of vertices : in metabolic networks , for instance , connector hubs , which share most edges with vertices of other clusters than their own , are often metabolites which are more conserved across species than other metabolites , i.  e. they have an evolutionary advantage  @xcite . if communities are overlapping , one can explore other statistical properties , like the distributions of the overlaps and of the vertex memberships . the overlap is defined as the number of vertices shared by each pair of overlapping clusters ; the membership of a vertex is the number of communities including the vertex . both distributions turn out to be skewed , so there seem to be no characteristic values for the overlap and the membership . moreover , one could derive a network , where the communities are the vertices and pairs of vertices are connected if their corresponding communities overlap  @xcite . such networks seem to have some special properties . for instance , the degree distribution is a particular function , with an initial exponential decay followed by a slower power law decay ) and a coauthorship network of physicists . there is no _ a priori _ reason to believe that this result is general . ] . we stress that the above results have been obtained with the clique percolation method by palla et al . ( section  [ sec45_1 ] ) and it is not clear whether other techniques would confirm them or not . in a recent analysis it has been shown that the degree distribution of the network of communities can be reproduced by assuming that the graph grows according to a simple preferential attachment mechanism , where communities with large degree have an enhanced chance to interact / overlap with new communities  @xcite . the ultimate goal of clustering algorithms is trying to infer properties of and relationships between vertices , that are not available from direct observation / measurement . if the scientific community agrees on a set of reliable techniques , one could then proceed with careful investigations of systems in various domains . so far , most works in the literature on graph clustering focused on the development of new algorithms , and applications were limited to those few benchmark graphs that one typically uses for testing ( section  [ sec6_1 ] ) . still , there are also applications aiming at understanding real systems . some results have been actually mentioned in the previous sections . this section is supposed to give a flavor of what can be done by using clustering algorithms . therefore , the list of works presented here is by no means exhaustive . most studies focus on biological and social networks . we mention a few applications to other types of networks as well .      the recent abundance of genomic data has allowed us to explore the cell at an unprecedented depth . a wealth of information is available on interactions involving proteins and genes , metabolic processes , etc . in order to study cellular systems , the graph representation is regularly used . protein - protein interaction networks ( pin ) , gene regulatory networks ( grn ) and metabolic networks ( mn ) are meanwhile standard objects of investigation in biology and bioinformatics  @xcite . biological networks are characterized by a remarkable modular organization , reflecting functional associations between their components . for instance , proteins tend to be associated in two types of cellular modules : _ protein complexes _ and _ functional modules_. a protein complex is a group of proteins that mutually interact at the same time and space , forming a sort of physical object . examples are transcription factor complexes , protein transport and export complexes , etc . functional modules instead are groups of proteins taking place in the same cellular process , even if the interactions may happen at different times and places . examples are the cdk / cyclin module , responsible for cell - cycle progression , the yeast pheromone response pathway , etc .. identifying cellular modules is fundamental to uncover the organization and dynamics of cell functions . however , the information on cell units ( e. g. proteins , genes ) and their interactions is often incomplete , or even incorrect , due to noise in the data produced by the experiments . therefore , inferring modules from the topology of cellular networks enables one to restrict the set of possible scenarios and can be a safe guide for future experiments . rives and galitski  @xcite studied the modular organization of a subset of the pin of the yeast ( _ saccharomyces cerevisiae _ ) , consisting of the ( signaling ) proteins involved in the processes leading the microorganism to a filamentous form . the clusters were detected with a hierarchical clustering technique . proteins mostly interacting with members of their own cluster are often essential proteins ; edges between modules are important points of communication . spirin and mirny  @xcite identified protein complexes and functional modules in yeast with different techniques : clique detection , superparamagnetic clustering  @xcite and optimization of cluster edge density . they estimated the statistical significance of the clusters by computing the @xmath45-values of seeing those clusters in random graphs with the same expected degree sequence as the original network . from the known functional annotations of yeast genes one can see that the modules usually group proteins with the same or consistent biological functions . indeed , in many cases , the modules exactly coincide with known protein complexes . the results appear robust if noise is introduced in the system , to simulate the noise present in the experimental data . functional modules in yeast were also found by chen and yuan  @xcite , who applied the algorithm by girvan and newman with a modified definition of edge betweenness ( section  [ subsec5_1 ] ) . the standard girvan - newman algorithm has proved to be reliable to detect functional modules in pins  @xcite . the novelty of the work by chen and yuan is its focus on weighted pins , where the weights come from information derived through microarray expression profiles . weights add information about the system and should lead to a more reliable modular structure . by knocking out genes in the same structural cluster similar phenotypes appeared , suggesting that the genes have similar biological roles . moreover , the clusters often contained known protein complexes , either entirely or to a large extent . finally , chen and yuan were able to make predictions of the unknown function of some genes , based on the structural module they belong to : gene function prediction is the most promising outcome deriving from the application of clustering techniques to pins . farutin et al . @xcite have adopted a local concept of community , and derived a hierarchical decomposition of pins , in that the modules identified at some level become the vertices of a network at the higher level . communities are overlapping , to account for the fact that proteins ( and whole modules ) may have diverse biological functions . high level structures detected in a human pin correspond to general biological concepts like signal transduction , regulation of gene expression , intercellular communication . sen et al . @xcite identified protein clusters for yeast from the eigenvectors of the laplacian matrix ( section  [ sec1_2 ] ) , computed via singular value decomposition . in a recent analysis , lewis et al . @xcite carefully explored the relationship between structural communities of pins and their biological function . communities were detected with the multiresolution approach by reichardt and bornholt  @xcite ( section  [ sub_sec6_01 ] ) . a community is considered biologically homogeneous if the functional similarity between protein pairs of the community ( extracted through the gene ontology database  @xcite ) is larger than the functional similarity between all protein pairs of the network . lewis et al . also specified the comparison to interacting and non - interacting protein pairs . as a result , many communities turn out to be biologically homogeneous , especially if they are not too small . moreover , some topological attributes of communities , like the within - community clustering coefficient ( i.e. the average value of the clustering coefficients of the vertices of a community , computed by considering just the neighbors belonging to the community ) and link density ( density of internal edges ) , are good indicators of biological homogeneity : the former is strongly correlated with biological homogeneity , independently of the community size , whereas for the latter the correlation is strong for large communities . metabolic networks have also been extensively investigated . we have already discussed the `` functional cartography '' designed by guimer and amaral  @xcite , which applies to general types of networks , not necessarily metabolic . a hierarchical decomposition of metabolic networks has been derived by holme et al . @xcite , by using a hierarchical clustering technique inspired by the algorithm by girvan and newman ( section  [ subsec5_1 ] ) . here , vertices are removed based on their betweenness values , which are obtained by dividing the standard site betweenness scores  @xcite by the indegree of the respective vertices . a picture of metabolic network emerges , in which there are core clusters centered at hub - substances , surrounded by outer shells of less connected substances , and a few other clusters at intermediate scales . in general , clusters at different scales seem to be meaningful , so the whole hierarchy should be taken into account . wilkinson and huberman  @xcite analyzed a network of gene co - occurrence to find groups of related genes . the network is built by connecting pairs of genes that are mentioned together in the abstract of articles of the medline database ( http://medline.cos.com/ ) . clusters were found with a modified version of the algorithm by girvan and newman , in which edge betweenness is computed by considering the shortest paths of a small subset of all vertex pairs , to gain computer time ( section  [ subsec5_1 ] ) . as a result , genes belonging to the same cluster turn out to be functionally related to each other . co - occurrence of terms is also used to extract associations between genes and diseases , to find out which genes are relevant for a specific disease . communities of genes related to colon cancer can be helpful to identify the function of the genes . networks depicting social interactions between people have been studied for decades  @xcite . recently the modern information and communication technology ( ict ) has opened new interaction modes between individuals , like mobile phone communications and online interactions enabled by the internet . such new social exchanges can be accurately monitored for very large systems , including millions of individuals , whose study represents a huge opportunity for social science . communities of social networks can be friendship circles , groups of people sharing common interests and/or activities , etc ..    blondel et al . have analyzed a network of mobile phone communications between users of a belgian phone operator  @xcite . the vertices of the graph are 2.6 millions and the edges are weighted by the cumulative duration of phone calls between users in the observation time frame . the clustering analysis , performed with a fast hierarchical modularity optimization technique developed by the authors ( discussed in section  [ sub_sec6_0_1 ] ) , delivers six hierarchical levels . the highest level consists of @xmath903 groups with more than @xmath874 vertices , which are clearly arranged in two main groups , linguistically homogeneous , reflecting the linguistic split of belgian population ( fig . [ blondphone ] ) . community structure of a social network of mobile phone communication in belgium . dots indicate subcommunities at the lower hierarchical level ( with more than @xmath874 people ) and are colored in a red - green scale to represent the level of representation of the two main languages spoken in belgium ( red for french and green for dutch ) . communities of the two larger groups are linguistically homogeneous , with more than @xmath904 of people speaking the same language . only one community ( zoomed ) , which lies at the border between the two main aggregations , has a more balanced distribution of languages . reprinted figure with permission from ref . 2008 by iop publishing and sissa.,width=302 ]    tyler et al . @xcite studied a network of e - mail exchanges between people working at hp labs . they applied the same modified version of girvan - newman algorithm that two of the authors have used to find communities of related genes  @xcite ( section  [ sec7_2_1 ] ) . the method enables one to measure the degree of membership of each vertex in a community and allows for overlaps between communities . the detected clusters matched quite closely the organization of the labs in departments and project groups , as confirmed by interviews conducted with researchers .     communities in social networking sites . ( top ) visualization of a network of friendships between students at caltech , constructed from facebook data ( september 2005 ) . the colors / shapes indicate the dormitories ( houses ) of the students . ( bottom ) topological communities of the network , which are quite homogeneous with respect to house affiliation . reprinted figures with permission from refs . @xcite and @xcite.,title="fig:",width=264 ]   communities in social networking sites . ( top ) visualization of a network of friendships between students at caltech , constructed from facebook data ( september 2005 ) . the colors / shapes indicate the dormitories ( houses ) of the students . ( bottom ) topological communities of the network , which are quite homogeneous with respect to house affiliation . reprinted figures with permission from refs . @xcite and @xcite.,title="fig:",width=264 ]    social networking sites , like _ myspace _ ( www.myspace.com ) , _ friendster _ ( www.friendster.com ) , _ facebook _ ( www.facebook.com ) , etc . have become extremely popular in the last years . they are online platforms that allow people to communicate with friends , send e - mails , solicit opinions on specific issues , spread ideas and/or fads , etc . traud et al . @xcite used anonymous facebook data to create networks of friendships between students of different american universities , where vertices / students are connected if they are friends on facebook . communities were detected by applying a variant of newman s spectral optimization of modularity ( section  [ sub_sec6_0_4 ] ) : the results were further refined through additional steps  la kernighan - lin ( section  [ sec4_1 ] ) . one of the goals of the study was to infer relationships between the online and offline lives of the students . by using demographic information on the students populations , one finds that communities are organized by class year or by house ( dormitory ) affiliation , depending on the university ( fig . [ figcaltech ] ) . yuta et al . @xcite observed a gap in the community size distribution of a friendship network extracted from _ mixi _ ( mixi.jp ) , the largest social networking site in japan ( as of december 2006 ) . communities were identified with the fast greedy modularity optimization by clauset et al . the gap occurs in the intermediate range of sizes between @xmath873 and @xmath905 , where but a few communities are observed . yuta et al . introduced a model where people form new friendships both by `` closing '' ties with people who are friends of friends , and by setting new links with individuals having similar interests . in this way most groups turn out to be either small or large , and medium size groups are rare . collaboration networks , in which individuals are linked if they are ( were ) involved in a common activity , have been often studied because they embed an implicit objective concept of acquaintance , that is not easy to capture in direct social experiments / interviews . for instance , somebody may consider another individual a friend , while the latter may disagree . a collaboration instead is a proof of a social relationship between individuals . the analysis of the structure of scientific collaboration networks  @xcite has exerted a big influence on the development of the modern network science . scientific collaboration is associated to coauthorship : two scientists are linked if they have coauthored at least one paper together . information about coauthorships can be extracted from different databases of research papers . communities indicate groups of people with common research interests , i. e. topical or disciplinary groups . in the seminal paper by girvan and newman  @xcite , the authors applied their method on a collaboration network of scientists working at the santa fe institute , and were able to discriminate between research divisions ( fig . [ fig3]b ) . the community structure of scientific collaboration networks has been investigated by many authors  @xcite . other types of collaboration networks have been studied too . gleiser and danon  @xcite considered a collaboration network of jazz musicians . vertices are either musicians , connected if they played in the same band , or bands , connected if they have a musician in common . by applying the algorithm of girvan and newman they found that communities reflect both racial segregation ( with two main groups comprising only black or white players ) and geographical separation , due to the different recording locations . citation networks  @xcite have been regularly used to understand the citation patterns of authors and to disclose relationships between disciplines . rosvall and bergstrom  @xcite used a citation network of over @xmath906 scientific journals to derive a map of science . they used a clustering technique based on compressing the information on random walks taking place on the graph ( section  [ subsec_statinf2 ] ) . a random walk follows the flow of citations from one field to another , and the fields emerge naturally from the clustering analysis ( fig . [ maprosvall ] ) . the structure of science resembles the letter @xmath197 , with the social sciences and engineering at the terminals , joined through a chain including medicine , molecular biology , chemistry and physics . reichardt and bornholdt  @xcite performed a clustering analysis on a network built from bidding data taken from the german version of ebay ( www.ebay.de ) , the most popular online auction site . the vertices are bidders and two vertices are connected if the corresponding bidders have expressed interest for the same item . clusters were detected with the multiresolution modularity optimization developed by the authors themselves  @xcite ( section  [ sub_sec6_01 ] ) . in spite of the variety of items that it is possible to purchase through ebay , about @xmath904 of bidders were classified into a few major clusters , reflecting bidders broad categories of interests . ebay data were also examined by jin et al . @xcite , who considered bidding networks where the vertices are the individual auctions and edges are placed between auctions having at least one common bidder . communities , detected with greedy modularity optimization  @xcite ( section  [ sub_sec6_0_1 ] ) , allow to identify substitute goods , i. e. products that have value for the same bidder , so that they can be purchased together or alternatively . legislative networks enable one to deduce associations between politicians through their parliamentary activity , which may be related or not to party affiliation . porter and coworkers have carried out numerous studies on the subject  @xcite , by using data on the congress of the united states . in refs . @xcite , they examined the community structure of networks of committees in the us house of representatives . committees sharing common members are connected by edges , which are weighted by dividing the number of common members by the number one would expect to have if committee memberships were randomly assigned . hierarchical clustering ( section  [ sec4_2 ] ) reveals close connections between some of the committees . in another work  @xcite , zhang et al . analyzed networks of legislation cosponsorship , in which vertices are legislators and two legislators are linked if they support at least one common bill . communities , identified with a modification of newman s spectral optimization of modularity ( section  [ sub_sec6_0_4 ] ) , are correlated with party affiliation , but also with geography and committee memberships of the legislators . networks of correlations between time series of stock returns have received a growing attention in the past few years  @xcite . in early studies , scholars found clusters of correlated stocks by computing the _ maximum spanning tree _ of the network  @xcite ( section  [ sec1_1 ] ) , and realized that such clusters match quite well the economic sectors of the stocks . more recently , the community structure of the networks has been investigated by means of proper clustering algorithms . farkas et al . @xcite have applied the weighted version of the clique percolation method ( section  [ sec45_1 ] ) and found that the presence of two strong ( i. e. carrying high correlation ) edges in triangles is usually accompanied by the presence of a strong third edge . heimo et al . @xcite used the weighted version of the multiresolution method by reichardt and bornholdt  @xcite ( section  [ sub_sec6_01 ] ) . clusters correspond to relevant business sectors , as indicated by forbes classification ; moreover , smaller clusters at lower hierarchical levels seem to correspond to ( economically ) meaningful substructures of the main clusters . despite the remote origins and the great popularity of the last years , research on graph clustering has not yet given a satisfactory solution of the problem and leaves us with a number of important open issues . from our exposition it appears that the field has grown in a rather chaotic way , without a precise direction or guidelines . in some cases , interesting new ideas and tools have been presented , in others existing methods have been improved , becoming more accurate and/or faster .    what the field lacks the most is a theoretical framework that defines precisely what clustering algorithms are supposed to do . everybody has his / her own idea of what a community is , and most ideas are consistent with each other , but , as long as there is still disagreement , it remains impossible to decide which algorithm does the best job and there will be no control on the creation of new methods . therefore , we believe that the first and foremost task that the scientific community working on graph clustering has to solve in the future is defining a set of reliable benchmark graphs , against which algorithms should be tested ( section  [ sec6_1 ] ) . defining a benchmark goes far beyond the issue of testing . it means designing practical examples of graphs with communities , and , in order to do that , one has to agree on the fundamental concepts of community and partition . clustering algorithms have to be devised consistently with such definitions , in order to give the best performance on the set of designated benchmarks , which represent a sort of ground truth . the explosion in the number of algorithms we have witnessed in recent times is due precisely to the present lack of reliable mechanisms of control of their quality and comparison of their performances . if the community agrees on a benchmark , the future development of the field will be more coherent and the progress brought by new methods can be evaluated in an unbiased manner . the planted @xmath293-partition model  @xcite is the easiest recipe one can think of when it comes to defining clusters , and is the criterion underlying well - known benchmarks , like that by girvan and newman . we believe that the new benchmarks have to be defined along the same lines . the benchmark graphs recently introduced by lancichinetti et al . @xcite and by sawardecker et al . @xcite are an important step in this direction .    defining a benchmark implies specifying the `` natural '' partition of a graph , the one that any algorithm should find . this issue in turn involves the concept of quality of a partition , that has characterized large part of the development of the field , in particular after the introduction of newman - girvan modularity ( section  [ sec3_2_2 ] ) . estimating the quality of a partition allows to discriminate among the large number of partitions of a graph . in some cases this is not difficult . for instance , in the benchmark by girvan and newman there is a single meaningful partition , and it is hard to argue with that . but most graphs of the real world have a hierarchical structure , with communities including smaller communities and so on . hence there are several meaningful partitions , corresponding to different hierarchical levels , and discriminating among them is hard , as they may be all relevant , in a sense . if we consider the human body , we can not say that the organization in tissues of the cells is more important than the organization in organs . we have seen that there are recent methods dealing with the problem of finding meaningful hierarchical levels ( section  [ sub_sec6_20 ] ) . such methods rank the hierarchical partitions based on some criterion and one can assess their relevance through the ranking . one may wonder whether it makes sense sorting out levels , which means introducing a kind of threshold on the quality index chosen to rank partitions ( to distinguish `` good '' from `` bad '' partitions ) , or whether it is more appropriate to keep the information given by the whole set of hierarchical partitions . the work by clauset et al . on hierarchical random graphs @xcite , discussed in section  [ sub_sec6_202 ] , indirectly raises this issue . there it was shown that the ensemble of model graphs , represented by dendrograms , encodes most of the information on the structure of the graph at study , like its degree distribution , transitivity and distribution of shortest path lengths . at the same time , by construction , the model reveals the whole hierarchy of communities , without any distinction between good and bad partitions . the information given by a dendrogram may become redundant and confusing when the graph is large , as then there is a big number of partitions this is actually the reason why quality functions were originally introduced . however , in that case , one was dealing with artificial hierarchies , produced by techniques that systematically yield a dendrogram as a result of the analysis ( like , e. g. , hierarchical clustering ) , regardless of whether the graph actually has a hierarchical structure or not . here instead we speak of real hierarchy , which is a fundamental element of real graphs and , as such , it must be considered in any serious approach to graph clustering . any good clustering method must be able to tell whether a graph has community structure or not , and , in the first case , whether the community structure is hierarchical ( i. e. with two or more levels ) or flat ( one level ) . we expect that the concept of hierarchy will become a key ingredient of future clustering techniques . in particular , assessing the consistence of the concepts of partitions quality and hierarchical structure is a major challenge .    a precise definition of null models , i. e. of graphs without community structure , is also missing . this aspect is extremely important , though , as defining communities also implies deciding whether or not they exist in a specific graph . at the moment , it is generally accepted that random graphs have no communities . the null model of modularity ( section  [ sec3_2_2 ] ) , by far the most popular , comprises all graphs with the same expected degree sequence of the original graph and random rewiring of edges . this class of graphs is characterized , by construction , by the fact that any vertex can be linked to any other , as long as the constraint on the degree sequence is satisfied . but this is by no means the only possibility . a community can be generically defined as a subgraph whose vertices have a higher probability to be connected to the other vertices of the subgraph than to external vertices . the planted @xmath293-partition model  @xcite is based on this principle , as we have seen . however , this does not mean that the linking probabilities of a vertex with respect to the other vertices in its community or in different communities be constant ( or simply proportional to their degrees , as in the configuration model  @xcite ) . in fact , in large networks it is reasonable to assume that the probability that a vertex is linked to most vertices is zero , as the vertex `` ignores '' their existence . this does not exclude that the probability that the vertex gets connected to the `` known '' vertices is the same ( or proportional to their degrees ) , in which case the graph would still be random and have no communities . we believe that we are still far from a precise definition and a complete classification of null models . this represents an important research line for the future of the field , for three main reasons : 1 ) to better disentangle `` true '' communities from byproducts of random fluctuations ; 2 ) to pose a stringent test to existing and future clustering algorithms , whose reliability would be questionable if they found `` false positives '' in null model graphs ; 3 ) to handle `` hybrid '' scenarios , where a graph displays community structure on some portions of it , while the rest is essentially random and has no communities .    in the previous chapters we have seen a great number of clustering techniques . which one(s ) shall we use ? at the moment the scientific community is unable to tell . modularity optimization is probably the most popular method , but the results of the analysis of large graphs are likely to be unreliable ( section  [ sub_sec6_1 ] ) . nevertheless , people have become accustomed to use it , and there have been several attempts to improve the measure . a newcomer , who wishes to find clusters in a given network and is not familiar with clustering techniques , would not know , off - hand , which method to use , and he / she would hardly find indications about good methods in any single paper on graph clustering , except perhaps on the method presented in the paper . so , people keep using algorithms because they have heard of them , or because they know that other people are using them , or because of the reputation of the scientists who designed them . waiting for future reliable benchmarks , that may give an objective assessment of the quality of the algorithms , there are at the moment hardly solid reasons to prefer an algorithm to another : the comparative analyses by danon et al . @xcite and by lancichinetti and fortunato  @xcite ( section  [ sec6_3 ] ) represent a first serious assessment of this issue . however , we want to stress that there is no such thing as the perfect method , so it is pointless to look for it . among the other things , if one tries to look for a very general method , that should give good results on any type of graphs , one is inevitably forced to make very general assumptions on the structure of the graph and on the properties of communities . in this way one neglects a lot of specific features of the system , that may lead to a more accurate detection of the clusters . informing a method with features characterizing some types of graphs makes it far more reliable to detect the community structure of those graphs than a general method , even if its applicability may be limited . therefore in the future we envision the development of domain - specific clustering techniques . the challenge here is to identify the peculiar features of classes of graphs , which are bound to become crucial ingredients in the design of suitable algorithms . some of the methods available today are actually based on assumptions that hold only for some specific categories of graphs . the clique percolation method by palla et al . @xcite , for instance , may work well for graphs characterized by a large number of cliques , like certain social networks , whereas it may give poor results otherwise . moving one step further , one should learn how to use specific information about a graph , whenever available , e. g. properties of vertices and/or partial information about their classification . for instance , it may be that one has some information on a subset of vertices , like demographic data on people of a social network , and such data may highlight relationships between people that are not obvious from the network of social interactions . in this case , using only the social network may be reductive and ideally one should exploit both the structural and the non - structural information in the search of clusters , as the latter should be consistent with both inputs . how to do this is an open problem . the scientific community has just begun to study this aspect  @xcite . most algorithms in the literature deal with the `` classical '' case of a graph with undirected and unweighted edges . this is certainly the simplest case one could think of , and graph clustering is already a complex task on such types of graphs . we know that real networks may be directed , have weighted connections , be bipartite . methods to deal with such systems have been developed , as we have seen , especially in the most recent literature , but they are mostly preliminary attempts and there is room for improvement . another situation that may occur in real systems is the presence of edges with positive and negative weights , indicating attractive and repulsive interactions , respectively . this is the case , for instance , of correlation data  @xcite . in this case , ideal partitions would have positively weighted intracluster edges and negatively weighted intercluster edges . we have discussed some studies in this direction  @xcite , but we are just at the beginning of this endeavour . instead , there are no algorithms yet which are capable to deal with graphs in which there are edges of several types , indicating different kinds of interactions between the vertices ( _ multigraphs _ ) . agents of social networks , for instance , may be joined by working relationships , friendship , family ties , etc . at the moment there are essentially two ways of proceeding in these instances : 1 ) keeping edges of one type and forgetting the others , repeating the analysis for each type of edges and eventually comparing the results obtained ; 2 ) analyzing a single ( weighted ) graph , obtained by `` combining '' the contributions of the different types of edges in some way . finally , since most real networks are built through the results of experiments , which carry errors in their estimates , it would be useful to consider as well the case in which edges have not only associated weights , but also errors on their values .    since the paper by palla et al . @xcite , overlapping communities have received a lot of attention ( section  [ sec45 ] ) . however , there is still no consensus about a quantitative definition of the concept of overlapping community , and most definitions depend on the method adopted . intuitively , one would expect that clusters share vertices lying at their borders , and this idea has inspired most algorithms . however , clusters detected with the clique percolation method ( section  [ sec45_1 ] ) often share central vertices of the clusters , which makes sense in specific instances , especially in social networks . so , it is still unclear how to characterize overlapping vertices . moreover , the concept of overlapping clusters seems at odds with that of hierarchical structure . no dendrogram can be drawn if there are overlapping vertices , at least in the standard way . due to the relevance of both features in real networks , it is necessary to adapt them to each other in a consistent way . overlapping vertices pose problems as well when it comes to comparing the results of different methods on the same graph . most similarity measures are defined only in the case of partitions , where each vertex is assigned to a single cluster ( section  [ sec6_2 ] ) . it is then necessary to extend such definitions to the case of overlapping communities , whenever possible . another issue that is getting increasingly more popular is the study of graphs evolving in time . this is now possible due to the availability of timestamped network data sets . tracking the evolution of community structure in time is very important , to uncover how communities are generated and how they interact with each other . scholars have just begun to study this problem  @xcite ( section  [ sec7_1_2 ] ) . typically one analyzes separately snapshots at different times and checks what happened at time @xmath690 to the communities at time @xmath156 . it would be probably better to use simultaneously the whole dynamic data set , and future work shall aim at defining proper ways to do that . in this respect , the evolutionary clustering framework by chakrabarti et al . @xcite is a promising starting point . the computational complexity of graph clustering algorithms has improved by at least one power in the graph size ( on average ) in just a couple of years . due to the large size of many systems one wishes to investigate , the ultimate goal would be to design techniques with linear or even sublinear complexity . nowadays partitions in graphs with up to millions of vertices can be found . however , the results are not yet very reliable , as they are usually obtained by greedy optimizations , which yield rough approximations of the desired solution . in this respect the situation could improve by focusing on the development of efficient local methods , for two reasons : 1 ) they enable analyses of portions of the graph , independently of the rest ; 2 ) they are often suitable for parallel implementations , which may speed up considerably the computation . finally , if there has been a tremendous effort in the design of clustering algorithms , basically nothing has been done to make sense of their results . what shall we do with communities ? what can they tell us about a system ? the hope is that they will enable one to disclose `` hidden '' relationships between vertices , due to features that are not known , because they are hard to measure , for instance . it is quite possible that the scientific community will converge sooner or later to a definition _ a posteriori _ of community . already now , most algorithms yield similar results in practical applications . but what is the relationship between the vertex classification given by the algorithms and real classifications ? this is the main question beneath the whole endeavor .    0.5 cm    * acknowledgments *    i am indebted to these people for giving useful suggestions and advice to improve this manuscript at various stages : a. arenas , j. w. berry , a. clauset , p. csermely , s. gmez , s. gregory , v. gudkov , r. guimer , y. ispolatov , r. lambiotte , a. lancichinetti , j .- onnela , g. palla , m. a. porter , f. radicchi , j. j. ramasco , c. wiggins . i gratefully acknowledge ictecollective , grant number 238597 of the european commission . a _ graph _ @xmath313 is a pair of sets @xmath907 , where @xmath638 is a set of _ vertices _ or _ nodes _ and @xmath908 is a subset of @xmath909 , the set of unordered pairs of elements of @xmath638 . the elements of @xmath908 are called _ edges _ or _ links _ , the two vertices that identify an edge are called _ endpoints_. an edge is _ adjacent _ to each of its endpoints . if each edge is an ordered pair of vertices one has a _ directed _ graph ( or _ digraph _ ) . in this case an ordered pair @xmath910 is an edge directed from @xmath29 to @xmath752 , or an edge beginning at @xmath29 and ending at @xmath752 . a graph is visualized as a set of points connected by lines , as shown in fig . [ fig1 ] . in many real examples , graphs are _ weighted _ , i.  e. a real number is associated to each of the edges . graphs do not include _ loops _ , i.  e. edges connecting a vertex to itself , nor multiple edges , i.  e. several edges joining the same pair of vertices . graphs with loops and multiple edges are called _ multigraphs_. generalizations of graphs admitting edges between any number of vertices ( not necessarily two ) are called _ hypergraphs_.    a graph @xmath911 is a _ subgraph _ of @xmath912 if @xmath913 and @xmath914 . if @xmath380 contains all edges of @xmath313 that join vertices of @xmath915 one says that the subgraph @xmath380 is induced or spanned by @xmath915 . a partition of the vertex set @xmath638 in two subsets @xmath87 and @xmath916 is called a _ cut _ ; the _ cut size _ is the number of edges of @xmath313 joining vertices of @xmath87 with vertices of @xmath916 . we indicate the number of vertices and edges of a graph with @xmath15 and @xmath14 , respectively . the number of vertices is the _ order _ of the graph , the number of edges its _ size_. the maximum size of a graph equals the total number of unordered pairs of vertices , @xmath41 . if @xmath917 and @xmath918 , the graph is a _ clique _ ( or _ complete graph _ ) , and is indicated as @xmath919 . two vertices are _ neighbors _ ( or _ adjacent _ ) if they are connected by an edge . the set of neighbors of a vertex @xmath29 is called _ neighborhood _ , and we shall denote it with @xmath920 . the _ degree _ @xmath921 of a vertex @xmath29 is the number of its neighbors . the _ degree sequence _ is the list of the degrees of the graph vertices , @xmath922 . on directed graphs , one distinguishes two types of degree for a vertex @xmath29 : the _ indegree _ , i.  e. the number of edges beginning at @xmath29 and the _ outdegree _ , i.  e. the number of edges ending at @xmath29 . the analogue of degree on a weighted graph is the _ strength _ , i.  e. the sum of the weights of the edges adjacent to the vertex . another useful local property of graphs is _ transitivity _ or _ clustering _  @xcite , which indicates the level of cohesion between the neighbors of a vertex  . the clustering coefficient @xmath923 of vertex @xmath29 is the ratio between the number of edges joining pairs of neighbors of @xmath29 and the total number of possible edges , given by @xmath924 , @xmath925 being the degree of @xmath29 . according to this definition , @xmath923 measures the probability that a pair of neighbors of @xmath29 are connected . since all neighbors of @xmath29 are connected to @xmath29 by definition , edges connecting pairs of neighbors of @xmath29 form triangles with @xmath29 . this is why the definition is often given in terms of number of triangles . a _ path _ is a graph @xmath926 , with @xmath927 and @xmath928 . the vertices @xmath929 and @xmath930 are the _ endvertices _ of @xmath92 , whereas @xmath76 is its _ length_. given the notions of vertices , edges and paths , one can define the concept of _ independence_. a set of vertices ( or edges ) of a graph are independent if no two elements of them are adjacent . similarly , two paths are independent if they only share the endvertices . a _ cycle _ is a closed path whose vertices and edges are all distinct . cycles of length @xmath76 are indicated with @xmath931 . the smallest non - trivial cycle is the _ triangle _ , @xmath932 . paths allow to define the concept of connectivity and distance in graphs . a graph is _ connected _ if , given any pair of vertices , there is at least one path going from one vertex to the other . in general , there may be multiple paths connecting two vertices , with different lengths . shortest path _ , or _ geodesic _ , between two vertices of a graph , is a path of minimal length . such minimal length is the _ distance _ between the two vertices . the _ diameter _ of a connected graph is the maximal distance between two vertices . if there is no path between two vertices , the graph is divided in at least two connected subgraphs . each maximal connected subgraph of a graph is called _ connected component_.    a graph without cycles is a _ forest_. a connected forest is a _ tree_. trees are very important in graph theory and deserve some attention . in a tree , there can be only one path from a vertex to any other . in fact , if there were at least two paths between the same pair of vertices they would form a cycle , while the tree is an acyclic graph by definition . further , the number of edges of a tree with @xmath15 vertices is @xmath143 . if any edge of a tree is removed , it would get disconnected in two parts ; if a new edge is added , there would be at least one cycle . this is why a tree is a minimally connected , maximally acyclic graph of a given order . every connected graph contains a _ spanning tree _ , i.  e. a tree sharing all vertices of the graph . on weighted graphs , one can define a _ minimum _ ( _ maximum _ ) _ spanning tree _ , i.  e. a spanning tree such that the sum of the weights on the edges is minimal ( maximal ) . minimum and maximum spanning trees are often used in graph optimization problems , including clustering . a graph @xmath313 is _ bipartite _ if the vertex set @xmath638 is separated in two disjoint subsets @xmath933 and @xmath934 , or _ classes _ , and every edge joins a vertex of @xmath933 with a vertex of @xmath934 . the definition can be extended to that of _ @xmath375-partition _ , where the vertex classes are @xmath375 and no edge joins vertices within the same class . in this case one speaks of _ multipartite _ graphs . the whole information about the topology of a graph of order @xmath15 is entailed in the _ adjacency matrix _ * a * , which is an @xmath167 matrix whose element @xmath360 equals @xmath2 if there is an edge joining vertices @xmath67 and @xmath68 , otherwise it is zero . due to the absence of loops the diagonal elements of the adjacency matrix are all zero . for an undirected graph * a * is a symmetric matrix . the sum of the elements of the @xmath67-th row or column yields the degree of node @xmath67 . if the edges are weighted , one defines the _ weight matrix _ @xmath935 , whose element @xmath317 expresses the weight of the edge between vertices @xmath67 and @xmath68 . the _ spectrum _ of a graph @xmath313 is the set of eigenvalues of its adjacency matrix * a*. spectral properties of graph matrices play an important role in the study of graphs . for instance , the _ stochastic matrices _ rule the process of diffusion ( random walk ) on a graph . right stochastic matrix _ @xmath448 is obtained from * a * by dividing the elements of each row @xmath67 by the degree of vertex @xmath67 . the _ left stochastic matrix _ @xmath201 , or _ transfer matrix _ , is the transpose of @xmath448 . the spectra of stochastic matrices allow to evaluate , for instance , the mixing time of the random walk , i.  e. the time it takes to reach the stationary distribution of the process . the latter is obtained by computing the eigenvector of the transfer matrix corresponding to the largest eigenvalue . another important matrix is the _ @xmath936 , where * d * is the diagonal matrix whose element @xmath937 equals the degree of vertex @xmath67 . the matrix @xmath136 is usually referred to as _ unnormalized laplacian_. in the literature one often uses _ normalized laplacians _ @xcite , of which there are two main forms : @xmath938 and @xmath939 . the matrix @xmath195 is symmetric ; @xmath194 is not symmetric and is closely related to a random walk taking place on the graph . all laplacian matrices have a straightforward extension to the case of weighted graphs . the laplacian is one of the most studied matrices and finds application in many different contexts , like graph connectivity  @xcite , synchronization  @xcite , diffusion  @xcite and graph partitioning  @xcite . by construction , the sum of the elements of each row of the laplacian ( normalized or unnormalized ) is zero . this implies that * l * always has at least one zero eigenvalue , corresponding to the eigenvector with all equal components , such as @xmath940 . eigenvectors corresponding to different eigenvalues are all orthogonal to each other . interestingly , * l * has as many zero eigenvalues as there are connected components in the graph . so , the laplacian of a connected graph has but one zero eigenvalue , all others being positive . eigenvectors of laplacian matrices are regularly used in _ spectral clustering _ ( section  [ sec4_4 ] ) . in particular , the eigenvector corresponding to the second smallest eigenvalue , called _ fiedler vector _ @xcite , is used for graph bipartitioning , as described in section  [ sec4_1 ] .      in this section we present the most popular models of graphs introduced to describe real systems , at least to some extent . such graphs are useful null models in community detection , as they do not have community structure , so they can be used for negative tests of clustering algorithms .     basic models of complex networks . ( top ) erds - rnyi random graph with @xmath874 vertices and a link probability @xmath941 . ( center ) small world graph  la watts - strogatz , with @xmath874 vertices and a rewiring probability @xmath942 . ( bottom ) barabsi - albert scale - free network , with @xmath874 vertices and an average degree of @xmath323 . courtesy by j.  j. ramasco.,title="fig:",width=340 ]   basic models of complex networks . ( top ) erds - rnyi random graph with @xmath874 vertices and a link probability @xmath941 . ( center ) small world graph  la watts - strogatz , with @xmath874 vertices and a rewiring probability @xmath942 . ( bottom ) barabsi - albert scale - free network , with @xmath874 vertices and an average degree of @xmath323 . courtesy by j.  j. ramasco.,title="fig:",width=340 ]   basic models of complex networks . ( top ) erds - rnyi random graph with @xmath874 vertices and a link probability @xmath941 . ( center ) small world graph  la watts - strogatz , with @xmath874 vertices and a rewiring probability @xmath942 . ( bottom ) barabsi - albert scale - free network , with @xmath874 vertices and an average degree of @xmath323 . courtesy by j.  j. ramasco.,title="fig:",width=340 ]    the oldest model is that of _ random graph _ , proposed by solomonoff and rapoport  @xcite and independently by erds and rnyi  @xcite . there are two parameters : the number of vertices @xmath15 and the connection probability @xmath45 . each pair of vertices is connected with equal probability @xmath45 independently of the other pairs . the expected number of edges of the graph is @xmath943 , and the expected mean degree @xmath944 . the degree distribution of the vertices of a random graph is binomial , and in the limit @xmath945 , @xmath946 for fixed @xmath420 it converges to a poissonian . therefore , the vertices have all about the same degree , close to @xmath420 ( fig . [ fig2 ] , top ) . the most striking property of this class of graphs is the phase transition observed by varying @xmath420 in the limit @xmath945 . for @xmath947 , the graph is separated in connected components , each of them being microscopic , i.  e. occupying but a vanishing portion of the system size . for @xmath948 , instead , one of the components becomes macroscopic ( _ giant component _ ) , i.  e. it occupies a finite fraction of the graph vertices . the diameter of a random graph with @xmath15 vertices is very small , growing only logarithmically with @xmath15 . this property ( _ small - world effect _ ) is very common in many real graphs . the first evidence that social networks are characterized by paths of small length was provided by a series of famous experiments conducted by the phychologist stanley milgram  @xcite . the expected clustering coefficient of a vertex of a random graph is @xmath45 , as the probability for two vertices to be connected is the same whether they are neighbors of the same vertex or not . real graphs , however , are characterized by far higher values of the clustering coefficient as compared to random graphs of the same size . watts and strogatz  @xcite showed that the small world property and high clustering coefficient can coexist in the same system . they designed a class of graphs which result from an interpolation between a regular lattice , which has high clustering coefficient , and a random graph , which has the small - world property . one starts from a ring lattice in which each vertex has degree @xmath44 , and with a probability @xmath45 each edge is rewired to a different target vertex ( fig . [ fig2 ] , center ) . it turns out that low values of @xmath45 suffice to reduce considerably the length of shortest paths between vertices , because rewired edges act as shortcuts between initially remote regions of the graph . on the other hand , the clustering coefficient remains high , since few rewired edges do not perturb appreciably the local structure of the graph , which remains similar to the original ring lattice . for @xmath811 all edges are rewired and the resulting structure is a random graph  la erds and rnyi . the seminal paper of watts and strogatz triggered a huge interest towards the graph representation of real systems . one of the most important discoveries was that the distribution of the vertex degree of real graphs is very heterogeneous  @xcite , with many vertices having few neighbors coexisting with some vertices with many neighbors . in several cases the tail of this distribution can be described as a power law with good approximation , hence the expression _ scale - free networks_. such degree heterogeneity is responsible for a number of remarkable features of real networks , such as resilience to random failures / attacks  @xcite , and the absence of a threshold for percolation  @xcite and epidemic spreading  @xcite . the most popular model of a graph with a power law degree distribution is the model by barabsi and albert  @xcite . a version of the model for directed graphs had been proposed much earlier by de solla price  @xcite , building up on previous ideas developed by simon  @xcite . the graph is created with a dynamic procedure , where vertices are added one by one to an initial core . the probability for a new vertex to set an edge with a preexisting vertex is proportional to the degree of the latter . in this way , vertices with high degree have large probability of being selected as neighbors by new vertices ; if this happens , their degree further increases so they will be even more likely to be chosen in the future . in the asymptotic limit of infinite number of vertices , this _ rich - gets - richer _ strategy generates a graph with a degree distribution characterized by a power - law tail with exponent @xmath3 . in fig . [ fig2 ] ( bottom ) we show an example of barabsi - albert ( ba ) graph . the clustering coefficient of a ba graph decays with the size of the graph , and it is much lower than in real networks . moreover , the power law decays of the degree distributions observed in real networks are characterized by a range of exponents values ( usually between @xmath323 and @xmath3 ) , whereas the ba model yields a fixed value . however , many refinements of the ba model as well as plenty of different models have been later introduced to account more closely for the features observed in real systems ( for details see  @xcite ) .
Abstract:

Answer: the modern science of networks has brought significant advances to our understanding of complex systems . one of the most relevant features of graphs representing real systems is community structure , or clustering , i. e. the organization of vertices in clusters , with many edges joining vertices of the same cluster and comparatively few edges joining vertices of different clusters . such clusters , or communities , can be considered as fairly independent compartments of a graph , playing a similar role like , e. g. , the tissues or the organs in the human body . detecting communities is of great importance in sociology , biology and computer science , disciplines where systems are often represented as graphs . this problem is very hard and not yet satisfactorily solved , despite the huge effort of a large interdisciplinary community of scientists working on it over the past few years . we will attempt a thorough exposition of the topic , from the definition of the main elements of the problem , to the presentation of most methods developed , with a special focus on techniques designed by statistical physicists , from the discussion of crucial issues like the significance of clustering and how methods should be tested and compared against each other , to the description of applications to real networks . = 1