<jupyter_start><jupyter_text>Core NumberIn this notebook, we will use cuGraph to compute the core number of every vertex in our test graph  Notebook Credits* Original Authors: <NAME>* Created:   10/28/2019* Last Edit: 08/16/2020RAPIDS Versions: 0.13Test Hardware* GV100 32G, CUDA 10.2 IntroductionCore Number computes the core number for every vertex of a graph G. A k-core of a graph is a maximal subgraph that contains nodes of degree k or more. A node has a core number of k if it belongs to a k-core but not to k+1-core.  This call does not support a graph with self-loops and parallel edges.For a detailed description of the algorithm see: https://en.wikipedia.org/wiki/Degeneracy_(graph_theory)It takes as input a cugraph.Graph object and returns as output a cudf.Dataframe object To compute the K-Core Number cluster in cuGraph use: * __df = cugraph.core_number(G)__    * G: A cugraph.Graph object    Returns:* __df : cudf.DataFrame__    * df['vertex'] - vertex ID    * df['core_number'] - core number of that vertex  Some notes about vertex IDs...* The current version of cuGraph requires that vertex IDs be representable as 32-bit integers, meaning graphs currently can contain at most 2^32 unique vertex IDs. However, this limitation is being actively addressed and a version of cuGraph that accommodates more than 2^32 vertices will be available in the near future.* cuGraph will automatically renumber graphs to an internal format consisting of a contiguous series of integers starting from 0, and convert back to the original IDs when returning data to the caller. If the vertex IDs of the data are already a contiguous series of integers starting from 0, the auto-renumbering step can be skipped for faster graph creation times.  * To skip auto-renumbering, set the `renumber` boolean arg to `False` when calling the appropriate graph creation API (eg. `G.from_cudf_edgelist(gdf_r, source='src', destination='dst', renumber=False)`).  * For more advanced renumbering support, see the examples in `structure/renumber.ipynb` and `structure/renumber-2.ipynb`  Test DataWe will be using the Zachary Karate club dataset *<NAME>, An information flow model for conflict and fission in small groups, Journal ofAnthropological Research 33, 452-473 (1977).*![Karate Club](../img/zachary_black_lines.png)  Prep<jupyter_code># Import needed libraries
import cugraph
import cudf<jupyter_output><empty_output><jupyter_text>Read data using cuDF<jupyter_code># Test file    
datafile='../data//karate-data.csv'
# read the data using cuDF
gdf = cudf.read_csv(datafile, delimiter='\t', names=['src', 'dst'], dtype=['int32', 'int32'] )
# create a Graph 
G = cugraph.Graph()
G.from_cudf_edgelist(gdf, source='src', destination='dst')<jupyter_output><empty_output><jupyter_text>Now compute the Core Number<jupyter_code># Call k-cores on the graph
df = cugraph.core_number(G) 
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07859358841778696, 'fraction_numerical': 0.018958979662185453, 'mean_word_length': 5.071129707112971, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '393537', 'license': 'Apache-2.0', 'n_tokens_mistral': 894, 'n_tokens_neox': 830, 'n_words': 369, 'path': 'notebooks/cores/core-number.ipynb', 'repo_name': 'hlinsen/cugraph', 'size': '2914'}