PageRank assigns a score of importance to each node.Important nodes are those with many in-links from important pages.
——重要节点是具有来自重要页面的许多内链接的节点。
A node’s PageRank depends on the PageRank of other nodes.
标记所有节点的PageRank 都是 1 n \frac{1}{n} n1
因为我们需要所有结点PageRank之和为1
进行K次PageRank的更新
Basic PageRank Updata Rule: Each node give an equal share of its current PageRank to all nodes it links to.
The new PageRank of each node is the sum of all the PageRank it received from other nodes.
Time | A | B | C | D | E |
---|---|---|---|---|---|
0 | 1/5 | 1/5 | 1/5 | 1/5 | 1/5 |
1 | (1/3)*(1/5)+(1/5)=(D+E) | 1/5+1/5=(A+C) | (1/2) * (1/5)+(1/3) * (1/5)=(B+D) | (1/2)*(1/5)=B | (1/3)*(1/5)=D |
2 | 1/10=0.1 | 13/30=0.43 | 7/30=0.23 | 2/10=0.2 | 1/30=0.03 |
得到某点的权重,等于——该点权重*(1/出度)
可以看到B点拥有最高的PageRank(认为其是最重要的结点)
Time | A | B | C | D | E |
---|---|---|---|---|---|
3 | 0.1 | 0.33 | 0.28 | 0.22 | 0.06 |
∞ \infty ∞ | 0.12 | 0.38 | 0.25 | 0.19 | 0.06 |
随着次数的增加,值的变化会越来越小
Nodes with fewer in-degrees may have a high Page Rank when they are connected to a more important node.
we’re going to talk about how to interpret it and identify a potential problem that it has and also a solution.
——我们将讨论如何解释它并确定它存在的潜在问题以及解决方案
So first of all, the PageRank value of a node after k steps can be interpreted as the probability that a random walker lands on that node after taking k random steps.
——一个节点经过 k 步后的 PageRank 值可以解释为随机游走者在经过 k 个随机步后到达该节点的概率
——Figure out what the PageRank of each node is after taking a lot of PageRank steps.
For a large enough K:
F and G have PageRank of 1 2 \frac{1}{2} 21 and all the other nodes have PageRank 0
原因——当我们随机降落在这个网络时,一旦下降到了F或G,就会永远在那里循环,而出不去
Imagine a random walk on this network.Whenever the walk lands on F or G,it is “stuck” on F and G
To fix this ,we introduce a “damping parameter” α \alpha α
Ramdom walk of K stpes with damping parameter α \alpha α:
Repeat K times
So again, at every step, what we used to do before was to always follow the edges.
What we’re going to do now is that at every step, we’re either going to follow the edges with probability alpha.
Or we are going to forget about the edges, and choose a random node, and go to it with probability one minus(-) alpha, and we’re going to repeat this k times.
当我们到达F和G这种结点时,我们依然拥有 1 − α 1-\alpha 1−α的概率,跳去别的结点
The Scaled PageRank of k steps and damping factor α \alpha α of a node n is the probability that a random walk with damping factor α \alpha α lands on a n after k steps.
For most networks, as k gets larger, Scaled PageRank converges to a unique value, which depends on α \alpha α
一般情况下, α \alpha α取值为0.8-0.9
import networkx as nx
G=nx.Graph()
a=nx.pagerank(G,alpha=0.8)
print(type(a))
#>>dict
print(a)