Complex Systems · 7/11 · Series index · Notation

Suppose half the people in a town have one connection each and the other half have three. Pair the connections at random. The average person has two contacts. Yet if you follow a randomly chosen connection, you have a three-in-four chance of arriving at someone with three contacts. That bias determines whether a message sent from one person can reach most of the town. In a large town like this, about 81% of the people will belong to a single connected group. We can find that fraction without drawing the network.

Who is at the other end of an edge?

Take an undirected network with nn vertices and MM edges. Choose a vertex uniformly. Its degree, the number of incident edges, is a random variable KK with distribution pk=Pr⁡(K=k)p_k=\Pr(K=k) for nonnegative integers kk. Write c=E[K]=2M/nc=\mathbb E[K]=2M/n for the mean degree and m2=E[K2]m_2=\mathbb E[K^2] for its second moment; E\mathbb E means expectation. Assume c>0c>0 so there is an edge to follow.

Now choose an edge uniformly and point it in either direction with equal probability. Its destination is a uniformly chosen edge end. There are npknp_k vertices of degree kk, and they supply knpkknp_k of the 2M2M ends. If DD is the destination's degree, then

Pr⁡(D=k)=kpkc,E[D]=m2c,E[D]−c=Var⁡(K)c.\Pr(D=k)=\frac{kp_k}{c},\qquad \mathbb E[D]=\frac{m_2}{c},\qquad \mathbb E[D]-c=\frac{\operatorname{Var}(K)}{c}.

Here Var⁡(K)=m2−c2\operatorname{Var}(K)=m_2-c^2 is the degree variance. This is the friendship paradox: someone with many friends appears on many friend lists. The endpoint average is strictly larger than the ordinary mean unless all degrees agree. It says nothing about whether each person's friends have more connections. It also matters how you collect the lists. In a five-person star, the central person knows the other four, who know only the center. The average degree is 8/58/5; a random edge end sees mean degree 5/25/2. If you first choose a person uniformly and then one of their friends uniformly, the answer is instead (1+4⋅4)/5=17/5(1+4\cdot4)/5=17/5.

The edge you arrived on is already used. The excess degree Q=D−1Q=D-1 counts the edges still available. Let qjq_j be the probability that there are jj of them, and BB their mean, the branching factor:

qj=(j+1)pj+1c,B=∑j≥0jqj=∑k≥1k(k−1)pkc=m2−cc.q_j=\frac{(j+1)p_{j+1}}{c},\qquad B=\sum_{j\ge0}j q_j =\frac{\sum_{k\ge1}k(k-1)p_k}{c} =\frac{m_2-c}{c}.

For our town, p1=p3=1/2p_1=p_3=1/2, so c=2c=2 and m2=5m_2=5. At an edge end, a leaf has probability 1/41/4 and a degree-three vertex has probability 3/43/4. There are zero or two ways forward, giving B=3/2B=3/2. A heavy tail can make this bias much stronger: if pkp_k is proportional to k−γk^{-\gamma} at large kk, the second moment sums terms proportional to k2−γk^{2-\gamma}. For 2<γ≤32<\gamma\le3 the limiting mean can be finite while this second moment diverges. A finite graph always cuts off that tail.

When a network looks like a tree

The configuration model gives each vertex the prescribed number of half-edges, then pairs the half-edges uniformly at random. In the large, sparse, uncorrelated model, a short exploration from a typical starting vertex, or root, resembles a tree. Each unused edge initially leads to a fresh vertex. This is an approximation about a neighborhood of fixed radius; the whole graph can still contain many cycles.

A root with three neighbors. One neighbor is a leaf; the other two each lead to two new vertices.

The orange edge is the one used to reach the highlighted vertex. Counting its degree gives three; counting the two green edges gives its excess degree. Across the whole drawing the first shell contains three vertices and the second shell contains four. On a network with triangles, two such branches could meet and the shell would be smaller.

There is a quantitative check on this picture. Take two neighbors of the root with aa and bb unused half-edges respectively. There are abab ways to pair one half-edge from each neighbor, out of roughly 2M2M possible partners per half-edge. When these probabilities are small, the chance that the pair closes a triangle is about ab/(2M)ab/(2M). The neighbors' excess degrees are approximately independent and each has mean BB. Averaging gives the expected clustering of this random neighborhood:

C ≃ B22M=(m2−c)2nc3,C\ \simeq\ \frac{B^2}{2M} =\frac{(m_2-c)^2}{n c^3},

where CC is the probability that two neighbors are adjacent. At fixed cc and finite m2m_2, this tends to zero. More generally, among a fixed number of exposed vertices with bounded degrees, the chance of any extra edge closing a loop is of order 1/n1/n. A heavy tail, very large hubs or imposed triangles can invalidate this estimate; a numerical prediction C>1C>1 means the approximation has broken down. In an Erdős–Rényi graph each pair is linked independently with probability pp, so the triangle-closing probability is exactly pp.

Write cdc_d for the expected number of vertices at distance exactly dd from a random root. The first shell has mean size c1=cc_1=c. Given a root of degree kk, the kk neighbors contribute an average of kBkB fresh vertices to the next shell. Average over kk, then repeat:

c2=cB=m2−c,cd≃cBd−1(d≥1).c_2=cB=m_2-c,\qquad c_d\simeq c B^{d-1}\quad(d\ge1).

Thus B=c2/c1B=c_2/c_1 can also be estimated from the relative sizes of the first two shells. For B>1B>1, exploring up to distance ℓ\ell gives about 1+c(Bℓ−1)/(B−1)1+c(B^\ell-1)/(B-1) distinct vertices while overlaps are rare. Matching this to a component of order nn suggests a typical distance of order ln⁡n/ln⁡B\ln n/\ln B. It is a scale estimate for random mixing, not an exact diameter; on a square grid the branches meet almost immediately.

A function for counting branches

A branching factor gives the mean number of ways forward. Sometimes we need the chance that there are none, or the chance that there are exactly four. A probability generating function (PGF) keeps all those probabilities together. For a nonnegative integer count XX, define

GX(z)=E[zX]=∑k≥0Pr⁡(X=k)zk.G_X(z)=\mathbb E[z^X]=\sum_{k\ge0}\Pr(X=k)z^k .

Here zz is a bookkeeping variable. The power records the count; its coefficient records the probability. The notation [zk]GX(z)[z^k]G_X(z) means the coefficient of zkz^k. Equivalently it is GX(k)(0)/k!G_X^{(k)}(0)/k!, where the superscript denotes the kkth derivative: at zero, every other power drops out. At z=1z=1, by contrast, every probability contributes. Provided the relevant moments exist,

GX(1)=1,GX′(1)=E[X],GX′′(1)=E[X(X−1)],Var⁡(X)=GX′′(1)+GX′(1)−GX′(1)2.\begin{aligned} G_X(1)&=1,& G_X'(1)&=\mathbb E[X],\\ G_X''(1)&=\mathbb E[X(X-1)],& \operatorname{Var}(X)&=G_X''(1)+G_X'(1)-G_X'(1)^2. \end{aligned}

Primes are derivatives with respect to the function's input. The second derivative gives a factorial moment because differentiating zkz^k twice brings down k(k−1)k(k-1). For an ordinary moment of integer order r≥1r\ge1, apply the operator z d/dzz\,\mathrm d/\mathrm dz repeatedly: it sends zkz^k to kzkkz^k without changing the power. Applying it rr times and setting z=1z=1 gives E[Xr]\mathbb E[X^r].

Use g0g_0 for the degree PGF of a random vertex and g1g_1 for the excess-degree PGF at an edge end. Their connection is particularly useful:

g0(z)=∑k≥0pkzk,g1(z)=∑j≥0qjzj=g0′(z)g0′(1),g1′(1)=B.g_0(z)=\sum_{k\ge0}p_kz^k,\qquad g_1(z)=\sum_{j\ge0}q_jz^j =\frac{g_0'(z)}{g_0'(1)},\qquad g_1'(1)=B .

Differentiating g0g_0 does both jobs at once: it multiplies the coefficient by kk to account for the sampling bias, and it reduces the power by one to remove the incoming edge. The denominator g0′(1)=cg_0'(1)=c restores the total probability to one. If every vertex has degree rr, for example, the functions are zrz^r and zr−1z^{r-1}. For an Erdős–Rényi graph, g0(z)=(1−p+pz)n−1g_0(z)=(1-p+pz)^{n-1} because each of the other n−1n-1 vertices contributes an independent edge indicator. In the sparse limit with c=(n−1)pc=(n-1)p fixed, this becomes the Poisson PGF ec(z−1)e^{c(z-1)}. Its normalized derivative equals itself, so B=cB=c in this particular model.

Why use functions to count neighbors? For independent counts X,YX,Y, the identity zX+Y=zXzYz^{X+Y}=z^Xz^Y gives GX+Y=GXGYG_{X+Y}=G_XG_Y. Multiplication of the series sums the probabilities of all pairs of counts with the required total: it performs a convolution. If the number of independent contributions is itself random, we compose functions. Given kk contributions, each with PGF HH, the sum has PGF H(z)kH(z)^k. If the count of contributions is independent of their sizes and has PGF g0g_0, averaging over kk gives g0(H(z))g_0(H(z)).

For the number N2N_2 of second neighbors, the outer function counts neighbors of the root. The inner function counts the fresh vertices each neighbor contributes:

GN2(z)=g0(g1(z)),E[N2]=g0′(1)g1′(1)=cB,Pr⁡(N2=0)=g0(q0).G_{N_2}(z)=g_0(g_1(z)),\qquad \mathbb E[N_2]=g_0'(1)g_1'(1)=cB,\qquad \Pr(N_2=0)=g_0(q_0).

The last expression includes isolated roots as well as nonisolated roots whose neighbors are all leaves. Reversing the two functions would amount to starting from a different kind of vertex.

The fraction of the network one vertex can reach

A giant component contains a nonzero fraction SS of all vertices as nn grows. Every finite graph has a largest component, but its fraction can shrink to zero. In a homogeneous random network there is normally at most one giant: two extensive pieces would have many chances to meet. For instance, take two fixed disjoint groups occupying fractions aa and bb of the vertices in a sparse Erdős–Rényi graph. The probability that none of their abn2abn^2 potential cross-links exists is approximately (1−c/n)abn2(1-c/n)^{abn^2}, exponentially small in nn. This explains the role of random mixing; networks with deliberately isolated populations need not behave this way.

Let uu be the probability that, after following a random edge and excluding that edge, the forward branch eventually dies out. If there are jj outgoing branches, all jj must fail, an event of probability uju^j under the tree approximation. This gives one equation at an edge arrival and a different one at the root:

u=g1(u),S=1−g0(u).u=g_1(u),\qquad S=1-g_0(u).

The first equation always has the solution u=1u=1. To select the physical solution, begin with zero and repeatedly apply g1g_1: the successive values count extinction within successively more generations. They increase to the smallest fixed point in [0,1][0,1]. Starting at one would return one even when a giant exists.

The slope at one reveals the threshold. The nonnegative coefficients make g1g_1 increasing and convex. For B=g1′(1)>1B=g_1'(1)>1, its curve lies below the diagonal just to the left of one, but at zero g1(0)=q0≥0g_1(0)=q_0\ge0; there must be a smaller intersection. For B<1B<1, convexity rules one out. Thus the usual giant-component criterion for an uncorrelated, locally tree-like random network is

B>1⟺∑kk(k−2)pk>0.B>1\quad\Longleftrightarrow\quad \sum_k k(k-2)p_k>0.

At B=1B=1 the ordinary branching process is critical. The deterministic exception q1=1q_1=1 needs separate treatment: every arrival has exactly one way forward. The usual extinction argument for a fluctuating critical process does not apply to a graph made entirely of degree-two cycles.

Back in the town, g0(z)=(z+z3)/2g_0(z)=(z+z^3)/2 and g1(z)=(1+3z2)/4g_1(z)=(1+3z^2)/4. The extinction equation factors as (3u−1)(u−1)=0(3u-1)(u-1)=0. Its smaller root, u=1/3u=1/3, gives S=1−(1/3+1/27)/2=22/27S=1-(1/3+1/27)/2=22/27. A forward branch dies with probability 1/31/3, but a random person misses the giant with probability only 5/275/27: at the root all directions must fail.

For the Poisson case, the corresponding equations reduce to u=ec(u−1)u=e^{c(u-1)} and S=1−uS=1-u, or S=1−e−cSS=1-e^{-cS}. A positive fraction first appears for c>1c>1, corresponding to a pairwise edge probability of order 1/n1/n. This global threshold is consistent with the giant having an internal mean degree close to two near onset: a connected piece with vv vertices needs at least v−1v-1 edges, while the global mean also counts the many vertices outside it.

What is left outside the giant?

Even above the threshold, a randomly chosen vertex may belong to a small component. Let πs\pi_s be the probability that a uniform vertex belongs to a finite component with exactly ss vertices, and let ρs\rho_s be the probability that a forward branch contains exactly ss. Neither is conditioned on being finite. Denote their generating functions by h0(z)=∑s≥1πszsh_0(z)=\sum_{s\ge1}\pi_s z^s and h1(z)=∑s≥1ρszsh_1(z)=\sum_{s\ge1}\rho_s z^s. The gg functions count edges available; the hh functions count vertices reached.

At a root, the component is the root itself plus everything reached through each of its edges. At an arrival, count the vertex just reached, then its outgoing branches. The same composition rule gives

h0(z)=z g0(h1(z)),h1(z)=z g1(h1(z)).h_0(z)=z\,g_0(h_1(z)),\qquad h_1(z)=z\,g_1(h_1(z)).

The factor zz counts the current vertex once. At z=1z=1 these equations reduce to h1(1)=uh_1(1)=u and h0(1)=1−Sh_0(1)=1-S. The missing probability mass belongs to the giant; renormalize only if you want a distribution conditional on being outside it.

For a simple check, suppose p0=p2=1/4p_0=p_2=1/4 and p1=1/2p_1=1/2. Then g0(z)=(1+z)2/4g_0(z)=(1+z)^2/4, g1(z)=(1+z)/2g_1(z)=(1+z)/2, and B=1/2B=1/2. Each forward branch stops or extends one more edge with equal probability. Solving the two equations gives

h1(z)=z2−z,h0(z)=z(2−z)2,ρs=2−s,πs=s2s+1.h_1(z)=\frac{z}{2-z},\qquad h_0(z)=\frac{z}{(2-z)^2},\qquad \rho_s=2^{-s},\qquad \pi_s=\frac{s}{2^{s+1}}.

The branch and the full component have different laws, even though every nonisolated component looks like a chain locally.

To find a mean size it is enough to differentiate. With h1(1)=g1(u)=uh_1(1)=g_1(u)=u, the product and chain rules give

h1′(1)=u+g1′(u)h1′(1)=u1−g1′(u),h0′(1)=g0(u)+g0′(u)h1′(1).\begin{aligned} h_1'(1)&=u+g_1'(u)h_1'(1)=\frac{u}{1-g_1'(u)},\\ h_0'(1)&=g_0(u)+g_0'(u)h_1'(1). \end{aligned}

Away from criticality, if a finite root has positive probability, its conditional mean component size χ\chi is

χ=h0′(1)h0(1)=1+cu2g0(u)[1−g1′(u)].\chi=\frac{h_0'(1)}{h_0(1)} =1+\frac{c u^2}{g_0(u)[1-g_1'(u)]}.

The last step uses g0′(u)=cg1(u)=cug_0'(u)=c g_1(u)=cu at the fixed point. Below threshold u=1u=1 and the expression becomes 1+c/(1−B)1+c/(1-B), also the shell sum 1+c+cB+cB2+⋯1+c+cB+cB^2+\cdots. Above threshold that unconditioned geometric series cannot be used.

There is a direct explanation for why the finite part still has a finite mean. At a root of degree kk, all kk branches must fail for the root to be outside the giant. Bayes' rule therefore changes the degree distribution to pkuk/g0(u)p_ku^k/g_0(u), with mean cf=ug0′(u)/g0(u)c_{\mathrm f}=u g_0'(u)/g_0(u). The subscript f\mathrm f denotes conditioning on finiteness. Given extinction of a forward branch with u>0u>0, its excess-degree law likewise becomes qjuj/uq_j u^j/u, with mean Bf=g1′(u)B_{\mathrm f}=g_1'(u). Its expected size is 1+Bf+Bf2+⋯=1/(1−Bf)1+B_{\mathrm f}+B_{\mathrm f}^2+\cdots=1/(1-B_{\mathrm f}). Hence χ=1+cf/(1−Bf)\chi=1+c_{\mathrm f}/(1-B_{\mathrm f}), exactly the derivative result. If u=0u=0, this branch conditioning is undefined; any finite roots of positive density are isolated.

In the town example, only one tenth of the vertices outside the giant have degree three, although half the entire town did. Substitution gives cf=6/5c_{\mathrm f}=6/5, Bf=1/2B_{\mathrm f}=1/2, and χ=1+(6/5)⋅2=17/5\chi=1+(6/5)\cdot2=17/5. The global branching factor exceeds one; the average number of successors inside a finite branch is only one half.

One person's component, or one component?

To compare a calculation with a graph, let NsN_s be the number of finite components of size ss. There are sNssN_s vertices in those components, so πs=sNs/n\pi_s=sN_s/n for the empirical graph. The mean for a uniform component is ∑ssNs/∑sNs\sum_s sN_s/\sum_s N_s. The mean for a uniform finite vertex is ∑ss2Ns/∑ssNs\sum_s s^2N_s/\sum_s sN_s; this is χ\chi. If you divide the latter numerator by all nn vertices instead, the result is the unconditioned finite contribution h0′(1)h_0'(1). Two components of sizes two and eight illustrate the difference: a component chosen uniformly has mean size five, but a vertex sees mean size (22+82)/10=6.8(2^2+8^2)/10=6.8.

The function h0h_0 also gives the entire size distribution without solving explicitly for h1h_1. Write ww for a coefficient variable. For s=1s=1, π1=p0\pi_1=p_0. For s≥2s\ge2, the Lagrange inversion formula applied to h1=z g1(h1)h_1=z\,g_1(h_1) yields

πs=[zs−1]g0(h1(z))=1s−1[ws−2]g0′(w) g1(w)s−1=cs−1[ws−2]g1(w)s.\begin{aligned} \pi_s &=[z^{s-1}]g_0(h_1(z))\\ &=\frac{1}{s-1}[w^{s-2}]g_0'(w)\,g_1(w)^{s-1}\\ &=\frac{c}{s-1}[w^{s-2}]g_1(w)^s. \end{aligned}

The indices reflect two simple steps. Removing the root's factor zz leaves s−1s-1 powers to count. Differentiating once leaves s−2s-2 and introduces the divisor s−1s-1. To see the inversion step, put F(z)=g0(h1(z))F(z)=g_0(h_1(z)). Then [zs−1]F=[zs−2]F′/(s−1)[z^{s-1}]F=[z^{s-2}]F'/(s-1). Cauchy's coefficient formula picks out [zs−2]F′[z^{s-2}]F' by integrating F′(z)/zs−1F'(z)/z^{s-1} around a small circle about zero and dividing by 2πi2\pi\mathrm i, where i\mathrm i is the imaginary unit. Set w=h1(z)w=h_1(z): the chain rule gives F′(z) dz=g0′(w) dwF'(z)\,\mathrm dz=g_0'(w)\,\mathrm dw, and z=w/g1(w)z=w/g_1(w). The integral now selects [ws−2]g0′(w)g1(w)s−1[w^{s-2}]g_0'(w)g_1(w)^{s-1}. Finally g0′=cg1g_0'=c g_1 gives the extra power. This local change of variable works when q0>0q_0>0; without terminal vertices, a finite tree of size at least two has zero probability in the limiting exploration.

For two vertices the coefficient is simply π2=cq02=p12/c\pi_2=cq_0^2=p_1^2/c: both ends of the only edge must be leaves. For three it is π3=3cq02q1/2\pi_3=3c q_0^2q_1/2. For four, degree two in g1(w)4g_1(w)^4 can arise by taking q2w2q_2w^2 once or q1wq_1w twice, giving π4=c(4q03q2+6q02q12)/3\pi_4=c(4q_0^3q_2+6q_0^2q_1^2)/3. A coefficient is counting ways to distribute the available edges among the vertices.

Why critical clusters have two power-law exponents

For a sparse Erdős–Rényi network, g1(w)s=e−csecswg_1(w)^s=e^{-cs}e^{csw}, so its coefficient of ws−2w^{s-2} is e−cs(cs)s−2/(s−2)!e^{-cs}(cs)^{s-2}/(s-2)!. Inserting it above gives a particularly simple answer, also correct for the isolated vertex s=1s=1:

πs=(cs)s−1e−css!,s=1,2,….\pi_s=\frac{(cs)^{s-1}e^{-cs}}{s!},\qquad s=1,2,\ldots .

This is the mass for a uniform vertex in the sparse large-network limit, not the histogram obtained by counting each component once. When c>1c>1 it sums to 1−S1-S, not one. For large ss, Stirling's approximation s!∼2πs(s/e)ss!\sim\sqrt{2\pi s}(s/e)^s shows exactly where the cutoff lies:

πs∼s−3/2c2π exp⁡[−s(c−1−ln⁡c)].\pi_s\sim \frac{s^{-3/2}}{c\sqrt{2\pi}}\, \exp[-s(c-1-\ln c)].

At c=1c=1 the exponential factor disappears. A random vertex therefore sees a size probability proportional to s−3/2s^{-3/2}, whereas the number of components per original vertex, Ns/n=πs/sN_s/n=\pi_s/s, is proportional to s−5/2s^{-5/2}. These are the same network seen through two sampling rules. Away from the threshold c−1−ln⁡cc-1-\ln c is positive and suppresses large finite pieces. Writing ϵ=c−1\epsilon=c-1, its expansion near threshold starts with ϵ2/2\epsilon^2/2, so the characteristic cutoff grows like 2/ϵ22/\epsilon^2. Close to the transition, a handful of exceptionally large finite components can dominate a measured vertex-weighted mean.

This brings the calculation back to the original town. Following an edge weights a vertex by its degree; choosing a vertex weights a component by its size. In both cases the underlying network is unchanged. What changes is how often a particular piece of it gets counted.


← Working with NetworkX · Series index · Percolation and epidemics →