PageRankCentrality[g,α]
gives a list of page-rank centralities for the vertices in the graph g and weight α.
PageRankCentrality[g,α,β]
gives a list of page-rank centralities, using weight α and initial centralities β.
PageRankCentrality[{vw,…},…]
uses rules vw to specify the graph g.
PageRankCentrality
PageRankCentrality[g,α]
gives a list of page-rank centralities for the vertices in the graph g and weight α.
PageRankCentrality[g,α,β]
gives a list of page-rank centralities, using weight α and initial centralities β.
PageRankCentrality[{vw,…},…]
uses rules vw to specify the graph g.
Details and Options
- Page-rank centralities represent the likelihood that a person randomly following links arrives at any particular page on the web graph.
- PageRankCentrality gives a list of centralities that are solutions to
, where
is the adjacency matrix of g and
is the diagonal matrix consisting of
, where
is the out-degree of the 
vertex. » - If β is a scalar, it is taken to mean {β,β,…}.
- PageRankCentrality[g,α] is equivalent to PageRankCentrality[g,α,1/VertexCount[g]].
- Page-rank centralities are normalized.
- PageRankCentrality takes the following options:
-
PerformanceGoal Automatic aspects of performance to try to optimize WorkingPrecision Automatic the precision used in internal computations - The option WorkingPrecision->p can be used to control the precision used in internal computations.
- PageRankCentrality works with undirected graphs, directed graphs, multigraphs, and mixed graphs.
Examples
open all close allBasic Examples (2)
Compute page-rank centralities:
g = RandomGraph[{10, 20}];PageRankCentrality[g, 0.1]HighlightGraph[g, VertexList[g], VertexSize -> Thread[VertexList[g] -> Rescale[%]]]Find the probability that a person randomly clicking hyperlinks will arrive at a particular page:
g = [image];Part[PageRankCentrality[g, 0.85], VertexIndex[g, "wolframalpha.com"]]Rank webpages, with the most visible pages first:
Part[VertexList[g], Ordering[PageRankCentrality[g, 0.85], All, Greater]]//ShortScope (7)
PageRankCentrality works with undirected graphs:
PageRankCentrality[[image], 0.5]PageRankCentrality[[image], 0.5]PageRankCentrality[[image], 0.5]PageRankCentrality[[image], 0.5]Use rules to specify the graph:
PageRankCentrality[{1 -> 3, 2 -> 1, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 1}, 0.5]Nondefault initial centralities:
PageRankCentrality[[image], 0.5, {0.1, 0.2, 0.3, 0.1, 0.2, 0.1}]PageRankCentrality works with large graphs:
g = GridGraph[{10, 10, 10, 10}];PageRankCentrality[g, 0.5]//Short//TimingOptions (3)
WorkingPrecision (3)
By default, PageRankCentrality finds centralities using machine-precision computations:
PageRankCentrality[[image], 1 / 10]Specify a higher working precision:
PageRankCentrality[[image], 1 / 10, WorkingPrecision -> 50]Infinite working precision corresponds to exact computation:
PageRankCentrality[[image], 1 / 10, WorkingPrecision -> ∞]Applications (6)
Rank websites based on the likelihood that a person randomly clicking on hyperlinks will reach a particular page:
g = [image];SortBy[{VertexList[g], PageRankCentrality[g, 0.85]}, Last]//ReverseHighlight the page-rank 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, DirectedEdges -> True, VertexSize -> Large];cc = PageRankCentrality[g, 0.5];HighlightCentrality[g, cc]g = GridGraph[{10, 10}, DirectedEdges -> True, VertexSize -> 0.5];cc = PageRankCentrality[g, 0.5];HighlightCentrality[g, cc]g = CompleteKaryTree[3, 3, DirectedEdges -> True, VertexSize -> Large];cc = PageRankCentrality[g, 0.5];HighlightCentrality[g, cc]g = PathGraph[Range[20], DirectedEdges -> True, VertexSize -> Large];cc = PageRankCentrality[g, 0.5];HighlightCentrality[g, cc]A corporate network of webpages linked via hyperlinks. Find the page that you are most likely to arrive at after a large number of clicks, with a damping factor of 0.85:
g = DynamicModule[«3»];With[{c = PageRankCentrality[g, 0.85]}, Pick[VertexList[g], c, Max[c]]]A road network where a node represents a road, and two roads are connected if they intersect. Predict the road that always has a traffic flow:
g = [image];c = PageRankCentrality[ReverseGraph[g], 0.2];Pick[VertexList[g], c, Max[c]]Find species whose extinctions would lead to ecosystem collapse in a food chain:
g = ExampleData[{"NetworkGraph", "SimpleFoodWeb"}]c = PageRankCentrality[ReverseGraph[g], 0.85];Pick[VertexList[g], c, Max[c]]A metabolic cellular network for Neisseria gonorrhoeae. Find those proteins that play a marginal functional role in the system:
g = ExampleData[{"NetworkGraph", "MetabolicNetworkNeisseriaGonorrhoeae"}];c = PageRankCentrality[g, 0.85];Part[VertexList[g], Ordering[c, 10]]These proteins have the lowest in-degree:
SortBy[VertexList[g], VertexInDegree[g, #]&]//ShallowProperties & Relations (3)
The centrality vector is the normalized solution of the linear system
:
g = [image];n = VertexCount[g];
α = 1 / 3;
β = ConstantArray[1 / n, n];PageRankCentrality[g, α, β]d = DiagonalMatrix[Table[1 / Max[1, k], {k, VertexOutDegree[g]}]];
a = AdjacencyMatrix[g];LinearSolve[IdentityMatrix[n] - α a.d, β]//Normalize[N[#], Total]&Page-rank centralities are normalized:
PageRankCentrality[[image], 0.1]Total[%]Use VertexIndex to obtain the centrality of a specific vertex:
g = ExampleData[{"NetworkGraph", "Friendship"}];PageRankCentrality[g, 0.1][[VertexIndex[g, "Anna"]]]Related Guides
Text
Wolfram Research (2010), PageRankCentrality, Wolfram Language function, https://reference.wolfram.com/language/ref/PageRankCentrality.html (updated 2024).
CMS
Wolfram Language. 2010. "PageRankCentrality." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/PageRankCentrality.html.
APA
Wolfram Language. (2010). PageRankCentrality. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PageRankCentrality.html
BibTeX
@misc{reference.wolfram_2026_pagerankcentrality, author="Wolfram Research", title="{PageRankCentrality}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/PageRankCentrality.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_pagerankcentrality, organization={Wolfram Research}, title={PageRankCentrality}, year={2024}, url={https://reference.wolfram.com/language/ref/PageRankCentrality.html}, note=[Accessed: 13-June-2026]}