the modern science of networks is probably the most active field within the new interdisciplinary science of complex systems .many complex systems can be represented as networks , where the elementary parts of a system and their mutual interactions are nodes and links , respectively  .complex systems are usually organized in compartments , which have their own role and/or function . in the network representation ,such compartments appear as sets of nodes with a high density of internal links , whereas links between compartments have a comparatively lower density .these subgraphs are called communities , or modules , and occur in a wide variety of networked systems  .finding compartments may shed light on the organization of complex systems and on their function . therefore detecting communities in networkshas become a fundamental problem in network science .many methods have been developed , using tools and techniques from disciplines like physics , biology , applied mathematics , computer and social sciences .however , it is still not clear which algorithms are reliable and shall be used in applications .the question of the reliability itself is tricky , as it requires shared definitions of community and partition which are , at present , still missing .this essentially means that , despite the huge literature on the topic , there is still no agreement among scholars on what a network with communities looks like .nevertheless , there has been a silent acceptance of a simple network model , the _ planted -partition model _  , which is often used in the literature in various versions . in this model one`` plants '' a partition , consisting of a certain number of groups of nodes .each node has a probability of being connected to nodes of its group and a probability of being connected to nodes of different groups .as long as the groups are communities , whereas when the network is essentially a random graph , without community structure. the most popular version of the planted -partition model was proposed by girvan and newman ( gn benchmark )  . herethe graph consists of nodes , each with expected degree , which are divided into four groups of .the gn benchmark is regularly used to test algorithms for community detection .indeed , algorithms can be compared based on their performance on this benchmark .this has been done by danon et al . . however , the gn benchmark has two drawbacks : 1 ) all nodes have the same expected degree ; 2 ) all communities have equal size .these features are unrealistic , as complex networks are known to be characterized by heterogeneous distributions of degree  and community sizes  . in recent papers , we have introduced a new class of benchmark graphs ( lfr benchmark ) , that generalize the gn benchmark by introducing power law distributions of degree and community size .the new graphs are a real generalization , in that the gn benchmark is recovered in the limit case in which the exponents of the distributions of degree and community sizes go to infinity .most community detection algorithms perform very well on the gn benchmark , due to the simplicity of its structure .the lfr benchmark , instead , poses a much harder test to algorithms , and makes it easier to disclose their limits .moreover , the lfr benchmark graphs can be built very quickly : the complexity of the construction algorithms is linear in the number of links of the graph , so one can perform tests on very large systems , provided the method at study is fast enough to analyze them .for these reasons , we believe that a serious assessment of the goodness of community detection algorithms can be made by evaluating their performance on the lfr benchmark . in this paperwe propose a comparative analysis of this kind . after explaining briefly the lfr benchmark and how to compare partitions quantitatively we will pass to the description the algorithms that we examined .we will present the analysis of the algorithms performance first on the gn benchmark and then on the lfr benchmark , in its various versions including weighted and directed graphs , along with graphs with overlapping communities . finally we will consider the issue of whether the algorithms are able to give a null result , i. e. how they handle networks without expected community structure , like random graphs .our analysis will reveal that there are , at present , algorithms which are fast and reliable in many situations .we will conclude with a summary of our results and their consequences .the lfr benchmark  is a special case of the planted -partition model , in which groups are of different sizes and nodes have different degrees .the node degrees are distributed according to a power law with exponent ; the community sizes also obey a power law distribution , with exponent . in the following, indicates the number of nodes of the network . in the construction of the benchmark graphs ,each node receives its degree once and for all , and keeps it fixed until the end . in this way , the two parameters and of the planted -partition model in this case are not independent .once the value of is set one obtains the value of and viceversa .it is more practical to choose as independent parameter the _ mixing parameter _ , which expresses the ratio between the external degree of a node with respect to its community and the total degree of the node .of course , in general one may take different values for the mixing parameter for different nodes , but we will assume , for simplicity , that is the same for all nodes , consistently with the standard hypotheses of the planted -partition model . by construction ,the groups are communities when . this condition can be translated into a condition on the mixing parameter .let us label and the internal and external degree of node with respect to its community ( which we denote with ) . by definition , is the number of neighbors of that belong to its community and the number of neighbors of that belong to the other communities .the number of available connections ( ) outside ( inside ) is given by the sum of the degrees of the nodes outside ( inside ) the community .if the numbers of nodes inside and outside are not too small , the sum of their degrees can be approximated by the product of the average degree by the number of nodes .we indicate with the number of nodes of the community of node , so we have that and . by definition of the linking probabilities and we deduce that and in this way , the condition for the existence of communities becomes from which we get on the other hand , by definition we have that by comparing eq .[ eq5 ] with eq .[ eq4 ] we obtain the desired condition on  the condition expressed in eq .[ eq6 ] is general , and applies to any version of the planted -partition model . when communities are different in size , the upper bound on depends on the specific community at handhowever , if is the size of the largest community , we can safely assume that , whenever , all communities are well defined . in the gn benchmark , where and , the condition becomes .this is interesting , as in most works using the gn benchmark , one usually assumes that communities are there as long as , whereas they are not well defined for .instead , we see that communities are there , at least in principle , up until .however , we stress that , even if communities are there , methods may be unable to detect them .the reason is that , due to fluctuations in the distribution of links in the graphs , already before the limit imposed by the planted partition model it may be impossible to detect the communities and the model graphs may look similar to random graphs .this issue of the actual significance of communities and their detectability _ a priori _ is very important and has been recently discussed in the literature  .we notice that , on large networks , when , the limit value of below which communities are defined approaches . in our tests with the lfr benchmark , we will often be in this regime .testing an algorithm on any graph with built - in community structure also implies defining a quantitative criterion to estimate the goodness of the answer given by the algorithm as compared to the real answer that is expected .this can be done by using suitable similarity measures . for reviews of similarity measuressee refs .  . in the first tests of community detection algorithms ,one used a measure called _ fraction of correctly identified nodes _ , introduced by girvan and newman  .however , it is not well defined in some cases ( e. g. when a detected community is a merger of two or more `` real '' communities ) , so in the last years other measures have been used . in particular , measures borrowed from information theory have proved to be reliable .  to evaluate the shannon information content  of a partition ,one starts by considering the community assignments and , where and indicate the cluster labels of vertex in partition and , respectively .one assumes that the labels and are values of two random variables and , with joint distribution , which implies that and , where , and are the sizes of the clusters labeled by , and of their overlap , respectively . the _ mutual information _ of two random variables is defined as the measure tells how much we learn about if we know , and viceversa .actually , where is the shannon entropy of and is the conditional entropy of given .the mutual information is not ideal as a similarity measure : in fact , given a partition , all partitions derived from by further partitioning ( some of ) its clusters would all have the same mutual information with , even though they could be very different from each other . in this case the mutual information would simply equal the entropy , because the conditional entropy would be systematically zero . to avoid that , danon et al .adopted the _normalized mutual information _  which equals if the partitions are identical , whereas it has an expected value of if the partitions are independent .the normalized mutual information is currently very often used in tests of community detection algorithms .we have recently proposed a definition of the measure to evaluate the similarity of _ covers _ , i. e. of divisions of the network in overlapping communities , which one needs for the tests of section [ sec4.4 ] .the details can be found in the appendix of ref .we stress that our definition 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 . for consistency we used our definition in all tests , although in the tests involving benchmarks without overlapping communities the classic expression of eq .[ eqt08 ] could be used .for this reason , we warn that in the plots showing the performance of the algorithms on the gn benchmark , the curves are not identical to those already seen in previous papers ( for , e. g. , modularity - based methods ) , where eq .[ eqt08 ] was used , although they are rather close .we have tested a wide spectrum of community detection methods . in some casesthe software to implement the algorithms was publicly available , in other cases the original developers have let us use their own code , otherwise we have created the software on our own . we wanted to have a representative subset of algorithms , that exploit some of the most interesting ideas and techniques that have been developed over the last years .obviously we could not by any means perform an analysis of all existing techniques , as their number is huge . some of them were excluded a priori , if particularly slow , as our tests involve graphs with a few thousand nodes , which old methods are unable to handle . on the other hand , the code to create the lfr benchmark is freely available  and scholars are welcome to test their algorithms on it and compare their performance with that of the algorithms analyzed here .here is the list of the algorithms we considered .  * _ algorithm of girvan and newman_  .it is the first algorithm of the modern age of community detection in graphs .it is a hierarchical divisive algorithm , in which links are iteratively removed based on the value of their betweenness , which expresses the number of shortest paths between pairs of nodes that pass through the link . in its most popular implementation , the procedure of link removal ends when the modularity of the resulting partition reaches a maximum .the modularity of newman and girvan is a well known quality function that estimates the goodness of a partition based on the comparison between the graph at hand and a null model , which is a class of random graphs with the same expected degree sequence of the original graph .the algorithm has a complexity on a sparse graph . in the followingwe will refer to it as gn . *_ fast greedy modularity optimization by clauset , newman and moore _  .this method is essentially a fast implementation of a previous technique proposed by newman  . starting from a set of isolated nodes ,the links of the original graph are iteratively added such to produce the largest possible increase of the modularity of newman and girvan at each step .the fast version of clauset , newman and moore , which uses more efficient data structures , has a complexity of on sparse graphs . *_ exhaustive modularity optimization via simulated annealing _the goal is the same as in the previous algorithm , but the precision of the final estimate of the maximum is far higher , due to the exhaustive optimization , at the expense of the computational speed .the latter can not be expressed in closed form , as in the cases above , as it depends on the parameters used for the optimization .we will stick to the procedure used by guimer and amaral  .* _ fast modularity optimization by blondel et al ._  .this is a multistep technique based on a local optimization of newman - girvan modularity in the neighborhood of each node .after a partition is identified in this way , communities are replaced by supernodes , yielding a smaller weighted network .the procedure is then iterated , until modularity ( which is always computed with respect to the original graph ) does not increase any further .this method offers a fair compromise between the accuracy of the estimate of the modularity maximum , which is better than that delivered by greedy techniques like the one by clauset et al . above , and computational complexity , which is essentially linear in the number of links of the graph . * _ algorithm by radicchi et al ._  .this algorithm is in the spirit of that by girvan and newman above .in fact , it is a divisive hierarchical method , where links are iteratively removed based on the value of their edge clustering coefficient , which is defined as the ratio between the number of loops based on the link and the largest possible number of loops that can be based on the link . the edge clustering coefficient is a local measure , so its computation is not so heavy as that of edge betweenness , which yields a significant improvement in the complexity of the algorithm , which is on a sparse graph .another major difference from the gn algorithm is the stopping criterion of the procedure , which depends on the properties of the communities themselves and not on the values of a quality function like modularity .radicchi et al .considered two types of communities : _ strong _ communities are groups of nodes such that the internal degree of each node exceeds its external degree ; _ weak _ communities are groups of nodes such that the total internal degree of the nodes of the group exceeds their total external degree . *_ cfinder _  .this is a local algorithm proposed by palla et al .that looks for communities that may overlap , i.e. share nodes .it was the first paper in the physics literature on community detection to address this problem , which is important in many systems like , e. g. , social networks .communities are defined as the largest possible subgraphs that can be explored by rolling -cliques across the network , where a -clique rolls by rotating about any of its component -cliques ( which are links when ) .the complexity of this procedure can be high , as the computational time needed to find all -cliques of a graph is an exponentially growing function of the graph size  , but in practical applications the method is rather fast , enabling one to analyze systems with up to nodes . * _ markov cluster algorithm _this is an algorithm developed by s. van dongen , which simulates a peculiar diffusion process on the graph .one starts from the right stochastic matrix ( or diffusion matrix ) of the graph , which is obtained from the adjacency matrix of the original graph by dividing the elements of each row by their sum .then one computes an integer power of this matrix ( usually the square ) , which yields the probability matrix of a random walk after a number of steps equal to the number of powers of the right stochastic matrix considered .this step is called expansion .next , each element of the matrix is raised to some power , in order to enhance ( artificially ) the probability of the walker to be trapped within a community .this step is called inflation .the expansion and inflation steps are iterated until one obtains the adjacency matrix of a forest ( i. e. a disconnected tree ) , whose components are the communities .this method , widely used in bioinformatics , is strongly dependent on the choice of the parameter .its complexity can be lowered to if , after each inflation steps , only the largest elements of the resulting matrix are kept , whereas the others are set to zero . in the following we will refer to the method as mcl . * _ structural algorithm by rosvall and bergstrom _ . herethe problem of finding the best cluster structure of a graph is turned into the problem of optimally compressing the information on the structure of the graph , so that one can recover as closely as possible the original structure when the compressed information is decoded .this is achieved by computing the minimum of a function which expresses the best tradeoff between the minimal conditional information between the original and the compressed information ( maximal faithfulness to the original information ) and the maximal compression ( least possible information to transmit ) .the optimization of the function is carried out via simulated annealing , which makes the algorithm quite slow , although one could always go for a faster and less accurate optimization . in the followingwe will refer to the method as infomod . *_ dynamic algorithm by rosvall and bergstrom _  .this technique is based on the same principle as the previous one .the difference is that before one was compressing the information on the structure of the graph , here one wishes to compress the information of a dynamic process taking place on the graph , namely a random walk .the optimal compression is achieved again by optimizing a quality function , which is the minimum description length  of the random walk .such optimization can be carried out rather quickly with a combination of greedy search and simulated annealing . in the followingwe will refer to the method as infomap . *_ spectral algorithm by donetti and muoz _  .this is a method based on spectral properties of the graph .the idea is that eigenvector components corresponding to nodes in the same community should have similar values , if communities are well identified .donetti and muoz focused on the eigenvectors of the laplacian matrix .they considered a limited number of eigenvectors , say , and represented each node of the graph as a geometric point in an euclidean -dimensional space , whose coordinates are the eigenvector components corresponding to the node .the points are then grouped with traditional hierarchical clustering techniques . of the resulting partitions ,one picks the one that maximizes the modularity by newman and girvan .the method is rather quick when only a few eigenvectors are computed , which is usually the case , as this can be done via the lanczos method  . in the followingwe will refer to the method as dm . * _ expectation - maximization algorithm by newman and leicht _ . herebayesian inference is used to deduce the best fit of a given model to the data represented by the actual graph structure .the goodness of the fit is expressed by a likelihood that is maximized by means of the expectation - maximization technique  .this leads to a system of self - consistent equations , that can be solved by iteration starting from suitable initial conditions .the equations can be solved rather quickly and fairly large systems can be analyzed in this way ( up until nodes ) .a nice feature of the method is that it finds the most relevant group structure of the graph , whether the groups are communities or not ( in graphs with multipartite structure the classes are rather anti - communities , as there are very few links inside the groups ) .a drawback of the method is the fact that one needs to feed the number of groups , which is usually not known _ a priori_. in the following we will refer to the method as em .* _ potts model approach by ronhovde and nussinov _this method is based on the minimization of the hamiltonian of a potts - like spin model , where the spin state represents the membership of the node in a given community .a resolution parameter enables one to span several community scales , from very small to very large communities .the relevant scales are identified by checking for the stability of the partitions obtained for given values of the resolution parameter .this is done by computing the similarity of partitions obtained for the same resolution parameter but starting from different initial conditions .peaks in the similarity spectrum correspond to stable / relevant partitions .the method is rather fast , its complexity is slightly superlinear in the number of links of the graph . in the followingwe will refer to the method as rn .[ ht ]  tests of the algorithms on the gn benchmark.,title="fig : " ]  tests of the algorithms on the gn benchmark.,title="fig : " ]  tests of the algorithms on the gn benchmark.,title="fig : " ]  we begin by showing the performance of the algorithms on the gn benchmark . as we have explained in section [ sec1 ] , for the gn benchmark communities are well defined ( in principle ) up until a value for the mixing parameter .we will indicate the mixing parameter with the symbol to mean that we refer to topology . in section [ sec4.2 ] we will focus instead on the mixing parameter , which considers the weights of the links . in fig .[ gn ] we show the results of our analysis .each point of every curve corresponds to an average over realizations of the benchmark . for the algorithms by radicchi et al . andby newman and leicht ( em ) , we have put two curves instead of one ( likewise in section [ sec4.1 ] ) . in the first case, we showed the outcome of the method when one uses both possible stopping criteria , corresponding to a partition consisting of strong ( black curve ) and weak ( red curve ) communities , respectively . in the case of the em method, we show the curves delivered by the iterative solution of the em equations when one starts from a random partition ( red ) , and from the planted partition of the benchmark ( black curve ) .as one can see , results are different in these cases , even if they are solutions of the same equation .this shows how sensitive the solution is to the choice of the initial condition .moreover , the maximum likelihood achieved when one makes the `` intelligent guess '' of the real partition is higher compared to the maximum likelihood obtained starting from a random partition .this indicates that the greedy approach to the solution of the em equations suggested by newman and leicht is not an efficient way to maximize the likelihood , as one may expect .most methods perform rather well , although all of them start to fail much earlier than the expected threshold of .the cfinder fails to detect the communities even when , when they are very well identified .this is due to the fact that , even when is small , the probe clique that explores the system manages to pass from one group to the other and yields much larger groups , often spanning the whole graph .the method by radicchi et al . does not have a remarkable performance either , as it also starts to fail for low values of , although it does better than the cfinder .the mcl is better than the method by radicchi et al . , but is outperformed by modularity - based methods ( simulated annealing , clauset et al ., blondel et al . ) , which generally do quite well on the gn benchmark , something that was already known from the literature .the dm and rn methods have a comparable performance as the exhaustive optimization of modularity via simulated annealing .the gn algorithm performs about as well as the mcl .both methods by rosvall and bergstrom have a good performance .in fact , up until , they always guess the planted partition in four clusters .in this section we will present the tests on the lfr benchmark . for a thorough analysis ,we have considered various versions of the benchmark , in which links can have or not weights and/or direction .we have also examined the version which allows for community overlaps . in each test , we have averaged the value of the normalized mutual information over realizations for each value of the mixing parameter .[ ht ]  tests of the algorithms on the lfr benchmark with undirected and unweighted links.,title="fig : " ]  tests of the algorithms on the lfr benchmark with undirected and unweighted links.,title="fig : " ]  tests of the algorithms on the lfr benchmark with undirected and unweighted links.,title="fig : " ]  the plots of fig .[ lfr ] illustrate the results of the analysis .the following input parameters are the same for all benchmark graphs used here , as well as in sections [ sec4.3 ] , [ sec4.2 ] and [ sec4.4 ] : the average degree is , the maximum degree , the exponent of the degree distribution is and that of the community size distribution is . in each plot , except for the gn and the em algorithms , we show four curves , corresponding to two different network sizes ( and nodes ) and , for a given size , to two different ranges for the community sizes , indicated by the letters and : ( stays for `` small '' ) means that communities have between and nodes , ( stays for `` big '' ) means that communities have between and nodes . for the gn algorithm we show only the curves corresponding to the smaller network size , as it would have taken too long to accumulate enough statistics to present clean plots for networks of nodes , due to the high computational complexity of the method . for the em method we have plotted eight curves as for each set of benchmark graphs we have considered the two outcomes of the algorithm corrsponding to the different choices of initial conditions we have mentioned in the previous section , namely random ( bottom curves ) and planted partition ( top curves ) . in this case , the difference in the performance of the algorithm in the two cases is remarkable .the fact that , by starting from the planted partition , the final likelihood is actually higher as compared with a random start , as we have seen in the previous section , confirms that the method has a great potential , if only one could find a better way to estimate the maximum likelihood than the greedy approach currently adopted .nevertheless we remind that the em also has the big drawback to require as input the number of groups to be found , which is usually unknown in applications .  as a general remark, we see that the lfr benchmark enables one to discriminate the performances of the algorithms much better than the gn benchmark , as expected .modularity - based methods have a rather poor performance , which worsens for larger systems and smaller communities , due to the well known resolution limit of the measure  .the only exception is represented by the algorithm by blondel et al . , whose performance is very good ,probably because the estimated modularity maximum is not a very good approximation of the real one , which is more likely found by simulated annealing .the cfinder , the mcl and the method by radicchi et al .do not have impressive performances either , and display a similar pattern , i.e. the performance is severely affected by the size of the communities ( for larger communities it gets worse , whereas for small communities it is decent ) , whereas it looks rather insensitive to the size of the network .the dm has a fair performance , but it gets worse if the network size increases .the same trend is shown by infomod , where the performance worsens considerably with the increase of the network size .infomap and rn have the best performances , with the same pattern with respect to the size of the network and of the communities : up to values of both methods are capable to derive the planted partition in the of cases .we conclude that infomap , the rn method and the method by blondel et al .are the best performing algorithms on the lfr undirected and unweighted benchmark . since infomap and the method by blondel et al .are also very fast , essentially linear in the network size , we wonder how good their performance is on much larger graphs than those considered in fig .[ lfr ] . for this reason we carried out another set of tests of these two algorithms on the lfr benchmark , by considering graphs with and nodes .we have done so also because in the tests that can be found in the literature on community detection one typically uses very small graphs , and the performance can change considerably on large graphs . in fig .[ lfrl ] we show the performance of the two methods . due to the large network size, we decided to pick a broad range of community sizes , from to nodes . in this way , the heterogeneity of the community sizes is manifest .the maximum degree here was fixed to .remarkably , the performance of the method by blondel et al . is worse than on the smaller graphs of fig .[ lfr ] , whereas that of infomap is stable and does not seem to be affected .  [ ht ]  tests of the algorithm by blondel et al . and infomap on large lfr benchmark graphs with undirected and unweighted links.,title="fig : " ]   directedness is an essential features of many real networks .ignoring direction , as one often does or is forced to do , may reduce considerably the information that one can extract from the network structure .in particular , neglecting link directedness when looking for communities may lead to partial , or even misleading , results . in the literature there has been no benchmark for directed graphs with communities for a long time .however , we have recently extended the lfr benchmark to directed networks  , so we are in the position to evaluate the performance of community detection algorithms in this case .the presence of directed links is a serious obstacle towards a generalization of an algorithm for community detection .therefore , very few algorithms currently available are able to handle directed graphs . in the set of methods we consider here , only five can be used as well for directed networks : clauset et al . , simulated annealing for modularity , cfinder , infomap , em . for some of the other algorithms one may think of possible extensions which are , at present , still missing .the em method , in its original definition of ref . , has actually problems to deal with directed graphs  .we present here a comparison of the performances of two methods , exhaustive modularity optimization via simulated annealing and infomap .the results are in fig .[ lfrd ] . herethe topological mixing parameter refers to the indegree of the nodes , which are distributed according to a power law as in the original undirected benchmark , while the outdegree is kept constant for all nodes , a choice made to avoid an unnecessary proliferation of input parameters .again , we considered two different network sizes and ranges for the community size , which are the same as those in fig .the other input parameters for the benchmark are the same that we have given in section [ sec4.1 ] .as expected , modularity optimization shows the same limits that emerged in fig .[ lfr ] . on the other hand , the performance of infomap is still very good .[ ht ]  tests of infomap and of the exhaustive modularity optimization via simulated annealing on the lfr benchmark with directed and unweighted links.,title="fig : " ]   in this section we focus on undirected graphs with weighted links .[ ht ]  tests of infomap , mcl and of the exhaustive modularity optimization via simulated annealing on the lfr benchmark with undirected and weighted links.,title="fig : " ]  weights are also precious sources of information  . just as in the case of link directedness above , neglecting weights may imply a significant limitation of the information on a graph s properties , concealing features of real systems which may be very important and not deducible from the mere topology .ideally , one should exploit the information from both topology and weights for a reliable analysis of a network .the lfr benchmark has been extended to weighted graphs as well  .now there are two mixing parameters , one for topology , which is the same we have defined and used so far , and the other for the weights , , which is the weighted counterpart of , i. e. it expresses the fraction of the strength of the node that lies on links connecting the node to the nodes outside its community , with respect to the total strength of the node .we remind that the strength of the node is the sum of the weights of its links .moreover , there is an additional parameter , i. e. the exponent of the distribution for the strength : we have set it to for all realizations .all other parameters are the same specified in section [ sec4.1 ] .since we wish to show the results of the test on 2-dimensional plots , as we have done so far , we need to keep fixed one of the two parameters and study the dependence on the other . herewe freeze the topological mixing parameter and study the dependence of the results on , so that we see how the performance of an algorithm varies when only the weights are redistributed , but the topology is fixed .the results are in fig .[ lfrw ] , where we consider only three methods : infomap , mcl and exhaustive modularity optimization via simulated annealing .the other methods have no weighted counterpart or the code for the weighted version was not available . in each plotwe show four curves , corresponding to two choices for the topological mixing parameter and the two usual ranges of small ( s ) and big ( b ) communities that we have used so far .the network size is nodes in each case .the infomap by rosvall and bergstrom has , once more , a remarkable performance , although it worsens if communities are topologically more mixed ( higher ) and larger in size ( b ) .the mcl has a fair performance only in one case , for and small communities , whereas in the other extreme of big topological mixture and big communities it fails for any value of .modularity optimization seems to be more sensitive to the community size than to the other parameters .the fact that communities in real systems often overlap has attracted a lot of attention in the last years , leading to the creation of new algorithms able to deal with this special circumstance , starting from the first work by palla et al .meanwhile , a few methods have been developed  , but none of them has been thoroughly tested , except on a bunch of specific networks taken from the real world . indeed , there have been no suitable benchmark graphs with overlapping community structure , until recently  . in particular , the lfr benchmark has been extended to the case of overlapping communities  , and we use it here . of our set of algorithms , only the cfinder is able to find overlapping communities . in principlealso the em method assigns to each node the probability that it belongs to any community , but then one would need a criterion to define which , among such probability values , is significant and shall be taken or is not significant and shall be neglected . for this reason we report the results of tests carried out with the cfinder only .[ ht ]  tests of the cfinder on the lfr benchmark with undirected and unweighted links and overlapping communities .the variable on the -axis is the fraction of overlapping nodes .the networks have nodes , the other parameters are , , and .,title="fig : " ]  [ ht ]  tests of the cfinder on the lfr benchmark with undirected and unweighted links and overlapping communities . the variable on the -axis is the fraction of overlapping nodes . the networks have nodes , the other parameters are the same used for the graphs of fig .[ lfrov1].,title="fig : " ]  in figs .[ lfrov1 ] and [ lfrov2 ] we show the results .the topological mixing parameter is fixed and one varies the fraction of overlapping nodes between communities .we have run the cfinder for different types of -cliques ( indicates the number of nodes of the clique ) , with . in generalwe notice that triangles ( ) yield the worst performance , whereas - and -cliques give better results . in the two top diagrams community sizes range between and nodes , whereas in the bottom diagrams the range goes from to nodes . by comparing the diagrams in the top with those in the bottom we see that the algorithm performs better when communities are ( on average ) smaller .the networks used to produce fig . [ lfrov1 ] consist of nodes , whereas those of fig .[ lfrov2 ] consist of nodes . from the comparison of fig .[ lfrov1 ] with fig .[ lfrov2 ] we see that the algorithm performs better on networks of larger size .[ ht ]  tests of the algorithms on random graphs la erds - rnyi ( e - r ) and scale free ( s - f ) random graphs.,title="fig : " ]  tests of the algorithms on random graphs la erds - rnyi ( e - r ) and scale free ( s - f ) random graphs.,title="fig : " ]  tests of the algorithms on random graphs la erds - rnyi ( e - r ) and scale free ( s - f ) random graphs.,title="fig : " ]  an important test of community detection algorithms , usually ignored in the literature , consists in applying them to random graphs . in random graphs , by definition , the linking probabilities of the nodes are independent of each other . in this wayone does not expect that there will be inhomogeneity in the density of links on the graphs , i. e. there should be no communities .things are not that simple , though .it is certainly true that _ on average _ this is what happens . on the other hand , specific realizations of random graphsmay display pseudocommunities , i. e. , clusters produced by fluctuations in the link density .this is why , for instance , the maximum modularity of partitions in random graphs is not small  .however , a good method should distinguish between such pseudocommunities and meaningful modules .this is why we still expect to find no communities in random graphs .we considered two types of graphs : random graphs la erds - rnyi  , which have a binomial degree distribution , and random graphs with power law degree distributions ( scale free ) .the latter have been built via the configuration model  , starting from a fixed degree sequence for the nodes obeying the predefinite power law distribution .the exponent of the distribution is , the maximum degree was fixed to .the size of all graphs , erds - rnyi and scale free , is fixed to nodes . in fig .[ rand ] we show the number of modules found by various algorithms as a function of the average degree of the graph .each point corresponds to an average over graph realizations .we do not show the results of the em method , because the number of modules must be given by input , and of the gn algorithm because it is too slow to be used for the analysis .the best performance is that of the method by radicchi et al . , which always finds a single cluster comprising all nodes .another reasonable answer is to find as many clusters as there are nodes , like the mcl . here, however , the answer depends on the average degree of the graph : if is very low or very large the number of modules is smaller than , i.e. the method finds small groups of nodes .this is particularly evident for scale free graphs .modularity - based methods , like clauset et al . , the exhaustive optimization via simulated annealing , and the algorithm by blondel et al .are not so good , as they always find a few clusters , even in the limit of large : this is actually well known  .this is also the case for the dm method , which performs a sort of modularity optimization , on the restricted set of partitions delivered by hierarchical clustering .infomod and the rn method find non - trivial partitions for any value of .the cfinder finds a single module for very low values of and then a rapidly rising number of modules as increases .since the modules are strongly overlapping in this case , they may exceed the number of nodes , as we see from the plot .instead , infomap always finds a single module comprising all nodes , except when is low .we have carried out a comparative analysis of the performances of algorithms for community detection on various graphs : the gn and lfr benchmarks and random graphs .link direction , weights and the possibility for communities to overlap have been taken into account in dedicated tests .we conclude that the infomap method by rosvall and bergstrom  is the best performing on the set of benchmarks we have examined here . in particular , its results on the lfr benchmark graphs , which are much more difficult to examine than the gn benchmark graphs , as clearly shown by figs .[ gn ] and [ lfr ] , are encouraging about the reliability of the method in applications to real graphs . among the other things ,the method can be applied to weighted and directed graphs as well , with excellent performances , so it has a large spectrum of potential applications .the algorithms by blondel et al . and by ronhovde and nussinov ( rn )  also look very good from our analysis and could be used as well .in fact , for a study of the community structure in real graphs , one could think of using all three methods , to be able to extract some algorithm - independent information .furthermore , as we have seen in section [ sec2 ] , these methods have a low computational complexity , so one could use them on graphs with millions of nodes and links . on the other hand ,the algorithms are not able to account for overlapping communities , so they need to be properly refined to deal with this possibility , which is common in many real systems .one may object that , despite the features planted in the lfr benchmark , i. e. the fat - tailed distributions of degree and community size , which are actually observed in real networks , our artificial graphs are still different from real systems .for instance , the clustering coefficient  of the lfr benchmark is very low , due to the very small number of triangles , whereas real networks are characterized by many triangles and consequently a high clustering coefficient . on the one handthe gn benchmark also has very few triangles and low clustering coefficient ( the lfr benchmark is just a generalization of the gn benchmark ) , nevertheless people have used it extensively for testing algorithms . on the other hand , nothing forbids to modify the building mechanism of the lfr benchmark so that it does include triangles .this is actually a potentially interesting improvement of the benchmark , that deserves some attention in the future .another important remark is in order .our whole analysis has made use of graphs with a `` flat '' community structure , without hierarchy .many real networks instead have a hierarchical community structure , with communities inside other communities .good methods must be able to understand when a network has no communities , a flat or a hierarchical community structure .for an analysis of this kind we would need hierarchical benchmarks .there is actually a hierarchical version of the gn benchmark  , not yet one of the lfr benchmark , which is sorely needed .methods to find communities in multipartite graphs have yet to be tested as well .  from all of the above itis clear that this manuscript does not `` kill '' the issue of the actual efficiency and reliability of community detection methods .our analysis represents a first step , but it is clear that much more needs to be done along these lines .we thank l. donetti , r. lambiotte , f. radicchi , p. ronhovde and m. rosvall for kindly providing their code .we are also grateful to v. latora , t. nepusz , a. pluchino , a. rapisarda , m. sales - pardo , c. wiggins for useful suggestions .we gratefully acknowledge ictecollective , grant number 238597 of the european commission .

Abstract: uncovering the community structure exhibited by real networks is a crucial step towards an understanding of complex systems that goes beyond the local organization of their constituents . many algorithms have been proposed so far , but none of them has been subjected to strict tests to evaluate their performance . most of the sporadic tests performed so far involved small networks with known community structure and/or artificial graphs with a simplified structure , which is very uncommon in real systems . here we test several methods against a recently introduced class of benchmark graphs , with heterogeneous distributions of degree and community size . the methods are also tested against the benchmark by girvan and newman and on random graphs . as a result of our analysis , three recent algorithms introduced by rosvall and bergstrom , blondel et al . and ronhovde and nussinov , respectively , have an excellent performance , with the additional advantage of low computational complexity , which enables one to analyze large systems .