ArticleslgStudy

computer science

Closeness centrality

Closeness centrality is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Closeness centrality rather than just read about it. In short: In a connected graph, closeness centrality (or closeness) of a node is a measure of centrality in a network, calculated as the reciprocal of the sum of the length of the shortest paths between the node and all other nodes in the graph. Thus, the more central a node is, the closer it is to all other nodes.

Closeness centrality — main illustration
Closeness centrality — illustration

Key takeaways

  • Closeness centrality belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Closeness centrality to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Closeness centrality from memory before moving on to harder problems.

Reference excerpt

In a connected graph, closeness centrality (or closeness) of a node is a measure of centrality in a network, calculated as the reciprocal of the sum of the length of the shortest paths between the node and all other nodes in the graph. Thus, the more central a node is, the closer it is to all other nodes.

Closeness was defined by Bavelas (1950) as the reciprocal of the farness, that is:

CB(x)=1∑yd(y,x), where d(y,x) is the distance (length of the shortest path) between vertices x and y. This unnormalised version of closeness is sometimes known as status. When speaking of closeness centrality, people usually refer to its normalized form which represents the average length of the shortest paths instead of their sum. It is generally given by the previous formula multiplied by N−1, where N is the number of nodes in the graph resulting in:

C(x)=N−1∑yd(y,x). The normalization of closeness simplifies the comparison of nodes in graphs of different sizes. For large graphs, the minus one in the normalisation becomes inconsequential and it is often dropped. As one of the oldest centrality measures, closeness is often given in general discussions of network centrality measures in introductory texts or in articles comparing different centrality measures. The values produced by many centrality measures can be highly correlated. In particular, closeness and degree have been shown to be related in many networks through an approximate relationship

1C(x)≈−1ln⁡(z−1)ln⁡(kx)+β where kx is the degree of vertex x while z and β are parameters found by fitting closeness and degree to this formula. The z parameter represents the branching factor, the average degree of nodes (excluding the root node and leaves) of the shortest-path trees used to approximate networks when demonstrating this relationship. This is never an exact relationship but it captures a trend seen in many real-world networks. Closeness is related to other length scales used in network science. For instance, the average shortest path length ⟨ℓ⟩, the average distance between vertices in a network, is simply the average of the inverse closeness values

⟨ℓ⟩=1N∑x1C(x)=1N(N−1)∑x∑yd(y,x) . Taking distances from or to all other nodes is irrelevant in undirected graphs, whereas it can produce totally different results in directed graphs (e.g. a website can have a high closeness centrality from outgoing links, but low closeness centrality from incoming links).

Applications Closeness is used in many different contexts. In bibliometrics closeness has been used to look at the way academics choose their journals and bibliographies in different fields or to measure the impact of an author on a field and their social capital. When used to select potential leads in customer data, closeness has been seen to lead to a significant gain in the success rate. The closeness of a city in an air transport network has been shown to be highly correlated with socio-economic indicators such as gross regional domestic product. Closeness has also been applied to biological networks where, for instance, this was used to identify more than 50% of the global regulators within the top 2% of the ranked genes or essential genes were found to have higher closeness than nonessential genes in protein-interaction networks. In a metabolic network the closeness of nodes can identify the most important metabolites.

In disconnected graphs When a graph is not strongly connected, Gleditsch introduced in 1968 the idea of using the sum of reciprocal of distances, instead of the reciprocal of the sum of distances, with the convention 1/∞=0:

H(x)=1n−1∑y≠x1d(y,x). Gleditsch's modification follows the (much later in time) general principle proposed by Marchiori and Latora (2000) that in graphs with infinite distances the harmonic mean behaves better than the arithmetic mean. Indeed, Bavelas's closeness can be described as the denormalized reciprocal of the arithmetic mean of distances, whereas Gleditsch's centrality is the reciprocal of the harmonic mean of distances. This idea has resurfaced several times in the literature, often without the normalization factor n−1: under the name distance-weighted reach by Borgatti (2003), for undirected graphs under the name valued centrality by Dekker (2005), under the name nodal efficiency by Achard and Bullmore (2007), and, for the first time under the name harmonic centrality, by Rochat (2009) for undirected graphs; it was proposed once again later by Opsahl (2010). It was studied under the same name on general directed graphs by Boldi and Vigna (2014). This idea is also quite similar to market potential proposed in Harris (1954) which now often goes by the term market access.

Variants Dangalchev (2006), in a work on network vulnerability proposes for undirected graphs a different definition:

D(x)=∑y≠x12d(y,x). This definition is used effectively for disconnected graphs and allows to create convenient formulae for graph operations. For example: If graph G1+G2 is created by linking node p of graph G1 to node q of graph G2 then the combined closeness is:

D(G1+G2)=D(G1)+D(G2)+(1+D(p))(1+D(q)); if graph G1+G2 is created by collapsing node p of graph G1 and node q of graph G2 into one node then the closeness is:

D(G1+G2)=D(G1)+D(G2)+2D(p)D(q). If graph S(G) is the shadow graph of graph G, which has n nodes, then S(G) closeness is:

D(S(G))=4D(G)+n2. If graph T(G) is the thorn graph of graph G, which has n nodes, then T(G) closeness is:

D(T(G))=94D(G)+n. The natural generalization of this definition is:

… excerpt ends here. Continue reading the full article.

Illustrations

Closeness centrality: The number next to each node is the distance from that node to the square red node as measured by the length of the shortest path. The green edges illustrate one of the two shortest paths between the red square node and the red circle node.  The closeness of the red square node is therefore 5/(1+1+1+2+2) = 5/7.
The number next to each node is the distance from that node to the square red node as measured by the length of the shortest path. The green edges illustrate one of the two shortest paths between the red square node and the red circle node. The closeness of the red square node is therefore 5/(1+1+1+2+2) = 5/7.

Worked examples

Example 1 — a first encounter with Closeness centrality

Start with the simplest possible case. Write down what Closeness centrality claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Closeness centrality before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Closeness centrality ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Closeness centrality

In research
Closeness centrality appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Closeness centrality in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Closeness centrality is common in secondary-school and first-year university syllabi. It links to neighbouring topics Graph invariants, Network analysis, so understanding it makes those chapters shorter.
In everyday life
Look for Closeness centrality outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Closeness centrality” →

How to study Closeness centrality in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Closeness centrality means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Closeness centrality out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Closeness centrality in simple terms?

In a connected graph, closeness centrality (or closeness) of a node is a measure of centrality in a network, calculated as the reciprocal of the sum of the length of the shortest paths between the node and all other nodes in the graph. Thus, the more central a node is, the closer it is to all other…

Why does Closeness centrality matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Closeness centrality?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Closeness centrality.

Tags

  • Graph invariants
  • Network analysis

Keep exploring