Closeness centrality is calculated by taking the reciprocal of the sum of the shortest path distances from a node to all other nodes in the network. Mathematically, it can be expressed as:
Closeness Centrality = 1 / Σ d(i, j)
where d(i, j) is the shortest path distance between nodes i and j. Nodes with smaller sums of distances have higher closeness centrality values, indicating they are more central in the network.