Search

Search papers and lessons

Degree Centrality

Level 2 · 10 min read

Degree centrality scores each vertex by how many connections it has, divided by the most it could have, so the score runs from 0 to 1 and answers 'who is most connected?'.

On this page

  • Colour = topic mix
  • Discrete math
  • ReadReady to readNot yet

TL;DR

Degree centrality measures how well connected a vertex is, using nothing but its count of direct links. Divide that count by the largest count any vertex could have, and every score falls between 0 and 1, which makes networks of different sizes comparable. It is the simplest answer to the question "who is most connected?", and most other centrality measures start from it.

Builds on: vertex degree · Leads to: Edge Betweenness, PageRank, Graphormer

Where it's used

Social networks. In a company's message network, each person is a vertex and each pair who exchange messages is an edge. The people with the highest degree are the ones who talk to the most colleagues. Analysts use them as the first people to ask when they need information spread quickly through a team.

Disease spread and contact tracing. In a model of who meets whom, a person with many contacts has many chances to pass something on. Modelers use degree to find the people whose contacts matter most when they plan which contacts to trace first.

Air travel. Treat each airport as a vertex and each scheduled route as an edge. An airport's degree is the number of destinations it connects directly. Airports with very high degree are the hubs that most connecting passengers pass through.

Graph neural networks. The Graphormer model, described in its paper, adds a learned embedding indexed by each node's degree to that node's input, so the network can tell hubs from peripheral vertices.

How it works

Take five people, AA, BB, CC, DD and EE, with five friendships: ABAB, ACAC, ADAD, AEAE and BCBC.

  1. Count each person's degree. AA is joined to BB, CC, DD and EE, so deg⁡(A)=4\deg(A) = 4. BB is joined to AA and CC, so deg⁡(B)=2\deg(B) = 2. CC is joined to AA and BB, so deg⁡(C)=2\deg(C) = 2. DD and EE each have only AA, so each has degree 1. Check: 4+2+2+1+1=104 + 2 + 2 + 1 + 1 = 10, which is 2×52 \times 5 edges, as the handshake lemma requires.
  2. Find the largest possible degree. In a simple graph with nn vertices, a vertex can be joined to at most the other n−1n - 1 vertices. Here n=5n = 5, so the maximum is 44.
  3. Divide each degree by the maximum. AA scores 4/4=14 / 4 = 1. BB and CC each score 2/4=0.52 / 4 = 0.5. DD and EE each score 1/4=0.251 / 4 = 0.25.
  4. Read the scores. AA is connected to everyone, so it is as central as a vertex can be in this network. BB and CC are in the middle, and DD and EE sit on the edge of the network.
  5. Check the scores against the matrix. The adjacency matrix has a 1 in row ii, column jj when ii and jj are joined. Summing each row gives the degree of that vertex, so row AA has four 1s and sums to 4.
AABBCCDDEERow sum (degree)
AA011114
BB101002
CC110002
DD100001
EE100001
flowchart LR
  A((A)) --- B((B))
  A --- C((C))
  A --- D((D))
  A --- E((E))
  B --- C

The math

Definition: Degree centrality

Let G=(V,E)G = (V, E) be a simple graph with n=∣V∣≥2n = |V| \ge 2 vertices. The degree centrality of a vertex vv is

CD(v)=deg⁡(v)n−1.C_D(v) = \frac{\deg(v)}{n - 1}.

Here deg⁡(v)\deg(v) is the vertex degree, the number of edges that touch vv. The unnormalized version is deg⁡(v)\deg(v) itself.

Step 2 in symbols: the largest possible degree

A vertex has at most one edge to each other vertex in a simple graph, so 0≤deg⁡(v)≤n−10 \le \deg(v) \le n - 1. The bound is reached exactly when vv is adjacent to every other vertex. That is why n−1n - 1 is the right denominator: it is the value a score of 1 corresponds to.

Step 3 in symbols: the normalization

Dividing the inequality 0≤deg⁡(v)≤n−10 \le \deg(v) \le n - 1 by n−1n - 1 gives 0≤CD(v)≤10 \le C_D(v) \le 1 for every vertex in every network of that size. This is what makes scores comparable across networks. In the walkthrough, AA has CD=4/4=1C_D = 4/4 = 1, and DD has CD=1/4C_D = 1/4.

Step 5 in symbols: degrees from the matrix

Write A\mathbf{A} for the adjacency matrix, with Aij=1A_{ij} = 1 if vertices ii and jj are joined and 00 otherwise. The degree of vertex ii is the sum of its row:

deg⁡(i)=∑j=1nAij\deg(i) = \sum_{j=1}^{n} A_{ij}

Written as a matrix product, if 1\mathbf{1} is the column vector of nn ones, the vector of all degrees is A1\mathbf{A}\mathbf{1}. In the example, the first row of A\mathbf{A} sums to 0+1+1+1+1=40 + 1 + 1 + 1 + 1 = 4.

Directed graphs

If an edge has a direction, each vertex has two degrees. The in-degree counts edges arriving at vv, deg⁡in(v)=∑uAuv\deg_{\text{in}}(v) = \sum_{u} A_{uv}, and the out-degree counts edges leaving it, deg⁡out(v)=∑uAvu\deg_{\text{out}}(v) = \sum_{u} A_{vu}. Degree centrality is then defined with one of them, depending on whether the question is about receiving or sending.

Worked examples

Example
Tiny: a triangle

Three vertices XX, YY, ZZ, all joined to each other.

  1. Each vertex has degree 2, because each is joined to the other two.
  2. The maximum is n−1=2n - 1 = 2.
  3. Each centrality is 2/2=12 / 2 = 1.

Interpretation: every vertex is as connected as it can be, so no vertex stands out. Degree centrality cannot tell them apart.

Example
Standard: a path of four vertices

Four vertices in a line, P−Q−R−SP - Q - R - S, with three edges.

  1. Degrees: deg⁡(P)=1\deg(P) = 1, deg⁡(Q)=2\deg(Q) = 2, deg⁡(R)=2\deg(R) = 2, deg⁡(S)=1\deg(S) = 1. Check: the sum is 6=2×36 = 2 \times 3.
  2. The maximum is n−1=3n - 1 = 3.
  3. Centralities: PP scores 1/31/3, QQ scores 2/32/3, RR scores 2/32/3, and SS scores 1/31/3.

Interpretation: the two middle vertices are the most connected, and the two ends the least. Neither middle vertex is adjacent to everyone, so neither reaches 1.

Example
Realistic: a regional airline

Six airports: a hub HH, and five others AA, BB, CC, DD, EE. Routes: HAHA, HBHB, HCHC, HDHD, HEHE, ABAB and CDCD.

  1. Degrees: deg⁡(H)=5\deg(H) = 5, deg⁡(A)=2\deg(A) = 2, deg⁡(B)=2\deg(B) = 2, deg⁡(C)=2\deg(C) = 2, deg⁡(D)=2\deg(D) = 2, deg⁡(E)=1\deg(E) = 1. Check: 5+2+2+2+2+1=14=2×75 + 2 + 2 + 2 + 2 + 1 = 14 = 2 \times 7.
  2. The maximum is n−1=5n - 1 = 5.
  3. Centralities: HH scores 5/5=15/5 = 1. AA, BB, CC and DD each score 2/5=0.42/5 = 0.4. EE scores 1/5=0.21/5 = 0.2.
  4. Interpretation: the hub is the only airport that touches everyone, and it stands out from the rest.

Try it: the airline adds one route from EE to AA. What are the new centralities of EE and AA? Answer: EE now has degree 2, so it scores 2/5=0.42/5 = 0.4. AA now has degree 3, so it scores 3/5=0.63/5 = 0.6. The total degree is now 16=2×816 = 2 \times 8, which confirms that one new route adds two to the sum.

Common mistakes and tradeoffs

It is tempting to think that the vertex with the highest degree is always the most important. In fact degree counts only direct links. A vertex with three links to minor, poorly connected vertices can have a lower influence than one with two links to the hubs of the network. When influence depends on who you are connected to, PageRank and the eigenvector-based measures, which build on eigenvalues, give a better answer.

It is tempting to think that a normalized score of 0.1 means the same thing in every network. In fact dividing by n−1n - 1 makes the score comparable across sizes, but it can hide scale. In a network of a million people, a score of 0.1 means about 100,000 direct contacts, which is a very different situation from a score of 0.1 among 20 people. Report the raw degree alongside the normalized score when size matters.

It is tempting to think a directed graph needs no special treatment. In fact a follower count is an in-degree and an account's activity is an out-degree, and they measure different things. An account with many followers is well received, but one that follows many accounts is well informed. Choose the direction that matches the question.

When to use it: degree centrality is cheap, since one pass over the edges is enough, and easy to explain. It is a good first look at a network.

When not to use it: if paths matter, as in the flow of information or the bottlenecks in a transport network, use Edge Betweenness, which counts how many shortest paths pass through each edge. If influence should spread through neighbors, use PageRank.

MeasureWhat it countsGood forMisses
DegreeDirect linksHubs, quick screeningWho your neighbors are
Edge betweennessShortest paths through an edgeBridges between groupsCost on very large networks
PageRankVisits by a random walk over linksInfluence through important neighborsSimplicity of explanation

History

Jacob Moreno introduced sociograms in the 1930s, drawing people as points and their relationships as lines, and used them to study how groups formed and split. Counting the links at each person was the most direct way to read such a diagram.

In 1978, Linton Freeman wrote a paper that clarified what it means for a vertex to be central, and he defined degree, closeness and betweenness as three different answers to that question. Degree centrality is the first of those three, and it was the easiest to compute and check by hand. Later work on large networks, such as the web, made the limits of degree clear and led to measures like PageRank.

Recap

  • Degree centrality is the number of direct links at a vertex, divided by n−1n - 1, the largest possible number.
  • Dividing by n−1n - 1 keeps every score between 0 and 1, so networks of different sizes can be compared.
  • The degrees are the row sums of the adjacency matrix, and in a directed graph there is an in-degree and an out-degree.
  • Degree sees only direct links, so it can miss influence that comes through important neighbors.
  • Read next: Edge Betweenness for centrality based on shortest paths, and PageRank for centrality based on who links to you.

Check yourself

QuestionIn a simple graph with 7 vertices, what is the largest possible degree centrality of any vertex, and what does a score of 1 mean?Show answer

The largest possible degree is n−1=6n - 1 = 6, so the largest centrality is 6/6=16 / 6 = 1. A score of 1 means the vertex is joined to every other vertex in the graph.

QuestionA graph has four vertices and edges ABAB, ACAC, BCBC and CDCD. What are the degree centralities of AA, BB, CC and DD?Show answer

The degrees are deg⁡(A)=2\deg(A) = 2, deg⁡(B)=2\deg(B) = 2, deg⁡(C)=3\deg(C) = 3 and deg⁡(D)=1\deg(D) = 1. Check: 2+2+3+1=8=2×42 + 2 + 3 + 1 = 8 = 2 \times 4. Dividing by n−1=3n - 1 = 3 gives A=2/3A = 2/3, B=2/3B = 2/3, C=1C = 1 and D=1/3D = 1/3.

QuestionWhy is the denominator n−1n - 1 rather than the number of edges in the graph?Show answer

The number n−1n - 1 is the largest degree any vertex can have in a simple graph, so dividing by it always gives a score between 0 and 1. Dividing by the number of edges would not give that bound, and the scores would depend on how many edges the whole network happens to have, which says nothing about one vertex's position.

QuestionIn a company's directed message network, you want the people who reach the most colleagues directly. Should you use in-degree or out-degree, and why?Show answer

Use out-degree, which counts the messages a person sends. Those are the colleagues they reach directly. In-degree counts messages received, which measures how often others write to a person, a different question. If the goal were to find the people who receive the most attention, in-degree would be the right choice.

Sources