In Degrees All
SQL function: cugraph_in_degrees_all
Official cuGraph reference: Python API
Count incoming edges for every vertex in the graph.
Signature
cugraph_in_degrees_all(table_name [, src_col, dst_col [, weight_col [, options_json]]])
Relation inputs
The first positional argument names a registered edge table or view (the edges role). Parenthesized relation subqueries are not accepted; metadata validation uses the same registered name.
Vertex ID types
The edges relation declares the accepted vertex-ID domains. Numeric calls preserve the existing numeric schema. When logical string support is declared, Utf8, LargeUtf8, and Utf8View endpoint columns share one logical domain; their vertex-identity outputs are canonicalized to Utf8.
| Domain | Accepted endpoint inputs | Output contract |
|---|---|---|
| Numeric edge endpoints | Int32, Int64 | The numeric output schema is used for numeric calls. |
| Logical string edge endpoints | Utf8, LargeUtf8, Utf8View | Vertex identity columns are canonicalized to Utf8; scores, distances, counts, coordinates, and opaque labels remain numeric. |
The native mapping type is Int64. Call-specific output schemas come 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
Scalar arguments & JSON options
Positional scalar arguments
src_col and dst_col name the edge endpoint columns; both are optional and default to src and dst.
| Argument | Type | Required | Default | Notes |
|---|---|---|---|---|
weight_col | Utf8|null | no | accepted as an edge-column binding; native algorithm execution does not consume weights; semantic effect: none for this algorithm |
JSON options
This function has no algorithm-specific options.
Graph construction options
Graph construction follows the shared defaults (directed=true, renumbering, python_cugraph policy) documented in Graph Construction Options.
Output schema
| Column | Type | Nullable | Description |
|---|---|---|---|
vertex | Int64|Utf8 | no | Vertex whose in-degree count is reported. |
in_degree | Int64 | no | Number of incoming edges 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.
In-graph citations versus reported metadata
papers.n_citation is AMiner's global citation count; in_degree counts only
edges present in this corpus. Joining the two measures how much of each paper's
audience lies outside the dataset:
SELECT p.year, d.in_degree AS in_graph, p.n_citation AS reported,
p.n_citation - d.in_degree AS outside,
p.title AS paper
FROM cugraph_in_degrees_all('citation_edges', 'src', 'dst') d
JOIN papers p ON p.paper_id = d.vertex
ORDER BY d.in_degree DESC
LIMIT 5;
| year | in_graph | reported | outside | paper |
|---|---|---|---|---|
| 2004 | 22,892 | 35,541 | 12,649 | Distinctive Image Features from Scale-Invariant Keypoints |
| 2011 | 19,662 | 31,047 | 11,385 | LIBSVM: A library for support vector machines |
| 1989 | 17,207 | 44,175 | 26,968 | Genetic algorithms in search, optimization, and machine learning |
| 1996 | 16,579 | 42,437 | 25,858 | Fuzzy sets |
| 2001 | 15,048 | 34,741 | 19,693 | Random Forests |
SIFT is the most-cited paper within the corpus. Older cross-disciplinary classics (genetic algorithms, fuzzy sets) show the biggest gap — more than half their citations come from fields this CS-centric corpus doesn't cover.
Limitations & lifecycle
No algorithm-specific limitations.
Validate before running
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_in_degrees_all',
'{"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.