LinkRankMatrix[g]
returns the link rank of the graph g, in the form of a sparse matrix. The link rank of an edge u->v is defined as the PageRanks of u, divided by the out-degree of u.
LinkRankMatrix
LinkRankMatrix[g]
returns the link rank of the graph g, in the form of a sparse matrix. The link rank of an edge u->v is defined as the PageRanks of u, divided by the out-degree of u.
Details and Options
- LinkRankMatrix functionality is now available in the built-in Wolfram Language function LinkRankCentrality.
- To use LinkRankMatrix, you first need to load the Graph Utilities Package using Needs["GraphUtilities`"].
- The following options can be given:
-
Tolerance Automatic tolerance used for convergence check TeleportProbability 0.15 probability of visiting random nodes RemoveSinks True whether to remove sinks by linking them with every node - The link rank of a link from vertex i to vertex j is defined as page rank of i, as given by PageRanks[g], divided by the out-degree of i.
- The link rank reflects the probability that a random surfer follows that link.
- LinkRankMatrix has the same options as PageRanks.
Examples
open all close allBasic Examples (2)
This shows a small network of web pages:
Needs["GraphUtilities`"]g = {"home" -> "contact", "home" -> "links", "home" -> "work", "links" -> "friend site", "friend site" -> "home", "work" -> "home", "contact" -> "home"};This calculates the link ranks:
LinkRankMatrix[g] // MatrixFormLinkRankMatrix has been superseded by LinkRankCentrality:
g = Graph[{"home" -> "contact", "home" -> "links", "home" -> "work", "links" -> "friend site", "friend site" -> "home", "work" -> "home", "contact" -> "home"}];LinkRankCentrality[g]WeightedAdjacencyMatrix[g, EdgeWeight -> %]//MatrixFormApplications (1)
This shows a small network of web pages:
Needs["GraphUtilities`"]g = {"home" -> "contact", "home" -> "links", "home" -> "work", "links" -> "friend site", "friend site" -> "home", "work" -> "home", "contact" -> "home"};GraphPlot[g, VertexLabeling -> True, DirectedEdges -> True]This calculates the link ranks:
lm = LinkRankMatrix[g]This replots the network with link rank information:
GraphPlot[g, VertexLabeling -> True, EdgeRenderingFunction -> ({RGBColor[0.5, 0., 0.], Arrowheads[{{0.03, 0.8}}], Arrow[#1], Text[lm[[First[#4], Last[#4]]], LineScaledCoordinate[#1, .6], Background -> White]}&), DirectedEdges -> True]Tech Notes
Related Guides
-
▪
- Graph Utilities Package ▪
- Graphs & Networks ▪
- Graph Visualization ▪
- Computation on Graphs ▪
- Graph Construction & Representation ▪
- Graphs and Matrices ▪
- Graph Properties & Measurements ▪
- Graph Operations and Modifications ▪
- Statistical Analysis ▪
- Social Network Analysis ▪
- Graph Properties ▪
- Mathematical Data Formats ▪
- Discrete Mathematics
Text
Wolfram Research (2007), LinkRankMatrix, Wolfram Language function, https://reference.wolfram.com/language/GraphUtilities/ref/LinkRankMatrix.html.
CMS
Wolfram Language. 2007. "LinkRankMatrix." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphUtilities/ref/LinkRankMatrix.html.
APA
Wolfram Language. (2007). LinkRankMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/GraphUtilities/ref/LinkRankMatrix.html
BibTeX
@misc{reference.wolfram_2026_linkrankmatrix, author="Wolfram Research", title="{LinkRankMatrix}", year="2007", howpublished="\url{https://reference.wolfram.com/language/GraphUtilities/ref/LinkRankMatrix.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_linkrankmatrix, organization={Wolfram Research}, title={LinkRankMatrix}, year={2007}, url={https://reference.wolfram.com/language/GraphUtilities/ref/LinkRankMatrix.html}, note=[Accessed: 13-June-2026]}