Guest
Sign in to keep your graphs and progress.

Practice book
Graph Theory Through Problems300 Exercises with Hints, Worked Algorithms and Complete Solutions
By Mohammed Islam Hadjoudj
Learn graph theory by solving problems: 300 exercises, from routine checks to challenging proofs, each with a complete solution.
Also by the authorGraph Algorithms for Coding Interviews100 solved interview problems with visual explanations and Python solutions.View on AmazonSelect an algorithm and generate steps to begin visualization
Hubs point to authorities
Kleinberg's link analysis: authorities are pages good hubs link to, hubs are pages that link to good authorities, updated in turn until they settle
Select an algorithm and generate steps to begin visualization
HITS (Hyperlink-Induced Topic Search) is a link-analysis algorithm by Jon Kleinberg (1999) that gives every page of a directed graph two scores. The authority score says how valuable a page is as a source of information: many good hubs link to it. The hub score says how valuable a page is as a list of links: it points to many good authorities. The two definitions depend on each other, and HITS breaks the circle by iteration. It was developed at IBM's Almaden research center around the same time as PageRank, and the two are the classic algorithms of web search ranking.
Every page starts with hub and authority score 1/n. Each round first sets every authority to the sum of the hub scores of the pages that link to it, then every hub to the sum of the new authority scores of the pages it links to. After each update the scores are scaled to add up to 1, so they do not grow without bound. With A the adjacency matrix, the authorities converge to the leading eigenvector of AᵀA and the hubs to that of AAᵀ. The visualizer shows the first round vertex by vertex, authorities first, then one step per round until no score changes by more than 0.0001. The size of a vertex shows its authority, the badge its hub score.
Kleinberg designed HITS to rank web pages for a query: collect the pages about a topic and their neighbours, then let the hubs (directories, link lists, review pages) and the authorities (the pages they recommend) emerge. The same idea ranks papers and surveys in citation networks, experts and helpful answerers in question-and-answer communities, and sources and aggregators in news and social media. The search engine Teoma, later Ask.com, used a HITS-style ranking. In directed biological and economic networks, hub and authority scores separate regulators from regulated genes and suppliers from customers.
HITS alternates two updates, each a sum over the links in one direction, and rescales the scores after each update.
HITS(G, tol = 0.0001):
hub[v] = auth[v] = 1 / n for every vertex v
repeat:
for each vertex v:
auth[v] = Σ hub[u] over links u → v
auth = auth / sum(auth)
for each vertex v:
hub[v] = Σ auth[w] over links v → w
hub = hub / sum(hub)
until no score changes by more than tol
return hub, authKleinberg scaled the vectors to Euclidean length 1. NetworkX and this visualizer scale them to a sum of 1, which changes the numbers but not the ranking. The hub update uses the authorities just computed, which is the standard order.
Load the example: a small web of directory pages on top and content pages below.
Example graph: A links to D, E and F. B links to D and E. C links to D and F. G links to D and to three pages, H, I and J, that no other page links to. G has the most links, four, and A has three.
A is the best hub although G has more links: three of G's four links point to pages that nobody else recommends. This is the core idea of link analysis: a link counts by who makes it and where it points, not by how many there are.
Time: O(k(V + E)) · Space: O(V)
Each round reads every link twice, once for the authorities and once for the hubs, so it costs O(V + E). The number of rounds k depends on the gap between the two largest eigenvalues of AᵀA. In Kleinberg's setting HITS ran at query time on a small subgraph of a few thousand pages, the search results plus their neighbours, so it was fast enough, unlike PageRank, which is computed once for the whole web. Two score vectors of length V are kept.
HITS and its relatives rank the vertices of a directed graph by the links between them.
| Alternative | Prefer it when | Cost |
|---|---|---|
| HITS | Two roles, sources (authorities) and directories (hubs), on a topic subgraph built for one query. | O(k(V + E)) per query |
| PageRank | One global importance score per page, computed once offline for the whole graph. | O(k(V + E)) once |
| SALSA | A random-walk version of HITS (Lempel and Moran 2000) that is less dominated by one tightly linked group. | O(k(V + E)) |
| In-degree | A quick baseline: it counts links without weighing who made them. | O(V + E) |
Read the full article: Graph Centrality Measures: Degree, Betweenness, PageRank
Read the full article: Directed vs Undirected Graphs Explained
Related algorithms: PageRank, Eigenvector Centrality, Personalized PageRank, Betweenness Centrality