configuration model
configuration model
Aaron Clauset
Lecture 11 10 October 2013
For some ℓ to be a common neighbor of a pair i and j, both the (i, ℓ) edge and the (j, ℓ) edges
must exist. As with the multi-edge calculation above, the correct calculation must account for the
reduction in the number of available stubs for the (j, ℓ) edge once we condition on the (i, ℓ) edge
existing. Thus, the probability that ℓ is a common neighbor is the product of the probability that
ℓ is a neighbor of i, which is given by Eq. (1), and the probability that ℓ is a neighbor of j, given
that the edge (i, ℓ) exists, which is also given by Eq. (1) except that we must decrement the stub
count on ℓ.
X ki kℓ kj (kℓ − 1)
nij =
2m 2m
ℓ
X
ki kj kℓ (kℓ − 1)
=
2m hkin
ℓ
hk2 i − hki
= pij . (2)
hki
Thus, the probability that i and j have a common neighbor is proportional to the probability that
they themselves are connected (where the constant of proportionality again depends on the first
and second moments of the degree sequence).
1
Network Analysis and Modeling, CSCI 5352 Prof. Aaron Clauset
Lecture 11 10 October 2013
randomly chosen neighbor of a randomly chosen vertex, excluding the edge followed to get there.
This distribution also shows us something slightly counterintuitive about configuration model net-
works.
Let pk be the fraction of vertices in the network with degree k, and suppose that following the edge
brings us to a vertex of degree k. What is the probability that event? To have arrived at a vertex
with degree k, we must have followed an edge attached to one of the n pk vertices of degree k in the
network. Because edges are a random matching conditioned on the vertex’s degrees, the end point
of every edge in the network has the same probability k/2m (in the limit of large m) of connecting
to one of the stubs attached to our vertex.
Although the excess degree distribution is closely related to Eq. (3), there are a few interesting
things this formula implies that are worth describing.
From this expression, we can calculate the average degree of such a neighbor, as hkneighbor i =
2
P
k k p neighbor has k = hk i/hki, which is strictly greater than the mean degree itself hki (do you see
why?). Counterintuitively, this means that your neighbors in the network tend to have a greater
degree than you do. This happens because high-degree vertices have more edges attached to them,
and each edge provides a chance that the random step will choose them.
Returning to the excess degree distribution, note that because we followed an edge to get to our
final destination, its degree must be at least 1, as there are no edges we could follow to arrive a
vertex with degree 0. The excess degree distribution is the probability of the number of other edges
attached to our destination, and thus we substitute k + 1 for k in our expression for the probability
of a degree k. This yields
(k + 1)pk+1
qk = . (4)
hki
2
Network Analysis and Modeling, CSCI 5352 Prof. Aaron Clauset
Lecture 11 10 October 2013
exactly the excess degree distribution, because we chose a random vertex v and followed a randomly
chosen edge.
The probability that i and j are themselves connected is ki kj /2m, and the clustering coefficient is
given by this probability multiplied by the probability that i has excess degree ki and that j has
excess degree kj , and summed over all choices of ki and kj :
∞
∞ X
X ki kj
C= q ki q kj
2m
ki =0 kj =0
"∞ #2
1 X
= qk k
2m
k=0
"∞ #2
1 X
= k(k + 1)pk+1
2mhki2
k=0
"∞ #2
1 X
= k(k − 1)pk
2mhki2
k=0
"∞ ∞
#2
1 X
2
X
= k pk − k pk
2mhki2
k=0 k=0
2 2
1 hk i − hki
= . (5)
n hki3
where we have used the definition of the mth moment of a distribution to reduce the summations.
Like the expression we derived for the expected number of multi-edges, the expected clustering co-
efficient is a vanishing fraction O(1/n) in the limit of large networks, so long as the second moment
of the degree distribution is finite.
3
Network Analysis and Modeling, CSCI 5352 Prof. Aaron Clauset
Lecture 11 10 October 2013
A corollary of the existence of the giant component in this model is the implication that the
diameter of the network grows logarithmically with n, when a giant component exists. As with
G(n, p), the configuration model is locally tree-like (which is consistent with the vanishingly small
clustering coefficient derived above), implying that the number of vertices within a distance ℓ of
some vertex v grows exponentially with ℓ, where the rate of this growth again depends on the first
two moments of the degree distribution (which are themselves related to the number of first- and
second-neighbors of v).
Constructing directed random graphs using the configuration model is also analogous, but with one
small variation. Now, instead of maintaining a single array v containing the names of the stubs,
we must maintain two arrays, vin and vout , each of length m, which contain the in- and out-stubs
respectively. The uniformly random matching we choose is then between these arrays, with the
beginning of an edge chosen from vout and the ending of an edge chosen from vin .
4
Network Analysis and Modeling, CSCI 5352 Prof. Aaron Clauset
Lecture 11 10 October 2013
directly to the empirical values. Each of the mini-experiments below used 1000 instances of the
configuration model, and where multi-edges were collapsed and self-loops discarded.
The degree distribution (shown below as both pdf and ccdf) is very similar, but with a few notable
differences. In particular, there the highest-degree vertices in the model have slightly lower degree
values than observed empirically. This is reflects the fact that both multi-edges and self-loops have
a higher probability of occurring if ki is large, and thus converting the generated network into
a simple network tends to remove edges attached to these high-degree vertices. Otherwise, the
generated degree distribution is very close to the empirical one, as we expect.1
0
0.35 10
Karate club
configuration model
0.3
0.25
0.2
Pr(K≥ k)
Pr(k)
0.15 −1
10
0.1
0.05
0 0 1 2
0 5 10 15 20 10 10 10
degree, k degree, k
1
It is possible to change the configuration model slightly in order to eliminate self-loops and multi-edges, by
flipping a coin for each pair i, j (where i 6= j) with bias exactly ki kj /2m. In this model, the expected degree we
generate is distributed as k̂i ∼ Poisson(ki ), which assumes the specified value in expectation.
5
Network Analysis and Modeling, CSCI 5352 Prof. Aaron Clauset
Lecture 11 10 October 2013
Both the distribution of pairwise geodesic distances and the network’s diameter are accurately
reproduced under the configuration model, indicating that neither of these measures of the network
are particularly interesting as patterns themselves. That is, they are about what we would expect
for a random graph with the same degree distribution. One nice feature of the configuration
model’s pairwise distance distribution is that it both follows and extends the empirical pattern out
to geodesic distances beyond what are observed in the network itself.
0
10 0.7
Karate club
configuration model
0.6
−1
10
0.5
Pr(diameter)
0.4
Pr(d)
−2
10
0.3
−3 0.2
10
0.1
−4
10 0
1 2 3 4 5 6 7 2 3 4 5 6 7 8 9
geodesic distance, d diameter
We may also examine vertex-level measures, such as measures of centrality. From the geodesic
distances used in the previous figures, we may also estimate the mean harmonic centrality of each
vertex. The first figure below plots both the empirical harmonic centralities (in order of vertex la-
bel, from 1 to 34) and the mean values under the configuration model. The various centrality scores
are now placed in context, showing that their scores are largely driven by the associated vertex
degree, as demonstrated by the similar overall pattern seen in the configuration model networks.2
But, not all of the values are explained by degree alone. The second figure plots the difference
between the observed and expected centrality scores ∆, where the line ∆ = 0 indicates no differ-
ence between observed and expected values. If an observed value is above this line, then it is more
central than we would expect based on degree alone, while if it is below the line, it is less central.
When making such comparisons, however, it is important to remember that the null model defines
a distribution over networks, and thus the difference is also a distribution. Fortunately, however,
computing the expected centrality scores by drawing many instances from the configuration model
also produces the distribution of centrality scores for each vertex, which provides us with a quan-
2
Recall also that the Pearson correlation coefficient for harmonic centrality and degree was large r 2 = 0.83, a fact
that reinforces our conclusion here.
6
Network Analysis and Modeling, CSCI 5352 Prof. Aaron Clauset
Lecture 11 10 October 2013
titative notion of how much variance is in the configuration model value. The grey shaded region
shows the 25 and 75% quantiles on the distribution of centrality scores for each vertex. When the
∆ = 0 line is outside of this range, we may claim with some confidence that the observed value is
different from the expected value.
0.75 0.15
Karate club
0.7 configuration model
0.65 0.1
harmonic centrality
0.6
0.05
difference
0.55
0.5
0
0.45
0.4 −0.05
0.35
−0.1
1 4 7 10 13 16 19 22 25 28 31 34 1 4 7 10 13 16 19 22 25 28 31 34
vertex label vertex label
This analysis shows that the main vertices (1 and 34, the president and instructor) are somewhat
more central than we would expect just based on their degree alone. In fact, most vertices are more
central than we would expect, one is less central than we expect, and about a third of the vertices
fall in line with the expectation.
3 At home
1. Read Chapter 13.3–13.11 (pages 445–483) in Networks