 Software
 Open Access
Exploring biological network structure with clustered random networks
 Shweta Bansal^{1, 2}Email author,
 Shashank Khandelwal^{} and
 Lauren Ancel Meyers^{3, 4}
https://doi.org/10.1186/1471210510405
© Bansal et al; licensee BioMed Central Ltd. 2009
Received: 13 May 2009
Accepted: 9 December 2009
Published: 9 December 2009
Abstract
Background
Complex biological systems are often modeled as networks of interacting units. Networks of biochemical interactions among proteins, epidemiological contacts among hosts, and trophic interactions in ecosystems, to name a few, have provided useful insights into the dynamical processes that shape and traverse these systems. The degrees of nodes (numbers of interactions) and the extent of clustering (the tendency for a set of three nodes to be interconnected) are two of many wellstudied network properties that can fundamentally shape a system. Disentangling the interdependent effects of the various network properties, however, can be difficult. Simple network models can help us quantify the structure of empirical networked systems and understand the impact of various topological properties on dynamics.
Results
Here we develop and implement a new Markov chain simulation algorithm to generate simple, connected random graphs that have a specified degree sequence and level of clustering, but are random in all other respects. The implementation of the algorithm (ClustRNet: Clustered Random Networks) provides the generation of random graphs optimized according to a local or global, and relative or absolute measure of clustering. We compare our algorithm to other similar methods and show that ours more successfully produces desired network characteristics.
Finding appropriate null models is crucial in bioinformatics research, and is often difficult, particularly for biological networks. As we demonstrate, the networks generated by ClustRNet can serve as random controls when investigating the impacts of complex network features beyond the byproduct of degree and clustering in empirical networks.
Conclusion
ClustRNet generates ensembles of graphs of specified edge structure and clustering. These graphs allow for systematic study of the impacts of connectivity and redundancies on network function and dynamics. This process is a key step in unraveling the functional consequences of the structural properties of empirical biological systems and uncovering the mechanisms that drive these systems.
Keywords
 Random Graph
 Degree Distribution
 Cluster Coefficient
 Random Network
 Biological Network
Background
Over the last decade, network models have advanced our understanding of biology at all scales, from gene regulatory networks to metabolic cycles to global food webs [1–4]. They are also driving the forefront of sociology, information technology and many other disciplines [5–7]. Researchers often build network models from empirical data and then seek to characterize and explain nontrivial structural properties such as heavytail degree distributions, clustering, short average path lengths, degree correlations and community structure [1, 6–12]. Many of these properties appear in diverse natural and manmade systems, and can fundamentally influence dynamical processes of and on these networks [13–19].
Clustering in biological and other empirical networks can stem from two sources: (a) it can arise as a byproduct of other, more fundamental, topological properties such as the degree sequence (distribution) or degree correlations (the dependence of a node's degree on its neighbors' degrees); or (b) it can be generated directly by some inherent property or mechanism within the system, for example, "the friends of my friends tend to become my friends" in social networks.
Topological properties of some empirical networks
Empirical Network  N  <d>  <d^{2} >  C  T  

Little Rock Foodweb Interactions  183  27.3  1215  0.37  0.37  0.44  0.58 
Yeast Protein Interactions  4713  6.3  152  0.13  0.06  0.14  0.18 
C. elegans Metabolic Interactions  453  8.9  358  0.66  0.12  0.74  0.60 
Vancouver Epidemiological Contacts  2627  13.9  265  0.07  0.09  0.09  0.14 
US Air Traffic Links  165  38.0  2765  0.86  0.58  0.97  0.96 
Related Work
Random graphs are graphs that are generated by some random process [26]. They are widely used as models of complex networks [5] and can assume various levels of complexity. The simplest model for generating random graphs, with only a single parameter, is the Bernoulli or ErdösRenyi random graph model, which produces graphs that are completely defined by their average degree and are random in all other respects. A slightly more complex and general model is one that generates graphs with a specified degree distribution (or degree sequence) and ones which are random in all other respects [27]. These models can be extended to include additional structural constraints, such as degree correlations or the density of triangles or longer cycles, as we will demonstrate below.
Existing methods for generating clustered graphs, however, do not take this approach. One of the first examples is the seminal work of Watts and Strogatz [1]. They introduced a model that produces networks with high clustering and low average path length (typical distances between pairs of nodes in the network are small), now known as the small world property. Although not intended as a generative algorithm for clustered graphs, the model produces graphs with clustering spanning the range from 0 to 1. The graphs generated under this model, however, have rigid spatial structure and cannot accommodate varying degree distributions.
The first algorithms that were designed to generate graphs with a specified level of clustering for arbitrary degree distributions belonged to the class of projected bipartite graphs. Newman [20] introduced a threestep method that first builds a bipartite graph of individuals and affiliations, then projects the bipartite graph to a unipartite graph of individuals only, and finally runs a percolation process over the unipartite graph. This results in a clustered graph with a degree distribution that depends on the original distributions of numbers of individuals per group and groups per individual. The level of clustering in the final graph varies smoothly from 0 to 1 as a function of the percolation probability. In [28], Guillaume suggested a similar bipartite graph approach. Although these approaches can generate clustered graphs with diverse degree distributions, they lack straightforward methods for choosing parameters that yield graphs with not only a prespecified clustering coefficient but also a prespecified degree distribution. These algorithms also tends to produce graphs that leave a significant proportion of the graph vertices isolated.
A second class of clustered graph models use "growing network" algorithms [29–31]. The inputs to these models are a degree distribution and level of clustering. The method begins with a set of vertices with no edges; the graph is then "grown" by adding edges based on the degree and clustering constraints. Although the algorithms of this class allow for arbitrary degree distributions and levels of clustering, they either require a complex implementation [29], produce graphs of a highly specific structure [31] or introduce large amounts of degree correlations [31, 30].
Finally, the family of statistical models known as exponential random graph (ERG) models [32, 33] also provide tools to fit the structure of observed networks, for statistics such as degree distribution and number of triangles. These ERG modelbased methods, although they have advanced significantly in recent years (e.g. [34]), still suffer from problems of degeneracy and computational intractability for large networks.
Our Approach
Here, we present a model that generates undirected, simple and connected graphs with prescribed degree sequences and a specified frequency of triangles, while maintaining a graph structure that is as random (uncorrelated) as possible. (A simple graph is one which contains no selfloops (edges from a node to itself) or multiedges (multiple edges between the same pair of nodes); and a connected graph is one where every node in the graph is reachable by a path of edges from every other graph node.) Prior models in this area were intended to generate clustered graphs that replicate the properties of realworld networks; our goal, on the other hand, is to generate a class of null networks with arbitrary degree distributions that are simple and connected and have a high density of triangles, but are random in all other respects.
This method thus leads to two valuable applications. First, network structure fundamentally influences the functions of and dynamical processes on networks. We can use clustered random graphs to systematically study the consequences of clustering, both independently and in combination with various degree patterns. Second, these networks can serve as null models for detecting whether an empirical network can be boiled down to its degree distribution and clustering values or, instead, contains substantial degree correlations or other important structures (beyond the byproducts of the degree distribution and clustering). One would first use the algorithm to generate an ensemble of networks that match the empirical degree sequences and clustering values, and then compare the structural, functional, or dynamical properties of the empirical network to those of the clustered random networks. We focus here on the role of these networks as null models as it is crucial to have appropriate random controls in the study of biological systems, as has been demonstrated in [24, 35, 36].
The rest of this article is organized as follows. In the Implementation section, we review common measures of clustering and introduce our Markov chain model and algorithm for generating clustered graphs with a specified degree sequence. In the Results section, we test our algorithm with numerical simulations and explore the structural properties of the generated graphs. The Discussion section is devoted to a demonstration of the randomly generated clustered networks as null networks for the analysis of empirical networks. We finish off with our conclusions, presenting the benefits of our Markov Chain simulation method for biological networks.
Implementation
Our clustered random graph generation method begins with a random graph and iteratively rewires edges to introduce triangles. Network rewiring, also known as edge swapping, is a wellknown method for generating networks with desired properties [37, 36, 38]. Two edges are called adjacent if they connect to a common node. Each rewiring is performed on two nonadjacent edges of the graph and consists of removing these two edges and replacing them with another pair of edges. Specifically, a pair of edges (i, j) and (k, l) is replaced with either (i, k) and (j, l), or (i, l) and (j, k) (as illustrated in Figure 1c). This change in the graph leaves the degrees of the participating nodes unchanged, thus maintaining the specified degree sequence. Below we describe a rewiring algorithm that increases the level of clustering in a random graph, while preserving the degree sequence.
The algorithm we develop below is implemented in Python as ClustRNet. It is based on Networkx, an opensource Python library available for download at [39], which provides standard graph library functionality (e.g. data structure, input/output, and layouts). The source code for ClustRNet, along with documentation and test network datasets, is available on the web [40]. Our algorithm joins a existing suite of random graph modelbased software tools for the analysis of biological networks and the dynamics on them [41, 42].
Measures of Clustering
We begin with a graph G = (V, E) which is undirected and simple. V is the set of vertices of G and E is the set of the edges. We let N = V and M = E denote the number of nodes and edges in G, respectively. The degree of a node i will be denoted d_{ i }. The set of degrees for all nodes in the graph makes up the degree sequence, which follows a probability distribution called the degree distribution.
Clustering is the likelihood that two neighbors of a given node are themselves connected. In topological terms, clustering measures the density of triangles in the graph, where a triangle is the existence of the set of edges (i, j), (i, k), (j, k) between any triplet of nodes i, j, k (Figure 1b).
assuming d_{ i }≥ 2. To compute the total number of triples in the graph, τ(G), we sum τ(i) for all i ∈ V.
where N_{2} is the number of nodes with c(i) ≥ 0. Some authors do define the clustering coefficient for all nodes of G [43].
Although they are often similar, T(G) and C(G) can vary by orders of magnitude [22]. They differ most when the triangles are heterogeneously distributed in the graph.
where ω(i) measures the number of possible triangles for node i, and N_{ ω }is the number of nodes in G for which ω(i) > 0. We note that and are undefined if ω(G) = Σ_{ i }ω(i) = 0. ω(i) is computed by counting the maximum number of edges that can be drawn among the d_{ i }neighbors of a node i, given the degree sequence of i's neighbors; this value is often smaller than [22]. For example, consider a star network of five nodes, where four nodes have degree 1 and one node has degree 4. Although the total number of triples is τ(G) = 6, the number of possible triangles is ω(G) = 0 because the degree one nodes preclude their formation. The computation of ω(i) must be done algorithmically and is not possible in closed form. (From here on, we refer to as the SVclustering coefficient and to as the SVtransitivity.)
Generative Model
Here we develop a model to generate a simply connected random graph with a specified degree sequence and a desired level of clustering. Generating random graphs uniformly from the set of simply connected graphs with a prescribed degree sequence is a wellstudied problem with algorithmic solutions [37]. One of the simplest and most popular of these generative algorithms was suggested by Molloy and Reed and is known as the configuration model [27]. Given a specific realizable degree sequence [44], {d_{ i }}, this method assigns d_{ j }halfedges to each node j, and then randomly connects pairs halfedges to create edges until there are no halfedges left. (A realizable degree sequence is one which satisfies the Handshake Theorem (the requirement that the sum of the degrees be even) and the ErdosGallai criterion (which requires that for each subset of the k highest degree nodes, the degrees of these nodes can be "absorbed" within the subset and the remaining degrees.) Although the model sometimes produces graphs that are not simple or connected, this can be remedied by subsequently removing multiple edges and self loops from the constructed graph and keeping only the largest connected component [37]. Our method begins by using this approach to generate a simple, connected random graph G, with a specific realizable degree sequence D. We then introduce triangles into G using a Markov Chain process without disturbing the degree sequence until we achieve the desired level of clustering, as follows.
Let G_{ D }be the set of all simple, connected graphs with degree sequence D. If are the graphs of G_{ D }, then we let be the states of the Markov chain, P, where X_{ i }represents the state in which our graph G = G_{ i }. The states X_{ i }and X_{i+1}are connected in the Markov Chain if G_{ i }can be changed to G_{i+1}with the rewiring of one pair of edges. The state space of the Markov chain P is connected because there exists a path from X_{ i }to X_{ j }(for any pair i, j) by one or more rewiring moves that leave the degree sequence unchanged [45].
where clust(G_{ x }) is a clustering measure for graph G_{ x }, which can be replaced by any of the measures introduced in Section. The algorithm continues searching for a feasible rewiring (one that increases the clustering and does not disconnect the graph) until one is found. If a feasible move is not found, a transition is not made and the process remains in the current state.
The Markov chain above is finite and aperiodic, but not irreducible as the process can never transition to a state in which the graph has lower clustering. It does, however, have an absorbing state, X_{*}, in which the transitivity of G_{*} is greater than or equal to the desired transitivity or is the maximum possible transitivity given the particular degree sequence and connectivity constraints.
Algorithm
To generate clustered graphs, we apply the above Markov Chain simulation model by iteratively applying rewirings that increase graph clustering. Each rewiring takes a set of five nodes {x, y_{1}, y_{2}, z_{1}, z_{2}}, connected by four edges {(x, y_{1}), (x, y_{2}), (y_{1}, z_{1}), (y_{2}, z_{2})}, and swaps the outer edges: {(x, y_{1}), (x, y_{2}), (y_{1}, y_{2}), (z_{1}, z_{2})}(illustrated in Figure 1d). This introduces a triangle among nodes {x, y_{1}, and y_{2}}, without perturbing the degree sequence. The algorithm proceeds as follows:
Input: A realizable degree sequence {d_{ i }} a desired clustering value, target
Initialization: Generate a random graph G with degree sequence {d_{ i }} (using the configuration model), and measure the clustering of G, clust(G).
while clust(G) <target do
1. uniformly select a random node, x, from the
set of all nodes of G such that d_{ x }> 1.
2. uniformly select two random neighbors, y_{1}
and y_{2}, of x such that d_{y 1}> 1 and
d_{y 2}> 1 and y_{1}≠y_{2}.
3. uniformly select a random neighbor, z_{1}
of y_{1} and a random neighbor, z_{2} of
y_{2} such that z_{1} ≠ x, z_{2} ≠ x,
z_{1} ≠ z_{2}.
4. G_{ cand }: = G where G_{ cand }is the candidate
graph to which the transition may be made.
5. if (y_{1}, y_{2}) and (z_{1}, z_{2}) do not exist then
Rewire two edges of G_{ cand }: delete (y_{1}, z_{1}) and (y_{2}, z_{2}), add (y_{1}, y_{2}) and (z_{1}, z_{2}).
end
6. Update the value of clust(G_{ cand }) by measuring
δ (i) (and ω (i) if relevant) for the nodes involved
in the rewiring and their neighbors.
7. if clust(G_{ cand }) > clust(G) and G_{ cand }
is connected then
G: = G_{ cand }
end
end
Output: A random graph, G with degree sequence {d_{ i }} and clust(G) ≥ target.
The algorithm terminates when the graph attains at least the desired level of clustering or reaches a threshold number of unsuccessful rewiring attempts. In the latter case, the algorithm returns the graph with the maximum clustering achieved. For practical purposes, a threshold is placed on the number of unsuccessful attempts made by the algorithm in ClustRNet for the case that the desired clustering cannot be reached. Due to the random restarts made at every step, the algorithm is prevented from getting trapped in local minima.
The algorithm is designed to increase clustering while preserving both the degree sequence and connectedness of the graph. However, there are some cases where the desired clustering can only be reached by disconnecting the graph; and thus ClustRNet provides the option of removing the connectivity constraint (see Additional file 1, Figure S2).
Choice of Clustering Measure
The algorithm is defined independent of the choice of clustering measure. The term clust(G) in the algorithm above can be replaced by any clustering measure described in Section. ClustRNet includes all four of these clustering measures (C, , T; ).
The algorithm output varies with the choice of clustering measure. The clustering coefficient is a local measure; and thus C and yield networks that are only locally optimized for the desired level of clustering. The algorithm may have difficulty attaining target clustering values when using the absolute clustering measures (C or T) because of joint degree constraints (the degrees of adjacent nodes) on the possible numbers of triangles, as with the example presented in Section. The SofferVasquez clustering measures, which explicitly consider joint degree constraints, provide a way around this difficulty [22]. Although the rewiring in our algorithm changes the joint degree distribution (and thus the degree correlations) of the graph, ω(G) is not altered significantly during network generation (as shown in Additional file 1, Figure S3). Thus, when using or , clustering is increased primarily by the addition of triangles (that is, increasing δ (G)) rather than decreasing ω(G)).
Types of Graph Changes
As shown in Figure 2, there are six types of triangles that can be added or removed for every pair of edges that are rewired. As illustrated in Figure 1d, these additions and removals can occur in combination.

Type A: The addition of the edge between vertices y_{1} and y_{2} guarantees the addition of one triangle in every rewiring event.

Type B: The addition of the edge (y_{1}, y_{2}) could create new triangles with shared neighbors of y_{1} and y_{2}.

Type C: The addition of the edge (z_{1}, z_{2}) could add a triangle if there existed edges between x and z_{1} and x and z_{2}.

Type D: The addition of the edge between vertices z_{1} and z_{2} could create new triangles with shared neighbors of z_{1} and z_{2}.

Type E: The removal of edges (y_{1}, z_{1}) and (y_{2}, z_{2}) removes one triangle each if the edges (x, z_{1}) or (x, z_{2}) exist.

Type F: The removal of the edges between vertices y_{1} and z_{1}, and y_{2} and z_{2} could lead to the removal of existing triangles with shared neighbors of y_{1} and z_{1} or y_{2} and z_{2}.
Computational Complexity
Like many heuristic search methods, the algorithm we propose can be computationally expensive. The method outlined in Section 2.2 requires O(M) steps to generate a connected graph, and up to O(M) steps to randomize the graph, where M is the number of edges in the graph. At each step of randomization, we test that the graph remains connected (an O(M) operation), resulting in an overall O(M^{2}) random network generation process. A naive computation of the transitivity/clustering coefficient requires checking every node for the existence of edges between every pair of neighbors of the node. This step requires O( ) operations, where N is the number of nodes and d_{ max }is the maximum degree of any node in the graph. The most expensive step of our algorithm is the introduction of triangles via rewiring. A single rewiring step requires O(M) operations for switching edges, checking for connectivity and updating the clustering measure. Although we cannot analytically calculate the number of attempted rewiring steps required to reach the desired transitivity, we have found it empirically to be O(M). Thus, the average complexity of the clustered network algorithm presented here is O(M^{2}). This complexity has been computed for the most naive versions of our algorithms; and more efficient implementations may improve the complexity greatly. For example, we might improve efficiency by performing connectivity tests once every x rewirings (for some number x) rather than during every rewiring, as proposed in [46].
Results
Performance
Structural Properties of Generated Networks
There are several other topological properties (besides degree sequence and clustering) that can strongly influence network function and dynamics. Among these are degree correlations (the dependence of a node's degree on its neighbors' degrees), community structure (groups of nodes that are highly intraconnected and only loosely interconnected), and average path length (typical distances between pairs of nodes in the network). We have specifically developed this model to increase clustering with minimal structural byproducts. Thus, we confirm that we have reached this goal by measuring the above properties in the networks generated by our algorithm.
Several authors have discussed the relationship between clustering and community structure [8, 25, 47, 21]. As Figure 3 shows, the addition of triangles leads to modular structure. This behavior is not surprising: as the number of edges in the graph is constrained, sets of connected nodes with high ω(i) values (often highdegree nodes) must be brought together to create additional clustering. Although the presence of a significant proportion of triangles tends to separate the network into modules, it is not clear that clustering is always sufficient to explain the modular structure of a graph. We explore this further below.
Short average path lengths are a characteristic feature of random graphs [26]. To quantify the impact of our algorithm on path lengths, we calculated the average path length for each node to all other (N  1) nodes, and then compared the distributions of these values for several random and random clustered graphs (Figure 5). While our algorithm mostly maintains short average path lengths, the mean of the path length distribution does tend to be slightly larger for the clustered graphs than for the corresponding random graphs. The intuition behind this increase in average path length may lie in the increased community structure: as graphs become more clustered and separate into subgroups, nodes in different groups require more links to reach each other (Figure 3). Given that our algorithm can generate graphs of high clustering while preserving short path lengths, this introduces a novel method of generating graphs with the small world property without the correlations of WattsStrogatz graphs [1].
Discussion
Application: Analysis of Empirical Networks
It is crucial to have random controls in the study of biological systems. Our algorithm can be used to generate null models and applied to the detection of structure in empirical biological networks. We can generate ensembles of clustered random networks with empirically estimated degree sequences and clustering values to ascertain whether empirical networks have significant nonrandom structure in other respects. We demonstrate this application using representatives from four classes of biological networks. We also analyze one nonbiological network that is made of human transportation links as it provides contrast to the range of topological properties and design principles found in the biologicallymotivated networks. The five real networks are as follows: a) a trophic exchange network for the Little Rock Lake in Wisconsin [48]; b) a protein interaction network for yeast [3]; c) a metabolic network for the eukaryote Caenorhabditis elegans [49]; d) a network made up of epidemiologicallyrelevant contacts for individuals in the city of Vancouver [13]; and e) a transportation network, made up of US metropolitan areas connected by air travel [50]. These networks represent a diverse set of applications and are systems that are wellstudied in their respective literatures. The basic statistics of these networks, including clustering values, are listed in Table 1.
We use the following method to quantify deviations from randomness in these networks. First, we use our algorithm to generate 25 clustered random networks constrained to match the empirical degree sequence and clustering values. Second, we select a set of network topological measures (other than degree distribution and clustering), and compare these quantities for the empirical graph to the corresponding average quantities across the ensemble of generated graphs.
Comparisons between empirical networks and clustered random networks
Generated Network Type  N  <d>  <d^{2} >  T  Diam  r  Q  

Little Rock Foodweb Interactions  183  27.3  1215  0.38 [0.009]  0.58 [0.0]  4 [0.0]  0.09 [0.15]  0.11 [0.21] 
Yeast Protein Interactions  4713  6.3  152  0.07 [0.01]  0.18 [0]  12.5 [0.5]  0.11 [0.38]  0.39 [0.10] 
C. elegans Metabolic Interactions  453  8.9  358  0.14 [0.02]  0.60 [0]  6 [1]  0.19 [0.04]  0.29 [0.09] 
Vancouver Epidemiological Contacts  2627  13.9  265  0.09 [0]  0.14 [0]  6 [0]  0.15 [0.4]  0.28 [0.15] 
US Air Traffic Links  165  38.0  2765  0.58 [0]  0.97 [0]  3 [0]  0.55 [0]  0.11 [0.01] 
Of all the empirical networks analyzed, the random counterparts of the the US air traffic network are the only ones that have structural properties almost identical to the real network (with the network of Vancouver epidemiological contacts being the next closest). This suggests that the structure of the US air traffic network comes almost exclusively from its degree patterns. (In fact, even the high clustering is explained exclusively by the degree patterns.) We note that the US air traffic network is the only nonbiological one and the most engineered of the networks we consider, and thus may have fewer emergent properties. The remaining empirical networks (all biological) differ considerably from their random counterparts, suggesting that there are important mechanistic features not captured in the random model.
Degree correlations vary somewhat systematically among the four biological networks (Table 2). The Vancouver human epidemiological contact network has significantly higher degree assortativity than our random networks, thus showing that the positive degree correlations are not just the result of degree distribution or clustering, both of which have been found to be positively correlated with assortativity [53]. This suggests the existence of social rules among humans that go beyond (a) variation in numbers of "friends" and (b) the tendency for "my friend's friend also to be my friend" [11]. The remaining biological networks (the yeast protein interactions, the Little Rock Lake foodweb, and the C. elegans metabolic networks), on the other hand, all have negative degree correlations. Our results show that the C. elegans metabolic network, in particular, has degree correlations approximately equal to the amount expected to arise as a random byproduct of degree distribution and clustering. One reason that a biological network only show random degree correlations might be due to the lack of a clear functional or structural advantage for strong correlations: negatively correlated networks are vulnerable to failures because functionality often depends on a few high degree nodes that provide essential connectivity. If any of these fail (e.g., because of a gene deletion in a metabolic network) the whole system fails [11, 12]. On the other hand, positively correlated networks, which have short distances between hub (highdegree) nodes, may be less favorable because they allow for the propagation of random perturbations (e.g., changes in the concentration of a protein in a proteininteraction network) [36].
All of the natural networks we study have significantly higher modularity than the corresponding clustered random networks, despite having a wide range of transitivity values. This suggests that clustering and community structure are not necessarily positively correlated, as has been previously suggested [52, 8]. The high modularity of the Little Rock foodweb, in particular, has been attributed to its high clustering [54]. Our generated clustered random graphs, however, indicate that the degree distribution and high transitivity only account for about half the modularity of the foodweb graph (Table 2). There is an extensive literature on the presence and evolution of modularity in protein, metabolic, and ecological networks highlighting its possible roles in functional specialization, innovation and robustness [55–60]. Since clustering and the mechanisms that give rise to it cannot fully account for the modularity of these empirical networks, such mechanistic explanations for the structure are warranted.
Conclusions
In this work, we have introduced a Markov chain simulation algorithm to generate clustered random graphs with a specified degree sequence and level of clustering. Our algorithm perfectly preserves the degree sequence of a random graph and generally maintains other fundamental properties of random graphs like short path length and low degree correlations. The use of random graphs as controls is a common and effective method for identifying important structural characteristics of biological networks (as, for example, has been seen in [61, 54, 62, 49, 13]). Our method provides a new null model for use with this technique. Since this method is based on a dynamic process, it can be used to generate both static networks with a specified amount of clustering and dynamic networks with evolving levels of clustering. Furthermore, since the process is a "memoryless" one, additional clustering can be added to any network without having to grow a new one from scratch. These clustered networks can provide valuable insights into the interdependent impacts of connectedness and redundancy on biological processes, and serve as appropriate null models for investigating the biological significance of other structural attributes.
Availability and Requirements

Project name: ClustRNet

Project home page: http://sbansal.com/ClustRNet/

Operating system(s): Platform independent

Programming language: Python 2.5

Other requirements: Networkx Python package 2.5

License: BSDstyle

Any restrictions to use by nonacademics: None
Declarations
Acknowledgements
The authors acknowledge valuable feedback from Joel Miller, Mark Newman, Erik Volz, Alberto Segre Ted Herman, and two anonymous reviewers. SB acknowledges financial support from the University of Texas at Austin. LAM acknowledges support from the McDonnell Foundation and NSF grant DEB0749097.
Authors’ Affiliations
References
 Watts D, Strogatz SH: Collective dynamics of small world networks. Nature 1998., 393(441):Google Scholar
 Ulanowicz RE, Bondavalli C, Egnotovich MS: Network analysis of trophic dynamics in south florida ecosystem, FY 97: The florida bay ecosystem. Technical Report Ref. No. [UMCES] CBL 1998, 98–123.Google Scholar
 Colizza V, Flammini A, Maritan A, Vespignani A: Characterization and modeling of proteinprotein interaction networks. Physica A 2005, 352: 1–27. 10.1016/j.physa.2004.12.030View ArticleGoogle Scholar
 Vazquez A, Dobrin R, Sergi D, Eckmann JP, Oltvai ZN, Barabási AL: The topological relationship between the largescale attributes and local interaction patterns of complex networks. Proc Natl Acad Sci USA 2004, 101(52):17940–17945. 10.1073/pnas.0406024101PubMed CentralView ArticlePubMedGoogle Scholar
 Newman MEJ, Watts DJ, Strogatz SH: Random graph models of social networks. Proc Natl Acad Sci 2002., 99(2566):Google Scholar
 Albert R, Jeong H, Barabasi AL: Diameter of the worldwide web. Nature 1999, 401: 130–131. 10.1038/43601View ArticleGoogle Scholar
 Faloutsos M, Faloutsos P, Faloutsos C: On powerlaw relationships of the internet topology. Proceedings of the Conference on applications, technologies, architectures, and protocols for computer communications 1999, 251–262. full_textGoogle Scholar
 Newman MEJ, Park J: Why social networks are different from other types of networks. Phys Rev E 2003., 68(036122):Google Scholar
 Newman MEJ: Scientific collaboration networks: II. Shortest paths, weighted networks, and centrality. Phys Rev E 2001, 64(1):016132. 10.1103/PhysRevE.64.016132View ArticleGoogle Scholar
 Girvan M, Newman MEJ: Community structure in social and biological networks. Proc Natl Acad Sci USA 2002, 99(12):7821–7826. 10.1073/pnas.122653799PubMed CentralView ArticlePubMedGoogle Scholar
 Newman MEJ: Assortative mixing in networks. Phys Rev Lett 2002, 89.Google Scholar
 Friedel CC, Zimmer R: Influence of degree correlations on network structure and stability in proteinprotein interaction networks. BMC Bioinformatics 2007, 8: 297. 10.1186/147121058297PubMed CentralView ArticlePubMedGoogle Scholar
 Meyers LA, Pourbohloul B, Newman MEJ, Skowronski DM, Brunham RC: Network theory and sars: predicting outbreak diversity. J Theo Biol 2005, 232: 71–81. 10.1016/j.jtbi.2004.07.026View ArticleGoogle Scholar
 Keeling MJ, Eames KTD: Networks and epidemic models. J R Soc Interface 2005, 2: 295–307. 10.1098/rsif.2005.0051PubMed CentralView ArticlePubMedGoogle Scholar
 Albert R, Barabasi AL: Statistical mechanics of complex networks. Reviews of Modern Physics 2002, 74: 47–97. 10.1103/RevModPhys.74.47View ArticleGoogle Scholar
 Albert R, Jeong H, Barabasi AL: Error and attack tolerance of complex networks. Nature 2000, 406: 378–382. 10.1038/35019019View ArticlePubMedGoogle Scholar
 Bansal S, Grenfell B, Meyers LA: When individual behavior matters. J R Soc Interface 2007., 4(16): 10.1098/rsif.2007.1100Google Scholar
 Keeling MJ: The implications of network structure for epidemic dynamics. Theo Pop Biol 2005, 67: 1–8. 10.1016/j.tpb.2004.08.002View ArticleGoogle Scholar
 Keeling MJ: The effects of local spatial structure on epidemiological invasions. Proc R Soc B 1999, 266: 859–867. 10.1098/rspb.1999.0716PubMed CentralView ArticlePubMedGoogle Scholar
 Newman MEJ: Properties of highly clustered networks. Phys Rev E 2003., 68(026121):Google Scholar
 Serrano M, Boguna M: Clustering in complex networks i. Phys Rev E 2006., 74(056114):Google Scholar
 Soffer S, Vazquez A: Network clustering coefficient without degreecorrelation biases. Phys Rev E 2005., 71(057101):Google Scholar
 Petermann T, Rios PDL: The role of clustering and gridlike odering in epidemic spreading. Phys Rev E 2004., 69(066116):Google Scholar
 Milo R, ShenOrr S, Itzkovitz S, Kashtan N, Chklovskii D, Alon U: Network motifs: Simple building blocks of complex networks. Science 2002, 298: 824–827. 10.1126/science.298.5594.824View ArticlePubMedGoogle Scholar
 Radicchi F, Castellano C, Cecconi F, Loreto V, Parisi D: Defining and identifying communities in networks. PNAS 2004, 101(9):2658–2663. 10.1073/pnas.0400054101PubMed CentralView ArticlePubMedGoogle Scholar
 Newman MEJ, Strogatz SH, Watts DJ: Random graphs with arbitrary degree distributions and their applications. Phys Rev E 2001, 64: 026118. 10.1103/PhysRevE.64.026118View ArticleGoogle Scholar
 Molloy M, Reed B: A critical point for random graphs with a given degree sequence. Random Struct Algo 1995., 6(161):Google Scholar
 Guillaume J, Latapy M: Bipartite graphs as models of complex networks. Lecture Notes in Computer Science 2005, 3405: 127–139.View ArticleGoogle Scholar
 Boguna M, PastorSatorras R, Vespignani A: Statistical Mechanics of Complex Networks, of Lecture Notes in Physics, chapter Epidemic spreading in complex networks with degree correlations. Volume 625. Springer Berlin; 2003:127–47.Google Scholar
 Volz E: Random networks with tunable degree distribution and clustering. Phys Rev E 2004., 70(056115):Google Scholar
 Trapman P: On stochastic models for the spread of infections. PhD thesis, Vrije Universiteit Amsterdam; 2007.Google Scholar
 Robins G, Pattison P, Kalish Y, Lusher D: An introduction to exponential random graph (p*) models for social networks. Social Networks 2007, 29(2):173–91. 10.1016/j.socnet.2006.08.002View ArticleGoogle Scholar
 Snijders T, Pattison PE, Robins GL, Handcock MS: New specifications for exponential random graph models. Sociol Methodol 2006, 36(1):99–133. 10.1111/j.14679531.2006.00176.xView ArticleGoogle Scholar
 Goodreau S: Advances in exponential random graph (p*) models applied to a large social network. Social Networks 2007, 29: 231–48. 10.1016/j.socnet.2006.08.001PubMed CentralView ArticlePubMedGoogle Scholar
 ArtzyRandrup Y, Fleishman SJ, BenTal N, Stone L: Comment on "Network Motifs: Simple Building Blocks of Complex Networks" and "Superfamilies of Evolved and Designed Networks". Science 2004, 205: 1107. 10.1126/science.1099334View ArticleGoogle Scholar
 Maslov S, Sneppen K: Specificity and stability in topology of protein networks. Science 2002, 296: 910. 10.1126/science.1065103View ArticlePubMedGoogle Scholar
 Milo R, Kashtan N, Itzkovitz S, Newman MEJ, Alon U: Subgraphs in networks. Phys Rev E 2004., 70(058102):Google Scholar
 Gale D: A theorem on flows in networks. Pac J Math 1957, 7: 1073.View ArticleGoogle Scholar
 Networks[http://networkx.lanl.gov/]
 Clustrnet[http://sbansal.com/clustrnet]
 Graphcrunch[http://www.ics.uci.edu/~bionets/graphcrunch/]
 Neat[http://rsat.bigre.ulb.ac.be/neat/]
 Newman MEJ: The structure and function of complex networks. SIAM Review 2003, 45: 167–256. 10.1137/S003614450342480View ArticleGoogle Scholar
 Erdos P, Gallai T: Graphs with prescribed degree of vertices. Mat Lapok 1960, 11: 264–274.Google Scholar
 Taylor R: Constrained switchings in graphs. Comb Mat 1980., 8:Google Scholar
 Gkantsidis C, Mihail M, Zegura E: The markov chain simulation method for generating connected power law random graphs. Proc 5th Workshop on Algorithm Engineering and Experiments (ALENEX.SIAM) 2003.Google Scholar
 Ravasz E, Barabasi AL: Hierarchical organization in complex networks. Phys Rev E 2003., 67(026112):Google Scholar
 Martinez ND: Artifacts or attributes? effects of resolution on the little rock lake food web. Ecol Monogr 1991, 61: 367–392. 10.2307/2937047View ArticleGoogle Scholar
 Albert R, Oltvai ZN, Barabasi AL, Jeong H, Tombor B: The largescale organization of metabolic networks. Nature 2000, 407: 651–654. 10.1038/35036627View ArticlePubMedGoogle Scholar
 US Bureau of Transportation Statistics[http://www.transtats.bts.gov]
 Harary F: Graph Theory. Oxford University Press, London; 1969.Google Scholar
 Newman MEJ: Detecting community structure in networks. Eur Phys J B 2004, 38: 321–330. 10.1140/epjb/e200400124yView ArticleGoogle Scholar
 Holme P, Zhao J: Exploring the assortativityclustering space of a networks degree sequence. Phys Rev E 2007, 75: 046111. 10.1103/PhysRevE.75.046111View ArticleGoogle Scholar
 Montoya J, Sole R: Small world patterns in food webs. J Theo Bio 2002, 214: 405–412. 10.1006/jtbi.2001.2460View ArticleGoogle Scholar
 Pimm SL, Lawton JH: Are food webs divided into compartments? J Anim Ecol 1980, 49: 879898.View ArticleGoogle Scholar
 Yodzis P: The compartmentation of real and assembled foodwebs. American Naturalist 1982, 120: 551570.View ArticleGoogle Scholar
 Gophna U, Kreimer A, Borenstein E, Ruppin E: The evolution of modularity in bacterial metabolic networks. PNAS 2008, 105: 6976–6981. 10.1073/pnas.0712149105PubMed CentralView ArticlePubMedGoogle Scholar
 Kashtan N, Alon U: Spontaneous evolution of modularity and network motifs. PNAS 2005, 102(39):13773–13778. 10.1073/pnas.0503610102PubMed CentralView ArticlePubMedGoogle Scholar
 Ricard V Sol SV, RodriguezCaso C: Modularity in Biological Networks. In Biological Networks. World Scientific; 2008.Google Scholar
 Hartwell LH, Hopfield JJ, Leibler S, Murray AW: From molecular to modular cell biology. Nature 1999., 402(6761 Suppl):Google Scholar
 Dunne J, Williams R, Martinez N: Foodweb structure and network theory: The role of connectance and size. PNAS 2002, 99: 12917–22. 10.1073/pnas.192407699PubMed CentralView ArticlePubMedGoogle Scholar
 Wagner A: Yeast protein interaction network evolves repidly and contains few redundant duplicate genes. Mol Biol Evol 2001, 18: 1283–92.View ArticlePubMedGoogle Scholar
Copyright
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.