diff --git a/notebooks/link_analysis/HITS.ipynb b/notebooks/link_analysis/HITS.ipynb index 082b6c05185..01fd22929d5 100755 --- a/notebooks/link_analysis/HITS.ipynb +++ b/notebooks/link_analysis/HITS.ipynb @@ -5,7 +5,6 @@ "metadata": {}, "source": [ "# HITS\n", - "# Skip notebook test\n", "\n", "In this notebook, we will use both NetworkX and cuGraph to compute HITS. \n", "The NetworkX and cuGraph processes will be interleaved so that each step can be compared.\n", diff --git a/python/cugraph/cugraph/centrality/betweenness_centrality.py b/python/cugraph/cugraph/centrality/betweenness_centrality.py index 458f282dc2b..fb89d248280 100644 --- a/python/cugraph/cugraph/centrality/betweenness_centrality.py +++ b/python/cugraph/cugraph/centrality/betweenness_centrality.py @@ -48,7 +48,7 @@ def betweenness_centrality( Parameters ---------- G : cuGraph.Graph or networkx.Graph - The graph can be either directed (DiGraph) or undirected (Graph). + The graph can be either directed (Graph(directed=True)) or undirected. Weights in the graph are ignored, the current implementation uses BFS traversals. Use weight parameter if weights need to be considered (currently not supported) @@ -65,8 +65,8 @@ def betweenness_centrality( normalized : bool, optional Default is True. If true, the betweenness values are normalized by - __2 / ((n - 1) * (n - 2))__ for Graphs (undirected), and - __1 / ((n - 1) * (n - 2))__ for DiGraphs (directed graphs) + __2 / ((n - 1) * (n - 2))__ for undirected Graphs, and + __1 / ((n - 1) * (n - 2))__ for directed Graphs where n is the number of nodes in G. Normalization will ensure that values are in [0, 1], this normalization scales for the highest possible value where one @@ -170,7 +170,7 @@ def edge_betweenness_centrality( Parameters ---------- G : cuGraph.Graph or networkx.Graph - The graph can be either directed (DiGraph) or undirected (Graph). + The graph can be either directed (Graph(directed=True)) or undirected. Weights in the graph are ignored, the current implementation uses BFS traversals. Use weight parameter if weights need to be considered (currently not supported) @@ -186,8 +186,8 @@ def edge_betweenness_centrality( normalized : bool, optional Default is True. If true, the betweenness values are normalized by - 2 / (n * (n - 1)) for Graphs (undirected), and - 1 / (n * (n - 1)) for DiGraphs (directed graphs) + 2 / (n * (n - 1)) for undirected Graphs, and + 1 / (n * (n - 1)) for directed Graphs where n is the number of nodes in G. Normalization will ensure that values are in [0, 1], this normalization scales for the highest possible value where one diff --git a/python/cugraph/cugraph/centrality/betweenness_centrality_wrapper.pyx b/python/cugraph/cugraph/centrality/betweenness_centrality_wrapper.pyx index e63b6996816..4984f70822a 100644 --- a/python/cugraph/cugraph/centrality/betweenness_centrality_wrapper.pyx +++ b/python/cugraph/cugraph/centrality/betweenness_centrality_wrapper.pyx @@ -17,7 +17,6 @@ # cython: language_level = 3 from cugraph.centrality.betweenness_centrality cimport betweenness_centrality as c_betweenness_centrality -from cugraph.structure.graph_classes import DiGraph from cugraph.structure.graph_primtypes cimport * from libc.stdint cimport uintptr_t from libcpp cimport bool @@ -177,8 +176,7 @@ def batch_betweenness_centrality(input_graph, normalized, endpoints, comms = Comms.get_comms() replicated_adjlists = input_graph.batch_adjlists work_futures = [client.submit(run_mg_work, - (data, type(input_graph) - is DiGraph), + (data, input_graph.is_directed()), normalized, endpoints, weights, @@ -197,7 +195,7 @@ def sg_betweenness_centrality(input_graph, normalized, endpoints, weights, handle = Comms.get_default_handle() adjlist = input_graph.adjlist input_data = ((adjlist.offsets, adjlist.indices, adjlist.weights), - type(input_graph) is DiGraph) + input_graph.is_directed()) df = run_internal_work(handle, input_data, normalized, endpoints, weights, vertices, result_dtype) return df diff --git a/python/cugraph/cugraph/centrality/edge_betweenness_centrality_wrapper.pyx b/python/cugraph/cugraph/centrality/edge_betweenness_centrality_wrapper.pyx index 095d291c45e..f6c868de6e9 100644 --- a/python/cugraph/cugraph/centrality/edge_betweenness_centrality_wrapper.pyx +++ b/python/cugraph/cugraph/centrality/edge_betweenness_centrality_wrapper.pyx @@ -18,7 +18,6 @@ from cugraph.centrality.betweenness_centrality cimport edge_betweenness_centrality as c_edge_betweenness_centrality from cugraph.structure import graph_primtypes_wrapper -from cugraph.structure.graph_classes import DiGraph, Graph from cugraph.structure.graph_primtypes cimport * from libc.stdint cimport uintptr_t from libcpp cimport bool @@ -166,8 +165,7 @@ def batch_edge_betweenness_centrality(input_graph, comms = Comms.get_comms() replicated_adjlists = input_graph.batch_adjlists work_futures = [client.submit(run_mg_work, - (data, type(input_graph) - is DiGraph), + (data, input_graph.is_directed()), normalized, weights, vertices, @@ -188,7 +186,7 @@ def sg_edge_betweenness_centrality(input_graph, normalized, weights, handle = Comms.get_default_handle() adjlist = input_graph.adjlist input_data = ((adjlist.offsets, adjlist.indices, adjlist.weights), - type(input_graph) is DiGraph) + input_graph.is_directed()) df = run_internal_work(handle, input_data, normalized, weights, vertices, result_dtype) return df