HITS
SQL function: cugraph_hits
Official cuGraph reference: C API
Compute mutually reinforcing hub and authority scores: strong hubs point to strong authorities, and strong authorities are linked from strong hubs.
Quickstart
The call below supplies edges from registered relation target_edges with canonical src and dst columns and may include weight. Substitute your own registered relations.
SELECT * FROM cugraph_hits(edges => (SELECT src, dst FROM target_edges));
Inputs
Every relation is a named parenthesized SELECT subquery. The required edges role uses canonical src and dst columns; every role, its canonical columns, and their accepted Arrow types are listed under Relation arguments. Metadata validation resolves registered tables named in its JSON request.
Endpoint columns accept numeric Int32, Int64 vertex IDs or logical string Utf8, LargeUtf8, Utf8View vertex IDs; string vertex-identity outputs are canonicalized to Utf8 (native mapping Int64) while scores, distances, counts, coordinates, and opaque labels stay numeric. The shared vertex-ID contract is summarized in Vertex ID support; the concrete call-specific schema comes from gpu_validate_call.
Logical string side-input limitations:
- edge ID columns and edge-ID predicate side inputs are not supported for logical string graphs
Arguments and options
Relation arguments
| Argument | Required | Columns | Description |
|---|---|---|---|
edges | yes |
| edge relation with canonical src and dst columns, plus optional weight and edge_id columns |
Every edge_id column must have the integer type of src and dst; string-keyed graphs accept no edge IDs.
Named value arguments
| Option | Type | Default | Constraints | Description |
|---|---|---|---|---|
epsilon | number | 0.00001 | > 0 | positive convergence tolerance |
max_iterations | integer | 100 | min 1; max 4294967295 | maximum iteration count, at least 1 |
normalize | boolean | false | whether HITS scores are normalized |
Graph construction options
Graph construction follows the shared defaults (directed=true, renumbering, python_cugraph policy) documented in Graph Construction Options.
Output
| Column | Type | Nullable | Description |
|---|---|---|---|
vertex | Int64|Utf8 | no | Vertex receiving HITS scores. |
hub_score | Float64 | no | HITS hub score for the vertex. |
authority_score | Float64 | no | HITS authority score for the vertex. |
These are generic descriptor schemas; run gpu_validate_call to get the concrete, table-specific output schema.
Examples
This example runs on the citation network demo dataset.
Hubs versus authorities
HITS returns two scores per vertex in one pass. In a citation graph they
separate two kinds of importance that PageRank blends: a hub cites many
authorities (typically a survey), and an authority is cited by many hubs
(typically a foundational result). One call feeds two ORDER BY clauses:
SELECT p.year, p.n_references, p.title
FROM cugraph_hits(edges => (SELECT src, dst FROM citation_edges)) h
JOIN papers p ON p.paper_id = h.vertex
ORDER BY h.hub_score DESC
LIMIT 4;
| year | n_references | title |
|---|---|---|
| 2019 | 292 | Deep Learning for Generic Object Detection: A Survey |
| 2018 | 276 | Deep Learning for Generic Object Detection: A Survey. |
| 2015 | 299 | Recent Advances in Convolutional Neural Networks |
| 2019 | 211 | Object Detection With Deep Learning: A Review |
SELECT p.year, p.n_citation, p.title
FROM cugraph_hits(edges => (SELECT src, dst FROM citation_edges)) h
JOIN papers p ON p.paper_id = h.vertex
ORDER BY h.authority_score DESC
LIMIT 4;
| year | n_citation | title |
|---|---|---|
| 2004 | 35,541 | Distinctive Image Features from Scale-Invariant Keypoints |
| 2014 | 18,029 | VERY DEEP CONVOLUTIONAL NETWORKS FOR LARGE-SCALE IMAGE RECOGNITION |
| 2012 | 16,802 | ImageNet Classification with Deep Convolutional Neural Networks |
| 2005 | 19,433 | Histograms of oriented gradients for human detection |
The top hubs are titled "Survey" and "Review"; the top authorities are SIFT, VGG, AlexNet, and HOG. The mutually reinforcing definition places both lists in the field with the densest hub/authority structure (computer vision) without any field labels supplied as input.
Limits
No algorithm-specific limitations.
To dry-run validate relation metadata, column types, and options without execution, see gpu_validate_call.