dgl.DGLGraph.in_degree

DGLGraph.in_degree(v)[source]

Return the in-degree of node v.

Parameters:v (int) – The node ID.
Returns:The in-degree.
Return type:int

Examples

>>> G = dgl.DGLGraph()
>>> G.add_nodes(3)
>>> G.add_edges([0, 0, 1], [1, 2, 2])   # (0, 1), (0, 2), (1, 2)
>>> G.in_degree(2)
2

See also

in_degrees()