gives a list of eccentricity centralities for the vertices in the graph g.
EccentricityCentrality[{vw,…}]
uses rules vw to specify the graph g.
EccentricityCentrality
gives a list of eccentricity centralities for the vertices in the graph g.
EccentricityCentrality[{vw,…}]
uses rules vw to specify the graph g.
Details
- EccentricityCentrality will give high centralities to vertices that are at short maximum distances to every other reachable vertex.
- EccentricityCentrality for a graph g is given by
, where
is the maximum distance from vertex
to all other vertices connected to
. - The eccentricity centrality for isolated vertices is taken to be zero.
- EccentricityCentrality works with undirected graphs, directed graphs, weighted graphs, multigraphs, and mixed graphs.
Background & Context
- EccentricityCentrality returns a list of non-negative machine numbers ("eccentricity centralities") that approximate particular centrality measures of the vertices of a graph. Eccentricity centrality is a measure of the centrality of a node in a network based on having a small maximum distance from a node
to every other reachable node (i.e. the graph eccentricities). This measure has found applications in social networks, transportation, biology, and the social sciences. - If
is the maximum distance from vertex
to all other vertices connected to
, then the eccentricity centralities are given by
. The eccentricity centrality for isolated vertices is taken to be zero. Eccentricity centralities lie between 0 and 1 inclusive. - The eccentricity centrality of a vertex is the reciprocal of its VertexEccentricity. The full distance matrix of a graph can be computed using GraphDistanceMatrix.
Examples
open all close allBasic Examples (2)
Compute eccentricity centralities:
g = ExampleData[{"NetworkGraph", "Friendship"}];EccentricityCentrality[g]HighlightGraph[g, VertexList[g], VertexSize -> Thread[VertexList[g] -> Rescale[%]]]Rank vertices. Highest-ranked vertices are at short distances to every other reachable vertex:
g = ExampleData[{"NetworkGraph", "Friendship"}];Part[VertexList[g], Ordering[EccentricityCentrality[g], All, Greater]]Scope (7)
EccentricityCentrality works with undirected graphs:
EccentricityCentrality[[image]]EccentricityCentrality[[image]]EccentricityCentrality[[image]]EccentricityCentrality[[image]]EccentricityCentrality[[image]]Use rules to specify the graph:
EccentricityCentrality[{1 -> 3, 2 -> 1, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 1}]EccentricityCentrality works with large graphs:
g = RandomGraph[{10000, 10005}];EccentricityCentrality[g]//Short//TimingApplications (5)
Rank vertices by their eccentricity:
g = [image];SortBy[{VertexList[g], EccentricityCentrality[g]}, Last]//ReverseHighlight the eccentricity centrality for CycleGraph:
HighlightCentrality[g_, cc_] := HighlightGraph[g, Table[Style[VertexList[g][[i]], ColorData["TemperatureMap"][cc[[i]] / Max[cc]]], {i, VertexCount[g]}]];g = CycleGraph[8, VertexSize -> Large];cc = EccentricityCentrality[g];HighlightCentrality[g, cc]g = GridGraph[{10, 10}, VertexSize -> Large];cc = EccentricityCentrality[g];HighlightCentrality[g, cc]g = CompleteKaryTree[3, 3, VertexSize -> Large];cc = EccentricityCentrality[g];HighlightCentrality[g, cc]g = PathGraph[Range[20], VertexSize -> Large];cc = EccentricityCentrality[g];HighlightCentrality[g, cc]Based on the infrastructure network of the Marshall Islands in eastern Micronesia, find a strategically located island:
g = [image];With[{c = EccentricityCentrality[g]}, Pick[VertexList[g], c, Max[c]]]It is different with the median of the graph:
With[{d = Total[GraphDistanceMatrix[g]]}, Pick[VertexList[g], d, Min[d]]]A road network linking Chicago suburbs. Find the best location for hospitals and fire departments, to minimize the distance traveled by emergency vehicles:
g = [image];With[{c = EccentricityCentrality[g]}, Pick[VertexList[g], c, Max[c]]]For graphs with
vertices, the largest sum in differences in eccentricity centrality between the most central vertex and all other vertices is the inverse of
:
n = 10;
g = StarGraph[n];
c = EccentricityCentrality[g];{Total[Max[c] - c], (n - 1) / 2.}Measure how central the most central vertex is with respect to other vertices:
eccentricity[g_] := With[{c = EccentricityCentrality[g], n = VertexCount[g]}, N[Total[Max[c] - c] / ((n - 1) / 2)]]Centralization of social networks:
eccentricity[ExampleData[{"NetworkGraph", "ZacharyKarateClub"}]]eccentricity[ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]]Properties & Relations (6)
EccentricityCentrality is the inverse of maximum distances to other reachable vertices:
g = [image];EccentricityCentrality[g]The inverse of maximum distances to other reachable vertices:
d = GraphDistanceMatrix[g];1. / Map[Max, DeleteCases[d, 0 | ∞, {2}]]Eccentricity centrality of a vertex is the reciprocal of the VertexEccentricity:
g = RandomGraph[{6, 9}]Table[1. / VertexEccentricity[g, i], {i, VertexList[g]}]EccentricityCentrality[g]Eccentricity centrality is between 0 and 1:
Through[{Min, Max}[EccentricityCentrality [RandomGraph[{100, 200}]]]]Eccentricity centralities for an undirected graph are equivalent to centralities for each component:
g = [image];EccentricityCentrality[g]Computing the centralities for each component yields the same result:
{g1, g2} = Subgraph[g, #]& /@ ConnectedComponents[g]{EccentricityCentrality[g1], EccentricityCentrality[g2]}Join@@%Use GraphCenter to find vertices with the highest eccentricity centrality:
g = [image];GraphCenter[g]With [{c = EccentricityCentrality[g]}, Pick[VertexList[g], c, Max[c]]]Use VertexIndex to obtain the centrality for a specific vertex:
g = ExampleData[{"NetworkGraph", "Friendship"}];EccentricityCentrality[g][[VertexIndex[g, "Anna"]]]Related Guides
Text
Wolfram Research (2012), EccentricityCentrality, Wolfram Language function, https://reference.wolfram.com/language/ref/EccentricityCentrality.html (updated 2015).
CMS
Wolfram Language. 2012. "EccentricityCentrality." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/EccentricityCentrality.html.
APA
Wolfram Language. (2012). EccentricityCentrality. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EccentricityCentrality.html
BibTeX
@misc{reference.wolfram_2026_eccentricitycentrality, author="Wolfram Research", title="{EccentricityCentrality}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/EccentricityCentrality.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_eccentricitycentrality, organization={Wolfram Research}, title={EccentricityCentrality}, year={2015}, url={https://reference.wolfram.com/language/ref/EccentricityCentrality.html}, note=[Accessed: 13-June-2026]}