Algorithm HITS算法与维基百科
请浏览以下连结: 我声称给出的伪代码是错误的。问题是它正在定义一个名为Algorithm HITS算法与维基百科,algorithm,graph,Algorithm,Graph,请浏览以下连结: 我声称给出的伪代码是错误的。问题是它正在定义一个名为HubsAndAuthorities的函数,而该函数从未被调用。我认为修正算法的方法是删除第5行。这是第5行: function HubsAndAuthorities(G) 我说得对吗?我有什么遗漏吗 以下是来自维基百科的代码: 1 G := set of pages 2 for each page p in G do 3 p.auth = 1 // p.auth is the authority score of
HubsAndAuthorities
的函数,而该函数从未被调用。我认为修正算法的方法是删除第5行。这是第5行:
function HubsAndAuthorities(G)
我说得对吗?我有什么遗漏吗
以下是来自维基百科的代码:
1 G := set of pages
2 for each page p in G do
3 p.auth = 1 // p.auth is the authority score of the page p
4 p.hub = 1 // p.hub is the hub score of the page p
5 function HubsAndAuthorities(G)
6 for step from 1 to k do // run the algorithm for k steps
7 norm = 0
8 for each page p in G do // update all authority values first
9 p.auth = 0
10 for each page q in p.incomingNeighbors do // p.incomingNeighbors is the set of pages that link to p
11 p.auth += q.hub
12 norm += square(p.auth) // calculate the sum of the squared auth values to normalise
13 norm = sqrt(norm)
14 for each page p in G do // update the auth scores
15 p.auth = p.auth / norm // normalise the auth values
16 norm = 0
17 for each page p in G do // then update all hub values
18 p.hub = 0
19 for each page r in p.outgoingNeighbors do // p.outgoingNeighbors is the set of pages that p links to
20 p.hub += r.auth
21 norm += square(p.hub) // calculate the sum of the squared hub values to normalise
22 norm = sqrt(norm)
23 for each page p in G do // then update all hub values
24 p.hub = p.hub / norm // normalise the hub values
但是,我觉得最好在我发布链接的维基百科页面上查看。请在您的问题中发布维基百科的代码(具有适当的属性)。这似乎不是一个编程问题。如果你认为页面上有错误,你应该在页面上进行讨论。