【问题标题】:weighted HITS algorithm implementatoion (hub and authority score)加权 HITS 算法实现(中心和权威分数)
【发布时间】:2015-09-28 14:17:41
【问题描述】:

我正在研究 HITS 算法的加权版本。

这是 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


【解决方案1】:

对于加权版本的算法,需要修改更新部分的代码:

p.hub += weight(p,r) * r.auth
           ^^^

同样:

p.auth += weight(q,p) * q.hub
            ^^^

请注意,如果我们为所有节点设置wight(u,v)=1,则此更新会衰减为原始算法,这是一个理想的属性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-16
    • 1970-01-01
    相关资源
    最近更新 更多