Skip to main content

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.

Signature

cugraph_hits(table_name [, src_col, dst_col [, weight_col [, options_json]]])

Quickstart

The call below expects a registered edge table or view target_edges with endpoint columns src and dst. Substitute your own registered relations.

SELECT * FROM cugraph_hits('target_edges');

Inputs

table_name must be a registered edge table or view (the edges role); parenthesized subqueries are not accepted, and metadata validation resolves the same registered name.

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

Positional scalar arguments

src_col and dst_col name the edge endpoint columns; both are optional and default to src and dst.

ArgumentTypeRequiredDefaultNotes
weight_colUtf8|nullnoaccepted as an edge-column binding; native algorithm execution does not consume weights; semantic effect: none for this algorithm

JSON options

OptionTypeDefaultConstraintsDescription
epsilonFloat640.00001> 0Convergence tolerance on the summed change in hub scores between consecutive iterations. Smaller values tighten convergence and may need more iterations.
max_iterationsUInt32100min 1Upper bound on HITS iterations.
normalizeBooleanfalseWhen true, the final hub and authority score arrays are each scaled to L1 norm 1.0 before being returned.

Graph construction options

Graph construction follows the shared defaults (directed=true, renumbering, python_cugraph policy) documented in Graph Construction Options.

Output

ColumnTypeNullableDescription
vertexInt64|Utf8noVertex receiving HITS scores.
hub_scoreFloat64noHITS hub score for the vertex.
authority_scoreFloat64noHITS authority score for the vertex.

These are generic descriptor schemas; validate the 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('citation_edges', 'src', 'dst') h
JOIN papers p ON p.paper_id = h.vertex
ORDER BY h.hub_score DESC
LIMIT 4;
yearn_referencestitle
2019292Deep Learning for Generic Object Detection: A Survey
2018276Deep Learning for Generic Object Detection: A Survey.
2015299Recent Advances in Convolutional Neural Networks
2019211Object Detection With Deep Learning: A Review
SELECT p.year, p.n_citation, p.title
FROM cugraph_hits('citation_edges', 'src', 'dst') h
JOIN papers p ON p.paper_id = h.vertex
ORDER BY h.authority_score DESC
LIMIT 4;
yearn_citationtitle
200435,541Distinctive Image Features from Scale-Invariant Keypoints
201418,029VERY DEEP CONVOLUTIONAL NETWORKS FOR LARGE-SCALE IMAGE RECOGNITION
201216,802ImageNet Classification with Deep Convolutional Neural Networks
200519,433Histograms 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.

Validate the call

Dry-run validation checks registered relation metadata, column presence, static dtypes, and options only; it does not scan edge data, construct a graph, or prove source-vertex existence:

SELECT * FROM gpu_validate_call(
'cugraph_hits',
'{"schema_version":1,"relations":{"edges":{"table":"target_edges"}},"options":{"src_col":"src","dst_col":"dst"}}'
);

See GPU Function Catalog API for the full gpu_validate_call contract.