# HITS algorithm

Hyperlink-Induced Topic Search (HITS) (also known as Hubs and authorities) is a link analysis algorithm that rates Web pages, developed by Jon Kleinberg. It determines two values for a page: its authority, which estimates the value of the content of the page, and its hub value, which estimates the value of its links to other pages.

## Algorithm

In the HITS algorithm, the first step is to retrieve the set of results to the search query. The computation is performed only on this result set, not across all Web pages.

Authority and hub values are defined in terms of one another in a mutual recursion. An authority value is computed as the sum of the scaled hub values that point to that page. A hub value is the sum of the scaled authority values of the pages it points to. Some implementations also consider the relevance of the linked pages.

The algorithm performs a series of iterations, each consisting of two basic steps:

• Authority Update: Update each node's Authority score to be equal to the sum of the Hub Score's of each node that points to it. That is, a node is given a high authority score by being linked to by pages that are recognized as Hubs for information.
• Hub Update: Update each node's Hub Score to be equal to the sum of the Authority Score's of each node that it points to. That is, a node is given a high hub score by linking to nodes that are considered to be authorities on the subject.

The Hub score and Authority score for a node is calculated with the following algorithm:

• Start with each node having a hub score and authority score of 1.
• Run the Authority Update Rule
• Run the Hub Update Rule
• Normalize the values by dividing each Hub score by the sum of all Hub scores, and dividing each Authority score by the sum of all Authority scores.
• Repeat from the second step as necessary.

HITS, like Page and Brin's PageRank, is an iterative algorithm based on the linkage of the documents on the web. However it does have some major differences:

• It is executed at query time, not at indexing time, with the associated hit on performance that accompanies query-time processing. Thus, the hub and authority scores assigned to a page are query-specific.
• It is not commonly used by search engines. (Though a similar algorithm was said to be used by Teoma , which was acquired by Ask.com.)
• It computes two scores per document, hub and authority, as opposed to a single score.
• It is processed on a small subset of ‘relevant’ documents, not all documents as was the case with PageRank.

## Pseudocode

``` 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     for each page p in G do  // update all authority values first
8       for each page q in p.incomingNeighbors do // p.incomingNeighbors is the set of pages that link to p
9         p.auth += q.hub
10     for each page p in G do  // then update all hub values
11       for each page r in p.outgoingNeighbors do // p.outgoingNeighbors is the set of pages that p links to
12         p.hub += r.auth
```

Since the hub and authority values do not converge in the pseudocode above, it is necessary to limit the number of steps that the algorithm runs for. One way to get around this, however, would be to normalize the hub and authority values after each "step" by dividing each authority value by the sum of all authority values, and dividing each hub value by the sum of all hub values.