Artificial Benchmark for Community Detection (ABCD)—Fast random graph model with community structure

Abstract Most of the current complex networks that are of interest to practitioners possess a certain community structure that plays an important role in understanding the properties of these networks. For instance, a closely connected social communities exhibit faster rate of transmission of information in comparison to loosely connected communities. Moreover, many machine learning algorithms and tools that are developed for complex networks try to take advantage of the existence of communities to improve their performance or speed. As a result, there are many competing algorithms for detecting communities in large networks. Unfortunately, these algorithms are often quite sensitive and so they cannot be fine-tuned for a given, but a constantly changing, real-world network at hand. It is therefore important to test these algorithms for various scenarios that can only be done using synthetic graphs that have built-in community structure, power law degree distribution, and other typical properties observed in complex networks. The standard and extensively used method for generating artificial networks is the LFR graph generator. Unfortunately, this model has some scalability limitations and it is challenging to analyze it theoretically. Finally, the mixing parameter μ, the main parameter of the model guiding the strength of the communities, has a non-obvious interpretation and so can lead to unnaturally defined networks. In this paper, we provide an alternative random graph model with community structure and power law distribution for both degrees and community sizes, the Artificial Benchmark for Community Detection (ABCD graph). The model generates graphs with similar properties as the LFR one, and its main parameter ξ can be tuned to mimic its counterpart in the LFR model, the mixing parameter μ. We show that the new model solves the three issues identified above and more. In particular, we test the speed of our algorithm and do a number of experiments comparing basic properties of both ABCD and LFR. The conclusion is that these models produce graphs with comparable properties but ABCD is fast, simple, and can be easily tuned to allow the user to make a smooth transition between the two extremes: pure (independent) communities and random graph with no community structure.


Introduction
An important property of complex networks is their community structure, that is, the organization of vertices in clusters, with many edges joining vertices of the same cluster and comparatively few edges joining vertices of different clusters [28,14].In social networks, communities may represent groups by interest (practical applications include collaborative tagging), in citation networks they correspond to related papers, similarly in the web communities are formed by pages on related topics, etc. Being able to identify communities in a network helps to exploit it more effectively.For example, clusters in citation graphs may help to find similar scientific papers, discovering users with similar interests is important for targeted advertisement, clustering can also be used for network compression and visualization.Finally, many machine learning algorithms and tools use clustering as a unsupervised pre-processing step and then try to take advantage of the community structure to improve their performance or speed.
The goal of community detection algorithms is to partition the vertex set of a graph into subsets of vertices called communities such that there are more edges present within communities in comparison to the global density of the graph.The key ingredient for many clustering algorithms is modularity.Modularity for graphs was introduced by Newman and Girvan [25] and it is based on the comparison between the actual density of edges inside a community and the density one would expect to have if the vertices of the graph were attached at random regardless of community structure, while respecting the vertices' degree on average.There are many variants allowing, in particular, overlapping or hierarchical communities.Moreover, it is also possible to generalize modularity for hypergraphs [19].
Unfortunately, detecting communities in networks is a challenging problem.Many algorithms and methods have been developed over the last few years-see, for example, [11] for a recent review.It is important to point out that these algorithms are often quite sensitive and so they cannot be fine-tuned for a given family of networks we want these algorithms to work on.Some algorithms perform well on networks with strong communities but perform poorly on graphs with weak communities.The degree distribution and other properties of networks may also drastically affect the performance of these algorithms in terms of accuracy or computational complexity.Because of that it is important to test these algorithms for various scenarios that can only be done using synthetic graphs that have built-in community structure, power-law degree distribution, and other typical properties observed in complex networks.
In order to compare algorithms, one can use some quality measure, for example, the above mentioned modularity [25].Indeed, modularity is not only a global criterion to define communities and a way to measure the presence of community structure in a network but, at the same time, it is often used as a quality function of community detection algorithms.However, it is not a fair benchmark, especially for comparing algorithms (such as Louvain and Ensemble Clustering) that find communities by trying to optimize the very same modularity function!In order to evaluate algorithms in a fair and rigorous way, one should compare algorithm solutions to a synthetic network with an engineered ground truth.
The standard and extensively used method for generating artificial networks is the LFR (Lancichinetti, Fortunato, Radicchi) graph generator [22,21].This algorithm generates benchmark networks (that is, artificial networks that resemble real-world networks) with communities.The main advantage of this benchmark over other methods is that it allows for the heterogeneity in the distributions of both vertex degrees and of community sizes.As a result, in the past decade, the LFR benchmark has become a standard benchmark for experimental studies, both for disjoint and for overlapping communities [12].Some other benchmarks are discussed in the next section.
In order to generate a random graph following a given, previously computed, degree sequence, the LFR benchmark uses the fixed degree sequence model (also known as edge switching Markov chain algorithm) to obtain the desired community structure once the stationary distribution is reached.Unfortunately, the convergence process can be slow and so this model has some scalability limitations.Despite the need for experiments on large networks, the standard LFR implementation 4 can only be used to generate medium size networks.Moreover, due to its complexity and the fact that many implementations stop the switching before the stationary distribution is reached, it is challenging to analyze the model theoretically.Finally, the mixing parameter µ, the main parameter of the model guiding the strength of the communities, has a non-obvious interpretation and so can lead to unnaturally-defined networks.We discuss these issues at length in the next section.
In this paper, we provide an alternative random graph model with community structure and power-law distribution for both degrees and community sizes, the Artificial Benchmark for Community Detection (ABCD graph).We show that the new model solves the three issues identified above.In particular, we test the speed of our algorithm and do a number of experiments comparing basic properties of both ABCD and LFR.The conclusion is that these models produce comparable graphs but ABCD is fast, simple, and can be easily tuned between the two extremes: random graph with no community structure and independent communities.The Julia package providing an API for generation of ABCD graphs can be accessed at GitHub repository 5 .The repository also provides instructions how to set up R and Python to use the package directly from these environments.(For reference purposes, if requested, we can also provide a Python implementation of ABCD.)Finally, a command line interface to the library is provided that allows users to generate ABCD graphs without using an API.
The paper is structured as follows.In the next section, Section 2, we justify the need for a new benchmark network model.Section 3 provides a detailed description of the model.In order to compare ABCD and LFR, one needs to tune the two mixing parameters to make the corresponding graphs comparable.We explain this process in Section 4.
Section 5 presents experiments for comparison of the two models (both the speed and basic properties).Brief conclusion and directions for future work are presented in Section 6.Finally, pseudo-codes of our ABCD generator are presented in the Appendix.

Motivation
In the introduction, we already highlighted a few issues with the existing LFR benchmark.In this section, we provide more detailed justification for the need of a new benchmark model.

Problem with Scalability
In the big data era, there are many massive networks that need to be mined and analyzed.Since such networks cannot be handled in the memory of a single computer, new clustering methods have been introduced for advanced models of computation [8,36].These algorithms use hierarchical input representations which implies that the experiments performed on small or medium size benchmark graphs cannot be used to predict the performance on much larger instances [12].Unfortunately, many graph clustering benchmark generators currently available are not able to generate the graphs of necessary size [3,8].
Let us briefly discuss the reason for the leading benchmark not to be scalable.Switching edges in LFR can be viewed as a transition in an irreducible, symmetric, and aperiodic Markov chain.As a result, it converges to the uniform (stationary) distribution.More importantly, if the maximum degree is not too large compared to the number of edges, then it converges in polynomial time [16].However, despite the fact that these bounds on the mixing time are of theoretical importance, they are not practical even for small graphs.The convergence process is inherently slow and so the model has clear scalability limitations that are known to both academics and practitioners.The fastest published variant of the model that is able to generate large graphs is the external memory algorithm proposed by Hamann et.al. [17].
In order to generate huge graphs, practitioners typically use computationally inexpensive random graph models such as R-MAT [9] or the generator of Funke et.al. [13].These models might create communities.In fact, it is known that many random graph models naturally create community structure, especially the ones that are geometric in nature [26].However, they are not suitable for benchmarking purposes as there is no ground truth community structure to compare against.Hence, it is difficult to use them to evaluate clustering algorithms.
Another alternative, based on the scalable Block Two-Level Erdős-Rényi (BTER) graph generator [29], was recently proposed by Slota et.al. [30].The original model takes into account the desired degree distribution and per-degree clustering coefficient.Since it does not aim to create communities, its edge-generation process is more direct, simpler, and faster than LFR's.The authors of [30] try to twist the original model to create a graph that resembles the LFR benchmark.
The proposed ABCD model is fast.The experiments we performed imply that ABCD is 40 to 100 times faster than LFR (see Subsection 5.2 for more details).In particular, a graph on 10 million vertices with an average vertex degree of 25 can be generated on a standard desktop computer in several minutes (see Table 1 for example timing reports; the LFR algorithm implementation we used would take several hours to generate graphs of similar size).In this paper we concentrate on single threaded ABCD and LFR implementations in order to focus on the theoretical concepts behind ABCD.However, as an outlook for further work it is possible to design a distributed out-of-core implementation of ABCD to generate huge graphs having billions of vertices, similarly like it is done in [17] for LFR.Indeed, for example, generation of edges within communities can be performed using perfectly parallel approach, as each community is processed independently (see Section 3 for details).

Many Variants and Lack of Theoretical Foundations
The most computationally expensive part of the LFR benchmark is edge switching.In each step of this part of the algorithm, two edges are chosen uniformly at random and two of the endpoints are swapped if it removes the loop or parallel edge without introducing new ones.As already mentioned, the process converges to the stationary distribution but it does not converge fast enough for large graphs to be produced.Experimental results on the occurrence of certain motifs in networks [23], the average and maximum path length and link load [15] suggest that Θ(m) swaps are enough to get close to the desired distribution, where m is the number of edges in the graph.(See also [27] for further theoretical arguments and experiments.)The constant hidden in the asymptotic notation varies from experiment to experiment and is between 2 and 100.There are also some other heuristic arguments that justify more simplifications of the original algorithm.
There are at least two negative implications of this situation.First of all, there are many variants of this benchmark model and various implementations further modify some steps, either as an attempt to simplify the algorithm or to gain on speed.As a result, one can only create "LFR-type" graph and graphs generated by different implementations can have different properties.In fact, even the original formulation of the model leaves some ingredients not rigorously defined.This is certainly not desired for benchmark graphs that should provide a rigorous and fair comparison.Moreover, it creates challenges with reproducing experiments, something that is expected, if not required, when reporting scientific results.
The lack of a simple and clear description of the algorithm has another negative aspect.Despite the fact that the initial work on Erdős-Rényi model did not aim to realistically model real-world networks, the number of papers on random graphs and their applications to model complex networks is currently exploding.Indeed, in the period after 1999, due to the fact that data sets of real-world networks became abundantly available, their structure has attracted enormous attention in mathematics as well as various applied domains.For example, one of the first articles of Albert and Barabási [2] in the field is cited by more than 35,000 times.There are many papers investigating models of complex networks starting with a natural generalization of the Erdős-Rényi model to a random graph with a given expected degree distribution [10] to more challenging models such as random hyperbolic graphs [20] or spatial preferential attachment graphs [1].These results are not only interesting from theoretical point of view; they help us better understand the properties and the dynamics of these models by investigating local mechanisms that shape global statistics of the produced network.Despite this fact, there are very few results on theoretical properties of the LFR graph.It is unfortunate, as more research on models with community structure might shed light on how communities are formed and help us design better and faster clustering algorithms.
As described in Section 3, the proposed ABCD model can be seen as a union of independent random graphs.As a result, its asymptotic behaviour can be studied with the existing tools in random graph theory.Moreover, ABCD model is natural, relatively easy and straightforward to implement that limits a problem with reproducibility.Nevertheless, for those that look for "out-of-the-box" tool, we made it available as GitHub repository with a reference implementation.

Communities are Unnaturally-defined for Large Mixing Parameters
One of the parameters of the LFR benchmark is the mixing parameter µ ∈ [0, 1] which controls the desired "community tightness".The goal is to keep the fraction of inter-community edges to be approximately µ.In one of the two extremes, when µ = 0, all edges are within communities.On the other hand, when µ = 1, LFR generates pure "anti-communities" with no edge present in any of the communities.We believe that this is undesired and leads to unnaturally-defined communities.The threshold value of µ that produces pure random graph that is community agnostic is "hidden" somewhere in the interval [0, 1].It is possible to compute this threshold value (see Section 3.4 where we actually do it) but the formula is quite involved and not widely known.Indeed, many different values are reported in the literature (for example, µ = 0.7 is mentioned in [30]) and so many experiments are performed on unnaturally-defined networks and might lead to false conclusions.The influence of the parameter µ on the LFR graph is presented in Figure 1 (top).
In contrast, the parameter ξ ∈ [0, 1] in the ABCD model (counterpart of µ in LFR introduced in Section 3) has natural and important interpretation.As in LFR, if ξ = 0, then all edges are generated exclusively within communities.More importantly, ξ = 1 yields pure random graph in which communities do not affect the process of generating edges.Values of ξ ∈ (0, 1) produce graphs with additional signal coming from communities; the smaller the parameter, the more pronounced the communities are.One can easily move between ξ and µ (again, see Section 3.4 for more details) but there is no risk to create unnaturally-defined benchmark networks with "anti-communities".The influence of the parameter ξ on the ABCD graph is presented in Figure 1 (bottom).

Densities of Communities
The LFR model aims to generate a graph in which (1 − µ) fraction of edges adjacent to a given vertex stays within the community of that vertex.This property should hold for all vertices regardless whether this vertex belongs to large or small community.As a result, small communities will become much denser comparing to large ones.It is not clear that this property is desirable, especially in the case of unbalanced community sizes which the model is aiming for.Indeed, it seems to us that larger clusters should capture a proportionally larger fraction of edges-see Subsection 4.3 for a detailed discussion.
The approach used in LFR (which we call a local variant) seems to be inherited from the definition of the community in the classical book of Barabási [4].We challenge it and propose another approach (that we call a global variant) although we do respect this point of view.For those researchers and practitioners who prefer the original approach, we describe two variants of the ABCD model, one for each approach, and both variants are available on GitHub repository.Edges that fall between vertices in the same community are coloured accordingly.We see strong communities for the leftmost plots, and noisy yet still coherent communities for the middle plots.The rightmost plots, where µ = ξ = 0.95, illustrate our point regarding one of the main differences between LFR and ABCD.For LFR, in the top right plot, we see almost no edges within each community so the model generates "anti-communities".With ABCD, we see a random looking graph, where the number of edges within each "community" is proportional to the number of vertices that belong to it, as expected in a random graph.
3 Proposed Model

Parameters of the Model
We assume that the following parameters are provided as the input for the algorithm (for each input we specify a general approach and a proposed default specification): 1.The number of vertices, n.
(Notation: We label vertices with numbers from V = [n] := {1, . . ., n}.) 2. The exact (or expected) degree distribution w = (w 1 , . . ., w n ).The user can decide if the degree distribution has to follow a given distribution exactly (the configuration model will be used in this case) or only to follow it in expectation (the Chung-Lu model will be used instead).
(Remark: Note that the user does not have to provide vector w explicitly; it could be generated at random.In particular, it could follow a power law distribution with parameter γ and extreme values w min , w max .Alternatively, the average value w can be supplied instead of w min , which can then be computed, as it is done in the original LFR model.) 3. The number of clusters, k, and the sequence of cluster sizes s = (s 1 , . . ., s k ) satisfying k i=1 s i = n.(Remark: In particular, s could be a random sequence following the power law distribution with parameter β and extremes s min , s max , as it is done in LFR.If not specified, by default LFR sets s min and s max to the minimum and, respectively, the maximum degree.)(Notation: We label clusters with numbers from [k].We will use f (σ(i)) ∈ [k] to denote the cluster of vertex i ∈ [n], see Subsection 3.5 for a formal definition of this mapping.)4. The mixing parameter ξ.
(Remark: As already mentioned, at one extreme case when ξ = 0, all links are within clusters.On the other hand, if ξ = 1, then communities do not influence distribution of edges.Moreover, to add more flexibility, one may introduce different parameters ξ for each cluster-see Subsection 4.3 for more on that.)

Sampling w and s
At the very beginning, we sample the exact/expected degree distribution w, the number of clusters, and the cluster sizes s (unless they are given as deterministic parameters of the model).The algorithms used to generate them are presented in Appendix.Let us stress the fact that if w and s are sampled, then they are random variables.However, for fair comparison purposes, the same values of w and s are used when experiments on LFR and ABCD models are performed in Section 5.

Background and Cluster Graphs
Our model can be viewed as a union of k + 1 independent random graphs G i (i ∈ [k] ∪ {0})-one for each cluster, and one for the whole graph.As a result, one can view it as a generalization of the double round exposure method (also known in the literature as "sprinkling").We start with the background graph G 0 and "sprinkle" additional edges within communities that come from graphs G i (i ∈ [k]); the smaller value of ξ, the stronger ties between members of the same cluster are.As these graphs are generated independently, one can alternatively start with the cluster graphs and then "sprinkle" the background graph on top of it that can be seen as adding the "noise"; the larger value of ξ, the larger level of noise is.
First, we need to split the weight vector w into y and z; z will be responsible for the background graph and y will affect additional edges within communities.The process of splitting the weight is discussed in Section 3.4.Then, for a given , the set of vertices that belong to cluster i.We discuss the process of assigning vertices into clusters in Section 3.5.Let y i be the sub-sequence of y restricted to terms corresponding to vertices from V i .Let G i = (V i , E i ) be a random graph G(y i ) guided by the sequence y i -the exact model will be specified in Section 3.6.Finally, let G 0 = (V, E 0 ) be a random graph G(z) guided by the sequence z.We call graph G 0 the background graph and the remaining graphs G i (for i ∈ [k]) are called the cluster graphs.The model is defined as the union of these graphs, that is, G = (V, E), where Note that G allows loops and multiple edges.Indeed, they can occur both in any of the generated graphs or after taking a union of their edge sets.In general, however, there will not be very many of them, especially for sparse graphs.If one wants to study this random graph theoretically, one option is to work with multi-graphs or condition on G to be simple.From practical point of view, one can still work with multi-graphs or do some minor adjustments to the graph such as rewiring, re-sampling, or simply delete parallel edges.We will come back to this practical issue and provide a specific solution in Section 3.6.However, it is important to note that the proposed model of G has a value that it can be rigorously analyzed theoretically as all its components are well studied in graph theory literature and we take a union of independent graphs-see Subsection 2.2 for motivation for theoretical results.

Distribution of Weights
Parameter ξ ∈ [0, 1] controls the fraction of edges that are between communities; that is, it reflects the amount of noise in the network.Its role is similar to the role of the mixing parameter µ in the original LFR model.We split weights w into y and z as follows, keeping the same value of ξ for each vertex (recall that y will be associated with clusters and z will be associated with the noise): However, in order to add more flexibility, one may allow different coefficients ξ for each cluster.Let (ξ 1 , . . ., ξ k ) ∈ [0, 1] k .In the next subsection, vertices will be assigned into clusters: vertex i ∈ [n] will be assigned to cluster This variant is important if one wants to mimic the original LFR model as closely as possible, that is, to try to keep the fraction of internal edges for each cluster equal; otherwise, using the same ξ for all vertices suffice-see Subsection 4.3 for more discussion.

Assigning Vertices into Clusters
Our task now is to assign vertices into clusters, that is, to define the mapping f : [n] → [k] from vertices to clusters.Our goal is to design a fast algorithm that produces an assignment selected uniformly at random from some natural class of admissible assignments (formal definition is provided below).
The main problem is that vertices of large degree cannot be assigned to small clusters, as we aim to generate simple graphs for some applications of the proposed model.Recall that the weight vector w will be split into y and z that will guide the process of generating cluster graphs and, respectively, the background graph.All edges within cluster graphs will end up between vertices of the same community.On the other hand, only some fraction of the background edges will be also present there as an effect of the random sampling.Unfortunately, the number of such edges depends on the mapping f we are about to create, and so it is not known at this point.So how can we decide which vertex can be assigned to a given cluster leaving enough room for not only edges from the cluster graph but also for additional edges coming from the background graph?Fortunately, this "chicken and egg" problem can be solved as there exists a universal upper bound x i for y i that leaves enough room for the edges coming from the background graphs that works for all i ∈ [n], namely, where The reason for this choice of x i is as follows.In Subsection 4.1, we will show that the expected number of edges between communities is equal to ξµ 0 , where W is the volume of cluster , and W is the volume of the whole graph).If vertices are assigned to clusters randomly, then the expected value of W is s W .It follows that φ is a good approximation of µ 0 that is not known at this point.In any case, since φ < 1, we observe that x i ≥ (1 − ξφ)w i ≥ (1 − ξ)w i = y i and so there is definitely room for edges of the cluster graphs.

Let us call an assignment of vertices into clusters admissible
Recall that our goal is to select one admissible assignment uniformly at random.This condition is a necessary condition for the existence of a simple graph that this cluster induces.Note that it is only a necessary condition; in fact, the corresponding degree sequence has to be graphic.(A graphic sequence is a sequence of numbers which can be the degree sequence of some graph; see, for example [33] or any other textbook on graph theory for more.)We use this slightly weaker condition because it is much simpler and more convenient to use which gives us an easier framework to work with.Finally, let us stress that for the final graph G to be able to be simple, we get some additional constraints on admissible assignments of vertices into clusters.Not only z and all y i 's must be graphic but the union of all graphs needs to be simple as well.However, in practice, this causes no issue as we usually deal with sparse graphs that leave a lot of room for graphs to be fit.Indeed, in practice the probability that a non-graphic degree sequence is obtained for some cluster graph is extremely low.However, in order to deal with such potential problematic situations the algorithm tries to assign as many edges as possible to stay within the cluster graph and move the remaining ones to the background graphs.See the end of Subsection 3.6 for more details.
A formal definition is slightly technical.Suppose that vertices are sorted according to their bounds on the expected/exact internal degree, that is, x 1 ≥ x 2 ≥ . . .≥ x n .Similarly, suppose that cluster sizes are sorted, that is, In order to define the assignment of vertices into clusters, we need the following auxiliary sequence s ≤ .For each In particular, s ≤0 = 0 and s ≤k = n.Function f : [n] → [k], that we informally introduced earlier, is defined as follows.
For each i ∈ [n] and j ∈ [k], we fix The assignment now can be viewed as a permutation σ : Such assignments guarantee that the right number of vertices is assigned to each cluster but vertices of large degree could be assigned to small clusters.Let A be the set of admissible assignments defined as follows: In other words, no vertex in admissible assignment gets assigned to a cluster of size smaller than or equal to its expected/exact degree.Our goal is to select one member of the family A uniformly at random.
Sampling with uniform distribution is often a difficult task.Of course, generating one permutation with uniform distribution on the set of all permutations is easy and can be done in many different ways.If such permutation falls into A, then we could accept it; otherwise, we repeat the process until we get one that does it.Unfortunately, the size of A comparing to n!, the number of all possible permutations, can be very small so this rejection sampling process is not feasible from practical point of view.However, this point of view does have theoretical implications and might be useful in the future for analyzing the model.
Fortunately, sampling uniformly from A turns out to be relatively easy.To that end, we will use the following natural algorithm.(See also a pseudo-code in the Appendix.)Recall that vertices are sorted according to their bounds on internal degrees, that is, sequence x = (x 1 , . . ., x n ) is non-increasing.Consider vertices, one by one, starting with vertices that are associated with large values of x i , and assign them randomly to a cluster that has size larger than the corresponding bound and still has some "free spots"; that is, a cluster of size s j is considered for a vertex of degree x i if x i ≤ s j − 1 and the number of vertices already assigned to it is less than s j .The probability that a given vertex is assigned to a given cluster is proportional to the number of "free spots" that remain in that cluster.
The reason why this algorithm produces an admissible assignment uniformly at random comes from the fact that clusters that are assigned to earlier vertices could also be assigned to vertices considered later.In other words, it is not the case that vertices considered earlier could make decisions that create more (or less) choices for vertices considered later.They need to be assigned somewhere and, regardless of where they get assigned, the number of choices left for future vertices is not affected.In particular, the algorithm always terminates, unless A = ∅.
To see a formal argument, let It is straightforward to see that σ ∈ A if and only if σ(i) Note that, for any given admissible permutation σ ∈ A, our algorithm produces it with probability p that is only a function of t i but does not depend on σ.Indeed, it is easy to see that as there are t i − (i − 1) available "free spots" for a vertex i ∈ [n].Clearly, the algorithm does not produce any permutation that is not admissible.Hence, indeed, the algorithm generates a permutation from A uniformly at random.As mentioned above, the algorithm fails only if A = ∅.

Exact vs. Expected Degree Distribution -Two Variants of the Model
We will consider two variants of the model: the first one generates graphs with the expected degree distribution w (related to the well-known Chung-Lu model), and the second one with the exact degree distribution w (related to another well-known model, the configuration model).We will start with the description of the first variant, as it is slightly easier.However, it is presumably the case that the practitioners prefer the second variant.(In particular, a potential appearance of isolated vertices in sparse Chung-Lu models might not be desirable for practical purposes.) Recall that at this point we have vertices assigned to clusters: vertex i ∈ [n] belongs to cluster f (σ(i)).Moreover, the weight vector w is split into two vectors y and z that will guide the creation of cluster graphs G i (i ∈ [k]) and, respectively, the background graph G 0 .We need to specify how we actually do it and how we deal with potential problems after taking the union of these graphs.

The Expected Degree Distribution
In this variant of the model, we use the Chung-Lu model that produces a random graph with expected degree sequence following a given sequence.

Chung-Lu Model
Let w = (w 1 , . . ., w n ) be any vector of n real numbers, and let W = n i=1 w i .We define C(w) = ([n], E) to be the probability distribution of graphs on the vertex set [n] following the well-known Chung-Lu model [10,29,31,34].In this model, each set e = {i, j}, i, j ∈ [n], is independently sampled as an edge with probability given by: (Let us mention about one technical assumption.Note that it might happen that P(i, j) is greater than one and so it should really be regarded as the expected number of edges between i and j; for example, as suggested in [24], one can introduce a Poisson-distributed number of edges with mean P(i, j) between each pair of vertices i, j.However, since typically the maximum degree ∆ satisfies ∆ 2 ≤ 2|E| it rarely creates a problem and so we may assume that P(i, j) ≤ 1 for all pairs.)One desired property of this random model is that it yields a distribution that preserves the expected degree for each vertex, namely: for any i ∈ [n], w j = w i .

Theoretical Approach
The original Chung-Lu model is a multi-graph so it is natural and convenient to stay with multi-graphs in our model too.
We simply take and

Practical Approach -Insisting on Simple Graphs
From practical point of view, it is desired to generate a simple graph and use a fast algorithm that does it.In order to achieve both things, we use a version of the (fast) Chung-Lu model that produces the graph with a given number of edges.As a result, we need to round some numbers to integers.We use the following randomized way that is also used in the original LFR model.For a given integer k ∈ Z and real number ∈ [0, 1), let k + = k with probability 1 − k + 1 with probability .
(Note that the expected value of random variable k + is equal to k + .) We independently generate cluster graphs G i (i ∈ [k]) as follows.Note that v∈Vi y v /2 is the expected number of edges in C(y i ).We fix and then we generate the Chung-Lu graph C(y i ) conditioning on not having parallel edges or loops, and having exactly e i edges.This can be done in a fast way.We independently sample two vertices i and j with probabilities proportional to their weights.If i = j and adding an edge {i, j} does not create a parallel edge, then we accept it.We continue this process until e i edges are created.
Once all cluster graphs are created, we move to the background graph.In order to keep the total number of edges as desired, we fix Note that v∈V w v is usually an even integer (since vector w corresponds to the degree sequence) so e ∈ N ∪ {0}.(If not, we may replace v∈V w v /2 with v∈V w v /2 .)Note also that the expected value of e is equal to v∈V z v /2, the expected number of edges in C(z).We generate the Chung-Lu graph C(z) conditioning on not having loops, not creating parallel edges (in the union of all cluster graphs and the background edges created so far!), and having exactly e edges.To that end, we use the same fast algorithm as before.Note that, as long as the whole graph is sparse (which is typically the case), the second step is fast since not too many collisions occur, even if some of the cluster graphs G i (i ∈ [k]) are dense.

The Exact Degree Distribution
This variant of the model uses the configuration model (instead of the Chung-Lu model) that produces a random graph with a given degree sequence.However, this change brings a few small issues that need to be dealt with.

Configuration Model
Let w = (w 1 , . . ., w n ) be any vector of n non-negative integers such that W := n i=1 w i is even.We define a random miuti-graph M(w) with a given degree sequence known as the configuration model (sometimes called the pairing model), which was first introduced by Bollobás [7].(See [5,35] for related models and results.)Let us consider W configuration points partitioned into n labelled buckets v 1 , . . ., v n ; bucket v i consists of w i points.A pairing of these points is a perfect matching into W/2 pairs.(There are W !/((W/2)!2 W ) such pairings.)Given a pairing P , we may construct a multi-graph G(P ), with loops and parallel edges allowed, as follows: the vertices are the buckets v 1 , . . ., v n , and a pair {x, y} in P corresponds to an edge {v i , v j } in G(P ) if x and y are contained in the buckets v i and v j , respectively.We take a pairing P uniformly at random from the family of all pairings of W points and set M(w) = G(P ).
It is an easy but a fundamental fact that the probability of a random pairing corresponding to a given simple graph G is independent of the graph.Indeed, an easy calculation shows that every simple graph corresponds to exactly n i=1 w i !pairings.Hence, the restriction of the probability space of random pairings to simple graphs is precisely S(w), the uniform probability space of all simple graphs with a given degree sequence.Moreover, it is well known that if then the expected number of loops and multiple edges that are present in M(w) is O(1) and so the probability that M(w) is simple tends to δ = δ(w) > 0 which depends on w but is always separated from zero.As a result, event holding a.a.s.(that is, with probability tending to 1 as n → ∞) over the probability space M(w) also holds a.a.s.over the corresponding space S(w).For this reason, asymptotic results over random pairings immediately transfer to S(w).
One of the advantages of using this model is that the pairs may be chosen sequentially so that the next pair is chosen uniformly at random over the remaining (unchosen) points.

Distribution of Weights
We assume that integer-valued vector w is such that i w i is even so that a given degree sequence is feasible.(As mentioned earlier, it is only a trivial, necessary condition-in fact, w should be a graphic sequence.)Recall that the weights, vector w, is split into real-valued vectors y and z.However, since we deal with exact degree sequences not expected ones, this time we have two additional constraints that we need to satisfy, namely, that a) all involved weights are integers, and b) for each of the k clusters, the corresponding sum of weights is even.Note that once these conditions are satisfied for all cluster graphs, the background graph immediately has them too-all degrees are integers and the sum of weights is even.
We split w into integer-valued vectors ŷ = (ŷ 1 , . . ., ŷn ) and ẑ = (ẑ 1 , . . ., ẑn ) as follows.For each cluster i ∈ [k], we identify the leader, vertex of the largest weight in cluster i. (If more than one vertex has the largest weight, we select one of them to be the leader, arbitrarily.)In order to deal with non-integer values, for all vertices i ∈ [n] that are not leaders, we set ŷi = y i .For the remaining k vertices, the leaders, we round y i up or down so that the sum of weights in each cluster is even.(If some leader has the weight y i ∈ N and the sum of weights in its cluster is odd, then we randomly make a decision whether subtract or add 1 to make the sum to be even.)

Theoretical Approach
We take and G 0 = G(ẑ) = M(ẑ).Some of the involved graphs might not be simple but the expected number of loops and parallel edges is small, especially for sparse graphs.We have a few options how to deal with them.The first option is the easiest: we could do nothing and work with multi-graphs.Alternatively, we could condition on all G i (i ∈ [k] ∪ {0}) to be simple.From theoretical point of view, this model is equally easy to analyze, provided that for each G i , the probability of getting a simple graph tends to a constant as n → ∞ (does not matter how small it is and could be different for each i ∈ [k] ∪ {0}).It is known that under some mild assumptions this is the case (in particular, the order of each cluster graph should tend to infinity with n, etc.)-see above for the discussion around the configuration model.Let us remark that even though all G i 's are simple, it is not guaranteed that the final graph, G, is simple as edges from G 0 can overlap with edges of G i for some i ∈ [k].Hence, we could condition on G to be simple.Unfortunately, this model might be more challenging to analyze (as it introduces some dependencies between the background graph and the cluster graphs) but this is certainly worth investigating in the future work.

Practical Approach -Insisting on Simple Graphs
Before we discuss how we apply these observations to our problem, let us discuss a general approach and some theoretical, asymptotic results.Let us generate a random graph with a given degree sequence using the configuration model.If it happens that it is a simple graph, it is a uniformly distributed random graph from the family of simple graphs with this degree sequence.Suppose then that it is not simple.It is known that after performing some kind of "switching" we get a random graph that is very close to the uniform distribution and we should solve all problems in O(1) time.Indeed, in [18], it is proved that, assuming essentially a bounded second moment of the degree distribution, the configuration model with the simplest types of switchings yields a simple random graph with an almost uniform distribution, in the sense that the total variation distance is o(1).For each parallel edge uv, one needs to choose a random edge xy, remove uv, xy, and with probability 1/2 add ux, vy; otherwise, add uy, vx.
Let us now explain how we actually apply switchings to our problem.We start with the configuration model to generate cluster multi-graphs G i (i ∈ [k]).We then apply switchings to get a family of simple graphs.
After that, we use the configuration model to generate the background graph G 0 and use switchings to remove loops and parallel edges.
After taking the union, more parallel edges could be created.As usual, we use switchings to remove them.However, this time we restrict ourselves to edges in the background graph and switch only those.This can be done since all graphs G i are simple at this point and so collisions must involve at least one edge from the background graph.During switching more collisions can be created but each collision again involves at least one edge from the background graph.
We do this to preserve the number of internal edges within cluster; the cluster graphs are not affected by this final round of switchings.
In for our algorithm to be fast in all potential situations, we have implemented a procedure that controls the process of fixing multiple edges and self loops so that it is not extremely slow (and, in particular, to be robust against a mentioned earlier rare possibility of obtaining a non-graphic degree sequence).If some cluster graph G i is extremely dense, it might be computationally expensive (or simply impossible for non-graphic degree sequence) to sample a correct replacement that maintains all the desired constraints.This situation is extremely rare but if it happens, then we retry it only for a limited number of times.This creates a small bias for the number of edges captured within that community, but we have empirically found that it happens less than 1 per 1,000,000 edges for typical tight configurations of the model so the bias should not be noticeable in practice.It is possible to resolve all conflicts exactly (unless, of course, a non-graphic degree sequence is obtained, which is rare) so this is simply a trade-of between the speed and the quality of the implementation.
In summary, the conflict resolution algorithm we use for each cluster graph G i works as follows: 1. perform a standard configuration model on G i but put all self loops and multiple edges in a recycle list assigned to this graph; 2. iteratively, remove one edge from the recycle list and try to rewire it with randomly selected edge from G i including those from the recycle list; this process is tried as many times as the target number of edges in G i (so, in expectation, each edge is tried for rewiring once); if we successfully do the switching, then we move forward; otherwise, we return the chosen edge back to the recycle list; 3. the whole process is repeated as long as we are able to find a good rewiring for an edge in recycle until recycle becomes empty or the number of times we were unable to reduce the recycle list size is equal to the size of recycle, that is, we unsuccessfully tried to recycle all edges in recycle; in such a case, we give up and move the remaining degrees of the vertices forming those unmatched edges from G i to the global graph so that the final degree of all vertices in the union graph follows w-as noted above, this action is extremely rare-approximately less frequent than once per 1,000,000 edges.
For the background graph we follow the same procedure.However, we do not "give up" recycling and follow the process until all required edges are created.As the background graph is sparse, this process is very fast in practice.

Comparing ABCD and LFR
The role of parameter ξ in ABCD is similar to the one of parameter µ in LFR; however, they are not the same!If ξ = µ = 0, then in both models all edges are within communities, but if ξ = µ = 1, then ABCD is a random graph and so is substantially different than LFR which produces "anti-communities".As a result, in order to compare the two models one needs to tune the parameters such that the corresponding densities of communities are comparable.
The are two natural ways of distributing the weight w-the first one preserves the densities globally whereas the second one preserves it locally for each vertex in the graph.We will independently consider both approaches.After that we will discuss the difference between the two and their implications.However, before that let us recall one subtle caveat we already discussed in Section 3.5 when we assigned vertices into clusters.
If one creates a pure ABCD graph, then ξ is known upfront and there is no issue.Now, we try to find ξ for ABCD that matches given µ for LFR.The problem is that we cannot compute ξ before vertices are assigned to clusters.On the other hand, to do the assignment we need to bound the number of neighbours of each vertex that belong to its own cluster graph that is a function of ξ-recall equation (1).To overcome this "chicken and egg" problem, we apply some universal upper bound x i for y i , namely x i := (1 − µ)w i to do the assignment, and then compute ξ.Hence, in what follows we may assume that the assignment is given to us and we simply tune ξ to match given µ.

Recovering the Mixing Parameter (Globally)
In this scenario, we start with a fixed ξ that will be applied for all vertices regardless to which cluster they belong to.
Recall that ) is the set of vertices assigned to cluster .Let W = t∈V w t be the volume of G, and let W = t∈V t be the expected/exact volume of vertices of cluster .Clearly, W = ∈[k] W .There are two models (namely, Chung-Lu and Configuration Model) used to generate multi-graphs G i (i ∈ [k] ∪ {0}) but both of them have the property that edges occur with probability proportional to the product of the weights of the two endpoints.Consider two vertices i, j with weights w i and, respectively, w j .If they are in different clusters (f (σ(i)) = f (σ(j))), then the probability that they are adjacent is equal to (In fact, for multi-graphs it is the expected number of edges as the value above could potentially exceed 1.However, it is a rare situation in practice.)It follows that the fraction of edges that are between communities is equal to Hence, in order to mimic the structure of the LFR graph, one should consider On the other hand, if vertices i and j are in the same cluster , the probability is equal to The expected number of neighbours of i that are in cluster then equal to Let us make one remark.Note that if µ > µ 0 , then the corresponding value of ξ is grater than 1.As a result, we cannot generate our random graph.One can see it as a potential problem but, in fact, it is the opposite.Such values of µ correspond to models in which the density between clusters is larger than the internal density.As discussed in Subsection 2.3, we should not be ever concerned with such networks with "anti-communities".

Recovering the Mixing Parameter for Each Vertex (Locally)
In this scenario, we consider a sequence of parameters ξ i (i ∈ [k]), one per each cluster.In the original LFR model, once the degree sequence w = (w 1 , . . ., w n ) is fixed, the algorithm tries to re-wire the edges such that for each vertex i, the internal degree is close to (1 − µ)w i .There is some variability in the final "local" mixing parameters, but mainly due to the presence of low degree vertices which clearly must deviate from the desired ratio.
It is not clear if matching local parameters is what we want (see the discussion in the introduction and in Subsection 4.3) but here is a possible way to modify the approach presented above in order to have local mixing parameters close to µ.Instead of using the same ratio ξ for splitting weights into background and cluster portions, one can carefully tune it and use different values of ξ for different clusters.Consider vertex i with degree w i that belongs to a cluster with the total weight equal to W f (σ(i)) .For the background graph G 0 = G(z), let z i = ξ f (σ(i)) • w i be such that Indeed, this is desired as only the (W − W f (σ(i)) )/W fraction of the background edges are expected to be present between the communities.It follows that the ratio for cluster ∈ [k] should be defined as follows: As a result, for the cluster graph G f (σ(i)) = G(y f (σ(i)) ) corresponding to the cluster of vertex i, we let As before, there exists a threshold µ 1 such that if µ > µ 1 , then some value of ξ is grater than 1 and so the model cannot be applied.This time

The Comparison Between the Two Variants (Global vs. Local)
Let us summarize the difference between the two approaches discussed above.Both of them preserve the same number of edges between clusters: µ fraction of all edges are of this type (global property).The difference is how we split the degree of each vertex into internal degree and external one (local property).The original LFR model insists on each vertex keeping the same fraction of internal neighbours and the local version of our model (with k parameters ξ i ) does this too.As a result, small clusters will be much denser than large clusters.Is it what we expect to happen in complex networks?
Suppose that two researchers have the same number of friends (say, 100) but belong to different communities.The first one, Bob, belongs to a small community (say, he is a mathematician doing some esoteric part of mathematics), the second one, Alice, is part of a large community (say, she is a data scientist).Suppose that 30% of friends of Alice do data science.Should we expect 30% of friends of Bob to be in his field?We believe the answer is no.It might be the case that there are less than 30 people around the world working on this subject!Coming back to the model, it seems that it makes more sense for the number of internal neighbours of a given vertex to be a function of the size of the cluster this vertex belongs to.As long as the probability that a given vertex is connected to another member of its cluster is larger than the probability of being adjacent to a random vertex in the whole graph, this vertex is a legit member of this cluster.This is what we propose in our first variant, the global version of our model (with only one parameter ξ).

Experimental Results
In this Section, we compare ABCD and LFR benchmarks with respect to their respective mixing parameters (Subsection 5.1), the efficiency of the algorithms (Subsection 5.2), and properties of the graphs they generate (Subsection 5.3).
In order to perform fair comparisons, we fix the LFR mixing parameter µ and then derive the corresponding parameters for ABCD: ξ via equation ( 2) for the global model, or ξ i 's via equation ( 4) for the local model.
Instructions how to reproduce Figures 2 and 4 can be found on-line 6 .We do not make the codes for producing the exact results given in Section 5.2 public, as they required some technical changes in comparison to publicly available implementations of the algorithms; in particular, we wanted to measure only the graph generation time without saving it to disk.Using the instructions presented on GitHub, that are based on end-user versions of codes, allow to reproduce the presented results with high accuracy while minimizing complexity of execution of the experiments.Moreover, for Figures 2 and 4 we performed a slightly more exact comparison than presented on GitHub; that is, the same vertex degrees and community sizes are provided to all algorithms rather than generating them independently each time to make sure that the corresponding graph generation processes are compared on exactly the same data.However, the results are very similar to what is obtained with the simplified approach available on-line.The modified implementations that were used to generate figures in this paper can be made available upon request.

Global vs. Local Mixing Parameters
We showed above that in the ABCD model (global variant), we expect a larger proportion of internal edges for larger communities.This implies a negative correlation between the community-wise mixing parameters µ i (that is, the proportion of external edges for a given community) and the community sizes s i .This is slightly different than in the LFR model which tries to preserve the same community-wise µ i for each community.We showed that the ABCD model can be easily modified to mimic this property by defining community-wise parameters ξ i , which we refer to as the local variant of the model.
In Figure 2, we illustrate this behaviour for graphs with n = 250,000 vertices and the same degree and community sizes distributions.We plot the mixing parameter µ i for each community as a function of its size.For comparison purpose, the dashed black horizontal line corresponds to the constant value µ = 0.2.For the global variant of the ABCD model, we also display the regression line obtained by fitting the expected values for the µ i using the formula (3).In each case, due to rounding issue we see more variability for small communities, as expected.For LFR, we see that the average value stays close to µ = 0.2 while with the global variant of the ABCD, the value decreases with the community size matching the expected behaviour quite well.Using the local version of ABCD, we see that we get similar behaviour to the LFR model.In this subsection, we compare efficiency of the generating algorithms.All the results were obtained on a single thread of Intel Core i7-8550U CPU @ 1.80GHz, run under Microsoft Windows 10 Pro, and performing all computations in RAM.The computations for LFR were performed using the C++ language implementation7 .For ABCD, the Julia 1.3 language implementation was used [6] in order to ensure high performance of graph generation, while keeping the size of the code base small.We tested all four combinations of the ABCD model (Chung-Lu vs. Configuration Model, and global vs. local variant).

Efficiency Comparison
In order for comparison to be fair, we first generated the degree distribution and the distribution of cluster sizes, and then used it for all five algorithms tested (LFR and 4 combinations of ABCD).Only the times to generate the corresponding graphs (single threaded, in memory, without storing the outcome on a hard drive) were measured, assuming the degree distribution and the distribution of cluster sizes are given-these steps are fast anyway.
The models were generated for µ = 0.2 (and its counterparts for ξ's for ABCD-see equations ( 2) and ( 4)), vertex average degree of 25 with maximum of 500, and community sizes varying between 50 and 1,000.Three different configurations of (γ, β) guiding the degree distribution and the distribution of cluster sizes are presented on Figure 3 ((γ, β) ∈ {(3, 2), (2.5, 1.5), (2, 1)}).The number of vertices, n, spans from 8,192 to 472,392 and the timings are presented on the log-log scale.We present the results for one run of the LFR model whereas averages over five runs of the ABCD model are reported.The reason for running the ABCD generator more than once was that in most cases one run took less than a second, and so there was some non-negligible variability between runtimes due to external noise when performing the computing.
The conclusion is that the LFR algorithm is of the order of 100 times slower than the one for the ABCD model; the largest ABCD was generated in a similar time to the smallest LFR.The worst scenario for ABCD is when the configuration model is used with low exponents of the two distributions (namely, γ = 2 and β = 1); in this case, ABCD is roughly 40 times faster.
In order to test an influence of various distributions of (γ, β) on the of ABCD for larger networks, we performed benchmark tests for 10,000,000 vertices.As before, the mixing parameter is fixed to µ = 0.2, vertex average degree is 25 with maximum of 500, and community sizes vary between 500 and 10,000 (we increased the community sizes in comparison to the earlier test, as we now consider much larger number of vertices).
The time to generate the graphs using ABCD are of order of several minutes-see Table 1 where we vary parameters γ and β.In general, Configuration Model variant of ABCD is faster when local communities are not very dense.(See the rightmost plot in Figure 3 where we presented the case of very dense communities where Chung-Lu based generator is faster.)Also we note that an increase of parameter β leads to longer run times.This is associated with the fact that small values of β produce several very large communities that attract heavy vertices.In such scenarios, the generators do not have to resolve too many collisions (multiple edges or self loops) and so the algorithm terminates quickly.Each row in Table 1 is produced for the same vectors w and s (but they vary across rows).The high variability of the results between rows indicates that the run-time is quite sensitive to specific sampled values of w and s.Specifically, we have checked that the longest run-times are to be expected if there is a lot of heavy vertices sampled in w and at the same time not many large clusters sampled in s.

Comparing Graph Properties
In this subsection, we compare graphs generated with the LFR and the ABCD benchmarks via some topologybased measures.We investigate the following graph statistics: clustering coefficient (the average vertex transitivity), eigenvector centrality, the global transitivity, and the average shortest paths length (approximated via sampling).
We generated graphs with 100,000 vertices, average degree 25, maximum degree 500 and power law exponent γ = 2.5; for the community sizes, we used power law exponent β = 1.5 with sizes between 50 and 2000.The mixing parameter for LFR is set to µ = 0.2 and, in order to compare similar graphs, for the ABCD algorithm we derive ξ from (2) and the ξ i 's from (4) (for the local model).In Figure 4, we report the distribution of the graph properties obtained by generating 30 graphs each using LFR as well as 4 variations of ABCD, namely: The results of these experiments show high similarity of graphs generated with LFR and ABCD, in particular, when the configuration model is used.Indeed, some graph parameters that are sensitive with respect to the degree distribution (such as clustering coefficient) are not well preserved for the Chung-Lu variant of the model, which is natural and should be expected.Having said that, all graph parameters we evaluated are relatively well aligned.

Conclusion and Future Work
The paper has two interrelated angles, theoretical and practical.We tried to define the model in as easy and natural way as possible.As a result, from the theoretical point of view, using abundant tools from the theory of random graphs, we plan to investigate an asymptotic behaviour of the ABCD model.As explained in Subsection 2.2, this is not only interesting from pure math point of view but also might be important for practitioners.Finally, we plan to generalize the model and add geometry into the model.This would allow, for example, for overlapping and hierarchical communities.
From practical point of view, the implementation we propose in this paper is single-threaded which we believe is sufficient for generating small to medium size graphs.Indeed, it usually takes under one minute to generate a graph consisting of several millions of vertices; in fact, the timing of the process of generating an ABCD graph is of comparable magnitude as the time needed to save it to the hard drive later (on a typical server).However, in order to deal with enormous graphs containing billions of vertices, users might need out-of-core distributed implementation of the ABCD algorithm.In Section 2.1, we have commented on how this could be achieved in future work.Independently, it would be interesting to perform more extensive experiments with ABCD (and, in particular, compare it to LFR) when the generated graphs are used to test algorithms that require knowledge of ground truth community structure (such as clustering algorithms).We think that performing such experimental comparison is an important follow-up to this theoretical paper.
Figure 4: Comparing some properties for graphs generated with the LFR and ABCD benchmarks, using the same degree and community size distributions.

Figure 1 :
Figure 1: Examples of graphs generated by the LFR algorithm (top) and by the ABCD algorithm (bottom).All graphs have the same degree distribution and community sizes.The three LFR graphs correspond to values of the mixing parameter µ ∈ {0.1, 0.3, 0.95}, whereas for the ABCD graphs the plots correspond to ξ ∈ {0.1, 0.3, 0.95}.Edges that fall between vertices in the same community are coloured accordingly.We see strong communities for the leftmost plots, and noisy yet still coherent communities for the middle plots.The rightmost plots, where µ = ξ = 0.95, illustrate our point regarding one of the main differences between LFR and ABCD.For LFR, in the top right plot, we see almost no edges within each community so the model generates "anti-communities".With ABCD, we see a random looking graph, where the number of edges within each "community" is proportional to the number of vertices that belong to it, as expected in a random graph.

Figure 2 :
Figure2: Comparing the behaviour of graphs with n = 250, 000 vertices generated from 3 models: LFR, ABCD (with the configuration model), and its local variant.We used the same degree and community sizes distributions obtained with parameters: w = 25, w max = 1500 and γ = 2.5 for the degrees, and c min = 50, c max = 2500 and β = 1.5 for the community sizes.We see that with LFR and ABCD (local variant), the expected community-wise mixing parameter µ i is constant while for the ABCD model, it decreasing as a function of the community size.

Figure 3 :
Figure 3: Generation times in seconds of the LFR and the ABCD models; CL indicates the Chung-Lu model and CM indicates the configuration model.

Table 1 :
Generation times in seconds of the ABCD model-4 variants with n = 10,000,000 vertices; CL indicates the Chung-Lu model and CM indicates the configuration model.Generation of comparable graphs with LFR would require several hours, which is prohibitive for large-scale studies involving a large number of graphs.