cugraph.centrality.degree_centrality#
- cugraph.centrality.degree_centrality(G, normalized=True)[source]#
Computes the degree centrality of each vertex of the input graph.
- Parameters:
- GcuGraph.Graph or networkx.Graph
cuGraph graph descriptor with connectivity information. The graph can contain either directed or undirected edges.
- normalizedbool, optional, default=True
If True normalize the resulting degree centrality values
- Returns:
- dfcudf.DataFrame or Dictionary if using NetworkX
GPU data frame containing two cudf.Series of size V: the vertex identifiers and the corresponding degree centrality values.
- df[‘vertex’]cudf.Series
Contains the vertex identifiers
- df[‘degree_centrality’]cudf.Series
Contains the degree centrality of vertices
Examples
>>> from cugraph.datasets import karate >>> G = karate.get_graph(download=True) >>> dc = cugraph.degree_centrality(G)