加权边如何影响 networkx 中的 PageRank?
我正在使用networkx(python中的图形库),我发现文档说PageRank算法在评分时考虑边缘权重,但我想知道是否较大的边缘权重更好或较低的权重更好?
I'm playing around with networkx (graph library in python) and I found documentation saying the PageRank algorithm takes edge weights into account when scoring, but I was wondering if larger edge weights were better or lower weights better?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简而言之,大权重对于传入节点来说更好。
PageRank 在有向加权图上工作。如果页面A有到页面B的链接,那么B的分数就会上升,即页面B(节点)的输入越多,其分数就越高。
有关 PageRank 的维基百科文章了解更多详细信息。
编辑:让我们做一个实验。创建一个具有 3 个节点和两条权重相等的有向边的有向图。
现在,增加 (A,C) 边的权重:
如您所见,随着传入边权重的增加,节点 C 获得了更高的分数。
Shortly, large weights are better for incoming nodes.
PageRank works on a directed weighted graph. If page A has a link to page B, then the score for B goes up, i.e. the more input the page B (node) have, the higher is its score.
Wikipedia article on PageRank for further details.
Edit: let's make an experiment. Create a directed graph with 3 nodes and two directed edges with equal weights.
Now, increase the weight of the (A,C) edge:
As you see, the node C got higher score with increasing weight of the incoming edge.