Closeness centrality measures how close a node is to every other node in a network. It calculates shortest paths from the node, sums their distances, and returns the inverse of that sum, so higher scores indicate faster potential reach. section 8.1.3
The metric helps interpret a node’s global position. In a follower network, a highly central node may disseminate information quickly; in a character network, nodes near the center receive higher scores than peripheral nodes. section 8.0 section 8.1.3
When applying the metric, keep these points in mind:
- Use a disconnected-graph variation when shortest paths do not exist between every pair of nodes; the example uses the Wasserman and Faust variation. section 8.1.3
- Compare scores with the network structure rather than treating them as a universal measure of importance; closeness captures rapid reach, while betweenness captures bridge positions. section 8.0 section 8.5
- Inspect the score distribution before using closeness as a feature; the demonstrated values range from 0.0 to 0.25, with an average of 0.04. section 8.2.1
Mutating closeness in a projected graph
In Neo4j Graph Data Science, calculate and retain the metric on the in-memory graph with: CALL gds.closeness.mutate('knnExample', {mutateProperty:'closeness', useWassermanFaust: true}). The resulting property can then be inspected alongside other user features. section 8.1.3 section 8.2.1
Listing 8.4 Mutating the closeness centrality algorithm
CALL gds.closeness.mutate('knnExample',
{mutateProperty:'closeness', useWassermanFaust: true})
Shows the Cypher call for mutating closeness centrality with the Wasserman and Faust option enabled. section 8.1.3
