title: weighted HITS algorithm implementatoion (hub and authority score)
body: <p>I'm working on weighted version of HITS algorithm implementation.</p>
  
  <p>This is the formula for Hits algorithm (non weighted version):
  <a href="https://i.stack.imgur.com/bhgbx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bhgbx.png" alt="enter image description here"></a></p>
  
  <p>where HITS A is the authority score and HITS H is the hub score, pseudo code of the algorithm in wikipedia:</p>
  
  <pre><code> 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
  </code></pre>
  
  <p>How can I change this algorithm to work for weighted version of the problem:
  <a href="https://i.stack.imgur.com/DsrvP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DsrvP.png" alt="enter image description here"></a></p>
  
  <p>Please provide the Pseudocode or the java implementation</p>