Конечные цепи Маркова: Алгоритм PageRank

Зададим граф сайта по существующим ссылкам на страницы

Clear["Global`*"]
edge={a\[DirectedEdge]d,a\[DirectedEdge]f,b\[DirectedEdge]j,b\[DirectedEdge]k,b\[DirectedEdge]m,c\[DirectedEdge]c,c\[DirectedEdge]g,c\[DirectedEdge]j,c\[DirectedEdge]m,d\[DirectedEdge]f,d\[DirectedEdge]h,d\[DirectedEdge]k,e\[DirectedEdge]d,e\[DirectedEdge]h,e\[DirectedEdge]l,f\[DirectedEdge]a,f\[DirectedEdge]b,f\[DirectedEdge]j,f\[DirectedEdge]l,g\[DirectedEdge]b,g\[DirectedEdge]j,h\[DirectedEdge]d,h\[DirectedEdge]g,h\[DirectedEdge]l,h\[DirectedEdge]m,i\[DirectedEdge]g,i\[DirectedEdge]h,i\[DirectedEdge]n,j\[DirectedEdge]e,j\[DirectedEdge]i,j\[DirectedEdge]k,k\[DirectedEdge]n,l\[DirectedEdge]m,m\[DirectedEdge]g,n\[DirectedEdge]c,n\[DirectedEdge]j,n\[DirectedEdge]m};
G=Graph[edge,VertexLabels->"Name"]

Алгоритм на графе PageRankCentrality

prg=PageRankCentrality[G,0.85]
hprg=HighlightGraph[G,VertexList[G],VertexSize->Thread[VertexList[G]->Rescale[prg]]]
sprg=SortBy[Transpose[{VertexList[G], prg}],Last];
%//TableForm

Алгоритм на графе PageRank на основе  цепей Маркова

mt=Normal[AdjacencyMatrix[G]];
mt//MatrixForm;
mat=#/Total[#]&/@ mt;

proc1=DiscreteMarkovProcess[1,mat//N];
MarkovProcessProperties[proc1];
Graph[proc1]
pr=Table[Probability[x==i,x\[Distributed]StationaryDistribution[proc1]],{i,1,14}]

hpr=HighlightGraph[G,VertexList[G],VertexSize->Thread[VertexList[G]->Rescale[pr]]]
spr=SortBy[Transpose[{VertexList[G], pr}],Last];
%//TableForm

Сравнеие  PageRankCentrality  и PageRank

{{Grid[sprg,Frame->All,Background->{None,{3->Pink}}],Grid[spr,Frame->All,Background->{None,{3->Pink}}]}}//TableForm

{{hprg,hpr}}//TableForm