Skip to content

Commit

Permalink
Merge branch 'branch-24.12' into bug_build
Browse files Browse the repository at this point in the history
  • Loading branch information
seunghwak authored Nov 21, 2024
2 parents 9cce314 + c7f2c1d commit de75ea6
Show file tree
Hide file tree
Showing 29 changed files with 187 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/cugraph/source/nx_cugraph/benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ We ran several commonly used graph algorithms on both `networkx` and `nx-cugraph
![bench-image](../_static/bc_benchmark.png)

<figcaption style="text-align: center;">Results from running this <a
href="https://github.com/rapidsai/cugraph/blob/HEAD/benchmarks/nx-cugraph/pytest-based/bench_algos.py">Benchmark</a><span
href="https://github.com/rapidsai/nx-cugraph/blob/HEAD/benchmarks/nx-cugraph/pytest-based/bench_algos.py">Benchmark</a><span
class="title-ref"></span></figcaption>
</figure>

Expand All @@ -23,4 +23,4 @@ Below are the steps to reproduce the results on your own.

4. Install the latest `nx-cugraph` by following the [Installation Guide](installation.md)

5. Follow the instructions written in the README [here](https://github.com/rapidsai/cugraph/blob/HEAD/benchmarks/nx-cugraph/pytest-based)
5. Follow the instructions written in the README [here](https://github.com/rapidsai/nx-cugraph/blob/HEAD/benchmarks/nx-cugraph/pytest-based/README.md)
2 changes: 1 addition & 1 deletion docs/cugraph/source/nx_cugraph/supported-algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,4 @@ Generators


To request nx-cugraph backend support for a NetworkX API that is not listed
above, visit the `cuGraph GitHub repo <https://github.com/rapidsai/cugraph>`_.
above, visit the `nx-cugraph GitHub repo <https://github.com/rapidsai/nx-cugraph>`_.
10 changes: 10 additions & 0 deletions python/cugraph/cugraph/centrality/betweenness_centrality.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ def betweenness_centrality(
Algorithm (2001) to compute exact or approximate betweenness.
If weights are provided in the edgelist, they will not be used.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
k : int, list or cudf object or None, optional (default=None)
If k is not None, use k node samples to estimate betweenness. Higher
values give better approximation. If k is either a list, a cudf DataFrame,
Expand Down Expand Up @@ -224,6 +229,11 @@ def edge_betweenness_centrality(
The current implementation uses BFS traversals. Use weight parameter
if weights need to be considered (currently not supported).
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
k : int or list or None, optional (default=None)
If k is not None, use k node samples to estimate betweenness. Higher
values give better approximation. If k is either a list, a cudf DataFrame,
Expand Down
7 changes: 6 additions & 1 deletion python/cugraph/cugraph/centrality/degree_centrality.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -28,6 +28,11 @@ def degree_centrality(G, normalized=True):
cuGraph graph descriptor with connectivity information. The graph can
contain either directed or undirected edges.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
normalized : bool, optional, default=True
If True normalize the resulting degree centrality values
Expand Down
7 changes: 6 additions & 1 deletion python/cugraph/cugraph/centrality/eigenvector_centrality.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -37,6 +37,11 @@ def eigenvector_centrality(G, max_iter=100, tol=1.0e-6):
cuGraph graph descriptor with connectivity information. The graph can
contain either directed or undirected edges.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
max_iter : int, optional (default=100)
The maximum number of iterations before an answer is returned. This can
be used to limit the execution time and do an early exit before the
Expand Down
7 changes: 6 additions & 1 deletion python/cugraph/cugraph/centrality/katz_centrality.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -48,6 +48,11 @@ def katz_centrality(
cuGraph graph descriptor with connectivity information. The graph can
contain either directed or undirected edges.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
alpha : float, optional (default=None)
Attenuation factor defaulted to None. If alpha is not specified then
it is internally calculated as 1/(degree_max) where degree_max is the
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/community/egonet.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def ego_graph(G, n, radius=1, center=True, undirected=None, distance=None):
information. Edge weights, if present, should be single or double
precision floating point values.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
n : integer or list, cudf.Series, cudf.DataFrame
A single node as integer or a cudf.DataFrame if nodes are
represented with multiple columns. If a cudf.DataFrame is provided,
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/community/induced_subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ def induced_subgraph(
G : cugraph.Graph or networkx.Graph
The current implementation only supports weighted graphs.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
vertices : cudf.Series or cudf.DataFrame
Specifies the vertices of the induced subgraph. For multi-column
vertices, vertices should be provided as a cudf.DataFrame
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/community/ktruss_subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def k_truss(
defined for only undirected graphs as they are defined for
undirected triangle in a graph.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
k : int
The desired k to be used for extracting the k-truss subgraph.
Expand Down
7 changes: 6 additions & 1 deletion python/cugraph/cugraph/community/leiden.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -56,6 +56,11 @@ def leiden(
The adjacency list will be computed if not already present.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
max_iter : integer, optional (default=100)
This controls the maximum number of levels/iterations of the Leiden
algorithm. When specified the algorithm will terminate after no more
Expand Down
7 changes: 6 additions & 1 deletion python/cugraph/cugraph/community/louvain.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -62,6 +62,11 @@ def louvain(
present.
The current implementation only supports undirected graphs.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
max_level : integer, optional (default=100)
This controls the maximum number of levels of the Louvain
algorithm. When specified the algorithm will terminate after no more
Expand Down
15 changes: 15 additions & 0 deletions python/cugraph/cugraph/community/spectral_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def spectralBalancedCutClustering(
G : cugraph.Graph or networkx.Graph
Graph descriptor
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
num_clusters : integer
Specifies the number of clusters to find, must be greater than 1
Expand Down Expand Up @@ -142,6 +147,11 @@ def spectralModularityMaximizationClustering(
G : cugraph.Graph or networkx.Graph
cuGraph graph descriptor. This graph should have edge weights.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
num_clusters : integer
Specifies the number of clusters to find
Expand Down Expand Up @@ -233,6 +243,11 @@ def analyzeClustering_modularity(
G : cugraph.Graph or networkx.Graph
graph descriptor. This graph should have edge weights.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
n_clusters : integer
Specifies the number of clusters in the given clustering
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/community/subgraph_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def subgraph(
G : cugraph.Graph or networkx.Graph
The current implementation only supports weighted graphs.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
vertices : cudf.Series or cudf.DataFrame
Specifies the vertices of the induced subgraph. For multi-column
vertices, vertices should be provided as a cudf.DataFrame
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/community/triangle_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def triangle_count(G, start_list=None):
(edge weights are not used in this algorithm).
The current implementation only supports undirected graphs.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
start_list : list or cudf.Series
list of vertices for triangle count. if None the entire set of vertices
in the graph is processed
Expand Down
17 changes: 16 additions & 1 deletion python/cugraph/cugraph/components/connectivity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -115,6 +115,11 @@ def weakly_connected_components(G, directed=None, connection=None, return_labels
The adjacency list will be computed if not already present. The number
of vertices should fit into a 32b int.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
directed : bool, optional (default=None)
NOTE
Expand Down Expand Up @@ -224,6 +229,11 @@ def strongly_connected_components(
The adjacency list will be computed if not already present. The number
of vertices should fit into a 32b int.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
directed : bool, optional (default=True)
NOTE
Expand Down Expand Up @@ -330,6 +340,11 @@ def connected_components(G, directed=None, connection="weak", return_labels=None
The adjacency list will be computed if not already present. The number
of vertices should fit into a 32b int.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
directed : bool, optional (default=True)
NOTE
Expand Down
7 changes: 6 additions & 1 deletion python/cugraph/cugraph/cores/core_number.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -37,6 +37,11 @@ def core_number(G, degree_type="bidirectional"):
of the core numbers.
The current implementation only supports undirected graphs.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
degree_type: str, (default="bidirectional")
This option determines if the core number computation should be based
on input, output, or both directed edges, with valid values being
Expand Down
7 changes: 6 additions & 1 deletion python/cugraph/cugraph/cores/k_core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -55,6 +55,11 @@ def k_core(G, k=None, core_number=None, degree_type="bidirectional"):
weights, they don't participate in the calculation of the k-core.
The current implementation only supports undirected graphs.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
k : int, optional (default=None)
Order of the core. This value must not be negative. If set to None, the
main core is returned.
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/link_analysis/pagerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ def pagerank(
as an edge list.
The transposed adjacency list will be computed if not already present.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
alpha : float, optional (default=0.85)
The damping factor alpha represents the probability to follow an
outgoing edge, standard value is 0.85.
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/link_prediction/cosine.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ def cosine_coefficient(
This implementation only supports undirected, non-multi Graphs.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
ebunch : cudf.DataFrame or iterable of node pairs, optional (default=None)
A GPU dataframe consisting of two columns representing pairs of
vertices or iterable of 2-tuples (u, v) where u and v are nodes in
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/link_prediction/jaccard.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ def jaccard_coefficient(
This implementation only supports undirected, non-multi Graphs.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
ebunch : cudf.DataFrame or iterable of node pairs, optional (default=None)
A GPU dataframe consisting of two columns representing pairs of
vertices or iterable of 2-tuples (u, v) where u and v are nodes in
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/link_prediction/overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ def overlap_coefficient(
This implementation only supports undirected, non-multi edge Graph.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
ebunch : cudf.DataFrame or iterable of node pairs, optional (default=None)
A GPU dataframe consisting of two columns representing pairs of
vertices or iterable of 2-tuples (u, v) where u and v are nodes in
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/link_prediction/sorensen.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ def sorensen_coefficient(
This implementation only supports undirected, non-multi Graphs.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
ebunch : cudf.DataFrame or iterable of node pairs, optional (default=None)
A GPU dataframe consisting of two columns representing pairs of
vertices or iterable of 2-tuples (u, v) where u and v are nodes in
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/sampling/node2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ def node2vec(G, start_vertices, max_depth=1, compress_result=True, p=1.0, q=1.0)
The graph can be either directed or undirected.
Weights in the graph are ignored.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
start_vertices: int or list or cudf.Series or cudf.DataFrame
A single node or a list or a cudf.Series of nodes from which to run
the random walks. In case of multi-column vertices it should be
Expand Down
5 changes: 5 additions & 0 deletions python/cugraph/cugraph/sampling/random_walks.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ def random_walks(
G : cuGraph.Graph or networkx.Graph
The graph can be either directed or undirected.
.. deprecated:: 24.12
Accepting a ``networkx.Graph`` is deprecated and will be removed in a
future version. For ``networkx.Graph`` use networkx directly with
the ``nx-cugraph`` backend. See: https://rapids.ai/nx-cugraph/
random_walks_type : str, optional (default='uniform')
Type of random walks: 'uniform', 'biased', 'node2vec'.
Only 'uniform' random walks is currently supported
Expand Down
Loading

0 comments on commit de75ea6

Please sign in to comment.