{'fraction_non_alphanumeric': 0.033872485326403516, 'fraction_numerical': 0.012074913750616067, 'mean_word_length': 4.590356919223544, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Generating Simple Directed Social Network Graphs for Information Spreading

Online social networks are a dominant medium in everyday life to stay in contact with friends and to share information. In Twitter, users can connect with other users by following them, who in turn can follow back. In recent years, researchers studied several properties of social networks and designed random graph models to describe them. Many of these approaches either focus on the generation of undirected graphs or on the creation of directed graphs without modeling the dependencies between reciprocal (i.e., two directed edges of opposite direction between two nodes) and directed edges. We propose an approach to generate directed social network graphs that creates reciprocal and directed edges and considers the correlation between the respective degree sequences. Our model relies on crawled directed graphs in Twitter, on which information w.r.t. a topic is exchanged or disseminated. While these graphs exhibit a high clustering coefficient and small average distances between random node pairs (which is typical in real-world networks), their degree sequences seem to follow a $\chi^2$-distribution rather than power law. To achieve high clustering coefficients, we apply an edge rewiring procedure that preserves the node degrees. We compare the crawled and the created graphs, and simulate certain algorithms for information dissemination and epidemic spreading on them. The results show that the created graphs exhibit very similar topological and algorithmic properties as the real-world graphs, providing evidence that they can be used as surrogates in social network analysis. Furthermore, our model is highly scalable, which enables us to create graphs of arbitrary size with almost the same properties as the corresponding real-world networks.


INTRODUCTION
Online social networks, such as Facebook and Twitter have become leading platforms for people to stay in touch with others, communicate and exchange news and information. Since their emergence, researchers have studied the structure of the network graphs, utilised various topological features to describe and analyze them, and simulated the spread of messages therein. Some platforms offer the possibility to obtain the social network graph or parts of it, but the process of crawling these graphs is often very time-consuming, especially if they consist of millions of nodes and edges. Additionally, the information in these graphs needs to be handled carefully due to the sensitive nature of the user data and data protection regulations. Thus, there is a need to model and synthetically generate realistic social network graphs. The Web Conference, which is the premier international event focusing on the study of the World Wide Web, devotes one of its major tracks to the "investigation of arXiv:2205.02485v1 [cs.SI] 5 May 2022 graph-based techniques for social networks" and the development of "new theories, models, and algorithms to make these systems more effective and efficient" 1 .
Random graph generation dates back way before the invention of online social networks. Most approaches either create undirected graphs or directed graphs without specifically modeling reciprocal edges (two directed edges of opposite direction between two nodes). In a recent seminal paper [14], the authors analyzed the spread of information in online social networks and concluded that "the aggregation of users in homophilic clusters dominate online interactions on Facebook and Twitter". Motivated by the connection between interaction networks and the spread of information in social networks, we analyze real-world graphs on which information w.r.t. certain topics are exchanged and disseminated. We develop a synthetic graph generation method for such interaction networks that not only creates a graph with reciprocal and directed edges, but also takes the correlation between reciprocal and directed node degrees into account via Copulas. Nodes are then connected by edges according to their sampled degrees and edges are rewired to increase the average clustering coefficient to a realistic level.
We applied our method to 14 crawled subgraphs of the Twitter follower graph of different sizes and structures, and created graphs with the same number of nodes. Results show that our approach creates graphs that match several topological features of the crawled network graphs, and that behave similarly when applying certain processes, e.g., information dissemination. Our method can also create graphs of arbitrary size with various degree distributions.
The paper is structured as follows. In Section 2 we give a short summary about different graph generation methods and in Section 3 we present the crawled subgraphs. In Section 4 we describe our graph creation method, and we present our results in Section 5. The discussion in Section 6 concludes the paper.

RELATED WORK
One of the first random graph generation models is the Erdős-Rényi model [20], where for given numbers of nodes and edges, one of the possible graphs is chosen uniformly at random. An alternative version is presented in [25], where nodes are connected independently according to a predefined probability. Erdős-Rényi graphs have small clustering coefficients, but form the basis for random graph generation. A model with high clustering coefficient was designed by Watts and Strogatz [44]. In this model, the graph starts as a regular ring lattice (i.e., every node is connected to its closest neighbors on a ring, for some constant ) and edges are iteratively rewired. A different class of graph generation models is based on growth and the Preferential Attachment (PA) mechanism. The initial graph in the Barabási-Albert model [4] contains 0 nodes. In each step a new node is added to the graph (growth), which connects to ≤ 0 nodes chosen with probability proportional to their current degree (PA). This method has later been extended to directed graphs, see e.g., [7].
Other random graph generation methods are based on establishing connections between nodes according to node degree sequences. One of these methods is the Configuration model [5,8] whose functionality is described in [10] and [12]. The concept for undirected graphs is to sample node degrees from a distribution, create stubs for each node and randomly connect two of them until no stubs are left. The sampled node degrees are met exactly in the generated graphs, but they often contain self-loops (a node connected to itself) and parallel edges (two or more edges between two nodes). To create a simple graph (no self-loops and only one edge between nodes) with this method, alternatives are presented in [10] and [12]. The authors of [12] additionally introduce a directed version of the Configuration model, where the sum of the in-degrees and the sum of the out-degrees must be equal such that all stubs can connect. Similar to the idea of the Configuration model, but with a probabilistic approach, is the Chung-Lu model [13]. Each node pair is connected with a probability proportional to the product of their respective degrees. The sampled degree sequences are not met exactly, but the created graphs do not contain parallel edges. A directed version of the Chung-Lu model is presented in [19]. We should also mention the block two-level Erdős-Rényi model [30,40], which includes a community structure into the graphs. First, it creates communities using Erdős-Rényi graphs (called affinity blocks), and then edges are generated between communities using a variation of the Chung-Lu model. A structured summary of additional graph generation approaches can be found in [9], where the authors provide an extensive survey on state of the art graph generators, discuss their strengths, weaknesses and open challenges.
Various approaches for directed graphs exist, but most of them do not explicitly model reciprocal edges in directed graphs, even though real-world graphs often exhibit a high amount of reciprocity [19,31]. The authors of [19], for example, extend the Chung-Lu model and provide a powerful baseline model to match the reciprocal, in-and out-degree distributions of a graph; however, their model does not take the correlation between the node degrees into account. Also, it is known that many social network graphs exhibit a high average clustering coefficient (CC) [1,33,34], which has to be taken into account when generating random graphs with corresponding topological properties. [37] propose a modified Configuration model to create undirected graphs with high clustering by not only specifying the number of edges per node, but also the number of triangles per node. Extending this approach to directed graphs does not seem straightforward since for every triangle, the type of edge between two nodes would also need to be determined.
Alternatively, the technique of edge rewiring (also called edge switching) was developed to increase the CC in a graph. The authors of [2] introduce various rewiring algorithms where one edge is switched per iteration (e.g., edge ( − ) is replaced by ( − )), which alters the node degrees. In another approach, two non-adjacent edges are rewired at a time and the new graph is accepted if the CC has increased. In [3] and [27], the idea is to randomly select a node in the graph, two unconnected neighbors of , 1 and 2 , and two unconnected second degree neighbors of , 1 and 2 , with edges ( 1 − 1 ), ( 2 − 2 ). Changing these edges to ( 1 − 2 ) and ( 1 − 2 ) increases the CC of node and preserves the degree sequences. The authors of [42] propose switching more than two edges at a time by applying a random permutation on the destination nodes, thus preserving the degree sequences. The new graph is accepted if it fulfills predefined graph constraints (e.g., graph is simple).
Our graph creation method resembles the idea of [19] by treating reciprocal and directed edges separately, but additionally considers the rank correlation between the node degrees when sampling them. Nodes are then connected according to the principle of the Chung-Lu model [13], but avoiding self-loops or parallel edges. To increase the clustering coefficient of the created graph, the rewiring procedure in [3] is extended to directed graphs. Instead of randomly selecting one node in each iteration and aiming for a predefined CC, we apply several rewiring iterations on every node, depending on its degree, up to a certain node degree. Considering only a subset of options for rewiring induces a bias into our proposed graph generation method. [32,43] present and discuss methods for uniform random graph generation (also by utilising higherorder edge switches), which usually have a very high guaranteed running time [22,26]. We therefore accept this induced bias and favor increasing the CC of smaller degree nodes, which also tend to have a higher CC in social networks, cf. [33,34].

DATASET DESCRIPTION
Our work is based on Twitter follower networks, which is motivated by the results of [14] regarding the interaction networks, on which information about specific topics is exchanged or disseminated. We acquired six different Tweet datasets from the Twitter Historical Power Track. Tweets were collected in a time frames of 41 days between August 2019 and March 2020, which we believe results in sufficiently complete graphs of users for the respective topics. The topics include vegan diet, social distance, two soccer clubs in Germany and two political parties in Austria. Eight datasets were acquired through Premium Search API of Twitter, between August 2021 and October 2021, and the time frames are 4, 10 or 14 days depending on the topic, allowing us to investigate networks over shorter time periods. These topics cover mainly digitization trends and computer science fields. For each of the 14 topics, we extracted the users who actively posted, retweeted or quoted, and then crawled their followers using the Twitter API. The lists of followers were truncated to only keep the follower relationships between the users of a topic. Finally, user IDs were anonymized.
The follower network graphs = ( , ) are directed, where each node ∈ corresponds to a user and each edge ∈ represents a follower relationship between two users. In Twitter a user 1 can follow another user 2 which connects them by a directed edge ( 1 → 2 ) and if two users follow each other, they are connected by two directed edges of opposite direction, which we will treat as one reciprocal edge ( 1 − 2 ). For each node in the 14 graphs ( 1 through 14 ), we determined the reciprocal degree (number of neighbors that are connected via a reciprocal edge), the in-degree (total incoming edges minus reciprocal degree), the outdegree (total outgoing edges minus reciprocal degree) and the total degree (number of neighbors), which is the sum of the three node degrees above. We computed Spearman's rank correlation coefficient between the degrees and also several topological graph features, studied and defined in [1,33,34] to characterize the crawled graphs: The sizes of the largest strongly connected component (LSCC) and the largest weakly connected component (LWCC), the density, the average shortest path length (ASPL), the diameter and the average clustering coefficient (CC), all related to the LWCC. The statistics of 5 of the crawled graphs are listed in the first line of the respective cells in Table 1, and in Table 4 in Annex A for the remaining 9 graphs. Features related to the LWCC have an asterisk (e.g., Density* for the density in the LWCC). As typical for social networks [1,33,34], the crawled graphs are characterised by small shortest path lengths, huge connected components, small diameter and high average CC.

GRAPH CREATION METHOD
In this section we introduce the method to synthetically create realistic social network graphs with reciprocal and directed edges 2 . Our goal is to create graphs with the same number of nodes as the crawled ones, a comparable density and a similar average CC in the LWCC. We present the information extracted from the crawled graphs to generate node degrees and establish edges between the nodes without creating self-loops or parallel edges. An edge rewiring procedure concludes the approach. For the synthetic graph creation, we sample the reciprocal degree, the in-degree and the out-degree for each of the = | | nodes from fitted distributions. Most literature suggests that the degrees of a social network graph follow a power-law or a log-normal distribution [1,33,34]. We performed Kolmogorov-Smirnov tests to fit probability distributions to the three node degrees, but the returned -values were close to 0 for each distribution. By testing several distributions, we found that the degree sequences of the crawled and subsequently truncated Twitter subgraphs considered in this paper are best modeled by 2 -distributions, if hyperparameters were selected such that mean and standard deviation agrees with those of the crawled graphs. The log-scale histogram in Figure 1 shows that there are only a few nodes with a high reciprocal degree, e.g., > 500, in the crawled graph 1 (orange bins). A similar behavior regarding the node degree distribution was observed for the in-and out-degree in 1 , and also for the degrees in the other graphs. Even though the fitted 2 -distribution (blue bins) tends to generate a smaller amount of high-degree nodes, it fits the degree distribution of the crawled graph well w.r.t. the quartiles, the mean degree and the standard deviation, whereas the power-law distribution (pink bins) overproduces nodes with a high degree.

Node Degree Sampling
Sampling the reciprocal, in-and out-degree for the nodes of directed graphs independently results in nodes having unrealistic joint degrees such as high in-and out-degrees but a reciprocal degree of 0, which we did not observe in the crawled graphs. Indeed, there is a high rank correlation (Spearman's rank correlation coefficient ) between the reciprocal, in-and out-degree in the crawled graphs (see the first lines of the respective cells in Table  1 and Table 4 in Annex A). To prescribe the rank correlation between sampled node degrees, we make use of the NORTA principle (normal to anything) [11], where multivariate normally distributed data is sampled and transformed into the desired joint distribution in two steps. First, we fit 2 -distributions to the reciprocal, in-and out-degree and compute the rank correlation coefficients 1 = (reciprocal, in), 2 = (reciprocal, out), 3 = (in, out) between the three degrees. Next, we map 1 , 2 , 3 into the linear correlation coefficients 1 , 2 , 3 with = 2 · sin( · /6) [38], = 1, 2, 3, to sample times from a multivariate Gaussian distribution with mean vector = (0, 0, 0) and covariance matrix Applying the cumulative distribution function (CDF) transforms the sampled multivariate data into the ]0, 1[ 3 -space, where each dimension of the data approximately follows the uniform distribution U ]0,1[ . The joint distribution U 3 ]0,1[ is known as a Copula [35]. To receive the synthetic node degrees from the Copula, we use the inversion method [17]. We apply the inverse of the CDF of the fitted 2 -distributions to the respective dimensions of the Copula data and round the results to integers. This returns the synthetically generated reciprocal, in-and out-degree sequences R, I, O of length , which have approximately the same rank correlation as the node degree sequences of the crawled graphs. We interpret the degree sequences as indexed multisets, i.e., the degrees of each node are at the same position in R, I, O, such that we can use set notation.

Connecting nodes via edges
We now sample edges by computing the connection probability of two nodes based on their generated degrees while avoiding selfloops and parallel edges. First we sample reciprocal edges and based on these edges, we sample directed edges. Our approach resembles the Chung-Lu model [13,19], but results in a simple graph.
The method requires as input an empty graph = ( , ) that contains = | | numbered nodes = {1, . . . , } and the generated reciprocal, in-and out-degree sequences R, I, O. We determine the expected reciprocal degree sum = =1 R( ) and the expected number of directed edges = 1 2 · =1 (O( ) + I( )). Edge sampling is a Bernoulli experiment, only using the nodes with respective degrees unequal to zero. I.e., for a node pair ( , ) we place a reciprocal edge ( − ) (implemented as two directed edges ( → ) and ( → )) with probability proportional to R( ) · R( ), and a directed edge ( → ) with probability proportional to O( ) · I( ).
To avoid self-loops, before sampling reciprocal edges, we compute the probability sum of the reciprocal self-loops and uniformly Algorithm 1 Edge rewiring for -times 10: Randomly select 1 ∈ ( ) and 2 ∈ ( ) \ 1 11: for 10-times 13: Randomly break add it to the connection probabilities of the possible reciprocal edges (where R( ) ≠ 0 and R( ) ≠ 0). Before sampling directed edges, we first inspect if a directed edge ( → ) has already been sampled as a reciprocal edge. If this is the case, we add its probability to a reservoir of already sampled potential directed edges (the same is done for the edge ( → )) which will be uniformly added to the possible directed edges (O( ) ≠ 0 and I( ) ≠ 0). For directed self-loops, we apply the same technique as for reciprocal self-loops.

Edge Rewiring
The degree distributions of the nodes in the created graphs match the desired degree distributions well, but the average CC in the LWCC of the created graphs is lower than in the crawled graphs, see Table 3 and Table 5 in Appendix A for comparison. To increase the CC, we utilise the technique of edge rewiring. We are following the approaches presented in [3] and [27], but instead of randomly selecting one node per iteration, we consider all nodes up to a certain total degree (95-percentile of all node degrees) for the rewiring procedure. For each node ∈ , we try to connect a fraction of its first degree neighbors, depending on the degree of . We do not compute the CC after every rewiring iteration since this is timeconsuming, and we do not aim for a target CC. The pseudocode for the edge rewiring procedure is depicted in Algorithm 1.
Since nodes with a high degree exhibit a smaller average CC [33,34], we do not apply the rewiring procedure on the nodes with the highest degrees. Experiments have shown that it suffices to only consider those 95 percent of all nodes with the lowest total degree. For ease of notation, we use deg( ) to denote the indexed multiset of node degrees in . From this set of nodes, we remove all nodes in the upper 95-percentile of node degrees and all nodes with a degree smaller than 2 since the rewiring procedure cannot be applied for them. The resulting set of nodes is denoted as ′ .
We look at each node ∈ ′ in ascending order of its node ID, i.e., potentially starting with node 1, and iterate multiple times over each node, depending on its degree deg( ), to apply the rewiring procedure. Since nodes with a high degree tend to have a smaller average CC, we sample 60% of first degree neighbor pairs for nodes with a degree above the median degree in ′ and all first degree neighbor pairs otherwise. One rewiring iteration (line 9 in Algorithm 1) for a node ∈ ′ starts with the random selection of two distinct first degree neighbors 1 ∈ ( ) and 2 ∈ ( ). If they are connected, they are not further considered in the rewiring process and a new first degree neighbor pair is selected. If they are not connected, we look at their neighbors, denoted as ( 1 ) and ( 2 ) and remove the nodes that are connected to both, 1 and 2 . We additionally remove all nodes that have a smaller node ID than to not disrupt the already investigated nodes too much. Next, we randomly sample two nodes 1 ∈ ( 1 ) and 2 ∈ ( 2 ). Rewiring can only happen if i) 1 and 2 are not connected and ii) to preserve the node degrees, if 1 , 2 are connected to 1 , 2 via reciprocal edges or if they are connected via directed edges with opposite directions (see Algorithm 2 in Appendix B). As these conditions may not always be fulfilled, we sample the second degree neighbors a maximum of 10 times (line 12 in Algorithm 1).

Topological Features
To evaluate the graph creation method, we aimed to replicate the 14 crawled graphs described in Section 3. For the topological features, the main goal was to create graphs with the same number of nodes, a similar density and a comparable average CC in the LWCC. The topological features of 5 crawled graphs and the corresponding synthetically created graphs are listed in Table 1 (the remaining ones are listed in Table 4 in Annex A).
The results show that our approach creates graphs with a similar size as the crawled graphs. The number of edges in the graphs are in a similar range and the density only starts to differ in the fourth decimal place. Due to the assignment of degrees to nodes according to rank correlations and the probabilistic sampling of edges, some nodes have a total degree of 0. Thus, the sizes of the largest connected components in the created graphs have the tendency to be smaller than in the crawled ones.
We observe that the average shortest path length (ASPL) and the diameter also tend to be slightly smaller in the created graphs.
Since nodes connect to each other with a probability proportional to their degrees, low-degree nodes are more likely to connect to nodes with a high degree than to nodes with low degree, leading to short path lengths between nodes and a small diameter in the created graphs. In the crawled graphs however, we observed nodes with a degree of one, known as leaves, that are connected to another node with a small degree. These leaves have a high shortest path length to each other causing a higher diameter.
In the crawled graphs, the average CC lies between 0.20 and 0.35, while in created graphs the span reaches from 0.15 to 0.38. Since we are not aiming for a fixed CC, these fluctuations are expected. Both for crawled and created graphs, a higher density in the LWCC (Density*) tends to correlate with a higher average CC. Even though the difference between the crawled and the created graph in 7 is above 0.1 (see Table 4 in Annex A), the result is still acceptable, since the created graph exhibits a reasonable average CC* (0.150).
The last three cells of Table 1 (and Table 4) contain the rank correlations between reciprocal, in-and out-degree, where we see that the correlation in the created graphs (line 2 in the cells) is lower than in the crawled ones (line 1 in the cells). This difference is caused by rounding the sampled data to integers (Section 4.1) and by probabilistic edge sampling (Section 4.2), where the node degrees are not replicated exactly. The second offset could be avoided by applying an adjusted version of the Configuration model.
We also analyzed the community structure of the crawled and the created graphs. When used for comparing random graph models to real-world networks, usually disjoint communities have been considered (see e.g., [30]). Here we focus on overlapping communities, which often can be observed in social networks (i.e., each user is usually part of several communities). To obtain these overlapping communities, we cluster the neighbourhood of each node , using the parallelized Louvain algorithm [6] from the NetworkKit tool suite [41], and assign to each of these clusters, which leads to a huge number of overlapping clusters. We therefore delete clusters that are contained in others. Two overlapping clusters are merged 3 if the second smallest eigenvalue of the normalized Laplacian of the merged cluster is larger than those of the two input clusters by some predefined margin. The clusters to be tested for merging are picked at random, though some heuristics are used to avoid expensive eigenvalue calculations for most of the candidates. Obviously, the resulting clustering ends in a local optimum w.r.t. the second smallest eigenvalues of the final clusters. The merging procedure stops when the time needed to find suitable candidates is estimated to be very high.
In the following, we compare the distribution of the sizes of the overlapping clusters in the crawled graphs, the created graphs, as well as the so-called intermediary graphs, which are constructed as described in Section 4, but without edge rewiring. We observe that there is no significant difference between the distribution of the cluster sizes in the crawled and the created graphs (see Figures 2 and 4-7; note that for the sake of visualization we use a smoothed distribution curve by averaging each data point with the left and right neighbor for the crawled graphs). This also indicates that the random graphs developed in Section 4 properly model the studied real-world networks. We also compare the distribution of the cluster sizes between the crawled and created graphs on the one side and the intermediary graphs on the other side in Section 5.3.

Algorithmic Properties
One of the major questions in social networks is how certain processes such as information dissemination or epidemics behave in the corresponding graphs. In this section, we compare the behavior of such processes in crawled and created graphs. For information dissemination, we consider the so-called push-pull model introduced in [16] and popularized later in [29]. It is known that this model is closely related to certain (structural and algorithmic) graph properties such as the conductance or the cover time of random walks, see e.g., [24]. Note that the computation of these properties is NP-complete in general (cf. [23]).
The push-pull model is a simple randomized process for information dissemination. The time is divided into rounds; in each round every node selects a neighbor uniformly at random and opens a communication channel to this neighbor. Since the same node can be selected by several neighbors, each node may have several incident communication channels. Then, communication is bidirectional, i.e., if one of the nodes incident to a communication channel possesses some information, the other node will also have this information by the end of the round. At the beginning of the process we place a message on some selected nodes and the question is how many rounds do we need until the message has reached all nodes. Clearly, the number of required rounds is a random variable, with a distribution well concentrated around its mean for many important graph classes [21].
In our experiments, we simulated the push-pull model on the LWCC of the crawled and created graphs. At the beginning, we assigned a message to 2 log nodes, where is the number of nodes in the graph, and ran the process until all nodes were informed. Each simulation run has been repeated 100 times for all graphs except 2 and 3 , for which we repeated each simulation 10 times (as these two graphs are much larger than the others). Although there may be a huge difference between different graph classes w.r.t. the completion time of the push-pull model in general [24], ranging between Ω(log ) and O ( 2 log ) rounds, we observe that this process behaves similarly on the graphs we consider.
According to Table 2, the number of rounds needed to inform all nodes is lower in the created graphs than in the crawled ones. However, we also observe that the created graphs have a higher density, and they also exhibit a smaller diameter. The crawled graphs also contain a certain number of paths with length 2 at the periphery 4 , which influence the running time in these graphs, while the number of such paths is much smaller in the created graphs.
The second process we consider in this section is the so-called Susceptible-Infected-Recovered (SIR) model [28]. In its simplest variant, we assume that at the beginning a (small) number of nodes is infected. In each round, any infected node spreads the infection to each of its outgoing neighbors with some probability , independently. Then, the nodes that spread the infection in this round become recovered and cannot become infected again. There are several results focusing on the time until the disease dies out as well as on the fraction of nodes becoming infected for different graphs depending on the probability [28,36]. Since our main focus in this paper is the comparison of the created graphs to the crawled graphs, we do not aim to simulate different variants of the SIR model. We consider the simplest variant instead and compare the influence of the probability on the number of recovered nodes by the end of the epidemic process. Also in this case, we repeated the simulations on all graphs 100 times (10 times for 2 and 3 ).
For better comparison, Table 2 shows the fraction of recovered nodes (instead of the total number of recovered nodes, as the total numbers of nodes differ). We observe that the difference in most of the cases is almost negligible (i.e., less than 0.03), and the highest difference we observe is less than 0.12. Overall this simple epidemic process seems to have a similar behavior in the crawled graphs and the corresponding created graphs.
Motivated by the fact that the behavior of several algorithms is governed by the eigenvalues of the (normalized) Laplacian of the underlying graphs [18,39], we also analyze the distribution of eigenvalues for the crawled and created graphs. Similar analysis, using the first 50 eigenvalues of the corresponding adjacency matrices, has been performed in e.g., [30]. We observe that there is a difference between the graphs w.r.t. the number of eigenvalues close to 1, while the distribution of the eigenvalues in the ranges   Figure 3). The same holds for the other graphs we consider in this paper.

Ablation Analysis
The graph creation method consists of three separate steps, node degree sampling, connecting nodes via edges and rewiring of edges.
To demonstrate the importance of correlated degree sampling and edge rewiring, we analyzed the topological and algorithmic features of the created intermediary graphs before applying the rewiring procedure and additionally created a graph with randomly assigned node degrees of the size of 1 .

5.
3.1 Random assignment of node degrees. The node degrees in our proposed method were sampled using a Copula to match the rank correlations between the degrees in the crawled graphs. To show the importance of joint degree sampling, we created a graph with the same number of nodes as 1 , sampled the degrees from the fitted 2 -distributions, and randomly assigned them to the nodes, similar to the FRD null model in [19]. As expected, the rank correlations between the degrees in the created graph are around zero, 1 = 0.018, 2 = 0.001, 3 = 0.002. The largest connected components are bigger (LSCC: 8, 944; LWCC: 10, 669), as less nodes have a sampled total degree of zero.

Results without edge rewiring.
After connecting nodes via edges, the intermediary graphs have node degrees similar to the node degrees in the crawled graphs. We investigated these graphs to assess the influence of the rewiring procedure. While other topological features considered above remain stable, the average CC in the LWCC is significantly lower in all intermediary graphs. Table 3 and Table 5 in Annex A contain the average CC of the graphs before (*) and after (**) rewiring. Another evidence for the importance of edge rewiring can be observed w.r.t. the distribution of community sizes. While the distributions in the crawled and created graphs are similar, the distribution of the community sizes in the intermediary graphs differs significantly from those in the crawled or created ones, cf. Figure 2. In contrast, the algorithmic properties analyzed in Section 5.2 are similar in the intermediary and the created graphs. The rewiring procedure takes up most of the graph creation time. Creating graphs without edge rewiring is therefore much faster, especially for bigger graphs, but the results are notably worse.

Runtime Analysis
The experiments were conducted on 1 core of an Intel(R) Xeon(R) 6248 CPU @ 2.50GHz processor with 256GB RAM, and runtimes are listed in Table 1 and in Table 4 in Annex A. It can be seen that the runtime for the graph creation method differs significantly between the graphs. While smaller graphs (e.g., 1 ) are created within 1 hour, it takes more than a day to create a graph of the size of 2 . We observe that the runtime can also vary significantly between graphs with a similar number of nodes (e.g., 2 and 7 ). This indicates that the runtime depends heavily on the number of edges | |, and in turn on the degree deg( ) of each node ∈ ′ .
Since connecting nodes via edges has a fixed time complexity of O | | 2 in our algorithm, we conclude that the edge rewiring procedure (Algorithm 1) dominates the graph creation time. Recall that we are iterating over every node in the lower 95-percentile w.r.t. their degrees, and check for each pair of its first degree neighbors if there is an edge between these nodes in the graph. If two selected first degree neighbors are connected, they are not further considered in the rewiring process. Otherwise, we look at the nodes which are connected by (incoming and outgoing) incident edges to either of these neighbors, denoted by 1 and 2 . Among the neighbors of these two nodes, we do not take into account the nodes with a smaller ID than as well as those which are connected to both, 1 and 2 . From the rest, we select a constant number (10 in our implementation) of pairs uniformly at random, and check whether the rewiring procedure described in Algorithm 1 can be applied.
In order to achieve a space complexity of O (| | + | |) and runtime O ( ∈ ′ deg( ) 2 ·max(deg( ′ ))·log max(deg( ′ ))), where max(deg( ′ )) denotes the maximum degree in ′ , we need to extend our data structure. We assume that the graph is given as an adjacency list [15]. Clearly, the list of each node only contains the nodes connected through an outgoing edge in some arbitrary order. In a pre-processing phase, we examine each list entry in the adjacency list exactly once, and construct an additional adjacency list such that the list of a node contains the nodes connected by an incoming edge. Furthermore, for a node in the outgoing adjacency list of a node we set a pointer to the node in the incoming adjacency list of . Before we start the rewiring procedure, we sort each adjacency list according to the IDs of the nodes in this list. Furthermore, we duplicate each (sorted) adjacency list, and update the duplicates in the rewiring process as follows. Whenever for a chosen node we finish the rewiring process w.r.t. two neighbors considered in any further step whenever 1 or 2 are selected as a first degree neighbor of some node (different from ).
Apart from duplicating the adjacency lists, in a step when two nodes 1 and 2 are chosen as first degree neighbors of a node (see line 10 in Algorithm 1), we first construct two sorted (dynamic) arrays [15] containing the neighbors of 1 and 2 , respectively. Assume now without loss of generality that deg( 1 ) ≤ deg( 2 ). We crawl the array of 1 and examine for each neighbor in this array whether it is also connected to 2 (as the adjacency lists of 1 and 2 are sorted, this can be performed for each neighbor of 1 in time O (log deg( 2 )) using binary search). If this is the case, then the corresponding neighbor of 1 and 2 is marked in the two arrays. After all neighbors of 1 have been examined, the marked nodes are removed from the arrays of 1 and 2 . Then, the selection of 10 random pairs of neighbors of 1 and 2 can be performed in constant time (see line 12 of Algorithm 1).
Clearly, each node 1 is selected as a first degree neighbor of some other node ∈ ( 1 ) deg( ) ≤ deg( 1 ) · max(deg( ′ )) times. Removing the common neighbors of two selected first degree neighbors takes time O (deg( 1 ) · log max(deg( ′ ))). Selecting the second degree neighbors for possible rewiring takes constant time. Sorting the adjacency lists, duplicating them, and creating the arrays takes time O (deg( 1 ) · log max(deg( ′ ))) each time a node 1 is selected as first degree neighbor. Thus, the total time is . Assuming that the average degree in the graph is constant (as for the 2 degree distributions we observed in the graphs considered in this paper), we obtain O · max(deg( ′ )) 2 · log max(deg( ′ )) as runtime.

DISCUSSION AND CONCLUSION
In this paper we presented a new method to synthetically create simple directed social network graphs with given rank correlations between the reciprocal, in-and out-degrees that can be used as surrogates in social network analysis. We fit 2 -distributions to the respective degrees of crawled Twitter subgraphs and generate correlated degrees for each node which then connect to other nodes proportional to their degrees. To increase the clustering coefficient of the graphs to a real-world level, we apply an edge rewiring procedure that preserves the node degree sequences.
We compared the created graphs to the crawled ones by analyzing several topological and algorithmic properties. The results show that the graphs are similar regarding the number of edges, the density and the largest connected components. Various topological graph features in the LWCC, e.g., the clustering coefficient, are in the same range. The diameter and the rank correlation between the degrees in the created graphs are slightly lower in all cases. The graphs also show a similar behavior w.r.t. the application of information dissemination and epidemics spreading algorithms.
We saw that after the generation of node degrees and the sampling of edges, some nodes have a degree of zero. When applying spreading algorithms, e.g., push-pull or SIR model, these isolated nodes will not be affected if information is only disseminated between neighbors. Since spreading algorithms are usually applied on the largest connected component and not every node is part of it, this circumstance does not seem to be a major concern. Even in the crawled graphs not all nodes are part of the largest connected component, implying that these nodes are not affected by spreading algorithms. Applying a restricted sampling method, where each node ends up with a node degree of at least one, would result in less nodes having a degree of zero, but due to the probabilistic edge sampling, there will still be isolated nodes.
From a theoretical perspective, a limitation of our algorithm is that it does not guarantee unbiased graph generation. That is, there is no guarantee that all random graphs satisfying the considered constraints (degree sequences and their correlation, target range for average CC, etc.) are sampled with the same probability. Such a guarantee usually relies on a Markov chain with a high guaranteed mixing time, cf. [22,26], and is therefore not feasible when generating graphs with more than 2 · 10 4 nodes. Note that several other well-known graph models for real-world networks (e.g., PA or the directed model by [7]) also induce a certain bias.
Regarding the efficiency of our graph generation algorithm, the rewiring procedure is the main bottleneck since it takes up most of the runtime, especially for large graphs. We therefore implemented several modifications of the method of [3]. The hyperparameters (95percentile node degree and 60% of first degree neighbor pairs) were determined based on experiments, trading between runtime and outcome. Instead of limiting the rewiring procedure to the nodes that have a degree in the lower 95-percentile of neighbors, it could be applied to all nodes (runtime would increase), or fewer nodes, e.g., 90-percentile (runtime would decrease, but the CC would likely be smaller). We also only looked at 60% of first degree neighbor pairs for each node that has a degree above the median degree. Considering more first degree neighbor pairs would lead to a higher CC for these nodes, but increase the runtime. Parallelizing the rewiring procedure to decrease the runtime does not seem feasible. Each iteration builds on the previous one and the graph constantly evolves with edges being deleted and new edges being created. By looking at multiple nodes at the same time, situations might occur where the same edge is used twice for the rewiring step, leading to errors and altered node degrees.
The results show that the presented approach can be used to create realistic social network graphs that have the same number of nodes and a similar density as crawled subgraphs from the Twitter graph. Our method is highly scalable, i.e., it can generate graphs of arbitrary size with similar properties as real-world networks. We can choose arbitrary rank correlations for the node degrees or select different parameters for the 2 -distributions. We can also sample the node degrees from other distributions, e.g., a power-law distribution, which has been used to describe the degree distributions in other social network graphs. We are therefore convinced that the proposed approach to create directed social network graphs is a useful alternative to existing network generation methods.

ACKNOWLEDGMENTS
This publication is part of the project "HPC and Big Data Technologies for Global Systems" (HiDALGO), which has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No. 824115

Algorithm 2 Rewiring
Step Table 4 contains the topological features of the 9 additional graphs we consider, and Table 5 contains the average CC before (*) and after (**) applying of the rewiring procedure. Table 6 contains the averages of the topological features for 4 created graphs over 5 runs, which serves as an indicator that our method consistently creates graphs of desired size and properties. The number of edges in the created graphs naturally diverges as we are sampling the reciprocal, the in-and the out-degree from distributions which in turn influences most of the other topological features, but the differences are negligible. Figure 3 gives the spectrum of eigenvalues on the LWCC for 1 . Similarly to Figure 2, Figures 4 through 7 reproduce the community size distribution of 2 through 5 .

B REWIRING STEP
Algorithm 2 depicts the extension of the actual rewiring step from undirected graphs as presented in [3] to directed graphs and applied in the rewiring procedure in Algorithm 1.   Table 5: Average CC of the additional created graphs before (*) and after (**) applying the rewiring procedure