Skip to content

Commit

Permalink
Re-enabled HITS notebook for testing, updated BC to no longer check f…
Browse files Browse the repository at this point in the history
…or deprecated DiGraph classes.
  • Loading branch information
rlratzel committed Nov 11, 2021
1 parent 6ccd1eb commit d592af4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
1 change: 0 additions & 1 deletion notebooks/link_analysis/HITS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions python/cugraph/cugraph/centrality/betweenness_centrality.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit d592af4

Please sign in to comment.