A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 ·...

36
A Sequential Algorithm for Generating Random Graphs Mohsen Bayati * Jeong Han Kim Amin Saberi Abstract We present the fastest FPRAS for counting and randomly generating simple graphs with a given de- gree sequence in a certain range. For degree sequence (di ) n i=1 with maximum degree dmax = O(m 1/4-τ ), our algorithm generates almost uniform random graph with that degree sequence in time O(mdmax) where m = 1 2 i di is the number of edges in the graph and τ is any positive constant. The fastest known FPRAS for this problem [26] has running time of O(m 3 n 2 ). Our method also gives an indepen- dent proof of McKay’s estimate [37] for the number of such graphs. Our approach is based on sequential importance sampling (SIS) technique that has been recently successful for counting graphs [18, 13, 12]. Unfortunately validity of the SIS method is only known through simulations and our work together with [12] are the first results that analyze the performance of this method. Moreover, we show that for d = O(n 1/2-τ ), our algorithm can generate an asymptotically uniform d-regular graph. Our results are improving the previous bound of d = O(n 1/3-τ ) due to Kim and Vu [34] for regular graphs. 1 Introduction The focus of this paper is on generating random simple graphs (graphs with no multiple edge or self loop) with a given degree sequence. Random graph generation has been studied extensively as an interesting theoretical problem (see [47, 13] for detailed surveys). It has also become an important tool in a variety of real world applications including detecting motifs in biological networks [41] and simulating networking protocols on the Internet topology [46, 23, 36, 17, 4]. The most general and well studied approach for this problem is the Markov chain Monte Carlo (MCMC) method [26, 27, 28, 19, 21, 30, 10]. However, current MCMC-based algorithms have large running times, which make them unusable for real-world networks that have tens of thousands of nodes (for example, see [24]). This has constrained practitioners to use simple heuristics that are non-rigorous and have often led to wrong conclusions [40, 41]. Our main contribution in this paper is to provide a much faster fully polynomial randomized approximation scheme (FPRAS) for generating random graphs; this we can do in almost linear time. An FPRAS provides an arbitrary close approximaiton in time that depends only polynomially on the input size and the desired error. (For precise definitions of this, see Section 2.) Recently, sequential importance sampling (SIS) has been suggested as a more suitable approach for de- signing fast algorithms for this and other similar problems [18, 13, 35, 6]. Chen et al. [18] used the SIS method to generate bipartite graphs with a given degree sequence. Later Blitzstein and Diaconis [13] used a similar approach to generate general graphs. Almost all existing work on SIS method are justified only through simulations and for some special cases counter examples have been proposed [11]. However the simplicity of these algorithms and their great performance in several instances, suggest further study of the SIS method is necessary. * Department of Electrical Engineering, Stanford University, Stanford, CA 94305-9510; [email protected] Department of Mathematics, Yonsei University, South Korea; [email protected] Departments of Management Science and Engineering, Institute for Computational and Mathematical Engineering, Stan- ford University, Stanford, CA 94305; [email protected]. 1

Transcript of A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 ·...

Page 1: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

A Sequential Algorithm for Generating Random Graphs

Mohsen Bayati∗ Jeong Han Kim† Amin Saberi ‡

Abstract

We present the fastest FPRAS for counting and randomly generating simple graphs with a given de-gree sequence in a certain range. For degree sequence (di)

ni=1 with maximum degree dmax = O(m1/4−τ ),

our algorithm generates almost uniform random graph with that degree sequence in time O(m dmax)where m = 1

2

i di is the number of edges in the graph and τ is any positive constant. The fastestknown FPRAS for this problem [26] has running time of O(m3

n2). Our method also gives an indepen-

dent proof of McKay’s estimate [37] for the number of such graphs.Our approach is based on sequential importance sampling (SIS) technique that has been recently

successful for counting graphs [18, 13, 12]. Unfortunately validity of the SIS method is only knownthrough simulations and our work together with [12] are the first results that analyze the performanceof this method.

Moreover, we show that for d = O(n1/2−τ ), our algorithm can generate an asymptotically uniformd-regular graph. Our results are improving the previous bound of d = O(n1/3−τ ) due to Kim and Vu[34] for regular graphs.

1 Introduction

The focus of this paper is on generating random simple graphs (graphs with no multiple edge or self loop)with a given degree sequence. Random graph generation has been studied extensively as an interestingtheoretical problem (see [47, 13] for detailed surveys). It has also become an important tool in a varietyof real world applications including detecting motifs in biological networks [41] and simulating networkingprotocols on the Internet topology [46, 23, 36, 17, 4]. The most general and well studied approach for thisproblem is the Markov chain Monte Carlo (MCMC) method [26, 27, 28, 19, 21, 30, 10]. However, currentMCMC-based algorithms have large running times, which make them unusable for real-world networks thathave tens of thousands of nodes (for example, see [24]). This has constrained practitioners to use simpleheuristics that are non-rigorous and have often led to wrong conclusions [40, 41]. Our main contributionin this paper is to provide a much faster fully polynomial randomized approximation scheme (FPRAS) forgenerating random graphs; this we can do in almost linear time. An FPRAS provides an arbitrary closeapproximaiton in time that depends only polynomially on the input size and the desired error. (For precisedefinitions of this, see Section 2.)

Recently, sequential importance sampling (SIS) has been suggested as a more suitable approach for de-signing fast algorithms for this and other similar problems [18, 13, 35, 6]. Chen et al. [18] used the SISmethod to generate bipartite graphs with a given degree sequence. Later Blitzstein and Diaconis [13] useda similar approach to generate general graphs. Almost all existing work on SIS method are justified onlythrough simulations and for some special cases counter examples have been proposed [11]. However thesimplicity of these algorithms and their great performance in several instances, suggest further study ofthe SIS method is necessary.

∗Department of Electrical Engineering, Stanford University, Stanford, CA 94305-9510; [email protected]†Department of Mathematics, Yonsei University, South Korea; [email protected]‡Departments of Management Science and Engineering, Institute for Computational and Mathematical Engineering, Stan-

ford University, Stanford, CA 94305; [email protected].

1

Page 2: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

Our Result. Let d1, . . . , dn be non-negative integers given for the degree sequence and let∑n

i=1 di = 2m.Our algorithm is as follows: start with an empty graph and sequentially add edges between pairs of non-adjacent vertices. In every step of the procedure, the probability that an edge is added between twodistinct vertices i and j is proportional to didj(1−didj/4m) where di and dj denote the remaining degreesof vertices i and j. We will show that our algorithm produces an asymptotically uniform sample withrunning time of O(mdmax) when maximum degree is of O(m1/4−τ ) and τ is any positive constant. Thenwe use a simple SIS method to obtain an FPRAS for any ǫ, δ > 0 with running time O(mdmaxǫ

−2 log(1/δ))for generating graphs with dmax = O(m1/4−τ ). Moreover, we show that for d = O(n1/2−τ ), our algorithmcan generate an asymptotically uniform d-regular graph. Our results are improving the bounds of Kimand Vu [34] and Steger and Wormald [45] for regular graphs.

Related Work. McKay and Wormald [37, 39] give asymptotic estimates for number of graphs withinthe range dmax = O(m1/3−τ ). But, the error terms in their estimates are larger than what is needed toapply Jerrum, Valiant and Vazirani’s [25] reduction to achieve asymptotic sampling. Jerrum and Sinclair[26] however, use a random walk on the self-reducibility tree and give an FPRAS for sampling graphs withmaximum degree of o(m1/4). The running time of their algorithm is O(m3n2ǫ−2 log(1/δ)) [44]. A differentrandom walk studied by [27, 28, 10] gives an FPRAS for random generation for all degree sequences forbipartite graphs and almost all degree sequences for general graphs. However the running time of thesealgorithms is at least O(n4m3dmax log5(n2/ǫ)ǫ−2 log(1/δ)).

For the weaker problem of generating asymptotically uniform samples (not an FPRAS) the best algorithmwas given by McKay and Wormald’s switching technique on configuration model [38]. Their algorithmworks for graphs with d3

max =O(m2/∑

i d2i ) and d3

max = o(m +∑

i d2i ) with average running time of

O(m+ (∑

i d2i )

2). This leads to O(n2d4) average running time for d-regular graphs with d = o(n1/3). Veryrecently and independently from our work, Blanchet [12] have used McKay’s estimate and SIS techniqueto obtain an FPRAS with running time O(m2) for sampling bipartite graphs with given degrees whendmax = o(m1/4). His work is based on defining an appropriate Lyapunov function as well as using Mckay’sestimates.

Our Technical Contribution. Our algorithm and its analysis are based on beautiful works of Stegerand Wormald [45] and Kim and Vu [33]. The technical contributions of our work beyond their analysis arethe followings:

1. In both [45, 33] the output distribution of proposed algorithms are asymptotically uniform. Here weuse SIS technique to obtain an FPRAS.

2. Both [45, 33] use McKay’s estimate [37] in their analysis. In this paper we give a combinatorialargument to show the failure probability of the algorithm is small and attain a new proof for McKay’sestimate.

3. We exploit combinatorial structure and a simple martingale tail inequality to show concentrationresults in the range d = O(n1/2−τ ) for regular graphs that previous polynomial inequalities [32] donot work.

Other Applications and Extensions. Our algorithm and its analysis provide more insight into themodern random graph models such as the configuration model or random graphs with a given expecteddegree sequence [20]. In these models, the probability of having an edge between vertices i and j of thegraph is proportional to didj . However, one can use our analysis or McKay’s formula [37] to see that ina random simple graph this probability is proportional to didj(1 − didj/2m). We expect that, by addingthe correction term and using the concentration result of this paper, it is possible to achieve a betterapproximation for which sandwiching theorems similar to [34] can be applied.

We have also used similar ideas to generate random graphs with large girth [7]. These graphs are used todesign high performance Low-Density Parity-Check (LDPC) codes. One of the methods for constructing

2

Page 3: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

these codes is to generate a random bipartite graph with a given optimized degree sequence [5]. Twocommon heuristics for finding good codes are as follows: (i) generate many random copies and pick theone with the highest girth; (ii) grow progressively the graph while avoiding short loops. While the formerimplies an exponential slowing down in the target girth, the latter induces a systematic and uncontrolledbias in the graph distribution. Using the same principles, we can remove the bias and achieve a moreefficient algorithm that sequentially adds the edges avoiding small cycles.

Organization of the Paper. The rest of the paper has the following structure. The algorithm and themain results are stated in Section 2. In Section 3 we explain the intuition behind the weighted configurationmodel and our algorithm. It also includes the FPRAS using SIS approach. Section 4 is dedicated to analysisand proofs. The rest of the paper is dedicated to supplementary proofs.

2 Our Algorithm

Suppose we are given a sequence of n nonnegative integers d1, d2, . . . dn with∑ni=1 di = 2m and a set of

vertices V = v1, v2, . . . , vn. Assume the sequence of given degrees d1, . . . , dn is graphical. That is thereexists at least one simple graph with those degrees. We propose the following procedure for sampling(counting) an element (number of elements) of set L(d) of all labeled simple graphs G with V (G) = Vand degree sequence d =(d1, d2, · · · , dn). Throughout this paper m =

∑ni=1 di/2 is number of edges in the

graph, dmax = maxni=1di and for regular graphs d refers to degrees; i.e. di = d for all i = 1, . . . , n.

Procedure A

(1) Let E be a set of edges, d = (d1, . . . , dn) be an n-tuple of integers and P be a number. Initialize

them by E = ∅, d = d, and P = 1.

(2) Choose two vertices vi, vj ∈ V with probability proportion to didj(1− didj

4m ) among all pairs i, j withi 6= j and (vi, vj) /∈ E. Denote this probability by pij and multiply P by pij . Add (vi, vj) to E and

reduce each of di, dj by 1.

(3) Repeat step (2) until no more edge can be added to E.

(4) If |E| < m report failure and output N = 0, otherwise output G = (V,E) and N = (m! P )−1.

Note that for regular graphs the factors 1 − didj/4m are redundant and Procedure A is the same asSteger-Wormald’s [45] algorithm. Next two theorems characterize output distribution of Procedure A.

Theorem 1 Let τ > 0: For any degree sequence d with maximum degree of O(m1/4−τ ), Procedure Aterminates successfully in one round with probability 1 − o(1) and any graph G with degree sequence d isgenerated with probability within 1 ± o(1) factor of uniform. Expected running time of Procedure A is atmost O(mdmax).

For regular graphs a similar result can be shown in a larger range of degrees. Let L(n, d) denotes the setof all d regular graphs with n vertices:

Theorem 2 Let τ > 0: If d = O(n1/2−τ ), then for all graphs G ∈ L(n, d) except a set of size o(|L(n, d)|)Procedure A generates G with probability within 1 ± o(1) factor of uniform. In other words as n → ∞output distribution of Procedure A converges to uniform in total variation metric.

The above results show that output distribution of Procedure A is asymptotically uniform only as n→ ∞.But for finite values of n we use SIS to obtain an FPRAS for calculating |L(d)| and randomly generatingits elements.

3

Page 4: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

Definition An algorithm for approximately counting (randomly generating) graphs with degree sequenced is called an FPRAS if for any ǫ, δ > 0, it runs in time polynomial in m, 1/ǫ, log(1/δ) and with probabilityat least 1 − δ the output of the algorithm is number of graphs (a graph with uniform probability) upto a multiplicative error of 1 ± ǫ. For convenience we define a real valued random variable X to be an(ǫ, δ)-estimate for a number y if P(1 − ǫ)y ≤ X ≤ (1 + ǫ)y ≥ 1 − δ.

The following theorem summarizes our main result.

Theorem 3 Let τ > 0: For any degree sequence d with maximum degree of O(m1/4−τ ) and any ǫ, δ > 0 wegive an FPRAS for counting and generating graphs with degree sequence d with running time O(mdmaxǫ

−2 log(1/δ)).

3 Definitions and the Main Idea

Before explaining our approach let us quickly review the configuration model. Let W = ∪ni=1Wi be a setof 2m =

∑ni=1 di labeled mini-vertices with |Wi| = di. If one picks two distinct mini-vertices uniformly

at random and pairs them together then repeats that for remaining mini-vertices, after m steps a perfectmatching M on the vertices of W is generated. Such matching is also called a configuration on W . One cansee that number of all distinct configurations is equal to (1/m!)

∏m−1r=0

(2m−2r

2

). The same equation shows

that this sequential procedure generates all configurations with equal probability. Given a configurationM, combining all mini-vertices of each Wi to form a vertex vi, a graph GM is generated whose degreesequence is d.

Note that the graph GM might have self edge loops or multiple edges. In fact McKay and Wormald’sestimate [39] show that this happens with very high probability except when dmax = O(log1/2m). In orderto fix this problem, at any step one [45] can only look at those pairs of mini-vertices that lead to simplegraphs (denote these by suitable pairs) and pick one uniformly at random. For d-regular graphs whend = O(n1/28−τ ) Steger-Wormald [45] have shown this approach asymptotically samples regular graphswith uniform distribution and Kim-Vu [33] have extended that result to d = O(n1/3−τ ).

Weighted Configuration Model. Unfortunately for general degree sequences some graphs can haveprobabilities that are far from uniform. In this paper we will show that for non-regular degree sequencessuitable pairs should be picked non-uniformly. In fact Procedure A is a weighted configuration model whereat any step a suitable pair (u, v) ∈ Wi ×Wj is picked with probability proportional to 1 − didj/4m.

Here is a rough intuition behind Procedure A. Define the execution tree T of the configuration model asfollows. Consider a rooted tree where root (the vertex in level zero) corresponds to the empty matching inthe beginning of the model and level r vertices correspond to all partial matchings that can be constructedafter r steps. There is an edge in T between a partial matching Mr from level r to a partial matchingMr+1 from level r + 1 if Mr ⊂ Mr+1. Any path from the root to a leaf of T corresponds to one possibleway of generating a random configuration.

Let us denote those partial matchings Mr whose corresponding partial graph GMr is simple by “valid”matchings. Denote the number of invalid children of Mr by ∆(Mr). Our goal is to sample valid leaves ofthe tree T uniformly at random. Steger-Wormald’s improvement to configuration model is to restrict thealgorithm at step r to the valid children of Mr and picking one uniformly at random. This approach leadsto almost uniform generation for regular graphs [45, 33] since the number of valid children for all partialmatchings at level r of the T, is almost equal. However it is crucial to note that for non-regular degreesequences if the (r+ 1)th edge matches two elements belonging to vertices with larger degrees, the numberof valid children for Mr+1 will be smaller. Thus there will be a bias towards graphs that have more ofsuch edges.

In order to find a rough estimate of the bias fix a graph G with degree sequence d. Let M(G) be set of allleaves M of the tree T that lead to graph G; i.e. Configurations M with GM = G. It is easy to see that

4

Page 5: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

|M(G)| = m!∏ni=1 di!. Moreover for exactly (1 − qr) |M(G)| of these leaves a fixed edge (i, j) of G appears

in the first r edges of the path leading to them; i.e. (i, j) ∈ Mr. Here qr = (m − r)/m. Furthermore wecan show that for a typical such leaf after step r, number of unmatched mini-vertices in each Wi is roughlydiqr. Thus expected number of un-suitable pairs (u, v) is about

i∼Gjdidjq

2r(1 − qr). Similarly expected

number of unsuitable pairs corresponding to self edge loops is approximately∑n

i=1

(diqr

2

)≈ 2mq2rλ(d)

where λ(d) =∑ni=1

(di

2

)/(∑ni=1 di). Therefore defining γG =

i∼Gjdidj/4m and using

(2m−2r

2

)≈ 2m2q2r

we can write

P(G) ≈ m!n∏

i=1

di!m−1∏

r=0

1

2m2q2r − 2mq2rλ(d) − 4m(1 − qr)q2rγG

≈ eλ(d)+γG m!n∏

i=1

di!m−1∏

r=0

1(2m−2r

2

) ∝ eγG

Hence adding the edge (i, j) roughly creates an exp(didj/4m) bias. To cancel that effect we need to reduceprobability of picking (i, j) by exp(−didj/4m) ≈ 1−didj/4m. We will rigorously prove the above argumentin Section 4.

Sequential Importance Sampling (SIS). For finite values of m output distribution of Procedure Acan be slightly nonuniform but sequential nature of Procedure A gives us extra information that can beexploited to obtain very close approximations of any target distribution, including uniform. In particularthe random variable N that is output of Procedure A is an unbiased estimator for |L(d)|. More specifically:

EA(N) = EA(N1A succeeds) =∑

G∈L(d)

πG

[m! PA(πG)]−1

PA(πG) = |L(d)|

where πG denotes one of the m! ways of generating a graph G by Procedure A. Therefore we suggest thefollowing algorithm for approximating |L(d)|.

Algorithm: CountGraphs(ǫ, δ)

(1) For k = k(ǫ, δ) run Procedure A exactly k times and denote the corresponding values of the randomvariable N by N1, . . . , Nk.

(2) Output X = N1+···+Nk

k as estimator for |L(d)|.

We will show in the next section that if variance of the random variable N is small enough then AlgorithmCountGraphs gives the desired approximation when k(ǫ, δ) = O(ǫ−2 log(1/δ)). In order to generate elementsof L(d) with probabilities very close to uniform we will use the estimator X and apply SIS to a differentrandom variable. For that the algorithm is as follows:

Algorithm: GenerateGraph(ǫ, δ)

(1) Let X be an (ǫ, δ)-estimate for |L(d)| given by Algorithm CountGraphs.

(2) Repeat Procedure A to obtain one successful outcome G.

(3) Find an (ǫ, δ)-estimate, PG, for PA(G) using Procedure B.

(4) Report G with probability11X

5PGand stop. Otherwise go back to step (2).

1In section 4 we will show that 1

X< 5PG for large enough n (independent of ǫ, δ > 0).

5

Page 6: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

The crucial step of Algorithm GenerateGraph is step (3) that is finding (ǫ, δ)-estimate for PA(G). For thatwe use Procedure B which is exactly similar to Procedure A except for steps (2), (4).

Procedure B(G, ǫ, δ)

(1) Let E be a set of edges, d = (d1, . . . , dn) be an n-tuple of integers and P be a number. Initialize

them by E = ∅, d = d, and P = 1.

(2) Choose an edge e = (vi, vj) of G that is not in E uniformly at random. Assume that (vi, vj) is chosen

with probability proportion to didj(1− didj

4m ) among all pairs i, j with i 6= j and (vi, vj) /∈ E. Denote

this probability by pij and multiply P by pij . Add (vi, vj) to E and reduce each of di, dj by 1.

(3) Repeat step (2) until no more edge can be added to E.

(4) Repeat steps (1) to (3) exactly ℓ = ℓ(ǫ, δ) times and let P1, . . . , Pℓ be corresponding values for P .Output PG = m!P1+···+Pℓ

ℓ as estimator for PA(G).

Note that random variable P at the end of step (3) is exactly PA(πG) for a random permutation of theedges of G. It is easy to see that EB(P ) = PA(G)/m!. Therefore PG is an unbiased estimator for PA(G).Later we will show that it is an (ǫ, δ)-estimator as well by controlling the variance of random variable P .

4 Analysis

Let us fix a simple graph G with degree sequence d. Denote the set of all edge-wise different perfectmatchings on mini-vertices of W that lead to graph G by R(G). Any two elements of R(G) can beobtained from one another by permuting labels of the mini-vertices in any Wi. We will find probability ofgenerating a fixed element M in R(G). There are m! different orders for picking edges of M sequentiallyand different orderings could have different probabilities. Denote the set of these orderings by S(M). Thus

PA(G) =∑

M∈R(G)

N∈S(M)

PA(N ) =

n∏

i=1

di!∑

N∈S(M)

PA(N ).

For any ordering N = e1, . . . , em ∈ S(M) and 0 ≤ r ≤ m− 1 denote probability of picking the edge er+1

by P(er+1). Hence PA(N ) =∏m−1r=0 P(er+1) and each term P(er+1) equals to

P (er+1 = (i, j)) =(1 − didj/4m)

(u,v)∈Erd(r)u d

(r)v (1 − dudv/4m)

where d(r)i denotes the residual degree of vertex i after r steps which shows number of unmatched mini-

vertices of Wi at step r. The set Er consists of all possible edges after picking e1, . . . , er. Denomi-nator of the above fraction for P(er+1) can be written as

(2m−2r

2

)− Ψ(Nr) where Ψ(Nr) = ∆(Nr) +

(i,j)∈Erd(r)i d

(r)j didj/4m. This is because

(u,v)∈Erd(r)u d

(r)v counts number of suitable pairs in step r and

is equal to(2m−2r

2

)− ∆(Nr). The quantity Ψ(Nr) can be also viewed as sum of the weights of unsuitable

pairs. Now using 1 − x = e−x+O(x2) for 0 ≤ x ≤ 1 we can write PA(G) in the range dmax = O(m1/4−τ ) asfollowing

PA(G) =

n∏

i=1

di!∏

i∼Gj

(1 − didj4m

)∑

N∈S(M)

m−1∏

r=0

1(2m−2r

2

)− Ψ(Nr)

=n∏

i=1

di! e−γG+o(1)

N∈S(M)

m−1∏

r=0

1(2m−2r

2

)− Ψ(Nr)

6

Page 7: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

The next step is to show that with very high probability Ψ(Nr) is close to a number ψr(G) independent

of the ordering N . More specifically for ψr(G) = (2m− 2r)2(λ(d)2m +

r∑

i∼Gj(di−1)(dj−1)

4m3 +(∑n

i=1 d2i )2

32m3

)

the

following is true

N∈S(M)

m−1∏

r=0

1(2m−2r

2

)− Ψ(Nr)

= (1 + o(1))m!m−1∏

r=0

1(2m−2r

2

)− ψr(G)

(1)

The proof of this concentration uses Kim-Vu’s polynomial [32] and is quite technical. It generalizes Kim-Vu’s [33] calculations to general degree sequences. To the interest of space we omit this cumbersomeanalysis but it is given in in Section 5 of extended version of this paper [8]. But in Section 4.1 we showconcentration for regular graphs in a larger region using a new technique.

Next step is to show the following equation for dmax = O(m1/4−τ ).

m−1∏

r=0

1(2m−2r

2

)− ψr(G)

=

m−1∏

r=0

1(2m−2r

2

)eλ(d)+λ2(d)+γG+o(1). (2)

Proof of equation (2) is algebraic and is given in Section 5.2 of [8]. Following lemma summarizes the aboveanalysis.

Lemma 1 For dmax = O(m1/4−τ ) Procedure A generates all graphs with degree sequence d with asymp-totically equal probability. More specifically

N∈S(M)

P(N ) =m!

∏mr=0

(2m−2r

2

)eλ(d)+λ2(d)+o(1)

of Theorem 1 In order to show that PA(G) is uniform we need an important piece. Lemma 1 shows thatPA(G) is independent of G but this probability might be still far from uniform. In other words we need toshow that Procedure A always succeed with probability 1 − o(1). We will show this in section 6 of [8] byproving the following lemma.

Lemma 2 For dmax = O(m1/4−τ ) the probability of failure in one trial of Procedure A is o(1).

Therefore all graphs G are generated asymptotically with uniform probability. Note that this will also givean independent proof of McKay’s formula [37] for number of graphs.

Finally we are left with analysis of the running time which is given by the following lemma.

Lemma 3 The Procedure A can be implemented so that the expected running time is O(mdmax) for dmax =O(m1/4−τ ).

Proof of Lemma 3 is given in Section 7 of [8]. This completes proof of Theorem 1.

of Theorem 3 First we will prove the following result about output X of Algorithm GraphCount.

Lemma 4 For any ǫ, δ > 0 there exist k(ǫ, δ) = O(ǫ−2 log(1/δ)) where X is an (ǫ, δ)-estimator for |L(d)|.

Proof By definition

P((1 − ǫ)|L(d)| < X < (1 + ǫ)|L(d)|

)= P

− ǫEA(N)√

VarA(N)k

<X − EA(X)√

VarA(N)k

<ǫEA(N)√

VarA(N)k

7

Page 8: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

On the other hand by central limit theorem limk→∞X−EA(X)√VarA(N)/k

d= Z ∼ N(0, 1). Therefore ǫEA(N)√

VarA(N)/k> zδ

guarantees that X is (ǫ, δ)-estimator |L(d)| where P(|Z| > zδ) = δ. This condition is equivalent to:

k > z2δ ǫ

−2VarA(N)/EA(N)2. Moreover for tail of normal distribution we have P(Z > x) ≈ x−1e−x2/2(2π)−1

as x → +∞ which gives z2δ = o(log(1/δ)). This means if we show VarA(N)/EA(N)2 < ∞ then k =

O(log(1/δ)ǫ−2). In fact we will prove a stronger statement

VarA(N)

EA(N)2= o(1) (3)

Proof of equation (3) is given in Section 8.1 of [8].

Last step is to find running time of Algorithm CountGraph. By Theorem 1 each trial of Procedure A takestime O(mdmax). Therefore running time of Algorithm CountGraph is exactly k times O(mdmax) which isO(mdmaxǫ

−2 log(1/δ)). This finishes proof of Lemma 4.

Now we are left with analysis of Algorithm GenerateGraph which is given by following lemma.

Lemma 5 For any ǫ, δ > 0 there exist ℓ(ǫ, δ) for Procedure B such that Algorithm GenerateGraph usesO(mdmaxǫ

−2 log(1/δ)) operations and its output distribution is an (ǫ, δ)-estimator for uniform distribution.

Similar calculations as in proof of Lemma 4 show that provided VarB(P )/EB(P )2 <∞ then for any graphG there exist ℓ(ǫ, δ) = O(ǫ−2 log(1/δ)) such that estimator PG is an (ǫ, δ)-estimator for PA(G). Similarlywe will show the following stronger result in section 8.2 of [8].

VarB(P )

EB(P )2= o(1) (4)

Now we are ready to prove Lemma 5.

Proof of Lemma 5 From Theorem 1 there exist integer n0 > 0 independent of ǫ, δ such that for n > n0

the following is true 0.5|L(d)| ≤ PA(G) ≤ 1.5|L(d)|. Thus using Lemma 4 for any ǫ′, δ′ > 0 and k = k(ǫ′, δ′)and also ℓ = k(ǫ′, δ′), with probability 1 − 2δ′ we have:

0.51 − ǫ′

1 + ǫ′≤

1X

PG≤ 1.5

1 + ǫ′

1 − ǫ′(5)

Note that for δ′ < δ/2 and ǫ′ < min(0.25, ǫ/2) the upper bound in equation (5) is strictly less than 5 whichmeans 5PGX > 1 and this validates step (4) of Algorithm GenerateGraph. Moreover the lower bound inequation (5) is at least 1/8 which shows that expected number of repetitions in Algorithm GenerateGraph isat most 8. On the other hand probability of generating a graph G by one trial of Algorithm GenerateGraphis equal to PA(G)/(5XPG). This means probability of generating an arbitrary graph G in one round ofAlgorithm GenerateGraph is an (ǫ, δ)-estimator for 1

5X . Therefore final output distribution of AlgorithmGenerateGraph is an (ǫ, δ)-estimator for uniform distribution.

Expected running time of Algorithm GenerateGraph is at most 8k times expected running time of ProcedureA plus expected running time of Algorithm GraphCount which is O(mdmaxǫ

−2 log(1/δ)). This finishesproof of Lemma 5 and therefore proof of Theorem 3.

4.1 Concentration inequality for random regular graphs

Recall that L(n, d) denotes the set of all simple d-regular graphs with m = nd/2 edges. Same as beforelet G be a fixed element of L(n, d) and M be a fixed matching on W with GM = G. The main goal isto show that for d = o(n1/2−τ ) probability of generating G is at least (1 − o(1)) of uniform; i.e. PA(G) =(d!)n

N∈S(M) P(N ) ≥ (1 − o(1)) /|L(n, d)|. Our proof builds upon the steps in Kim and Vu [34]. The

8

Page 9: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

following summarizes the analysis of Kim and Vu [34] for d = O(n1/3−τ ). Let m1 = md2ω where ω goes to

infinity very slowly; e.g. O(logδ n) for small δ > 0 then:

|L(n, d)|(d!)n∑

N∈S(M)

P(N )(a)=

1 − o(1)

m!

N∈S(M)

m−1∏

r=0

(2m−2r

2

)− µr

(2m−2r

2

)− ∆(Nr)

(b)

≥ 1 − o(1)

m!

N∈S(M)

m1∏

r=0

(

1 +∆(Nr) − µr

(2m−2r

2

)− ∆(Nr)

)

(c)

≥ (1 − o(1))

m1∏

r=0

(

1 − 3T 1r + T 2

r

(2m− 2r)2

)

(d)

≥ (1 − o(1)) exp

(

−3e

m1∑

r=0

T 1r + T 2

r

(2m− 2r)2

)

(6)

Here we explain these steps in more details. First define µr = µ1r + µ2

r where µ1r = (2m− 2r)2(d − 1)/4m

and µ2r = (2m − 2r)2(d − 1)2r/4m2. Step (a) follows from equation (3.5) of [34] and McKay-Wormald’s

estimate [39] for regular graphs. Also algebraic calculations in page 10 of [34] justify (b).

The main step is (c) which uses large deviations. For simplicity write ∆r instead of ∆(Nr) and let∆r = ∆1

r + ∆2r where ∆1

r and ∆2r show the number of unsuitable pairs in step r corresponding to self edge

loops and double edges respectively. For pr = r/m, qr = 1 − pr Kim and Vu [34] used their polynomialinequality [32] to derive bounds T 1

r , Tr2 and to show with very high probability |∆1

r − µ1r| < T 1

r and|∆2

r − µ2r | < T 2

r . More precisely for some constants c1, c2

T 1r = c1 log2 n

nd2q2r(2dqr + 1) , T 2r = c2 log3 n

nd3q2r (d2qr + 1)

Now it can be shown that µir = o((2m− 2r)2

)and T ir = o

((2m− 2r)2

), i = 1, 2 which validates the step

(c). The step (d) is straightforward using 1 − x ≥ e−ex for 1 ≥ x ≥ 0.

Kim and Vu show that for d = O(n1/3−τ ) the exponent in equation (6) is of o(1). Using similar calculationsas equation (3.13) in [34] it can be shown that in the larger region d = O(n1/2−τ ) for m2 = (m log3 n)/d:

m1∑

r=0

T 1r

(2m− 2r)2= o(1) ,

m1∑

r=m2

T 2r

(2m− 2r)2= o(1)

But unfortunately the remaining∑m2

r=0T 2

r

(2m−2r)2 is of order Ω(d3/n). In fact it turns out the random

variable ∆2r has large variance in this range.

Let us explain the main difficulty for moving from d = O(n1/3−τ ) to d = O(n1/2−τ ). Note that ∆2r is

defined on a random subgraphs GNr of the graph G which has exactly r edges. Both [45] and [33, 34]have approximated the GNr with Gpr in which each edge of G appears independently with probabilitypr = r/m. Our analysis shows that when d = O(n1/2−τ ) this approximation causes the variance of ∆2

r toblow up.

In order to fix this problem we modify ∆2r before moving to Gpr . It can be shown via simple algebraic

calculations that: ∆2r − µ2

r = Xr + Yr where Xr =∑

u∼GNrv[d

(r)u − qr(d − 1)][d

(r)v − qr(d − 1)] and

Yr = qr(d−1)∑

u

[

(d(r)u − qrd)

2 − dprqr

]

. This modification is critical since the equality ∆2r−µ2

r = Xr−Yrdoes not hold in Gpr .

Next task is to find a new bound T 2r such that |Xr−Yr| < T 2

r with very high probability and∑m2

r=0T 2

r

(2m−2r)2 =

o(1). It is easy to see that in Gpr both Xr and Yr have zero expected value. At this time we will move toGpr and show that Xr and Yr are concentrated around zero. In the following we will show the concentrationof Xr in details. For Yr it can be done in exact same way.

9

Page 10: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

Consider the edge exposure martingale (page 94 of [3]) for the edges that are picked up to step r. That isfor any 0 ≤ ℓ ≤ r define Zrℓ = E(Xr | e1, . . . , eℓ). For simplicity of notation let us drop the index r from

Zrℓ , d(r)u , pr and qr.

Next step is to bound the martingale difference |Zi − Zi−1|. Note that for ei = (u, v):

|Zi − Zi−1| =

∣∣∣∣

(du − (d− 1)q

)(dv − (d− 1)q

)+

u′∼Gpu

(du′ − (d− 1)q

)+

v′∼Gpv

(dv′ − (d− 1)q

)∣∣∣∣

(7)

Bounding the above difference should be done carefully since the standard worst case bounds are weak forour purpose. Note that the following observation is crucial. For a typical ordering N the residual degreeof the vertices are roughly dq ±√

dq. We will make this more precise. For any vertex u ∈ G consider thefollowing Lu = |du − dq| ≤ c log1/2 n(dq)1/2 where c > 0 is a large constant. Then the following lemmaholds:

Lemma 6 For all 0 ≤ r ≤ m2 the following is true: P(Lcu) = o( 1m4 ).

Proof of Lemma 6 uses generalization of the Chernoff inequality from [3] and is given in Section 9 of [8].

To finish bounding the martingale difference we look at other terms in equation (7). For any vertex uconsider the event

Ku =

|∑

u′∼Gpu

(du′ − (d− 1)q)| ≤ c(

(dq)3/2 + qd+ dq1/2)

logn

where c > 0 is a large constant. We will use the following lemma to bound the martingale difference.

Lemma 7 For all 0 ≤ r ≤ m2 the followings hold P(Kcu) = o( 1

m4 ).

Proof of Lemma 7 is given in Section 9 of [8].

Now we are ready to bound the martingale difference. Let L =⋂m2

r=0

⋂ nu=1(Lu ∩Ku). Using Lemmas 6,

7 and the union bound P(Lc) = o(1/m2). Hence for the martingale difference we have |Zi − Zi−1|1L ≤O(dq + dq1/2 + (dq)3/2) log n.

Next we state and use the following variation of Azuma’s inequality.

Proposition 1 (Kim [31]) Consider a martingale Yini=0 adaptive to a filtration Bini=0. If for all kthere are Ak−1 ∈ Bk−1 such that E[eωYk |Bk−1] ≤ Ck for all k = 1, 2, · · · , n with Ck ≥ 1 for all k, then

P(Y − E[Y ] ≥ λ) ≤ e−λωn∏

k=1

Ck + P(∪n−1k=0Ak)

of Theorem 2 Applying the above proposition for a large enough constant c′ > 0 gives:

P

(

|Xr| > c′√

6r log3 n(dq + d(q)1/2 + (dq)3/2

)2)

≤ e−3 logn + P(Lc) = o(1

m2)

The same equation as above holds for Yr since the martingale difference for Yr is of O(|dqr(du − qrd)|) =

O((dq)3/2 log1/2 n)) using Lemma 6.

Therefore defining T 2r = c′(dq + d(q)1/2 + (dq)3/2)

6r log3 n we only need to show the following is o(1).

m2∑

r=0

(dq + d(q)1/2 + (dq)3/2)√

6r log3 n

(2m− 2r)2

10

Page 11: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

But using ndq = 2m− 2r:

m2∑

r=0

(dq + dq1/2 + (dq)3/2

)√

6r log3 n

n2d2q2

=

m2∑

r=0

O

(d1/2 log1.5 n

n1/2(2m− 2r)+

d log1.5 n

(2m− 2r)3/2+

d1/2 log1.5 n

n(2m− 2r)1/2

)

= O(d1/2 log(nd)

n1/2+

d

(n log3 n)1/2+

d

n1/2

)

log1.5 n

which is o(1) for d = O(n1/2−τ ).

5 Generalizing Kim-Vu’s Concentration Result and Proof of Equa-tion (1)

The aim of this section is to show equation (1) via generalization of Kim-Vu’s analysis. Let us define:

f(N ) =

m−1∏

r=0

(2m−2r

2

)− ψr(G)

(2m−2r

2

)− Ψ(Nr)

then equation (1) is equivalent toE(f(N )) = 1 + o(1) (8)

where expectation is with respect to uniform distribution on space of all m! orderings of M that is denotedby S(M). Proof of equation (8) is done by partitioning the set S(M) into smaller pieces and looking atconcentration of f on each of them. The partition is given in Section 5.3. But before that we need someextra notations.

5.1 Definitions

In section 4 we saw that probability of choosing an edge between Wi,Wj at step r + 1 of Procedure A is

equal to (1 − didj

4m )[(

2m−2r2

)− Ψ(Nr)

]−1where Ψ(Nr) =

(i,j)/∈Erd(r)i d

(r)j +

(i,j) ∈ Erd(r)i d

(r)j

didj

4m . For

simplicity in notation from now Ψr means Ψ(Nr) unless it is specified. For our analysis we need to breakΨr into more pieces. Let:

∆r =∑

(i,j) /∈ Er

d(r)i d

(r)j

Λr =∑

(i,j)

d(r)i d

(r)j

didj4m

−∑

(i,j) /∈ Er

d(r)i d

(r)j

didj4m

hence:

Ψr = ∆r + Λr

For any edge (i, j) /∈ Er there are two possibilities. It is either creating a self loop (i = j) or a double edge.We distinguish between these two cases by an extra index as follows:

∆r,1 =

n∑

i=1

(d(r)i

2

)

self loops

∆r,2 = ∆r − ∆r,1 double edges

11

Page 12: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

Moreover

4mΛr =∑

(i,j)

d(r)i d

(r)j didj −

(i,j) /∈ Er

d(r)i d

(r)j didj

=(∑n

i=1 d(r)i di)

2 +∑ni=1(d

(r)i )2d2

i

2−

(i,j) /∈ Er

d(r)i d

(r)j didj

=(∑n

i=1 d(r)i di)

2 +∑ni=1(d

(r)i )2d2

i

2−

n∑

i=1

(d(r)i

2

)

d2i −

(i,j) /∈ Er , i6=jd(r)i d

(r)j didj

=(∑n

i=1 d(r)i di)

2

2+

∑ni=1 d

(r)i d2

i

2−

(i,j) /∈ Er, i6=jd(r)i d

(r)j didj

We distinguish these last three terms by adding numerical indices to Λr:

Λr,1 =

n∑

i=1

d(r)i di , Λr,2 =

n∑

i=1

d(r)i d2

i , Λr,3 =∑

(i,j) /∈ Er, i6=jd(r)i d

(r)j didj

Hence

Λr =Λ2r,1 + Λr,2

8m− Λr,3

4m

The following simple bounds will be very useful throughout section 5.

Lemma 8 For all r the followings hold:

(i) ∆r ≤ (2m−2r)d2max

2

(ii) Λr,1 ≤ dmax(2m− 2r)

(iii) Λr ≤ (2m−2r)2d2max

8m

Proof :

(i) At step r there are 2m− 2r mini-vertices left and for each each u ∈ Wi there are at most dmax − 1

mini-vertices in Wi that u can connect to. Hence ∆r,1 ≤ (2m−2r)(dmax−1)2 . Similarly u can connect to

at most (d− 1)2 mini-vertices from Wj with i 6= j to create double edge. Taking into account double

counting ∆r,2 ≤ (2m−2r)(dmax−1)2

2 . Now use ∆r = ∆r,1 + ∆r,2 to get (i).

(ii) Λr,1 ≤ dmax

u d(r)u = dmax(2m− 2r)

(iii) If follows from definition of Λr that

Λr =∑

(i,j) ∈ Er

d(r)i d

(r)j

didj4m

≤ d2max

4m

(i,j) ∈ Er

d(r)i d

(r)j ≤ d2

max

4m

(2m− 2r

2

)

In order to define ψr we look at a slightly similar model. Recall that GNr is the partial graph that isconstructed up to step r. With uniform distribution on S(M) the graph GNr is a random subgraph ofG with exactly r edges. We can approximate this graph by Gpr which is the random subgraph of Gwhich contains each of G independently with probability pr = r/m. Now we are ready evaluate quantitiesEpr (∆r,1),Epr (∆r,2),Epr (Λr,1),Epr (Λr,2) and Epr (Λr,3).

12

Page 13: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

Lemma 9 With uniform distribution on all m! orderings of M:

(i) Epr (∆r,1) = (2m−2r)2

2

(∑n

i=1 (di2 )

2m2

)

= (2m−2r)2

2

(λ(d)2m

)

(ii) Epr (∆r,2) = (2m−2r)2

2

(r∑

i∼Gj(di−1)(dj−1)

2m3

)

(iii) Epr (Λr,1) = (2m− 2r)∑n

i=1 d2i

2m

(iv) Epr (Λr,2) = (2m− 2r)∑n

i=1 d3i

2m

(v) Epr (Λr,3) = (2m−2r)2

2

(r∑

i∼Gj didj(di−1)(dj−1)

2m3

)

Proof (i) Under uniform measure on S(M) each of first r edges of N is chosen uniformly at random.So every edge has a probability of r

m to be chosen. Let Xi be number of unordered tuples j, i, kwhere j, i, i, k ∈ E(G) \ E(GNr ). Then Xi is the number of unsuitable edges that connect twomini-vertices of Wi at (r + 1)th step of creating N . Hence

∆1(Nr) =

n∑

i=1

Xi (9)

On the other hand for a fixed i, number of tuples j, i, k where j, i, i, k ∈ E(G) is exactly(di

2

)

and probability of j, i, i, k /∈ E(GNr ) is (1 − rm )2 which gives: E(Xi) = (1 − r

m )2(di

2

)and this

combined with (9) completes proof of (i).

(ii) Define Yij be number of unordered tuples k, i, j, l where i, j ∈ E(GNr ) but k, i, j, l ∈ E(G) \E(GNr ). Then Yij is exactly number of unsuitable edges between Wi,Wj at (r+1)th step of creatingN . Hence

∆2(Nr) =∑

i∼Gj

Yij (10)

On the other hand for fixed a i ∼G j, number of tuples k, i, j, l where k, i, j, l ∈ E(G) isexactly (di − 1)(dj − 1) and probability of k, i, j, l /∈ E(GNr ) is (1 − r

m )2 and probability ofi, j ∈ E(GNr ) is r

m which gives: E(Yij) = rm (1 − r

m )2(di − 1)(dj − 1) and this with (10) completesproof of (ii)

(iii),(iv) These two parts are direct consequence of E(d(r)i ) = (1 − r

m )di.

(v) Exactly similar to (ii) except we are using the following instead of (10)

Λ3(Nr) =∑

i∼Gj

didj4m

Yij

Definition Exact definition of ψr from Section 4 is given by:

ψr = Epr (∆r) +Epr (Λr,1)

2 + Epr (Λr,2)

8m− Epr (Λr,3)

4m(11)

Corollary 2 For all r using equation (11) we obtain ψr =O(d2max(2m−2r)2

2m ).

Now we are ready to prove equation (2)

13

Page 14: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

5.2 Algebraic Proof of Equation (2)

m−1∏

r=0

(2m−2r

2

)

(2m−2r

2

)− ψr

=

m−1∏

r=0

(

1 +ψr

(2m−2r

2

)− ψr

)

=

m−1∏

r=0

(

1 +

λ(d)m +

r∑

i∼Gj(di−1)(dj−1)

2m3 +(∑

i d2i )2

16m3 +O(d4max

m2 +d2max

m(2m−2r))

1 − 12m−2r −O(

d2max

m )

)

= exp[m−1∑

r=0

log(

1 +

λ(d)m +

r∑

i∼Gj(di−1)(dj−1)

2m3 +(∑

i d2i )2

16m3 +O(d4max

m2 +d2max

m(2m−2r) )

1 − 12m−2r −O(

d2max

m )

)]

= exp[m−1∑

r=0

log(

1 +λ(d)

m+r∑

i∼Gj(di − 1)(dj − 1)

2m3+

(∑

i d2i )

2

16m3+O(

d4max

m2+

d2max

m(2m− 2r)))]

= exp[m−1∑

r=0

(λ(d)

m+r∑

i∼Gj(di − 1)(dj − 1)

2m3+

(∑

i d2i )

2

16m3+O(

d4max

m2+

d2max

m(2m− 2r)))]

(12)

= exp[

λ(d) +m(m− 1)

i∼Gj(di − 1)(dj − 1)

4m3+

(∑

i d2i )

2

16m2+O(

d2max

mlog(2m) +

d4max

m)]

= exp[

λ(d) +

i∼Gj(di − 1)(dj − 1)

4m+

(∑

i d2i )

2

16m2+O(

d2max

m+d2max

mlog(2m) +

d4max

m)]

= exp[

λ(d) +

i∼Gjdidj

4m−∑

i∼Gj(di + dj)

4m+

1

4+

(∑

i d2i )

2

16m2+ o(1)

]

(13)

=(1 + o(1)

)exp

[

λ(d) + λ2(d) +

i∼Gjdidj

4m

]

(14)

where (12) uses log(1+x) = x−O(x2) and (13) uses dmax = O(m1/4−τ ). We also used ψr

(2m−2r)2 = O(d2max

m )

couple of times.

5.3 Partitioning the Set of Orderings S(M)

Partitioning of S(M) will be done in four steps. At each step one or a family of subsets of S(M) will beremoved from it.

Step 1) Consider those orderings N ∈ S(M) where at any state during the algorithm number of unsuitableedges is a constant fraction of number of all available edges. More specifically for any arbitrary small0 < τ ≤ 1/3 let:

S∗(M) =

N ∈ S(M) | Ψ(Nr) ≤ (1 − τ/4)

(2m− 2r

2

)

: ∀ 0 ≤ r ≤ m− 1

The first element of the partition will be the set S(M) \ S∗(M). Now we need to partition S∗(M)further.

Step 2) Consider those members of S∗(M) for which Ψ(Nr) − Ψ(Nr) > (log n)1+δ for all 0 ≤ r ≤ m − 1.Denote this set by A. Here δ is a small positive constant. For example δ < .1 works.

Step 3) From S∗(M) \A remove those elements with Ψ(Nr) > 0 for some r with 2m− 2r ≤ (log n)1+2δ. Putthese elements in the set B.

14

Page 15: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

Step 4) Last element of the partition is C = S∗(M) \ (A ∪ B).

Equation (1) is result of the followings:

E(f(N )1A) = o(1) (15)

E(f(N )1B) = o(1) (16)

E(f(N )1C) ≤ 1 + o(1) (17)

E(f(N )1C) ≥ 1 − o(1) (18)

E(f(N )1S(M)\S∗(M)) = o(1) (19)

Proof of (15) involves further partitioning of A into smaller sets and using Vu’s inequality carefully. It isgiven in section 5.5. Proofs of (16-19) are easier and use typical combinatorial and algebraic bounds. Theyare also proved in section 5.5.

5.4 More notations

In order to prove (15) we need some extra notations. Let ω = (logn)δ. Remember from section 5.3 thatwhere δ > 0 is a very small constant. Let λ0 = ω logn and λi = 2iλ0 for i = 1, 2, . . . , L. L is such thatλL−1 < cd2 logn ≤ λL where c is a large constant specified later. For any 0 ≤ r ≤ m− 1 : Tr is a functiondefined as follows:

Definition Let qr = (1 − r/m), pr = 1 − qr ∀0 ≤ r ≤ m− 1. Then let

αr(λ) = c√

λ(mdmaxq2r + λ2)(dqr + λ)

βr(λ) = c√

λ(md2maxq

2r + λ2)(d2qr + λ)

γr(λ) = c√

λ(md2maxq

3r + λ3)(d2q2r + λ2)

ζr(λ) = cd2qr√

λ(mqr + λ)

νr = 8md2maxq

3r

Tr(λ) =

αr(λ) + βr(λ) + ζr(λ) + (1 +d2max

4m )min(γ(λ), νr) if 2m− 2r ≥ ωλλ2/ω Otherwise

The intuition behind this definition becomes more clear when we will use it for concentration inequalitiesin section 5.5.2. Note that with the above definition since λi = 2λi−1 the following is true

Tr(λi−1) < Tr(λi) ≤ 8Tr(λi−1) (20)

In order to prove (15, 16) we need to partition A,B into smaller pieces. For that let us repeat steps 2 and3 of partitioning in section 5.3 more carefully.

Define subsets A0 ⊆ A1 ⊆ . . . ⊆ AL ⊆ S∗(M) as follows:

Ai = N ∈ S∗(M) | Ψ(Nr) − ψr(M) < Tr(λi) : ∀ 0 ≤ r ≤ m− 1and A∞ = S∗(M) \ ∪Li=0Ai. Then we have:

A = A∞ ∪(∪Li=1Ai \Ai−1

)

Let K be an integer such that 2K−1 < (logn)2+δ + 1 ≤ 2K . Define sets B0 ⊆ B1 ⊆ · · · ⊆ BK ⊆ A0 by:

Bj = N ∈ A0 | Ψ(Nr) < 2j : ∀ r ≥ (2m− ωλ0)/2Hence C = B0. Note that Tr’s are chosen such that Tr(λ0) = λ0 logn : ∀ r ≥ (2m − ωλ0)/2 and bycorollary 2 for all r ≥ (2m− ωλ0)/2 : ψr = o(1). Thus for all such r and all elements of A0

Ψr < λ0 logn+ ψr < 2K

this shows: A0 = ∪Kj=0Bj and B = ∪Kj=1Bj .

15

Page 16: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

5.5 Proofs of (15), (16) and (17)

Consider the following four lemmas:

Lemma 10 For all 1 ≤ i ≤ L

(a) Pu(Ai \Ai−1) ≤ e−Ω(λi)

(b) f(N ) ≤ eo(λi) : ∀N ∈ Ai \Ai−1.

Lemma 11 :

(a) Pu(A∞) ≤ e−cd2max logn

(b) f(N ) ≤ e4d2max logn : ∀N ∈ A∞

Lemma 12 For all 1 ≤ j ≤ K

(a) Pu(Bj \Bj−1) ≤ e−Ω(2j/2 logn)

(b) f(N ) ≤ eO(23j/4) : ∀N ∈ Bj \Bj−1

Lemma 13 For all N ∈ C, f(N ) ≤ 1 + o(1)

Now it is easy to see that (15) is result of Lemmas 10, 11. Note that by definition ofK we have 2K/4 ≪ lognso 23j/4 ≪ 2j/2 logn. Thus one can deduce (16) from Lemma 12 and finally (17) is consequence of Lemma13.

Proof of Lemma 10 uses Vu’s concentration inequality but for other three Lemmas typical algebraic andcombinatorial bounds are sufficient. Section 5.5.1 is a quick introduction to Vu’s concentration inequality.Section 5.5.2 gives proofs of Lemmas 10(a) and 11(a). In section 5.5.3 part b of the same lemmas will beshown. Finally sections 5.5.4 and 5.5.5 prove Lemmas 13, 12 respectively.

5.5.1 Vu’s Concentration inequality

Proofs of Lemmas 10(a) and 11(a) use a very strong concentration inequality proved by Vu [48] whichis a generalized version of an earlier result by Kim and Vu [32]. Consider independent random variablest1, t2, . . . , tn with arbitrary distribution in [0, 1]. Let Y (t1, t2, . . . , tn) be a polynomial of degree k andcoefficients in (0, 1]. For any multi-set A of elements t1, t2, . . . , tn let ∂AY denote partial derivative of Ywith respect to variables in A. For example if Y = t1 + t31t

22 and A = t1, t1, B = t1, t2 then

∂AY =∂2

∂t21Y = 6t1t

22 , ∂BY =

∂2

∂t1∂t2Y = 6t21t2

For all 0 ≤ j ≤ k, let Ej(Y ) = max|A|≥j E(∂AY ). Define parameters ck, dk recursively as follows: c1 =

1, d1 = 2, ck = 2k1/2(ck−1 + 1), dk = 2(dk−1 + 1).

Theorem 4 (Vu) Take a polynomial Y as defined above. For any collection of positive numbers E0 >E1 > · · · > Ek = 1 and λ satisfying:

• Ej ≥ Ej(Y )

• Ej/Ej+1 ≥ λ+ 4j logn, 0 ≤ j ≤ k − 1

the following holds

P

(

|Y − E(Y )| ≥ ck√

λE0E1

)

≤ dke−λ/4.

16

Page 17: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

5.5.2 Proof of part (a) of Lemmas 10 and 11

In this section in order to show part (a) of Lemmas 10 we actually show the stronger property:

Pu(Aci−1) ≤ e−Ω(λi) (21)

This property combined with λL ≥ cd2 logn proves part (a) of Lemma 11 too. From (20) we have:

Aci−1 ⊆ Ψr − ψr ≥Tr(λi)

8

so to show (21) it is sufficient to show the following two lemmas.

Lemma 14 For all r such that 2m− 2r ≥ ωλi:

P

(

Ψ(Nr) − ψr ≥1

8

(

αr(λi) + βr(λi) + ζr(λi) + (1 +d2

4m)min(γr(λi), νr)

))

≤ e−Ω(λi)

Lemma 15 For any r such that 2m− 2r < ωλi

P(Ψ(Nr) − ψr ≥ λ2

i /ω)≤ e−Ω(λi)

Now we focus on Lemma 14. For each variable ∆r,Λr,Ψr denote their analogues quantity in Gpr by∆pr ,Λpr ,Ψpr .

Lemma 16 ∀r:

Ppr (|E(Gpr )| = r) ≥ 1

n

Proof let f(m, r) = Ppr (|E(Gpr )| = r) then it can be seen that:

f(m, r + 1)

f(m, r)=

(1 + 1/r)r

(1 + 1m−r−1)m−r ≤ 1 ∀r ≤ (m− 1)/2

so minimum of f(m, r) is around r = m/2 and for that using Stirling’s approximation we can get f(m, r) ≥1√2m

≥ 1n

By Lemma 16, with probability at least 1/n, Gpr has exactly r edges and since λi ≫ logn to prove Lemma14 we need to show:

P

(

Ψpr − ψr ≥1

8

(

αr(λi) + βr(λi) + ζr(λi) + (1 +d2max

4m)min(γr(λi), νr)

))

≤ e−Ω(λi) (22)

From now until end of the proof we fix r, i and remove all sub-indices r, i for simplicity. Note that expec-tation with respect to randomness in Gp is the same as expectation with respect to uniform distributionon S(M). Therefore (22) is result of the following:

Lemma 17 :

(i) P (∆p,1 − E(∆p,1) ≥ α/8) ≤ e−Ω(λ)

(ii) P (∆p,2 − E(∆p,2) ≥ min(β + γ, β + ν)/8) ≤ e−Ω(λ)

(iii) P

(Λp,1+Λp,2

8m − E(Λp,1)2+E(Λp,2)8m ≥ ζ/8

)

≤ e−Ω(λ)

17

Page 18: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

(iv) P

(Λp,3

4m − E(Λp,3)4m ≥ d2max

4m min(β + γ, β + ν)/8)

≤ e−Ω(λ)

Proof :

(i) Same as Kim-Vu’s proof for each edge e of G consider random variable te which is equal to 0 whene is present in Gp and 1 otherwise. These te’s will be i.i.d. Bernoulli with mean q. Now note that:

∆p,1 =∑

u

u∈e∩f, e6=ftetf

and E(∆p,1) =∑

u

(du

2

)q2 ≤ mdmaxq

2. Next for each te, E(∂te∆p,1) = E(∑

f :f∩e6=∅ tf ) ≤ 2(dmax −1)q < 2dmaxq. And any partial second order derivative is at most 1. So we have:

E0(∆p,1) ≤ max(mdmaxq2, 2dmaxq, 1) , E1(∆p,1) ≤ max(2dmaxq, 1) and E2(∆p,1) = 1

Set E0 = 2mdmaxq2 + 2λ2, E1 = 2dmaxq + λ, E2 = 1 then using λ ≫ logm conditions of Theorem 4

satisfy. On the other hand if c in definition of α is large enough we have c2√E0E1 ≤ α/8 hence by

Theorem 4 part (i) is proved.

(ii) We need to prove the followings

P

(

∆p,2 − E(∆p,2) ≥β + γ

8

)

≤ e−Ω(λ) (23)

P

(

∆p,2 − E(∆p,2) ≥β + ν

8

)

≤ e−Ω(λ) (24)

Consider the same random variables te from part (i). Let R be set of all paths of length 3 in G. Then

∆p,2 =∑

e,f,g∈Rtetg(1 − tf ) =

e,f,g∈Rtetg −

e,f,g∈Rtetf tg

Let Y1 =∑

e,f,g∈R tetg and Y2 =∑

e,f,g∈R tetf tg. Similar to part (i) we have:

E0(Y1) ≤ max(md2maxq

2, 2d2maxq, 1) , E1(Y1) ≤ max(2d2

maxq, 1) and E2(Y1) = 1

Now set E0 = 2md2maxq

2 + 2λ2, E1 = 2d2maxq + λ, E2 = 1. These satisfy conditions of Theorem 4.

Again by considering c large enough we have

P(|Y1 − E(Y1)| ≥ β/8) ≤ e−Ω(λ) (25)

and for Y2

E0(Y2) ≤ max(md2maxq

3, 2d2maxq

2, 2dmaxq, 1) , E1(Y2) ≤ max(2d2maxq

2, 2dmaxq, 1)

E2(Y2) ≤ max(2dmaxq, 1) and E3(Y2) = 1

Set E0 = 2md2maxq

2 + 3λ3, E1 = 2d2maxq

2 + 2λ2, E2 = 2dmaxq + λ, E3 = 1 to get:

P(|Y2 − E(Y2)| ≥ γ/8) ≤ e−Ω(λ) (26)

Combining (25,26) together (23) is proved.

Finally (24) is result of (25) and the following

∆p,2 − E(∆p,2) ≤ |Y1 − E(Y1)| + E(Y2) ≤ |Y1 − E(Y1)| +md2maxq

3 ≤ |Y1 − E(Y1)| + ν/8

18

Page 19: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

(iii) We will show the followings:

P(Λ2p,1

8m− E(Λp,1)

2

8m≥ c1d

2maxq

λ(λ +mq)) ≤ e−Ω(λ) (27)

P(Λp,28m

− E(Λp,28m

) ≥ c1d2max

4m

λ(λ +mq)) ≤ e−Ω(λ) (28)

Note that by making c in definition of ζ large enough (27) and (28) together give us (iii).

First we show (27). Note that one can write:

Λp,12dmax

=∑

e=(u,v)∈E(G)

du + dv2dmax

te

which is a polynomial with coefficients in (0, 1]. As before

E0(Λp,1/(2dmax)) ≤ max(mq, 1) , E1(Λp,1/(2dmax)) ≤ 1

now set E0 = λ+mq, E1 = 1. so we get

P(|Λp,1/(2dmax) − E(Λp,1/(2dmax))| ≥ c1√

λ(λ +mq)) ≤ d1e−Ω(λ) (29)

By Lemma 8(ii) Λp,1 ≤ 2mdmaxq, so Λ2p,1−E(Λp,1)

2 ≥ 8c1md2maxq

λ(λ+mq) yields Λp,1/(2dmax)−E(Λp,1/(2dmax)) ≥ c1

λ(λ +mq). Now using (29) equation (27) is trivial.

Proof of (28) is much easier. Start with

Λp,22d2

=∑

e=(u,v)∈E(G)

d2u + d2

v

2d2max

te

useE0(Λp,2/(2d

2max)) ≤ max(mq, 1) , E1(Λp,2/(2d

2max)) ≤ 1

so with the same E0, E1 we get

P(Λp,2

2d2max

− E(Λp,2

2d2max

) ≥ c1√

λ(λ +mq)) ≤ e−Ω(λ)

which yields (28) easily.

(iv) This case is treated exactly the same as (ii) because we have the following

Λp,3d2max

=∑

e,f,g∈R, e=(u,v)

dudvd2max

tetg(1 − tf )

and everything is as in (ii).

of Lemma 15 Using Lemma 8(iii) and definition of Ψ from Ψp ≥ λ2/ω one can get

∆p ≥ λ2

ω− Λp

≥ λ2

ω−md2

maxq2

>λ2

ω− d2

maxω2λ2

4m(30)

>λ2

2ω(31)

19

Page 20: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

where (30) uses 2mq = 2m− 2r < ωλ and (31) holds since d2maxω

3 ≪ m.

Since 2m − 2r is small then Gp is very dense so we consider its complement Gq which is sparse. LetN0(u) = N(u) ∪ u. Then using

∆pr ≤∑

u

dGq(u)∑

v∈N0(u)

dGq(v)

from ∆p ≥ λ2/2ω one of the followings should hold:

(a) Gq has more than ω2λ/4 edges

(b) For some u,∑

v∈N0(u) dGq(v) ≥ λ/ω3

If (a) holds since 2mq ≤ ωλ:

P(Gq has more thanω2λ

4edges) ≤

(mω2λ4

)

qω2λ4

≤ (4mqe

ω2λ)

ω2λ4

≤ e−ω2λ4 (logω−1−log 2) = e−Ω(λ)

and if (b) holds note the number of edges of G that contribute in∑

v∈N0(u) dGq(v) is at most d2max and

each one contributes at most twice. Hence

P(∑

v∈N0(u)

dGq(v) ≥ λ/ω3) ≤(d2maxλ

2ω3

)

2ω3

≤ (2d2

maxqω3e

λ)

λ2ω3

≤ (d2maxω

4e

m)

λ2ω3

= e−λ

2ω3 (logm−log(d2maxω4)−1) ≤ e−Ω( λ

ω3 logm) = e−Ω(λ)

Note that we need δ in definition of ω to be small enough such that logm ≫ ω3 and actually for δ < .1this is true.

5.5.3 Proof of part (b) of Lemmas 10 and 11

Note that:

f(N ) =

m−1∏

r=0

(

1 +Ψ(Nr) − ψr

(2m−2r

2

)− Ψ(Nr)

)

and since Ψ(Nr) ≤ (1 − τ/4)(2m−2r

2

)for N ∈ S∗(M):

f(N ) ≤m−1∏

r=0

(

1 +3/τ max(Ψ(Nr) − ψr, 0)

(2m− 2r)2

)

of Lemma 10 part (b) Using 1 + x ≤ ex we only need to show:

m−1∑

r=0

max(Ψ(Nr) − ψr, 0)

(2m− 2r)2≤ o(λ)

20

Page 21: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

For simplicity let g(r) = max(Ψ(Nr)−ψr,0)(2m−2r)2 . Note that 0 ≤ g(r) ≤ 1 so

∑λ/ω1/2

2m−2r=2 g(r) = o(λ) hence we

only need to show∑2m−2

2m−2r=λ/ω1/2 g(r) = o(λ) . Also note that numerator of g(r) is at most Tr(λ) so by

definition of Tr(λ) and using d2

4m ≪ 1 we have:

2m−2∑

2m−2r=λ/ω1/2

(2m− 2r)2g(r) ≤ωλ∑

2m−2r=λ/ω1/2

λ2

ω

+2

ωλ2∑

2m−2r=ωλ

(

αr(λ) + βr(λ) + ζr(λ) + νr

)

+22m−2∑

2m−2r=ωλ2

(

αr(λ) + βr(λ) + ζr(λ) + γr(λ))

A series of elementary inequalities will be used now to bound these three sums. We will use qr = 2m−2r2m :

2m−2∑

2m−2r=2

(λmd2maxq

3r )

1/2

(2m− 2r)2=

λ1/2dmax

2m√

2

2m−2∑

2m−2r=2

1√2m− 2r

= O(λ1/2dmax

m

∫ 2m

x=2

1√xdx) = O(

λ1/2dmax√m

)

2m−2∑

2m−2r=2

λ(mdmaxq2r)

1/2

(2m− 2r)2=λd

1/2max

2m1/2

2m−2∑

2m−2r=2

1

2m− 2r= O(

λd1/2max

m1/2logm)

2m−2∑

2m−2r=2

(λ3dmaxqr)1/2

(2m− 2r)2=λ3/2d

1/2max

(2m)1/2

2m−2∑

2m−2r=2

1

(2m− 2r)3/2= O(

λ3/2d1/2max

m1/2)

2m−2∑

2m−2r=ωλ

λ2

(2m− 2r)2≤ λ2

∫ 2m

x=ωλ

x−2dx = o(λ)

First three of last four equations imply next three equations using the same reasoning:

2m−2∑

2m−2r=2

(λmd4maxq

3r)

1/2

(2m− 2r)2= O(

λ1/2d2max√m

)

2m−2∑

2m−2r=2

λ(md2maxq

2r )

1/2

(2m− 2r)2= O(

λdmax

m1/2logm)

2m−2∑

2m−2r=2

(λ3d2maxqr)

1/2

(2m− 2r)2= O(

λ3/2dmax

m1/2)

Furthermore

2m−2∑

2m−2r=2

(λ3md2maxq

3r )

1/2

(2m− 2r)2=λ3/2dmax

2m√

2

2m−2∑

2m−2r=2

1√2m− 2r

= O(λ3/2dmax√

m)

2m−2∑

2m−2r=2

λ2dmaxqr(2m− 2r)2

= O(λ2dmax logm

2m)

21

Page 22: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

2m−2∑

2m−2r=ωλ2

λ3

(2m− 2r)2= O(λ3

∫ ∞

x=ωλ2

x−2dx) = O(λ3

ωλ2) = o(λ) (32)

ωλ2∑

2m−2r=2

md2maxq

3r

(2m− 2r)2=

ωλ2∑

2m−2r=2

d2max(2m− 2r)

8m2= O(

ω2λ4d2max

m2) (33)

Remark All previous equations are o(λ) because λ ≤ λL = O(d2max logn) and dmax = o(m

14−τ ).

Note that we are applying√A+B ≤

√A+

√B to αr, βr, γr, ζr.

of Lemma 11(b) Similar to proof of Lemma 10(b) we will show

f(N ) ≤m∏

r=m−d2max+1

(2m−2r

2

)− ψr

(2m−2r

2

)− Ψ(Nr)

m−d2max∏

r=0

(1 + 3/τ

max(Ψ(Nr) − ψr, 0)

(2m− 2r)2)

≤(

2d2max

2

)d2max

·m−d2max∏

r=0

(1 + 3/τ

Ψr

(2m− 2r)2)

≤ (2d4max)

d2max ·m−d2max∏

r=0

(1 + 3/τ

2d2max

2m− 2r+O(

d2max

m))

(34)

≤ ed2max log 2d4max+

∑mi=d2

max+1

d2maxi +O(d2max)

≤ ed2max

(log 2+4 log dmax+logm+O(1)

)

≤ e4d2max log n (35)

Where (34) use Lemma 8 and (35) uses m ≤ ndmax/2 and d≪ m1/3 ≤ n1/2

5.5.4 Proof of Lemma 13

By definition of C :∑ωλ0

2m−2r=2 g(r) = 0. We only need to show if Ψ(Nr) − Ψ(Nr) ≤ Tr(λ0) for all r suchthat 2m− 2r ≥ ωλ0 then:

m∑

2m−2r=ωλ0

g(r) = o(1)

So it is sufficient to prove thatm∑

2m−2r=ωλ0

Tr(λ0)

(2m− 2r)2= o(1)

The proof is similar to proof of Lemma 10 (b) with a slight modification. Instead of (32, 33) we use

2m−2∑

2m−2r=ωλ30

λ30

(2m− 2r)2= O(λ3

0

∫ ∞

ωλ30

x−2dx) = O(λ3

0

ωλ30

) = o(1)

ωλ30∑

2m−2r=2

md2maxq

3r

(2m− 2r)2=

ωλ30∑

2m−2r=2

(2m− 2r)d2max

m2= O(

d2maxω

2λ60

m2) = o(1)

and in all others letting λ = λ0 they become o(1).

22

Page 23: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

5.5.5 Proof of Lemma 12

of Lemma 12(a) We have 2m− 2r ≤ ωλ0 ≪ (logn)2 which means proving the bound only for one r isenough. Similar to proof of Lemma 15 from Ψp ≥ 2j−1 one gets ∆p ≥ 2j−2 so one of the followings hold:

(a) Gq has more than 2j/2−2 edges

(b) For some u,∑

v∈N0(u) dGq(v) ≥ 2j/2−1

and rest of the proof will be exactly as in Lemma 15

Proof of Lemma 12(b) By definition of Bj

ωλ0∑

2m−2r=2

g(r) ≤ωλ0∑

2m−2r=2

2j

(2m− 2r)2= O(2j)

5.6 Proofs of (18)

From Lemma 14 for all r : 2m− 2r ≥ ωλ0 the following holds

P

(

|Ψr − ψr| ≥ αr(λ0) + βr(λ0) + (1 + d2max/4m)γr(λ0) + ζr(λ0)

)

= o(1) (36)

Let N be an ordering with |Ψr−ψr| ≤ αr(λ0)+βr(λ0)+(1+d2max/4m)γr(λ0)+ζr(λ0) for all 2m−2r ≥ ωλ0.

Then it follows:

f(N ) ≥2m−2∏

2m−2r=ωλ30

(

1 − (3/τ)αr(λ0) + βr(λ0) + γr(λ0) + ζr(λ0)

(2m− 2r)2

)

×ωλ3

0∏

2m−2r=2

(

1 − (3/τ)ψr

(2m− 2r)2

)

In section 5.5.3 it is shown that 3τ

∑2m−22m−2r=ωλ3

0

αr(λ0)+βr(λ0)+γr(λ0)+ζr(λ0)(2m−2r)2 = o(1). Now one can use 1−x ≥

e−2x when 0 ≤ x ≤ 1/2 to see the first term in the above product is 1 − o(1). The second term is also

1 − o(1) because a corollary of Lemma 8 is that ψr = O[

(2m− 2r)2d2max

m

]

and since ωλ30d

2 = o(m). These

together with (36) finish proof of (18). In fact it shows the stronger statement: E(f(N )1S∗(M)) > 1− o(1).

Remark Proofs of this section and section 5.5 yield the following corollary which will be used in section5.7.

Corollary 3 Setting c in definition of λL very large:

E

(

exp

[1

τ2

m−1∑

r=0

max(Ψ(Nr) − Ψ(Nr), 0)

(2m− 2r)2

])

= 1 + o(1) (37)

Bounds of sections 5.5.3, 5.5.5 and 5.5.4 show that contribution of the sets Ai \ Ai−1 and Bj \ Bj−1 areall o(1) and contribution of C is 1 + o(1). Contribution of A∞ also is o(1) by taking the constant c largeenough.

23

Page 24: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

5.7 Proof of (19)

In this section we deal with those orderings N for which the condition

Ψ(Nr) ≤ (1 − τ/4)

(2m− 2r

2

)

(∗)

is violated for some r. If this happens for some r then from Lemma 8(iii) and d4 = o(m)

∆r(N ) ≥ Ψ(Nr) −d2

4m(2m− 2r)2 > Ψ(Nr) − τ/4

(2m− 2r

2

)

> (1 − τ/2)

(2m− 2r

2

)

On the other hand using Lemma 8(i) ∆r(N ) ≤ d2max(2m−2r)2 . So for 2m−2r ≥ d2max

1−τ/2 +1 we have ∆r(N ) ≤(1−τ/2)

(2m−2r

2

). Thus condition (∗) is violated only for r very close to m. Let Si(M), i = 1, . . . ,

d2max

1−τ/2 +1,

be the set of all ordering N for which (∗) fails for the first time at r = m− i. We will use∑∞

i=11mτi = o(1)

to prove (19). It is enough to show:

E(f(N )1Si) ≤(

1 + o(1)) 1

mτi

Note that(2m−2r

2

)− Ψ(Nr) =

(i,j) ∈ Erd(r)i d

(r)j (1 − didj

4m ) ≥ (m − r)(1 − d2max

4m ) because at step r there

should be at least m− r suitable edges to complete the ordering N . Hence using d = o(m14−τ ):

(2m−2r

2

)

(2m−2r

2

)− Ψ(Nr)

≤ 2m− 2r − 1 +O(d4

m) ≤ 2m− 2r

therefore,m−1∏

r=m−i

(2m−2r

2

)

(2m−2r

2

)− Ψ(Nr)

≤ 2ii! ≤ 2ii

and since i is the first place that (∗) is violated:

m−i−1∏

r=0

(2m−2r

2

)− Ψ(Nr)

(2m−2r

2

)− Ψ(Nr)

≤ exp

[5

τ

m−1∑

r=0

max(Ψ(Nr) − Ψ(Nr), 0)

(2m− 2r)2

]

so,

f(N )1Si = 1Si

m−1∏

r=0

(2m−2r

2

)− Ψ(Nr)

(2m−2r

2

)− Ψ(Nr)

≤ 2ii1Si exp

[5

τ

m−1∑

r=0

max(Ψ(Nr) − Ψ(Nr), 0)

(2m− 2r)2

]

Now using Holder’s inequality:

E(f(N )1Si) ≤ 2iiE

(

1Si exp

[5

τ

m−i−1∑

r=0

max(Ψ(Nr) − Ψ(Nr), 0)

(2m− 2r)2

])

≤ 2iiE((1)Si)1−τ/2

E

(

1Si exp

[10

τ2

m−i−1∑

r=0

max(Ψ(Nr) − Ψ(Nr), 0)

(2m− 2r)2

])τ/2

.

But using Corollary 3 the second term in the above product is 1 + o(1) and we only need to show:

2iiP(Si)1−τ/2 ≤

(

1 + o(1)) 1

mτi.

Let r = m− i and Γ(u) = ΓN ,r(u) be the set of all neighbors of u in GNr . Note that:

∆r(N ) =1

2

u

d(r)u

v∈Γ(u)∪u(drv − 1u=v)

24

Page 25: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

and (2m− 2r

2

)

=1

2

u

d(r)u

v

(drv − 1u=v)

now ∆r(N ) > (1 − τ/2)(2m−2r

2

)> (1 − τ)

(2m−2r

2

)implies there exist a vertex u with d

(r)u > 0 such that:

v∈Γ(u)∪u(drv − 1u=v) > (1 − τ)

v

(drv − 1u=v)

or∑

v/∈Γ(u)∪udrv ≤ τ

v

(drv − 1u=v)

≤ τ(2m− 2r − 1) ≤ 2τi (38)

Any of last i edges of N that does not have its both endpoints inside Γ(u) contributes at least once inthe left side of (38). So there are at most 2τi of such edges. Let j = du − |Γ(u)| and ℓ be number of

edges entirely in Γ(u). Then we should have j ≥ 1 and ℓ ≥ (1 − 2τ)i. The probability that d(r)u > 0 and

v/∈Γ(u)∪u drv ≤ 2τi for a fixed vertex u is upper bounded by:

j≥1, ℓ≥(1−2τ)i

(du

j

)((du−j2 )ℓ

)(m−du−(du−j2 )

i−j−ℓ)

(mi

)

hence:

P(Si) ≤∑

u

j≥1, ℓ≥(1−2τ)i

(du

j

)((du−j2 )ℓ

)(m−du−(du−j2 )

i−j−ℓ)

(mi

)

Now using(duj

)

≤ djuj!,

((du−j2

)

)

≤ (d2u/2)ℓ

ℓ!,

(m− du −

(du−j

2

)

i− j − ℓ

)

≤ mi−j−ℓ

(i− j − ℓ)!

and, as i = O(d2) = o(m1/2),(m

i

)

=(1 + o(1)

)mi

i!,

hence:

P(Si) ≤(1 + o(1)

)∑

u

j≥1, ℓ≥(1−2τ)i

dju

j!(d2u/2)

ℓ!mi−j−ℓ

(i−j−ℓ)!mi

i!

=(1 + o(1)

)∑

u

j≥1, ℓ≥(1−2τ)i

(du/m)j(d2u/2m)ℓi!

j!ℓ!(i− j − ℓ)!

≤(1 + o(1)

)2τi∑

u

(du/m)(d2u/2m)(1−2τ)i

(i

2τi

)

≤(1 + o(1)

)idmax

m

u

(d2u/2m)(1−2τ)i2i (39)

≤(1 + o(1)

)i22i/3 dmax

m

u

(d2u

m

)(1−2τ)i

(40)

≤(1 + o(1)

)2i22i/3

(d2max

m

)(1−2τ)i

(41)

25

Page 26: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

here (39, 40) use τ ≤ 1/3 and(ab

)≤ 2a. Equation (41) uses

u dku =

u∼Gv(dk−1u + dk−1

v ) ≤ 2mdk−1max.

Now we can use i ≤ 3d2max

1−τ/2 and dmax ≤ m14−τ to get:

2iiP(Si)1−τ/2 ≤

(1 + o(1)

)4i

(6d4−4τ

max

m1−2τ

)i

≤(1 + o(1)

)4i(6m−3τ+4τ2

)i

≤(1 + o(1)

)m−τi

6 Probability of Failure of Procedure A

Before giving the proof consider the following remark.

Remark Without using any of the known formulas for |L(d)| Lemma 1 gives an upper bound for numberof simple graphs with degree sequence d. If dmax = O(m1/4−τ ) then

|L(d)| ≤ e−λ(d)−λ2(d)+o(1)

∏mr=0

(2m−2r

2

)

m!∏ni=1 di!

In this section we will show that the above inequality is in fact an equality.

In this section we will show that probability of failure in one round of Procedure A is very small. Firstwe will characterize the degree sequence of the partial graph generated up to the time of failure. Thenwe apply the upper bound of Remark 1 from the beginning of Section 4 to derive an upper bound onprobability of failure and show that it is o(1).

Lemma 18 If Procedure A fails in step s then 2m− 2s ≤ d2max + 1.

Proof Procedure A fails when there is no suitable pair left to choose. If the failure occurs in step s thennumber of unsuitable edges is equal to total number of possible pairs

(2m−2s

2

). On the other it can be

easily shown that the number of unsuitable edges at step s is at most d2max(2m− 2s)/2 (see Corollary 3.1

in [45] for more details). Therefore 2m− 2s ≤ d2max + 1.

Failure in step s means there are some Wi’s which have unmatched mini-vertices (d(s)i 6= 0). Let us call

them “unfinished” Wi’s. Since the algorithm fails, any two unfinished Wi’s should be already connected.Hence there are at most dmax of them due to ∀i : |Wi| = di ≤ dmax. The main idea is to show this is a veryrare event. Without loss of generality assume W1,W2, . . . ,Wk are all the unfinished sets. Above argumentshows k ≤ dmax and by construction k ≤ 2m − 2s. The algorithm up to this step has created a partial

matching Ms where graph GMs is simple with degree sequence d(s) = (d1−d(s)1 , . . . , dk−d(s)

k , dk+1, . . . , dn).Let A

d(s)1 ,...,d

(s)k

denotes the above event of failure. Hence

P(fail) =

d2max+1∑

2m−2s=2

max(dmax,2m−2s)∑

k=1

n∑

i1,...,ik=1

PA(Ad(s)1 ,...,d

(s)k

) (42)

The following lemma is the central part of the proof.

Lemma 19 Probability of the event that Procedure A fails in step s and vertices v1, . . . , vk are the only

unfinished vertices; i.e. d(s)i 6= 0 i = 1, · · · , k is at most

(1 + o(1))dk(k−1)max

∏ki=1 d

d(s)i

i

m(k2)(2m)2m−2s

(2m− 2s

d(s)1 , . . . , d

(s)k

)

26

Page 27: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

Proof By our notation the above event is denoted by Ad(s)1 ,...,d

(s)k

. Note that the above discussion shows

the graph GMs should have a clique of size k on v1, . . . , vk. Therefore number of such graphs should be less

than |L(d(s)k )| where d

(s)k =(d1−d(s)

1 − (k−1), . . . , dk−d(s)k − (k−1), dk+1, . . . , dn). Thus PA(A

d(s)1 ,...,d

(s)k

) is

at most |L(d(s)k )| PA(GMs). On the other hand we can use Remark 1 to derive an upper bound for |L(d

(s)k )|

because m−s and k are small relative to m and the following can be easily shown dmax = O([s−(k2

)]1/4−τ ).

The result of these gives

PA(Ad(s)1 ,...,d

(s)k

) ≤

(2s− k(k − 1))! exp

[

−λ(d(s)k ) − λ2(d

(s)k ) + o(1)

]

[s−(k2

)]! 2s−(k

2)∏ni=1(d

(s)i )!

PA(GMs)

The next step is to bound PA(GMs). We can use the same methodology as in the beginning of Section 4to derive

PA(GMs) =

∏ni=1 di!

∏ki=1

[

d(s)i

]

!

Ns∈S(Ms)

PA(Ns)

= s! exp

(

−∑

i∼Gs jdidj

4m+ o(1)

)s−1∏

r=0

1(2m−2r

2

)− ψr(GMs)

= s! exp

(m

sλ(d) +

m2

s2λ2(d) + o(1)

) s−1∏

r=0

1(2m−2r

2

)

Now using the following simple algebraic approximation

m

sλ(d) +

m2

s2λ2(d) − λ(d

(s)k ) − λ2(d

(s)k ) = O

(

λ(d)[

λ(d) − λ(d(s)k )])

= O(d4max

m2) = o(1)

the following is true

PA(Ad(s)1 ,...,d

(s)k

) ≤ eo(1)[2s− k(k − 1)]! (2m− 2s)! s! 2(k

2)∏ki=1 di!

[s−(k2

)]! (2m)!

∏ki=1

[(d

(s)i )!(di − k − d

(s)i + 1)!

]

≤ eo(1)∏ki=1 d

d(s)i +k−1i

∏2mℓ=2s+1 ℓ

∏(k2)j=1(2s− 2j + 1)

(2m− 2s

d(s)1 , . . . , d

(s)k

)

(43)

Next usingm−s = O(d2max) and k = O(dmax) we can show

∏(k2)j=1(2s−2j+1) ≥ m(k

2) and (1/m2m−2s)∏2mℓ=2s+1 ℓ ≥

e−O(d4max/m). These two added to equation (43) finish proof of Lemma 19.

Now we are ready to prove the main result of this section.

of Lemma 2 First we show that the event of failure has probability of o(1) for the case of only oneunfinished vertex; i.e. k = 1. Lemma 19 for k = 1 simplifies to PA(A

d(s)1

) = O((Dm )2m−2s

)therefore

summing over all possibilities of k = 1 gives

d2max+1∑

2m−2s=2

n∑

i=1

PA(Ad(s)i

) = O

d2max+1∑

2m−2s=2

d2m−2s−1max

m2m−2s−1

= O(dmax

m) = o(1)

For k > 1 we use Lemma 19 differently. Using dk(k−1)max /m(k

2) ≤ d2max/m and equation (42) we have

P(fail) ≤ o(1) +eo(1)d2

max

m

d2max+1∑

2m−2s=2

(a)︷ ︸︸ ︷

max(dmax,2m−2s)∑

k=2

n∑

i1,...,ik=1

k∏

i=1

dd(s)ii

(2m− 2s

d(s)1 , . . . , d

(s)k

)

(2m)2m−2s

27

Page 28: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

Now note that the double sum (a) is at most (d1 + . . .+dn)2m−2s = (2m)2m−2s since

∑ki=1 d

(s)i = 2m−2s.

Therefore

P(fail) ≤ o(1) + eo(1)d2max

m

d2max+1∑

2m−2s=2

1 = O(d4max

m) = o(1).

7 Running Time of Procedure A

In this section we prove Lemma 3.

Proof Note that for regular graphs the quantities (1 − didj/4m) are fixed for all pairs (vi, vj). Thereforestep (2) of algorithm A is equivalent to (ignoring the random variable P for now):

(2a) Choose (with replacement) vertex vi ∈ V and then vertex vj ∈ V with probabilities proportion to

di, dj respectively. Accept the pair (vi, vj) if i 6= j and (vi, vj) /∈ E. Add (vi, vj) to E and reduce

each of di, dj by 1. Otherwise reject the pair (vi, vj) and repeat step (2a).

Steger-Wormald [45] have used the above implementation and showed the running time of Procedure A forregular graphs is O(nd2)=O(mdmax) per trial.

Now for general graphs we use the following modified version:

(2b) Choose (with replacement) vertex vi ∈ V and then vertex vj ∈ V with probabilities proportion to

di, dj respectively. Toss a coin which comes head with probability 1 − didj/4m. Accept the pair

(vi, vj) if coin shows head, i 6= j and (vi, vj) /∈ E. Add (vi, vj) to E and reduce each of di, dj by 1.Otherwise reject the pair (vi, vj) and repeat step (2b).

It is not hard to see that steps (2b) and (2) choose any suitable pair (i, j) with equal probability. This is

because in each trial of (2b) probability of choosing a suitable pair (vi, vj) is proportion to didj(1−didj/4m).Moreover probability that one trial of (2b) does not produce a pair is fixed for all pairs (vi, vj).

Since dmax = O(m1/4−τ ) we have 1− didj/4m > 1/2. Thus expected running time of (2b) is at most twicethe expected running time of (2a). The rest of the analysis is just repetition of Steger-Wormald’s argumentin page 19 of [45] for regular graphs. Their argument only uses the fact that all degrees are at most dmax

which can be easily generalized to general degrees. We have included this generalization after the proof.

Before finalizing the proof we still need to explain how pij is calculated for any suitable pair (i, j) that ischosen in step r. This should be done in order to update random variable P correctly. Note that usingcalculations of section 5.1:

pij =(1 − didj/4m)d

(r)i d

(r)j

(2m−2r

2

)− ∆r − Λ2

r,1+Λr,2

8m +Λr,3

4m

.

therefore if we know ∆r and each Λr,i at step r of the algorithm then calculation of pij will be easy. Atthe beginning of the Procedure A we have

∆0 =∑

u

(du2

)

which can be calculated with O(n) operations. And at each step it can be updated via O(dmax) operations.This is because by choosing a pair (i, j) at step r:

∆r+1 − ∆r = d(r)i d

(r)j −

u∼Gr i

d(r)u +

v∼Gr j

d(r)v

28

Page 29: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

and each summation has at most dmax elements. We will explain a data structure below that shows howexactly every summation can be calculated with O(dmax) operations. Similar argument shows that eachΛr,i : r = 1, 2, 3 can be calculated using O(n) operations at step 0 and can be updated with O(dmax)operations at any step. Thus the expected running time of the new implementation of Procedure A isO(mdmax) per trial for general degree sequences. Now using Lemma 2 the expected running time of theProcedure A is of O(mdmax).

Generalization of Steger-Wormald’s Analysis of Running Time. Steger-Wormald (SW) imple-mentation is in three phases and uses the configuration model.

First phase is to have all mini-vertices in an array L where all matched mini-vertices are kept in the front.It is also assumed that members of each pair of matched mini-vertices will be two consecutive elements ofL. There is another array I that keeps location of each mini-vertex inside array L. Then two uniformly atrandom selected elements of L can be checked for suitability in time O(dmax) using I.2 We can also updateΨr using I via O(dmax) operations. Repeat the above till a suitable pair is found then update L and I.

Phase 1 stops when number of remaining mini-vertices falls bellow 2d2max. Hence using Corollary 3.1 in

[45], throughout phase 1 number of suitable pairs is more than half of total number of available pairs.Therefore expected number of repetitions in the above process is at most 2. This means expected runningtime of phase 1 is O(mdmax).

Phase 2 is when number of available mini-vertices is less than 2d2max and number of available vertices is at

least 2dmax. In this phase instead of choosing mini-vertices, choose a pair of vertices of G (two random setWi,Wj in configuration model) from the set of vertices that are not fully matched. Repeat the above tilli, j is not already an edge in G. Again the expected number of repetitions is at most 2. Now randomlychoose one mini-vertex in each selected Wi. If both of the mini-vertices are not matched yet add the edge,otherwise pick another two mini-vertices. Expected number of repetitions here is at most O(d2

max) andhence expected running time of phase 2 is at most O(d4

max).

Phase 3 is when number of available vertices (Wi’s) is less than 2dmax. We can construct a graph H , intime O(d2

max), that indicates the set of all possible connections. Now choose an edge (i, j) of H uniformly

at random and accept it with probability didj/d2max. Again expected number of repetitions will be at most

O(d2max). Update H in constant time and repeat the above till H is empty. Therefore expected running

time of phase 3 is also O(d4max).

Hence the total running time for dmax = O(m1/4−τ ) will be O(mdmax).

8 Bounding the Variance of SIS Estimator

In this section we will prove two variance bounds from Section 4. We will borrow some notations andresults form Section 5.

8.1 Proof of Equation (3)

It is easy to see that equation (3) is equivalent to EA(N2)/EA(N)2 ≤ 1 + o(1).

EA(N2) =∑

G

M

(1

m! PA(M)

)2

PA(M) =∑

G

M

1

(m!)2 PA(M)

On the other hand analysis of Theorem 1 gives us the estimate

|L(d)| =

∏m−1r=0 (1 + o(1))

[(2m−2r

2

)− ψr

]

m!∏ni=1 di!

.

2Note that in our modification the pair is accepted with probability 1− didj/4m depending to which Wi, Wj they belong.

29

Page 30: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

Therefore:

EA(N2)

EA(N)2=

G

M1

(m!)2 PA(M)

|L(d)|2

=

G

M∏m−1r=0

[

(2m−2r2 )−Ψr(M)

(2m−2r2 )−ψr

]

m!|L(d)|

=

G E(g(N ))

|L(d)| (44)

where g(N ) =∏m−1r=0

(2m−2r2 )−Ψr(M)

(2m−2r2 )−ψr

and E is with respect to uniform distribution on set of allm! orderings,

S(M). We will show that for all graphs G ∈ L(d) the following holds:

E(g(N )) < 1 + o(1) (45)

Note that equations (44, 45) finish the proof. Thus we only need to prove (45).

Proof of Equation (45). Before starting the proof it is important to see that g(N ) = f(N )−1 and theaim of Section 5 was to show E(f(N )) = 1 + o(1). In this section we show that concentration results ofsection 5 are strong enough to bound the variance of g(N ) as well.

Recall definitions for variables λi and T (λi) from Section 5. Here we will consider a different partitioningof the set S(M). Define subsets F0 ⊆ F1 ⊆ . . . ⊆ FL ⊆ S(M) as follows:

Fi = N ∈ S(M) | ψr − Ψ(Nr) < Tr(λi) : ∀ 0 ≤ r ≤ m− ωλi/2

and F∞ = S(M) \ ∪Li=0Fi. The following two lemmas are exact analogous to Lemmas 10, 13.

Lemma 20 For all 1 ≤ i ≤ L

(a) Pu(Fi \ Fi−1) ≤ e−Ω(λi)

(b) g(N ) ≤ eo(λi) : ∀N ∈ Fi \ Fi−1.

Lemma 21 For all N ∈ F0, g(N ) ≤ 1 + o(1)

Proof of these Lemmas is exactly similar to proofs for Lemmas 10 and 13. We only need the followingextra piece

ωλ∑

2m−2r=2

g(N ) ≤ 2ψr

(2m−2r)2

2

= O(ωλd2

max

m).

Then for Lemma 20 we useωλd2max

m = o(λ) and for Lemma 21 we useωλ0d

2max

m = o(1). Combination of thesetwo lemmas gives E(g(N )) < 1 + o(1).

8.2 Proof of Equation (4)

Same as before we will use lemmas from Section 5. But the main technical point in this section is a newresult which exploits combinatorial structure to obtain a stronger bound for controlling the variance.

Equation (4) is equivalent toEB(P 2)

EB(P )2< 1 + o(1).

30

Page 31: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

For that we start with a bit of algebraic calculations

EB(P 2)

EB(P )2=m!

M PA(M)2

PA(G)2=

E(f(N )2)

E(f(N ))2

Therefore all we need to show is E(f(N )2) = 1 + o(1).

Consider exactly the same partitioning of the set S(M) as in Section 5. It is straightforward to see thatLemmas 10, 11, 12, 13 give us the following stronger results as before:

E(f(N )21A) = o(1)

E(f(N )21B) = o(1)

E(f(N )21C) ≤ 1 + o(1)

and the only missing part is the following

E(f(N )21S∗(M)\S∗(M)) = o(1) (46)

which we will prove by exploiting combinatorial structure.

Proof of (46) In this section we deal with those orderings N for which the condition

Ψ(Nr) ≤ (1 − τ/4)

(2m− 2r

2

)

(∗)

is violated for some r. If this happens for some r then from Lemma 8(iii) and d4 = o(m)

∆r(N ) ≥ Ψ(Nr) −d2

4m(2m− 2r)2 > Ψ(Nr) − τ/4

(2m− 2r

2

)

> (1 − τ/2)

(2m− 2r

2

)

On the other hand using Lemma 8(i) from Section 5: ∆r(N ) ≤ d2(2m−2r)2 . So for 2m− 2r ≥ d2

1−τ/2 + 1 we

have ∆r(N ) ≤ (1 − τ/2)(2m−2r

2

). Thus condition (∗) is violated only for r very close to m.

Lemma 22 Let nr be the number of available vertices (vi’s with Wi 6= 0) at step r then:

∆r(N ) ≤ (2m− 2r)2

2

[

1 − 2m− 2r

(dmax + 1)2

]

− (m− r) ≤[

1 − 2m− 2r

(dmax + 1)2

](2m− 2r

2

)

Proof We know ∆r =∑

i∼rjd(r)i d

(r)j +

i

(d(r)

2

). In order to bound the first sum, note that each d

(r)i in

the first sum appears at most nr − 1 − d(r)i times (exclude the vertex i). It also appears at most di − d

(r)i

times. By Hardy-Polya-Littlewood inequality such a sum is less than∑

i d2r

min(nr−1,di)−d(r)i

2 . Therefore

∆r ≤∑

i

(

d(r)i

)2 min(nr, di + 1) − d(r)i

2− (m− r)

Now a simple Lagrange multiplier method (using∑

i d(r)i = 2m− 2r and di ≤ dmax) tells us the above sum

is at most nr(2m−2r)2

2n2r

[

min(nr, dmax + 1) − 2m−2rnr

]

− (m− r) therefore

∆r(N ) + (m− r) ≤

(2m−2r)2

2

[

1 − 2m−2r(dmax+1)2

]

if nr < dmax + 1.

(2m−2r)2

2

[

1 − 2m−2r(dmax+1)2

]

Otherwise.

The last inequality comes from the fact that nr ≤ 2m − 2r ≤ 2d2. Therefore it is minimized whennr = dmax + 1.

31

Page 32: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

Now similar to Section 5.7 define Si(M), i = 1, . . . , d2

1−τ/2 +1, be the set of all ordering N for which (∗) fails

for the first time at r = m− i. We will show: E(f(N )21Si) ≤(

1 + o(1))

1mτi and use

∑∞i=1m

−τi = o(1).

Lemma 22 gives us:(

2m− 2r

2

)

− Ψ(Nr) ≥[(

2m− 2r

2

)

− ∆r(N )

]

(1 − d2max

4m)

≥(

2m− 2r

2

)2m− 2r

(dmax + 1)2(1 − d2

max

4m)

≥(

2m− 2r

2

)m− r

d2max

Note also that for m− r < dmax we may bound(2m−2r

2

)− ∆r(N ) from below by m− r since there are at

least m− r edges left. Therefore(2m−2r

2

)− ψr

(2m−2r

2

)− Ψ(Nr)

d2max

m−r < dmax if m− r ≥ dmax.

2(m− r) < 2dmax Otherwise.

therefore,m−1∏

r=m−i

(2m−2r

2

)− ψr

(2m−2r

2

)− Ψ(Nr)

≤ 2min(dmax,i)dimax

From here we will closely follow the steps taken in Section 5.7. Since i is the first place that (∗) is violated:

m−i−1∏

r=0

(2m−2r

2

)− Ψ(Nr)

(2m−2r

2

)− Ψ(Nr)

≤ exp

[5

τ

m−1∑

r=0

max(Ψ(Nr) − Ψ(Nr), 0)

(2m− 2r)2

]

so,

f(N )1Si = 1Si

m−1∏

r=0

(2m−2r

2

)− Ψ(Nr)

(2m−2r

2

)− Ψ(Nr)

≤ 2min(dmax,i)dimax1Si exp

[5

τ

m−1∑

r=0

max(Ψ(Nr) − Ψ(Nr), 0)

(2m− 2r)2

]

Now using Holder’s inequality:

E(f(N )21Si)

≤ 22min(dmax,i)d2imaxE

(

1Si exp

[10

τ

m−i−1∑

r=0

max(Ψ(Nr) − Ψ(Nr), 0)

(2m− 2r)2

])

≤ 2min(dmax,i)d2imaxE(1Si)

1−τ/2E

(

1Si exp

[20

τ

m−i−1∑

r=0

max(Ψ(Nr) − Ψ(Nr), 0)

(2m− 2r)2

])τ/2

.

Again by Corollary 3 the second term in the above product is 1 + o(1) and we only need to show:

d2imaxP(Si)

1−τ/2 ≤(

1 + o(1)) 1

mτi.

Now using the bound given by equation (41) for P(Si) we have:

2min(dmax,i)d2imaxP(Si)

1−τ/2 ≤(1 + o(1)

)4i

(22+2min(dmax,i)/id4−4τ

m1−2τ

)i

≤(1 + o(1)

)4i(6m−3τ+4τ2

)i

≤(1 + o(1)

)m−τi

32

Page 33: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

9 Generalized Chernoff Bound: Proof of Lemmas 6, 7

Proof of Lemma 6. Note that in the Gp model the residual degree of a vertex u, du, is sum of dindependent Bernoulli random variables with mean q. Two generalizations of the Chernoff inequality(Theorems A.1.11, A.1.13 in page 267 of [3]) state that for a > 0 and X1, . . . , Xd i.i.d. Bernoulli(q) randomvariables:

P(X1 + · · · +Xd − qd ≥ a) < e− a2

2qd + a3

2(qd)2 , P(X1 + · · · +Xd − qd < −a) < e−a2

2qd

.

Applying these two for a =√

12qd logn Lemma 6 directly follows.

Proof of Lemma 7. For any vertex u letNG(u) ⊂ V (G) denotes neighbors of u inG. Set AG(u), BG(u), CG(u) ⊂E(G) where AG(u) is the edges that are connected to u, BG(u) is those edges with both endpoints in NG(u)and CG(u) consists of the edges with exactly one endpoint in NG(u). For any edge e of G let te = 1e/∈Gp.Then we can write

u′∼Gpu

(du′ − (d− 1)q

)

=∑

u′∈NGp(u)

e∈AG(u′)\AG(u)

(te − q)

=∑

u′∈NG(u)

e∈AG(u′)\AG(u)

(te − q) −∑

u′∈NG(u)\NGp (u)

e∈AG(u′)\AG(u)

(te − q)

=∑

e∈CG(u)

(te − q)

︸ ︷︷ ︸

(i)

+2∑

e∈BG(u)

(te − q)

︸ ︷︷ ︸

(ii)

−∑

u′∈NG(u)\NG(u′)

(d′u − 1 − q(d− 1)

)

︸ ︷︷ ︸

(iii)

each of (i) and (ii) are sum of O(d2) i.i.d. Bernoulli(q) random variables minus their expectations and

similar to Lemma 6 can be shown to be less than O(√

12qd2 logn) with probability at least 1 − o(1/m4).For (iii) we can say

u′∈NG(u)\NG(u′)

(d′u − 1 − q(d− 1)

)≤ du max

u′∈NG(u)\NG(u′)(|du′ − 1 − q(d− 1)|)

now using Lemma 6 twice we can say (iii) is of O(

[dq +√

12qd logn ]√

12qd logn)

with probability atleast 1 − o(1/m4). These finish proof of Lemma 7.

10 Acknowledgement

We would like to thank Joe Blitzstein, Persi Diaconis, Adam Guetz, Milena Mihail, Alistair Sinclair, EricVigoda and Ying Wang for insightful discussions and useful comments on earlier version of this paper.

References

[1] W. Aiello, F. Chung and L. Lu, Random evolution in massive graphs, (2001), FOCS.

[2] B. Aiello, F. Chung and L. Lu, A random graph model for massive graphs, (2000) STOC.

[3] N. Alon and J. Spencer, The Probabilistic Method, (1992), Wiley, NY.

33

Page 34: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

[4] D. Alderson, J. Doyle, and W. Willinger, Toward and Optimization-Driven Framework for Designingand Generating Realistic Internet Topologies, (2002) HotNets.

[5] A. Amraoui, A. Montanari and R. Urbanke, How to Find Good Finite-Length Codes: From Art TowardsScience, (2006) Preprint, arxiv.org/pdf/cs.IT/0607064.

[6] F. Bassetti, P. Diaconis, Examples Comparing Importance Sampling and the Metropolis Algorithm,(2005).

[7] M. Bayati, A. Montanari, B. Prabhakar and A. Saberi, (2006), Work in progress.

[8] M. Bayati, J. H. Kim and A. Saberi, A Sequential Algorithm for Generating Random Graphs, (2007),Extended Version, Available at: http://arxiv.org/abs/cs/0702124.

[9] E.A. Bender and E.R. Canfield, The asymptotic number of labeled graphs with given degree sequence,J. Combinatorial Theory Ser. (1978), A 24, 3, 296-307.

[10] I. Bezakova, N. Bhatnagar and E. Vigoda Sampling Binary Contingency tables with a Greedy Start,(2006), SODA.

[11] I. Bezakova, A. Sinclair, D. Stefankovic and E. Vigoda Negative Examples for Sequential ImportanceSampling of Binary Contingency Tables, preprint (2006).

[12] J. Blanchet, Efficient Importance Sampling for Counting, preprint (2006).

[13] J. Blitzstein and P. Diaconis, A sequential importance sampling algorithm for generating randomgraphs with prescribed degrees, (2005), Submitted.

[14] B. Bollobas, A probabilistic proof of an asymptotoic forumula for the number of labelled regulargraphs, (1980), European J. Combin. 1, 4, 311-316.

[15] B. Bollobas, Random Graphs, (2001), Cambrdige University Press.

[16] T. Britton, M. Deijfen and A. Martin-Lof ,Generating simple random graphs with prescribed degreedistribution, (2005), Preprint.

[17] T. Bu and D. Towsley, On Distinguishing between Internet Power Law Topology Generator, (2002)INFOCOM.

[18] Y. Chen, P. Diaconis, S. Holmes and J.S. Liu, Sequential Monte Carlo methods for statistical analysisof tables, (2005), Journal of the American Statistical Association 100, 109-120.

[19] C. Cooper, M. Dyer and C. Greenhill, Sampling regular graphs and peer-to-peer network, (2005),Combinatorics, Probability and Computing to appear.

[20] F. Chung and L. Lu, Conneted components in random graphs with given expected degree sequence,(2002), Ann. Comb. 6, 2, 125-145.

[21] P. Diaconis and A. Gangolli, Rectangular arrays with fixed margins, (1995), Discrete probability andalgorithms (Minneapolis, MN, 1993) . IMA Vol. Math. Appl., Vol 72. Springer, New York, 15-41.

[22] R. Durret, Random Graph Dynamics, (2006), Cambridge University Press.

[23] M. Faloutsos, P. Faloutsos and C. Faloutsos, On Power-law Relationships of the Internet Topology,(1999) SIGCOM.

[24] C. Gkantsidis, M. Mihail and E. Zegura, The Markov Chain Simulation Method for Generating Con-nected Power Law Random Graphs, (2003) Alenex.

[25] M. Jerrum, L. Valiant and V. Vazirani, Random generation of combinatorial structures from a uniformdistribution, (1986), Theoret. Comput. Sci. 43, 169-188. 73, 1, 91-100.

34

Page 35: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

[26] M. Jerrum and A. Sinclair, Approximate counting, uniform generation and rapidly mixing Markovchains, (1989), Inform. and Comput. 82 , no. 1, 93–133.

[27] M. Jerrum and A. Sinclair, Fast uniform generation of regular graphs, (1990), Theoret. Comput. Sci.73, 1, 91-100.

[28] M. Jerrum, A. Sinclair and B. McKay, When is a graphical sequence stable?, (1992) Random graphsVol 2 (Poznan 1989) Wiley-Intersci. Publ. Wiley, New York, 101-115.

[29] M. Jerrum, A. Sinclair and E. Vigoda, A Polynomial-Time Approximation Algorithm for the Perma-nent of a Matrix with Non-Negative Entries, (2004) Journal of the ACM, 51(4):671-697.

[30] R. Kannan, P. Tetali and S. Vempala, Simple Markov chain algorithms for generating bipartite graphsand tournaments, (1992) Random Structures and Algorithms (1999) 14, 293-308.

[31] J.H.Kim , On Brooks’ Theorem for Sparse Graphs, Combi. Prob. & Comp., (1995) 4, 97-132.

[32] J. H. Kim and V. H. Vu, Concentration of multivariate polynomials and its applications, (2000)Combinatorica 20, no 3, 417-434.

[33] J. H. Kim and V. H. Vu, Generating Random Regular Graphs, , STOC 2003 213-222.

[34] J.H.Kim and V. Vu, Sandwiching random graphs, Advances in Mathematics (2004) 188, 444-469.

[35] D. Knuth, Mathematics and computer science: coping with finiteness, (1976) Science 194(4271):1235-1242.

[36] A. Medina, I. Matta and J. Byers, On the origin of power laws in Internet topologies, ACM ComputerCommunication Review, (2000), vol. 30, no. 2, pp. 18-28.

[37] B. McKay , Asymptotics for symmetric 0-1 matrices with prescribed row sums, (1985), Ars Combina-torica 19A:15-25.

[38] B. McKay and N. C. Wormald, Uniform generation of random regular graphs of moderate degree,(1990b), J. Algorithms 11, 1, 52-67.

[39] B. McKay and N. C. Wormald, Asymptotic enumeration by degree sequence of graphs with degreeso(n1/2), (1991), Combinatorica 11, 4, 369-382.

[40] R. Milo, N. Kashtan, S. Itzkovitz, M. Newman and U. Alon, On the uniform genera-tion of random graphs with prescribed degree sequences, (2004), http://arxiv.org/PS cache/cond-mat/pdf/0312/0312028.pdf

[41] R. Milo, S. ShenOrr, S. Itzkovitz, N. Kashtan, D. Chklovskii and U. Alon, Network motifs: Simplebuilding blocks of complex networks, (2002), Science 298, 824-827

[42] M. Molloy and B. Reed, A critical point for random graphs with a given degree sequence, (1995),Random Structures and Algorithms 6, 2-3, 161-179.

[43] M. Molloy and B. Reed, The size of the ginat component of a random graph with a given degreesequence, (1998), Combin. robab. Comput. 7, 3, 295-305.

[44] A. Sinclair, Personal communication, (2006).

[45] A. Steger and N.C. Wormald, Generating random regular graphs quickly, (English Summary) Randomgraphs and combinatorial structures (Oberwolfach, 1997), Combin. Probab. Comput. 8, no. 4, 377-396.

[46] H.Tangmunarunkit, R.Govindan, S.Jamin, S.Shenker, and W.Willinger, Network Topology Genera-tors: Degree based vs. Structural, (2002), ACM SIGCOM.

35

Page 36: A Sequential Algorithm for Generating Random Graphssaberi/randgraphext.pdf · 2007-09-08 · through simulations and our work together with [12] are the first results that analyze

[47] N. C. Wormald, Models of random regular graphs, (1999), Surveys in combinatorics (Canterbury)London Math. Soc. Lecture Notes Ser., Vol 265. Cambridge Univ. Press, Cambridge, 239-298.

[48] V. H. Vu, Concentration of non-Lipschitz functions and applications, Probabilistic methods in combi-natorial optimization, Random Structures Algorithms 20 (2002), no. 3, 267-316.

36