Skip to main content

HITS

UDTF: 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​

ArgumentRequiredColumnsDescription
edgesyes
  • src, dst: Int32, Int64, Utf8, LargeUtf8, Utf8View
  • weight (optional): Float32, Float64
  • edge_id (optional): Int32, Int64
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​

OptionTypeDefaultConstraintsDescription
epsilonnumber0.00001> 0positive convergence tolerance
max_iterationsinteger100min 1; max 4294967295maximum iteration count, at least 1
normalizebooleanfalsewhether 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​

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; run gpu_validate_call to get the concrete, table-specific output schema.

Examples​

This example runs on the citation network demo dataset.

Which papers act as reading guides, and which works are their shared foundations?​

HITS scores two citation roles through mutually reinforcing links. A paper's hub score reflects the authority of works it cites; its authority score reflects how strongly it is cited by hubs. This query ranks the top four vertices for each role and joins both lists back to paper titles and years.

CREATE OR REPLACE TABLE hits_snapshot AS
SELECT vertex, hub_score, authority_score
FROM cugraph_hits(edges => (SELECT src, dst FROM citation_edges));

WITH guides AS (
SELECT vertex, hub_score AS score, 'Reading guide' AS role
FROM hits_snapshot
ORDER BY hub_score DESC, vertex
LIMIT 4),
foundations AS (
SELECT vertex, authority_score AS score, 'Foundation' AS role
FROM hits_snapshot
ORDER BY authority_score DESC, vertex
LIMIT 4)
SELECT h.role, p.year, p.title
FROM (
SELECT * FROM guides
UNION ALL
SELECT * FROM foundations
) h
JOIN papers p ON p.paper_id = h.vertex
ORDER BY h.role, h.score DESC, h.vertex;
roleyeartitle
Foundation2004Distinctive Image Features from Scale-Invariant Keypoints
Foundation2014VERY DEEP CONVOLUTIONAL NETWORKS FOR LARGE-SCALE IMAGE RECOGNITION
Foundation2012ImageNet Classification with Deep Convolutional Neural Networks
Foundation2005Histograms of oriented gradients for human detection
Reading guide2019Deep Learning for Generic Object Detection: A Survey
Reading guide2018Deep Learning for Generic Object Detection: A Survey.
Reading guide2015Recent Advances in Convolutional Neural Networks
Reading guide2019Object Detection With Deep Learning: A Review

One snapshot supplies both rankings. The returned rows identify each paper's role, year, and title. These scores describe citation structure; they do not prove research quality.

Limits​

No algorithm-specific limitations.

To dry-run validate relation metadata, column types, and options without execution, see gpu_validate_call.