Closeness Centrality Calculator

Measure how quickly information reaches each node today. Choose weighted or unweighted paths easily here. Export results for reports, comparisons, and practical decisions fast.

Calculator Inputs

If empty, labels are inferred from edges.
Use matrix when you already have a table.
Undirected adds reverse edges automatically.
Weights must be positive distances or costs.
Pick harmonic for sparse or broken networks.
One edge per line: source target weight. Weight is optional when unweighted.

Formula Used

Closeness centrality summarizes how near a node is to all others through shortest paths.

Here, d(u,v) is shortest-path distance. For weighted graphs, distances are computed using Dijkstra’s method.

How to Use This Calculator

  1. Enter node labels, or leave them blank to infer.
  2. Select edge list or adjacency matrix as input.
  3. Choose directed or undirected behavior.
  4. Enable weights if your distances are not equal.
  5. Select a centrality mode suitable for your network.
  6. Press Calculate to show results above the form.
  7. Use CSV or PDF buttons to export the table.

Example Data Table

Example undirected network with five nodes and unit weights.

Source Target Weight
AB1
AC1
BD1
CD1
DE1

Closeness Centrality in Physical Network Analysis

1) Why closeness matters in physics graphs

Many physics systems form graphs: lattice sites, sensors, transport links, or coupled oscillators. Closeness centrality estimates how quickly a perturbation or signal reaches other nodes along shortest paths. Higher values often indicate efficient mediators for diffusion, routing, or synchronization. In experimental lattice models, it helps identify hubs for control and measurement. In thermal networks, it relates to rapid equilibration routes.

2) Distance as a measurable physical cost

In this calculator, distance is shortest-path cost. Unweighted mode counts each edge as one step. Weighted mode sums positive costs such as propagation delay, resistance, attenuation length, or travel time. The algorithm finds minimal total cost, aligning with practical experimental constraints. Use consistent units across all weights for reliable comparisons later.

3) Standard definition for connected networks

For connected networks, standard closeness is (N−1)/Σd. Scores rise when average shortest paths shrink. Interior nodes in a well-meshed lattice usually outperform boundary nodes. This mode is strict: if any node is unreachable, the node’s score becomes zero.

4) Normalized scores for imperfect connectivity

Measurements can miss links, creating components. Normalized mode preserves comparisons by scaling with reachable nodes. A node that reaches fewer peers is penalized, even if its local distances are small. This is helpful for thresholded correlation networks and sparse interaction graphs.

5) Harmonic centrality for sparse or broken graphs

Harmonic centrality sums 1/d over reachable nodes. Unreachable nodes contribute nothing, so scores stay meaningful in fragmented systems, boundary-limited lattices, or intermittent sensor links. Optional normalization divides by (N−1), keeping values within a compact and comparable range.

6) Directed versus undirected behavior

Directed graphs represent one-way transport, driven flows, or asymmetric couplings. Undirected mode mirrors edges, suitable for reciprocal interactions. With direction enabled, reachability can change sharply, producing different centrality rankings even when link weights are identical.

7) Interpreting the output table

The table shows reachable count, total distance sum, and the selected score. Reachable excludes the source, so the maximum is N−1. Low reachability signals disconnection or direction barriers. Lower distance sums typically indicate a geometrically central node within the network.

8) Performance and reproducible reporting

Unweighted shortest paths use breadth-first search, while weighted paths use a priority-queue method. Runtime grows with network size, so keep labels concise and avoid duplicates. Exporting CSV or PDF preserves rankings for lab notebooks, peer review, and repeatable comparisons. For large graphs, consider simplifying with thresholds or sampling to test sensitivity. Always document units and weight meaning.

FAQs

1) What does a higher closeness score mean?

A higher score means the node has shorter average shortest-path distances to others. In many physical networks, that suggests faster access for signals, flows, or diffusion compared with more peripheral nodes.

2) When should I use weighted mode?

Use weighted mode when links represent different costs, such as delay, resistance, or attenuation. Enter positive weights that behave like distances, where smaller values mean easier or faster traversal.

3) My network is disconnected. Which mode is best?

Choose normalized or harmonic. Normalized penalizes limited reach explicitly. Harmonic is robust because unreachable nodes contribute zero rather than forcing the full score to zero.

4) Do weights represent strength or distance?

In shortest-path calculations, weights act like distances or costs. If you measured strengths, convert them to costs first, such as using the inverse, so stronger links yield smaller effective distances.

5) How are ties handled in the ranking?

Rows are sorted by centrality from highest to lowest. If centrality values match, nodes are sorted by label. This keeps exports stable for repeated analyses.

6) Can I paste an adjacency matrix from a spreadsheet?

Yes. Select matrix input, provide node labels, and paste rows separated by new lines. Use commas or spaces between values, and use zeros where no edge exists.

7) Why does standard mode give zero for some nodes?

Standard closeness assumes every other node is reachable. If the graph is disconnected, or direction blocks paths, the strict definition returns zero. Use normalized or harmonic for realistic incomplete data.

Related Calculators

Network degree calculatorAverage path length calculatorClustering coefficient calculatorBetweenness centrality calculatorEigenvector centrality calculatorPageRank score calculatorKatz centrality calculatorAssortativity coefficient calculatorModularity score calculatorCommunity detection calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.