# Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
BUILT-IN WOLFRAM LANGUAGE SYMBOL

# ClosenessCentrality

gives a list of closeness centralities for the vertices in the graph g.

ClosenessCentrality[{vw,},]
uses rules to specify the graph g.

## DetailsDetails

• ClosenessCentrality will give high centralities to vertices that are at a short average distance to every other reachable vertex.
• ClosenessCentrality for a graph is given by , where is the average distance from vertex to all other vertices connected to .
• If is the distance matrix, then the average distance from vertex to all connected vertices is given by , where the sum is taken over all finite and is the number of vertices connected to .
• The closeness centrality for isolated vertices is taken to be zero.
• ClosenessCentrality works with undirected graphs, directed graphs, weighted graphs, multigraphs, and mixed graphs.

## Background & ContextBackground & Context

• ClosenessCentrality returns a list of non-negative machine numbers ("closeness centralities") that approximate particular centrality measures of the vertices of a graph. Closeness centralities lie between 0 and 1 inclusive. A closeness centrality is a measure of the centrality of a node in a network based on the mean length of all shortest paths from that node to every other reachable node in the network. ClosenessCentrality therefore identifies nodes in the network that are crucial for the quick spread of information. This measure has found applications in social networks, transportation, biology, and the social sciences.
• If is the distance matrix (i.e. the square matrix consisting of all graph distances from vertex to vertex ), then the average distance from vertex to all connected vertices is given by , where the sum is taken over all finite and is the number of vertices connected to . The closeness centralities for a graph are then given by , where is the average distance from vertex to all other vertices connected to . The closeness centrality is taken to be zero for isolated vertices.
• ClosenessCentrality is a global centrality measure. Other prominent centrality measures that identify different properties of graphs include BetweennessCentrality and DegreeCentrality.

## ExamplesExamplesopen allclose all

### Basic Examples  (2)Basic Examples  (2)

Compute closeness centralities:

 Out[2]=

Highlight:

 Out[3]=

Rank vertices. Highest-ranked vertices are at a short average distance to every other vertex:

 Out[2]=