KatzCentrality[g,α]
gives a list of Katz centralities for the vertices in the graph g and weight α.
KatzCentrality[g,α,β]
gives a list of Katz centralities using weight α and initial centralities β.
KatzCentrality[{vw,…},…]
uses rules vw to specify the graph g.
KatzCentrality
KatzCentrality[g,α]
gives a list of Katz centralities for the vertices in the graph g and weight α.
KatzCentrality[g,α,β]
gives a list of Katz centralities using weight α and initial centralities β.
KatzCentrality[{vw,…},…]
uses rules vw to specify the graph g.
Details and Options
- KatzCentrality gives a list of centralities
that satisfy
, where
is the adjacency matrix of g. - If β is a scalar, it is taken to mean {β,β,…}.
- KatzCentrality[g,α] is equivalent to KatzCentrality[g,α,1].
- The option WorkingPrecision->p can be used to control the precision used in internal computations.
- KatzCentrality works with undirected graphs, directed graphs, multigraphs, and mixed graphs.
Examples
open all close allBasic Examples (2)
g = ExampleData[{"NetworkGraph", "Friendship"}];KatzCentrality[g, 0.1]HighlightGraph[g, VertexList[g], VertexSize -> Thread[VertexList[g] -> Rescale[%]]]Rank vertices by centrality; higher value means more influence:
g = ExampleData[{"NetworkGraph", "Friendship"}];Part[VertexList[g], Ordering[KatzCentrality[g, 0.1], All, Greater]]Scope (8)
KatzCentrality works with undirected graphs:
KatzCentrality[[image], 0.1]KatzCentrality[[image], 0.5]KatzCentrality[[image], 0.1]KatzCentrality[[image], 0.1]Use rules to specify the graph:
KatzCentrality[{1 -> 3, 2 -> 1, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 1}, 0.5]Table[KatzCentrality[[image], α], {α, {0.1, 0.2}}]Nondefault initial centralities:
KatzCentrality[[image], 0.1, 0.5]KatzCentrality works with large graphs:
g = RandomGraph[{10000, 10005}];KatzCentrality[g, 0.1]//Short//TimingOptions (3)
WorkingPrecision (3)
By default, KatzCentrality finds centralities using machine-precision computations:
KatzCentrality[[image], 1 / 10]Specify a higher working precision:
KatzCentrality[[image], 1 / 10, WorkingPrecision -> 50]Infinite working precision corresponds to exact computation:
KatzCentrality[[image], 1 / 10 , WorkingPrecision -> ∞]Applications (6)
Rank vertices of a graph by their importance in their reachable neighborhood:
g = [image];SortBy[{VertexList[g], KatzCentrality[g, 0.1]}, Last]//ReverseHighlight the Katz 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 = KatzCentrality[g, 0.1];HighlightCentrality[g, cc]g = GridGraph[{10, 10}, VertexSize -> Large];cc = KatzCentrality[g, 0.1];HighlightCentrality[g, cc]g = CompleteKaryTree[3, 3, VertexSize -> Large];cc = KatzCentrality[g, 0.1];HighlightCentrality[g, cc]g = PathGraph[Range[20], VertexSize -> Large];cc = KatzCentrality[g, 0.1];HighlightCentrality[g, cc]g = RandomGraph[PriceGraphDistribution[50, 3, 1], VertexSize -> 0.8];Find the top five most important papers and highlight them:
c = KatzCentrality[g, 0.1];highRankPapers = Ordering[c, -5]HighlightGraph[g, Table[VertexList[g][[i]], {i, highRankPapers}]]Predict a partition of the Zachary karate club in case of a conflict between influential members:
g = ExampleData[{"NetworkGraph", "ZacharyKarateClub"}]Part[VertexList[g], Ordering[KatzCentrality[g, 0.1], -2]]HighlightGraph[g, Subgraph[g, #] & /@ FindGraphPartition[g, Length[%]], VertexSize -> Thread[% -> 1.5], GraphHighlightStyle -> "DehighlightHide"]Find the most common ancestor in a family tree:
g = [image];c = KatzCentrality[g, 0.1];Pick[VertexList[g], c, Min[c]]Find descendants at the bottom of the tree:
Pick[VertexList[g], c, Max[c]]In a trust network among employees, select employees who could efficiently spread the corporate culture:
g = [image];Part[VertexList[g], Ordering[KatzCentrality[g, 0.1], -4]]Employees who are less likely to influence others:
Part[VertexList[g], Ordering[KatzCentrality[g, 0.1], 4]]Properties & Relations (4)
The centrality vector
satisfies the equation
:
g = [image];α = 1 / 3;
β = 1;
a = AdjacencyMatrix[g];
c = KatzCentrality[g, α, β];c == α a.c + βEigenvectorCentrality is a special case of KatzCentrality:
g = [image];EigenvectorCentrality[g]Take
and
with
the largest eigenvalue of the adjacency matrix:
α = 1 / First@Eigenvalues[N@AdjacencyMatrix[g], 1]KatzCentrality[g, α, 0] //Normalize[#, Total]& As
, all vertices get the same centrality:
RandomGraph[{10, 15}]KatzCentrality[%, 0]Use VertexIndex to obtain the centrality of a specific vertex:
g = ExampleData[{"NetworkGraph", "Friendship"}];KatzCentrality[g, 0.1][[VertexIndex[g, "Anna"]]]Related Guides
Text
Wolfram Research (2010), KatzCentrality, Wolfram Language function, https://reference.wolfram.com/language/ref/KatzCentrality.html (updated 2015).
CMS
Wolfram Language. 2010. "KatzCentrality." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/KatzCentrality.html.
APA
Wolfram Language. (2010). KatzCentrality. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KatzCentrality.html
BibTeX
@misc{reference.wolfram_2026_katzcentrality, author="Wolfram Research", title="{KatzCentrality}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/KatzCentrality.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_katzcentrality, organization={Wolfram Research}, title={KatzCentrality}, year={2015}, url={https://reference.wolfram.com/language/ref/KatzCentrality.html}, note=[Accessed: 13-June-2026]}