【发布时间】:2015-09-28 14:17:41
【问题描述】:
我正在研究 HITS 算法的加权版本。
其中HITS A是权威分数,HITS H是中心分数,维基百科中算法的伪代码:
G := set of pages
for each page p in G do
p.auth = 1 // p.auth is the authority score of the page p
p.hub = 1 // p.hub is the hub score of the page p
function HubsAndAuthorities(G)
for step from 1 to k do // run the algorithm for k steps
norm = 0
for each page p in G do // update all authority values first
p.auth = 0
for each page q in p.incomingNeighbors do // p.incomingNeighbors is the set of pages that link to p
p.auth += q.hub
norm += square(p.auth) // calculate the sum of the squared auth values to normalise
norm = sqrt(norm)
for each page p in G do // update the auth scores
p.auth = p.auth / norm // normalise the auth values
norm = 0
for each page p in G do // then update all hub values
p.hub = 0
for each page r in p.outgoingNeighbors do // p.outgoingNeighbors is the set of pages that p links to
p.hub += r.auth
norm += square(p.hub) // calculate the sum of the squared hub values to normalise
norm = sqrt(norm)
for each page p in G do // then update all hub values
p.hub = p.hub / norm // normalise the hub values
请提供伪代码或java实现
【问题讨论】:
-
您能否更具体地说明您在实施该算法时遇到了什么问题?
-
我不知道如何将原始算法修改为加权模型。我应该在哪里乘以边缘的权重?
标签: java algorithm graph search-engine information-retrieval