repo_id stringlengths 21 96 | file_path stringlengths 31 155 | content stringlengths 1 92.9M | __index_level_0__ int64 0 0 |
|---|---|---|---|
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/symmetrize_edgelist_sg.cu | /*
* Copyright (c) 2021-2022, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/symmetrize_edgelist_impl.cuh | /*
* Copyright (c) 2020-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/graph_weight_utils_sg.cu | /*
* Copyright (c) 2020-2022, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/remove_multi_edges_impl.cuh | /*
* Copyright (c) 2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/symmetrize_graph_sg.cu | /*
* Copyright (c) 2021-2022, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/symmetrize_edgelist_mg.cu | /*
* Copyright (c) 2021-2022, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/renumber_edgelist_impl.cuh | /*
* Copyright (c) 2020-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/create_graph_from_edgelist_sg.cu | /*
* Copyright (c) 2021-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/relabel_impl.cuh | /*
* Copyright (c) 2020-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/relabel_sg.cu | /*
* Copyright (c) 2021, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/renumber_edgelist_mg.cu | /*
* Copyright (c) 2021-2022, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/create_graph_from_edgelist_mg.cu | /*
* Copyright (c) 2021-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/graph_weight_utils_mg.cu | /*
* Copyright (c) 2020-2022, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/transpose_graph_storage_impl.cuh | /*
* Copyright (c) 2021-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/induced_subgraph_sg.cu | /*
* Copyright (c) 2021-2022, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/remove_self_loops.cu | /*
* Copyright (c) 2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/induced_subgraph_impl.cuh | /*
* Copyright (c) 2021-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/transpose_graph_sg.cu | /*
* Copyright (c) 2021-2022, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/graph_view_sg.cu | /*
* Copyright (c) 2020-2022, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/symmetrize_graph_impl.cuh | /*
* Copyright (c) 2021-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/remove_self_loops_impl.cuh | /*
* Copyright (c) 2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/coarsen_graph_mg.cu | /*
* Copyright (c) 2021-2022, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/create_graph_from_edgelist_impl.cuh | /*
* Copyright (c) 2021-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src | rapidsai_public_repos/cugraph/cpp/src/structure/coarsen_graph_impl.cuh | /*
* Copyright (c) 2020-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src/structure | rapidsai_public_repos/cugraph/cpp/src/structure/detail/structure_utils.cuh | /*
* Copyright (c) 2020-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp/src/structure | rapidsai_public_repos/cugraph/cpp/src/structure/legacy/graph.cu | /*
* Copyright (c) 2020-2023, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 0 |
rapidsai_public_repos/cugraph/cpp | rapidsai_public_repos/cugraph/cpp/doxygen/main_page.md | # libcugraph
libcugraph is a C++ GPU Accelerated Graph Algorithm library.
| 0 |
rapidsai_public_repos/cugraph/cpp | rapidsai_public_repos/cugraph/cpp/doxygen/Doxyfile | # Doxyfile 1.9.8
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will ... | 0 |
rapidsai_public_repos/cugraph/cpp | rapidsai_public_repos/cugraph/cpp/doxygen/header.html | <!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" con... | 0 |
rapidsai_public_repos/cugraph | rapidsai_public_repos/cugraph/notebooks/README.md |
# cuGraph Notebooks

This repository contains a collection of Jupyter Notebooks that outline how to run various cuGraph analytics. The notebooks do not address a complete data science problem. The notebooks are simply examples of how to run the graph analytics.... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/modules/README.md | # This folde contains partial notebooks
The code here is meant to be used to build other notebooks | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/modules/mag240m_pg.ipynb | # location of where the data is being downloaded/saved to
base_dir = "../../datasets"# Feature variable
skip_edges = False
skip_features = False
load_paper_features = True
load_paper_labels = True
load_paper_year = True
load_affiliation_edges = True
load_writes_edges = True
load_cites_edges = True# Import needed libr... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/algorithms/README.md | # cuGraph Algorithm Notebooks
As all the algorithm Notebooks are updated and migrated to this area, they will show in this Readme. Until then they are available [here](../README.md)

This repository contains a collection of Jupyter Notebooks that outline how to... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/layout/Force-Atlas2.ipynb | # Import RAPIDS libraries
import cugraph
import time# Define the parameters
ITERATIONS=500
THETA=1.0
OPTIMIZE=True# Import a built-in dataset
from cugraph.datasets import netscience# Setup Viz
client = Client()
hv.notebook_extension('bokeh','matplotlib')
decimate.max_samples=20000
dynspread.threshold=0.01
datashade.cm... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/components/README.md |
# cuGraph Components Algorithms
<img src="../../img/zachary_black_lines.png" width="35%"/>
cuGraph Components notebooks contain Jupyter Notebooks that demonstrate algorithms to identify the connected subgraphs within a graph.
Manipulation of the data before or after the graph analytic is not covered here. Extende... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/components/ConnectedComponents.ipynb | # Import needed libraries
import cugraph
import cudf
import numpy as npfrom cugraph.datasets import netscienceG = netscience.get_graph(download=True)# Call cugraph.weakly_connected_components on the dataframe
df = cugraph.weakly_connected_components(G)
df.head(5)# Use groupby on the 'labels' column of the WCC output to... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/community/ktruss.ipynb | # Import needed libraries
import cugraph
import cudf
# Import a built-in dataset
from cugraph.datasets import karate# Create a graph using the imported Dataset object
G = karate.get_graph(download=True)
G = G.to_undirected()print("Main Graph")
print("\tNumber of Vertices: " + str(G.number_of_vertices()))
print("\tNumb... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/community/ECG.ipynb | # Import needed libraries
import cugraph
import cudf
# Import a built-in dataset
from cugraph.datasets import karate# You can also just get the edgelist
gdf = karate.get_edgelist(download=True)
# The algorithm also requires that there are vertex weights. Just use 1.0
gdf["data"] = 1.0# just for fun, let's look at t... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/community/Triangle-Counting.ipynb | # Import needed libraries
import cugraph
import cudf
from collections import OrderedDict
# Import a built-in dataset
from cugraph.datasets import karate# NetworkX libraries
import networkx as nx
import pandas as pd
from scipy.io import mmreaddatafile= '../../data/karate.csv'
# Read the data, this also created a Networ... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/community/README.md |
# cuGraph Community Notebooks
<img src="../../img/zachary_graph_clusters.png" width="35%"/>
## cuGraph Community notebooks contain a collection of Jupyter Notebooks with algorithms that identify related groups of nodes within the graph:
* Louvain, Leiden, ECG, and Spectral Clustering all identify clusters or tightl... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/community/Subgraph-Extraction.ipynb | # Import needed libraries
import cugraph
import cudf
# Import a built-in dataset
from cugraph.datasets import karate# You can also just get the edgelist
gdf = karate.get_edgelist(download=True)
# The louvain algorithm requires that there are vertex weights. Just use 1.0
gdf["data"] = 1.0
# Create a graph
G = cugra... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/community/Spectral-Clustering.ipynb | # Import needed libraries
import cugraph
import cudf
import numpy as np
# Import a built-in dataset
from cugraph.datasets import karategdf = karate.get_edgelist(download=True)
# The algorithm requires that there are edge weights. In this case all the weights are being set to 1
gdf["data"] = cudf.Series(np.ones(len(g... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/community/Louvain.ipynb | # Import needed libraries
import cugraph
import cudf
# Import a built-in dataset
from cugraph.datasets import karate# You can also just get the edgelist
gdf = karate.get_edgelist(download=True)
# The algorithm also requires that there are vertex weights. Just use 1.0
gdf["data"] = 1.0# just for fun, let's look at t... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/community/Community-Clustering.ipynb | # Import the cugraph modules
import cugraph
import cudf# import non cugraph modules
import numpy as np# Compute clusters
# the clustering calls are very straightforward with the graph being the primary argument
# we are specifying a few optional parameters for this dataset.
def compute_clusters(_graph) :
# Compu... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/sampling/README.md |
# cuGraph Sampling Algorithms
<img src="../../img/zachary_black_lines.png" width="35%"/>
CuGraph Sampling notebooks begin to address graph problems solved by random or other methods of sampling.
These algorithms will solve problems like:
* How to collect uniform samples from a large graph
* Scaling down a large kno... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/sampling/RandomWalk.ipynb | # Import the modules
import cugraph
import cudf
# Import a built-in dataset
from cugraph.datasets import karategdf = karate.get_edgelist(download=True)gdf['weight'] = 1.0# Create a Graph - using the source (src) and destination (dst) vertex pairs from the Dataframe
G = cugraph.Graph()
G.from_cudf_edgelist(gdf, sourc... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/cores/core-number.ipynb | # Import needed libraries
import cugraph
import cudf
# import a built-in dataset
from cugraph.datasets import karateG = karate.get_graph(download=True)
G = G.to_undirected()# Call k-cores on the graph
df = cugraph.core_number(G) df | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/cores/README.md |
# cuGraph Core Algorithms
<img src="../../img/zachary_black_lines.png" width="35%"/>
cuGraph Cores notebooks contain Jupyter Notebooks that demonstrate algorithms to find maximally connected subgraphs within a graph. Either identifying the maximum k-core at the vertex (core-number) or graph level (K-Cores).
Manipu... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/cores/kcore.ipynb | # Import needed libraries
import cugraph
import cudf
# Import a built-in dataset
from cugraph.datasets import karateG = karate.get_graph(download=True)
G = G.to_undirected()print("Main Graph")
print("\tNumber of Vertices: " + str(G.number_of_vertices()))
print("\tNumber of Edges: " + str(G.number_of_edges()))# Call... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/centrality/Centrality.ipynb | # Import the cugraph modules
import cugraph
import cudf
from cugraph.datasets import karate# import the non-Rapids required modules
import numpy as np
import pandas as pd
from IPython.display import display_html # Compute Centrality
# the centrality calls are very straightforward with the graph being the primary arg... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/centrality/README.md |
# cuGraph Centrality Notebooks
<img src="../../img/zachary_graph_centrality.png" width="35%"/>
cuGraph Centrality notebooks contain a collection of Jupyter Notebooks that demonstrate algorithms to identify and quantify importance of vertices to the structure of the graph. In the diagram above, the highlighted verti... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/centrality/Betweenness.ipynb | # Import needed libraries
import cugraph
import cudf
# Import a built-in dataset
from cugraph.datasets import karate# NetworkX libraries
import networkx as nx# Create a graph using the imported Dataset object
G = karate.get_graph(download=True)# Call cugraph.betweenness_centrality
vertex_bc = cugraph.betweenness_cent... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/centrality/Eigenvector.ipynb | # Import needed libraries
import cugraph
import cudf# NetworkX libraries
import networkx as nx
import pandas as pdfrom cugraph.datasets import karatedef topKVertices(eigen, col, k):
top = eigen.nlargest(n=k, columns=col)
top = top.sort_values(by=col, ascending=False)
return top
karate.get_edgelist(download=... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/centrality/Degree.ipynb | # Import needed libraries
import cugraph
import cudf# NetworkX libraries
import networkx as nxfrom cugraph.datasets import karateG = karate.get_graph()# Call cugraph.degree_centrality
vertex_bc = cugraph.degree_centrality(G)# Find the most important vertex using the scores
def print_top_scores(_df, txt) :
m = _df[... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/centrality/Katz.ipynb | # Import rapids libraries
import cugraph
import cudf
# Import a built-in dataset
from cugraph.datasets import karate# Import NetworkX libraries
import networkx as nx# define the parameters
max_iter = 100 # The maximum number of iterations
tol = 0.00001 # tolerance# Create a graph using the imported Dataset object
... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/traversal/SSSP.ipynb | # Import needed libraries
import cudf
import cugraph# Import a built-in dataset
from cugraph.datasets import karate
gdf = karate.get_edgelist(download=True)# The SSSP algorithm requires that there are weights. Just use 1.0 here (equivalent to BFS)
gdf["data"] = 1.0gdf.head()# create a Graph
G = cugraph.Graph()
G.fro... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/traversal/BFS.ipynb | # First step is to import the needed libraries
import cugraph
import cudf
from collections import OrderedDict# define a print path function that take the dataframe and a vertex ID
def print_path(df, id):
p = cugraph.utils.get_traversed_path_list(df, id)
print(p)
# Import a built-in dataset
from cugrap... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/traversal/README.md |
# cuGraph Traversal Algorithms
<img src="../../img/zachary_graph_path.png" width="35%"/>
CuGraph Traversal notebooks demonstrate various algorithms for finding paths through a graph.
## Summary
|Algorithm |Notebooks Containing |Description ... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb | # Import needed libraries
import cugraph
import cudf
from collections import OrderedDict# define a function for printing the top most similar vertices
def print_most_similar_sorensen(df):
jmax = df['sorensen_coeff'].max()
dm = df.query('sorensen_coeff >= @jmax')
#find the best
for i in ran... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb | # Import needed libraries
import cugraph
import cudf# define a function for printing the top most similar vertices
def print_most_similar_jaccard(df):
jmax = df['jaccard_coeff'].max()
dm = df.query('jaccard_coeff >= @jmax')
#find the best
for i in range(len(dm)):
print("Vertice... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/link_prediction/README.md | # Vertex Similarity
----
In this folder we will explore and compare the various vertex similarity metrics available in cuGraph. [Vertex similarity](https://en.wikipedia.org/wiki/Similarity_(network_science)), as the name implies, is a measure how similar two vertices are.
|Algorithm |Notebooks Containing ... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb | # Import needed libraries
import cugraph
import cudf
from collections import OrderedDict# define a function for printing the top most similar vertices
def print_most_similar_jaccard(df):
d_local = df.query('first != second')
jmax = d_local['jaccard_coeff'].max()
dm = d_local.query('jaccard_coeff >= @jmax') ... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/link_prediction/similarity_combined.ipynb | import cugraph
from cugraph.datasets import dining_prefs
# only needed to display results in a table
from IPython.display import display_html def compute_similarity(G,pairs=None):
_jdf = cugraph.jaccard(G,pairs)
_jdf2 = _jdf[ (_jdf['first'] != _jdf['second'] ) ]
_odf = cugraph.overlap(G,pairs)
_odf2 = ... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/link_analysis/README.md |
# cuGraph Link Analysis Algorithms
<img src="../../img/zachary_graph_pagerank.png" width="35%"/>
cuGraph Link Analysis notebooks contain Jupyter Notebooks that demonstrate algorithms to rank the importance of individual vertices within the graph. A good comparison of the two algorithms can be found [here](https://ww... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/link_analysis/HITS.ipynb | # The notebook compares cuGraph to NetworkX,
# therefore there some additional non-RAPIDS python libraries need to be installed.
# Please run this cell if you need the additional libraries
%pip install networkx# Import needed libraries
import cugraph
import cudf# NetworkX libraries
import networkx as nx# Import a bu... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/link_analysis/Pagerank.ipynb | # The notebook compares cuGraph to NetworkX,
# therefore there some additional non-RAPIDS python libraries need to be installed.
# Please run this cell if you need the additional libraries
%pip install networkx
%pip install scipy# Import needed libraries
import cugraph
import cudf
from collections import OrderedDict... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/structure/Symmetrize.ipynb | # Import needed libraries
import cugraph
import cudf# Read the unsymmetrized data
unsym_data ='../../data/karate_undirected.csv'
gdf = cudf.read_csv(unsym_data, names=["src", "dst"], delimiter='\t', dtype=["int32", "int32"] )# Import a built-in dataset
from cugraph.datasets import karate
# This is the symmetrized da... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/structure/Renumber-2.ipynb | # Import needed libraries
import cugraph
import cudf
import cupy as cp
from cugraph.structure import NumberMap# Import a built-in dataset
from cugraph.datasets import cyber
gdf = cyber.get_edgelist(download=True)# trim
gdf = gdf[1:]
# take a peek at the data
gdf.head()# Since IP columns are strings, we first need to ... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/structure/README.md |
# cuGraph Structure Algorithms
<img src="../../img/zachary_black_lines.png" width="35%"/>
cuGraph Structure notebooks contain Jupyter Notebooks that demonstrate graph manipulations which support other cuGraph algorithms. Many cuGraph algorithms expect vertices ids formated as a contiguous list of integers. Some only... | 0 |
rapidsai_public_repos/cugraph/notebooks/algorithms | rapidsai_public_repos/cugraph/notebooks/algorithms/structure/Renumber.ipynb | import cugraph
import cudf
import socket
import struct
import pandas as pd
import numpy as np
import networkx as nx
from cugraph.structure import NumberMapsource_list = [ '192.168.1.1', '172.217.5.238', '216.228.121.209', '192.16.31.23' ]
dest_list = [ '172.217.5.238', '216.228.121.209', '192.16.31.23', '192.168.1.1' ]... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/demo/mg_jaccard.ipynb | # Import needed libraries. We recommend using a [conda environment](https://github.com/rapidsai/cugraph/tree/HEAD/conda/environments) provided in the cugraph repo.
from dask.distributed import Client, wait
from dask_cuda import LocalCUDACluster
from cugraph.dask.comms import comms as Comms
import cugraph.dask as dask_... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/demo/mg_pagerank.ipynb | # Import needed libraries. We recommend using cugraph_dev env through conda
from dask.distributed import Client, wait
from dask_cuda import LocalCUDACluster
from cugraph.dask.comms import comms as Comms
import cugraph.dask as dask_cugraph
import cugraph
import dask_cudf
import time
import urllib.request
import os
data... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/demo/mg_louvain.ipynb | # Import needed libraries. We recommend using the [cugraph_dev](https://github.com/rapidsai/cugraph/tree/branch-21.12/conda/environments) env through conda
from dask.distributed import Client, wait
from dask_cuda import LocalCUDACluster
from cugraph.dask.comms import comms as Comms
import cugraph.dask as dask_cugraph
i... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/demo/mg_property_graph.ipynb | # Import needed libraries. We recommend using the [cugraph_dev](https://github.com/rapidsai/cugraph/tree/branch-23.02/conda/environments) env through conda
from dask.distributed import Client, wait
from dask_cuda import LocalCUDACluster
from cugraph.dask.comms import comms as Comms
import cugraph.dask as dask_cugraph
i... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/demo/uvm.ipynb | import rmm #Set RMM to allocate all memory as managed memory (cudaMallocManaged underlying allocator)
rmm.mr.set_current_device_resource(rmm.mr.ManagedMemoryResource())
assert(rmm.is_initialized())# Import needed libraries. We recommend using cugraph_dev env through conda
import time
import cudf
import cugraph import ... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/demo/nx_cugraph_demo.ipynb | import sys
def reimport_networkx():
"""
Re-imports networkx for demonstrating different backend configuration
options applied at import-time. This is only needed for demonstration
purposes since other mechanisms are available for runtime configuration.
"""
# Using importlib.reload(networkx) has ... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/sssp_benchmark.ipynb | # Import needed libraries
import gc
import time
import rmm
import cugraph
import cudf
import os# NetworkX libraries
import networkx as nx
from scipy.io import mmreadtry:
import matplotlib
except ModuleNotFoundError:
os.system('pip install matplotlib')import matplotlib.pyplot as plt; plt.rcdefaults()
import nump... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/dataPrep.sh | #!/bin/bash
if [ ! -d "./data" ]
then
mkdir ./data
fi
cd data
if [ ! -f "./preferentialAttachment.mtx" ]
then
if [ ! -d "./tmp" ]
then
mkdir tmp
cd tmp
wget -N https://sparse.tamu.edu/MM/DIMACS10/preferentialAttachment.tar.gz
wget -N https://sparse.tamu.edu/MM/DIMACS10/ca... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/pagerank_benchmark.ipynb | # Import needed libraries
import gc
import time
import rmm
import cugraph
import cudf
import os# NetworkX libraries
import networkx as nx
from scipy.io import mmreadtry:
import matplotlib
except ModuleNotFoundError:
os.system('pip install matplotlib')import matplotlib.pyplot as plt; plt.rcdefaults()
import num... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/random_walk_perf.ipynb | # Import the modules
import cugraph
import cudf# system and other
import gc
import os
import time
import random
# MTX file reader
from scipy.io import mmread
import networkx as nxtry:
import matplotlib
except ModuleNotFoundError:
os.system('pip install matplotlib')
import matplotlib.pyplot as plt; plt.rcde... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/README.md | # cuGraph Benchmarking
This folder contains a collection of graph algorithm benchmarking notebooks. Each notebook will compare one cuGraph algorithm against NetworkX and potentially other frameworks.
_NOTE: Before any benchmarking can be done, it is important to first download the test data sets_
## Getting the D... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/nx_cugraph_bc_benchmarking.ipynb | import networkx as nx
import cugraph as cnx
import time
import operator# starting number of Nodes
N = 100# average degree
M = 16def run_nx(G, k=None):
t1 = time.time()
bc = nx.betweenness_centrality(G, k)
t2 = time.time() - t1
return t2, bcdef run_cu(G, k=None):
t1 = time.time()
bc = cnx.between... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/synth_release.ipynb | # system and other
import gc
import os
from time import perf_counter
import numpy as np
import math
# rapids
import cugraph
import cudf
# NetworkX libraries
import networkx as nx
# RMAT data generator
from cugraph.generators import rmat
from cugraph.structure import NumberMaptry:
import community
except ModuleN... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/random_walk_benchmark.ipynb | # Import the modules
import cugraph
import cudf# system and other
import gc
import os
import time
import random
# MTX file reader
from scipy.io import mmreadtry:
import matplotlib
except ModuleNotFoundError:
os.system('pip install matplotlib')
import matplotlib.pyplot as plt; plt.rcdefaults()
# Test File
da... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/release.ipynb | # system and other
import gc
import os
from time import perf_counter
import numpy as np
import math
# rapids
import cugraph
import cudf
# NetworkX libraries
import networkx as nx
# MTX file reader
from scipy.io import mmreadtry:
import community
except ModuleNotFoundError:
os.system('pip install python-louv... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/bfs_benchmark.ipynb | # Import needed libraries
import gc
import time
import rmm
import cugraph
import cudf
import os# NetworkX libraries
import networkx as nx
from scipy.io import mmreadtry:
import matplotlib
except ModuleNotFoundError:
os.system('pip install matplotlib')import matplotlib.pyplot as plt; plt.rcdefaults()
import num... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/cugraph_benchmarks/louvain_benchmark.ipynb | # Import needed libraries
import time
import cugraph
import cudf
import os# NetworkX libraries
import networkx as nx
from scipy.io import mmread# NetworkX libraries
try:
import community
except ModuleNotFoundError:
os.system('pip install python-louvain')
import communitytry:
import matplotlib
except M... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/applications/gen_550M.ipynb | import gc
import os
from time import perf_counter
import numpy as np
import random
import math
# rapids
import cugraph
import cudf
# NetworkX libraries
import networkx as nx
# RMAT data generator
from cugraph.generators import rmat
from datetime import datetimedef generate_data(scale, edgefactor=16):
_gdf = rmat... | 0 |
rapidsai_public_repos/cugraph/notebooks | rapidsai_public_repos/cugraph/notebooks/applications/CostMatrix.ipynb | # system and other
import time
from time import perf_counter
import math
# rapids
import cugraph
import cudf# simple function to read in the CSV data file
def read_data_cudf(datafile):
gdf = cudf.read_csv(datafile,
delimiter=" ",
header=None,
names=['s... | 0 |
rapidsai_public_repos/cugraph | rapidsai_public_repos/cugraph/.devcontainer/README.md | # cuGraph Development Containers
This directory contains [devcontainer configurations](https://containers.dev/implementors/json_reference/) for using VSCode to [develop in a container](https://code.visualstudio.com/docs/devcontainers/containers) via the `Remote Containers` [extension](https://marketplace.visualstudio.... | 0 |
rapidsai_public_repos/cugraph | rapidsai_public_repos/cugraph/.devcontainer/Dockerfile | # syntax=docker/dockerfile:1.5
ARG BASE
ARG PYTHON_PACKAGE_MANAGER=conda
FROM ${BASE} as pip-base
ENV DEFAULT_VIRTUAL_ENV=rapids
FROM ${BASE} as conda-base
ENV DEFAULT_CONDA_ENV=rapids
FROM ${PYTHON_PACKAGE_MANAGER}-base
ARG CUDA
ENV CUDAARCHS="RAPIDS"
ENV CUDA_VERSION="${CUDA_VERSION:-${CUDA}}"
ARG PYTHON_PACK... | 0 |
rapidsai_public_repos/cugraph/.devcontainer | rapidsai_public_repos/cugraph/.devcontainer/cuda11.8-pip/devcontainer.json | {
"build": {
"context": "${localWorkspaceFolder}/.devcontainer",
"dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile",
"args": {
"CUDA": "11.8",
"PYTHON_PACKAGE_MANAGER": "pip",
"BASE": "rapidsai/devcontainers:23.12-cpp-llvm16-cuda11.8-ubuntu22.04"
}
},
"hostRequireme... | 0 |
rapidsai_public_repos/cugraph/.devcontainer | rapidsai_public_repos/cugraph/.devcontainer/cuda12.0-pip/devcontainer.json | {
"build": {
"context": "${localWorkspaceFolder}/.devcontainer",
"dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile",
"args": {
"CUDA": "12.0",
"PYTHON_PACKAGE_MANAGER": "pip",
"BASE": "rapidsai/devcontainers:23.12-cpp-llvm16-cuda12.0-ubuntu22.04"
}
},
"hostRequireme... | 0 |
rapidsai_public_repos/cugraph/.devcontainer | rapidsai_public_repos/cugraph/.devcontainer/cuda12.0-conda/devcontainer.json | {
"build": {
"context": "${localWorkspaceFolder}/.devcontainer",
"dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile",
"args": {
"CUDA": "12.0",
"PYTHON_PACKAGE_MANAGER": "conda",
"BASE": "rapidsai/devcontainers:23.12-cpp-mambaforge-ubuntu22.04"
}
},
"hostRequirements... | 0 |
rapidsai_public_repos/cugraph/.devcontainer | rapidsai_public_repos/cugraph/.devcontainer/cuda11.8-conda/devcontainer.json | {
"build": {
"context": "${localWorkspaceFolder}/.devcontainer",
"dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile",
"args": {
"CUDA": "11.8",
"PYTHON_PACKAGE_MANAGER": "conda",
"BASE": "rapidsai/devcontainers:23.12-cpp-cuda11.8-mambaforge-ubuntu22.04"
}
},
"hostReq... | 0 |
rapidsai_public_repos/cugraph/docs | rapidsai_public_repos/cugraph/docs/cugraph/README.md | # Building Documentation
All prerequisite for building docs are in the cugraph development conda environment.
[See build instructions](../../SOURCEBUILD.md) on how to create the development conda environment
## Steps to follow:
In order to build the docs, we need the conda dev environment from cugraph and we need to... | 0 |
rapidsai_public_repos/cugraph/docs | rapidsai_public_repos/cugraph/docs/cugraph/make.bat | @ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=cuGraph
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make... | 0 |
rapidsai_public_repos/cugraph/docs | rapidsai_public_repos/cugraph/docs/cugraph/Makefile | # Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS = "-v"
SPHINXBUILD = sphinx-build
SPHINXPROJ = cugraph
SOURCEDIR = source
BUILDDIR = build
IMGDIR = images
gen_doc_dirs = build source/api_docs/api
# Put it first so that "make" witho... | 0 |
rapidsai_public_repos/cugraph/docs/cugraph | rapidsai_public_repos/cugraph/docs/cugraph/source/conf.py | # Copyright (c) 2018-2023, NVIDIA CORPORATION.
#
# pygdf documentation build configuration file, created by
# sphinx-quickstart on Wed May 3 10:59:22 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 0 |
rapidsai_public_repos/cugraph/docs/cugraph | rapidsai_public_repos/cugraph/docs/cugraph/source/index.rst | RAPIDS Graph documentation
==========================
.. image:: images/cugraph_logo_2.png
:width: 600
*Making graph analytics fast and easy regardless of scale*
.. list-table:: RAPIDS Graph covers a range of graph libraries and packages, that includes:
:widths: 25 25 25
:header-rows: 1
* - Core
- ... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.