Search

Search papers and lessons

Degree Distribution

Level 3 · 12 min read

The degree distribution of a network gives, for each k, the fraction of nodes that have exactly k connections, and its shape reveals how the network was built.

On this page

  • Colour = topic mix
  • Discrete math
  • Calculus
  • Probability
  • Sign in to see your progress

TL;DR

A network is a set of things (nodes) joined by links. The degree of a node is how many links it has. The degree distribution is the list of fractions: for each number kk, the share of nodes whose degree is exactly kk. That single picture shows whether a network is evenly connected, with most nodes having about the same number of links, or whether a few hubs (nodes with very many links) hold most of the links.

Where you'll see it: in studies of the web, citation networks, social networks and protein interaction maps, where the shape of the degree distribution is used to decide which random model a real network resembles.

Intuition

Imagine a town where every house has a road to the same handful of nearby houses. Each house has about four roads. Now imagine a country where most villages have two or three roads, but a few cities have thousands of roads leading into them. If you count the roads per place and draw a histogram, the two countries look completely different. The first has one tall bar. The second has a bar at small numbers and a long thin tail reaching out to very large numbers.

That histogram is the degree distribution. It is a count of how the links are spread across the nodes, and it is the simplest summary of a network's structure that is still informative.

Why does it matter? Two networks can have the same number of nodes and the same average number of links and still behave very differently. A few hubs can spread a disease, carry most traffic, or be the single point of failure. Only the distribution, not the average, shows that.

24681000.20.40.60.81degree krelative share
  • fast decay, e^(-k)
  • power law, k^(-2.5)
On a linear scale both shapes look as if they fall to near zero. The power law falls more slowly and keeps a far larger share of high degrees (about 0.003 at $k = 10$, against $5\times10^{-5}$ for the fast decay), and the difference only becomes obvious on a logarithmic scale, where each step along an axis multiplies the value by a fixed factor (see [[logarithm]]).

The math

Let a network have NN nodes. Let kik_i be the degree of node ii, meaning the number of links that touch it. Let NkN_k be the number of nodes with degree exactly kk. The degree distribution is

P(k)=NkN.P(k) = \frac{N_k}{N}.

Here P(k)P(k) is the probability that a node chosen at random has degree kk. It is a probability mass function over the whole numbers k=0,1,2,…k = 0, 1, 2, \ldots, so its values add up to 1.

Two facts follow directly. The first is the handshake identity. Each undirected link has two ends, so the degrees sum to twice the number of links EE:

∑iki=2E.\sum_i k_i = 2E.

The second is the mean degree, which is the expected value of kk under this distribution:

⟨k⟩=∑kk P(k)=2EN.\langle k \rangle = \sum_k k\,P(k) = \frac{2E}{N}.

To compare a heavy tail with a light one, it helps to use the complementary form of the cumulative distribution, the share of nodes whose degree is at least kk:

P≥(k)=∑k′≥kP(k′).P_{\geq}(k) = \sum_{k' \geq k} P(k').

For a Power Law tail, P(k)∝k−γP(k) \propto k^{-\gamma} for some exponent γ>1\gamma > 1. Then P≥(k)∝k−(γ−1)P_{\geq}(k) \propto k^{-(\gamma - 1)}. On a log-log plot (both axes logarithmic) a power law is a straight line whose slope is −γ-\gamma, and that straight line is the signature people look for in real data.

Worked examples

Example
Worked example 1: five nodes, counted by hand

Take five nodes A,B,C,D,EA, B, C, D, E with five undirected links (a link counts once for each end): ABAB, ACAC, ADAD, AEAE and BCBC.

  1. Count the degrees. AA touches four links, so kA=4k_A = 4. BB touches ABAB and BCBC, so kB=2k_B = 2. CC touches ACAC and BCBC, so kC=2k_C = 2. DD and EE each touch one link, so kD=kE=1k_D = k_E = 1.
  2. Check the handshake identity. 4+2+2+1+1=10=2×54 + 2 + 2 + 1 + 1 = 10 = 2 \times 5. The count is right.
  3. Count the nodes at each degree. Two nodes have degree 1, two have degree 2 and one has degree 4.
  4. Divide by N=5N = 5. P(1)=2/5=0.4P(1) = 2/5 = 0.4, P(2)=2/5=0.4P(2) = 2/5 = 0.4, P(4)=1/5=0.2P(4) = 1/5 = 0.2, and P(k)=0P(k) = 0 for every other kk. These add to 1.
  5. Check the mean. ⟨k⟩=1(0.4)+2(0.4)+4(0.2)=2.0\langle k \rangle = 1(0.4) + 2(0.4) + 4(0.2) = 2.0, which equals 2E/N=10/5=22E/N = 10/5 = 2.

Interpretation: a single hub at degree 4 pulls the mean up, but most nodes sit at degree 1 or 2. The distribution shows this in a way the mean alone does not.

Example
Worked example 2: the random network with no hubs

Build a random network on N=1001N = 1001 nodes, where each possible pair of nodes is joined with probability p=0.01p = 0.01. This is the Erdős–Rényi model. The degree of one node is the number of its other 10001000 potential partners that it links to, so each degree is a binomial count with n=1000n = 1000 and p=0.01p = 0.01. The mean is 1000×0.01=101000 \times 0.01 = 10.

  1. The binomial with a small pp and a large nn is close to a Poisson distribution with mean λ=10\lambda = 10.
  2. The Poisson probability of degree k=10k = 10 is e−10 1010/10!e^{-10}\,10^{10}/10!.
  3. Evaluate the pieces. e−10≈4.54×10−5e^{-10} \approx 4.54 \times 10^{-5}, 1010/10!=1010/3 628 800≈2755.710^{10}/10! = 10^{10}/3\,628\,800 \approx 2755.7.
  4. Multiply. 4.54×10−5×2755.7≈0.1254.54 \times 10^{-5} \times 2755.7 \approx 0.125.
  5. Check the tail. The chance of degree 20 is about 0.00190.0019, and the chance of degree 30 is essentially zero. Degrees far above the mean are rare.

Interpretation: in this model almost every node has a degree close to 10. There are no hubs, and the distribution is a narrow bump. This is the baseline that real networks are compared against.

Example
Worked example 3: a realistic heavy tail

Suppose a real network has degrees that follow a power law with exponent γ=2.5\gamma = 2.5, a value in the range often reported for social and information networks. Use the complementary form from The math, where P≥(k)∝k−1.5P_{\geq}(k) \propto k^{-1.5}.

  1. Compare two thresholds. The ratio of nodes with degree at least 100 to nodes with degree at least 10 is P≥(100)/P≥(10)=(100/10)−1.5P_{\geq}(100)/P_{\geq}(10) = (100/10)^{-1.5}.
  2. Evaluate. 10−1.5=1/1000≈0.03210^{-1.5} = 1/\sqrt{1000} \approx 0.032.
  3. Interpret. For every 100 nodes that have degree 10 or more, only about 3 have degree 100 or more.
  4. Now compare with the random network in Example 2. There, degree 100 is so unlikely that the count is effectively zero. The heavy tail is the difference.

The numbers here follow from the model, so they are illustrative. A real data set has to be fitted and tested, which is covered under Tradeoffs.

Tradeoffs and failure modes

The degree distribution is a strong summary (the full link structure can also be stored as an Adjacency Matrix, but that is far harder to read at a glance), but reading it takes care.

SituationWhat goes wrongBetter choice
A few hubs dominate the meanThe average degree hides the typical nodeShow the full distribution, or the median and the tail share
Looking at a histogram on a linear scaleA heavy tail looks flat and emptyPlot on log-log axes and look for a straight line
Fitting a power law by least squares on a log-log plotBinning and sparse tail points bias the slopeUse maximum likelihood with a fitted cut-off, as in Clauset et al.
Comparing a network with a random one of the same sizeThe random one may differ in mean degreeCompare against a random model with the same degree sequence
Very small networksToo few nodes in the tail to see any shapeReport the counts and do not claim a distribution

A straight line on a log-log plot is necessary but not sufficient for a power law. Many distributions with curved tails look straight over a narrow range. Careful fitting and a comparison with alternatives are needed before the word "scale-free" is justified.

History

The idea that link counts can have a heavy tail appeared in the 1960s. Derek de Solla Price studied citation networks of scientific papers and found that a few papers received far more citations than the rest.

The random-graph model that serves as the baseline dates to the late 1950s, when Erdős and Rényi studied graphs where edges appear at random. Their model produces Poisson-like degree distributions with no hubs, which is why it became the reference point.

In 1999 Albert-László Barabási and Réka Albert proposed a growth rule, Preferential Attachment: each new node links preferentially to nodes that already have many links. Their rule produces a power-law degree distribution. Their paper made the power-law degree distribution a central object of network science. Around the same time, studies of Internet topology reported heavy-tailed degrees in that setting too.

The idea caught on because the power-law shape turned up across very different systems, and because a single growth rule could explain it. Later work showed that many claimed power laws were weaker than first reported, which is why careful fitting became standard.

Check yourself

QuestionRecall: what does the degree of a node count, and what does the degree distribution P(k) give?Show answer

The degree of a node is the number of links that touch it. P(k)P(k) is the fraction of all nodes whose degree is exactly kk.

QuestionA network has 4 nodes and 3 links forming a path A-B-C-D. What are the degrees, and what is the mean degree?Show answer

The degrees are kA=1k_A = 1, kB=2k_B = 2, kC=2k_C = 2 and kD=1k_D = 1. They sum to 6, which equals 2E=2×32E = 2 \times 3. The mean degree is 6/4=1.56/4 = 1.5.

QuestionWhy does a straight line on a log-log plot suggest a power law, and what is its slope for an exponent of 2.5?Show answer

A power law P(k)∝k−γP(k) \propto k^{-\gamma} takes the logarithm of both sides to log⁡P=constant−γlog⁡k\log P = \text{constant} - \gamma \log k, which is a straight line in log⁡k\log k with slope −γ-\gamma. For γ=2.5\gamma = 2.5 the slope is −2.5-2.5.

QuestionIn a random network of 1001 nodes with link probability 0.01, why is a node with degree 100 essentially impossible?Show answer

Each degree is a binomial count with mean 10, which is close to a Poisson distribution with mean 10. The chance of 100 links is about e−10 10100/100!e^{-10}\,10^{100}/100!. The denominator 100!100! is roughly 1015810^{158}, far larger than the numerator, so the probability is effectively zero.

QuestionA colleague says the average degree of a network is 6, so the network has no hubs. Why is this claim not justified?Show answer

The mean can be 6 when most nodes have degree 2 or 3 and a few hubs have degree in the hundreds. The mean says nothing about the tail. Only the distribution shows whether hubs exist.

Sources