diff --git a/cpp/include/cugraph/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp index b624ec5c0e0..6bab7bfc2fe 100644 --- a/cpp/include/cugraph/algorithms.hpp +++ b/cpp/include/cugraph/algorithms.hpp @@ -37,7 +37,6 @@ #include /** @ingroup cpp_api - * @{ */ namespace cugraph { @@ -2078,7 +2077,7 @@ rmm::device_uvector sorensen_coefficients( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, + std::tuple,raft::device_span> vertex_pairs, bool do_expensive_check = false); /** @@ -2162,7 +2161,3 @@ rmm::device_uvector maximal_independent_set( raft::random::RngState& rng_state); } // namespace cugraph - -/** - * @} - */ diff --git a/cpp/include/cugraph_c/sampling_algorithms.h b/cpp/include/cugraph_c/sampling_algorithms.h index 05c8effd32c..d594132aa71 100644 --- a/cpp/include/cugraph_c/sampling_algorithms.h +++ b/cpp/include/cugraph_c/sampling_algorithms.h @@ -21,12 +21,7 @@ #include #include -/** @defgroup sampling Sampling algorithms - */ - -/** - * @defgroup sampling_test - * @ingroup c_api +/** @defgroup samplingC Sampling algorithms */ #ifdef __cplusplus @@ -138,7 +133,7 @@ cugraph_error_code_t cugraph_node2vec(const cugraph_resource_handle_t* handle, cugraph_error_t** error); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the max path length from random walk result * * @param [in] result The result from random walks @@ -150,7 +145,7 @@ size_t cugraph_random_walk_result_get_max_path_length(cugraph_random_walk_result // difference at the moment is that RW results contain weights // and extract_paths results don't. But that's probably wrong. /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the matrix (row major order) of vertices in the paths * * @param [in] result The result from a random walk algorithm @@ -160,7 +155,7 @@ cugraph_type_erased_device_array_view_t* cugraph_random_walk_result_get_paths( cugraph_random_walk_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the matrix (row major order) of edge weights in the paths * * @param [in] result The result from a random walk algorithm @@ -170,7 +165,7 @@ cugraph_type_erased_device_array_view_t* cugraph_random_walk_result_get_weights( cugraph_random_walk_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief If the random walk result is compressed, get the path sizes * @deprecated This call will no longer be relevant once the new node2vec are called * @@ -181,7 +176,7 @@ cugraph_type_erased_device_array_view_t* cugraph_random_walk_result_get_path_siz cugraph_random_walk_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Free random walks result * * @param [in] result The result from random walks @@ -203,7 +198,7 @@ typedef struct { } cugraph_sampling_options_t; /** - * @ingroup sampling + * @ingroup samplingC * @brief Enumeration for prior sources behavior */ typedef enum cugraph_prior_sources_behavior_t { @@ -215,7 +210,7 @@ typedef enum cugraph_prior_sources_behavior_t { } cugraph_prior_sources_behavior_t; /** - * @ingroup sampling + * @ingroup samplingC * @brief Create sampling options object * * All sampling options set to FALSE @@ -228,7 +223,7 @@ cugraph_error_code_t cugraph_sampling_options_create(cugraph_sampling_options_t* cugraph_error_t** error); /** - * @ingroup sampling + * @ingroup samplingC * @brief Set flag to renumber results * * @param options - opaque pointer to the sampling options @@ -237,7 +232,7 @@ cugraph_error_code_t cugraph_sampling_options_create(cugraph_sampling_options_t* void cugraph_sampling_set_renumber_results(cugraph_sampling_options_t* options, bool_t value); /** - * @ingroup sampling + * @ingroup samplingC * @brief Set flag to sample with_replacement * * @param options - opaque pointer to the sampling options @@ -246,7 +241,7 @@ void cugraph_sampling_set_renumber_results(cugraph_sampling_options_t* options, void cugraph_sampling_set_with_replacement(cugraph_sampling_options_t* options, bool_t value); /** - * @ingroup sampling + * @ingroup samplingC * @brief Set flag to sample return_hops * * @param options - opaque pointer to the sampling options @@ -255,7 +250,7 @@ void cugraph_sampling_set_with_replacement(cugraph_sampling_options_t* options, void cugraph_sampling_set_return_hops(cugraph_sampling_options_t* options, bool_t value); /** - * @ingroup sampling + * @ingroup samplingC * @brief Set prior sources behavior * * @param options - opaque pointer to the sampling options @@ -274,7 +269,7 @@ void cugraph_sampling_set_prior_sources_behavior(cugraph_sampling_options_t* opt void cugraph_sampling_set_dedupe_sources(cugraph_sampling_options_t* options, bool_t value); /** - * @ingroup sampling + * @ingroup samplingC * @brief Free sampling options object * * @param [in] options Opaque pointer to sampling object @@ -390,7 +385,7 @@ cugraph_error_code_t cugraph_uniform_neighbor_sample( cugraph_error_t** error); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the source vertices from the sampling algorithm result * * @param [in] result The result from a sampling algorithm @@ -400,7 +395,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_sources( const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the destination vertices from the sampling algorithm result * * @param [in] result The result from a sampling algorithm @@ -410,7 +405,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_destinations( const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the start labels from the sampling algorithm result * * @param [in] result The result from a sampling algorithm @@ -420,7 +415,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_start_labels( const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the edge_id from the sampling algorithm result * * @param [in] result The result from a sampling algorithm @@ -430,7 +425,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_edge_id( const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the edge_type from the sampling algorithm result * * @param [in] result The result from a sampling algorithm @@ -440,7 +435,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_edge_type( const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the edge_weight from the sampling algorithm result * * @param [in] result The result from a sampling algorithm @@ -450,7 +445,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_edge_weight( const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the hop from the sampling algorithm result * * @param [in] result The result from a sampling algorithm @@ -460,7 +455,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_hop( const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the index from the sampling algorithm result * * @param [in] result The result from a sampling algorithm @@ -470,7 +465,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_index( const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the result offsets from the sampling algorithm result * * @param [in] result The result from a sampling algorithm @@ -480,7 +475,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_offsets( const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the renumber map * * @param [in] result The result from a sampling algorithm @@ -490,7 +485,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_renumber_map( const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Get the renumber map offsets * * @param [in] result The result from a sampling algorithm @@ -500,7 +495,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_renumber_map_ const cugraph_sample_result_t* result); /** - * @ingroup sampling + * @ingroup samplingC * @brief Free a sampling result * * @param [in] result The result from a sampling algorithm @@ -508,7 +503,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_renumber_map_ void cugraph_sample_result_free(cugraph_sample_result_t* result); /** - * @ingroup sampling_test + * @ingroup samplingC * @brief Create a sampling result (testing API) * * @param [in] handle Handle for accessing resources @@ -539,7 +534,7 @@ cugraph_error_code_t cugraph_test_sample_result_create( cugraph_error_t** error); /** - * @ingroup sampling_test + * @ingroup samplingC * @brief Create a sampling result (testing API) * * @param [in] handle Handle for accessing resources @@ -570,7 +565,7 @@ cugraph_error_code_t cugraph_test_uniform_neighborhood_sample_result_create( cugraph_error_t** error); /** - * @ingroup sampling_test + * @ingroup samplingC * @brief Select random vertices from the graph * * @param [in] handle Handle for accessing resources diff --git a/docs/cugraph/source/api_docs/cugraph/index.rst b/docs/cugraph/source/api_docs/cugraph/index.rst index 1d8aa306431..3427a28f4a3 100644 --- a/docs/cugraph/source/api_docs/cugraph/index.rst +++ b/docs/cugraph/source/api_docs/cugraph/index.rst @@ -1,6 +1,6 @@ -~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cugraph Python API Reference -~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. toctree:: :maxdepth: 2 diff --git a/docs/cugraph/source/api_docs/cugraph_c/labeling.rst b/docs/cugraph/source/api_docs/cugraph_c/labeling.rst index 78c9018b0b3..af105ee8fc9 100644 --- a/docs/cugraph/source/api_docs/cugraph_c/labeling.rst +++ b/docs/cugraph/source/api_docs/cugraph_c/labeling.rst @@ -8,7 +8,7 @@ Weakly Connected Components :project: libcugraph Strongly Connected Components --------- +----------------------------- .. doxygenfunction:: cugraph_strongly_connected_components :project: libcugraph diff --git a/docs/cugraph/source/api_docs/cugraph_c/sampling.rst b/docs/cugraph/source/api_docs/cugraph_c/sampling.rst index e83b83cd0b3..21b837daf93 100644 --- a/docs/cugraph/source/api_docs/cugraph_c/sampling.rst +++ b/docs/cugraph/source/api_docs/cugraph_c/sampling.rst @@ -29,13 +29,9 @@ Uniform Neighborhood Sampling .. doxygenfunction:: cugraph_uniform_neighbor_sample :project: libcugraph -Sampling Testing ----------------- -.. doxygenfunction:: sampling_test - :project: libcugraph - Support ------- -.. doxygenfunction:: sampling - :project: libcugraph - +.. doxygengroup:: samplingC + :project: libcugraph + :members: + :content-only: diff --git a/docs/cugraph/source/api_docs/cugraph_c/similarity.rst b/docs/cugraph/source/api_docs/cugraph_c/similarity.rst index 9c342905c3c..fba07ad206c 100644 --- a/docs/cugraph/source/api_docs/cugraph_c/similarity.rst +++ b/docs/cugraph/source/api_docs/cugraph_c/similarity.rst @@ -9,7 +9,7 @@ Jaccard Sorensen -------- -.. jaccard:: cugraph_sorensen_coefficients +.. doxygenfunction:: cugraph_sorensen_coefficients :project: libcugraph Overlap @@ -19,5 +19,7 @@ Overlap Support ------- -.. doxygenfunction:: similarity - :project: libcugraph \ No newline at end of file +.. doxygengroup:: similarity + :project: libcugraph + :members: + :content-only: \ No newline at end of file diff --git a/docs/cugraph/source/api_docs/cugraph_c/traversal.rst b/docs/cugraph/source/api_docs/cugraph_c/traversal.rst index b98bdee3a02..c90760e9e79 100644 --- a/docs/cugraph/source/api_docs/cugraph_c/traversal.rst +++ b/docs/cugraph/source/api_docs/cugraph_c/traversal.rst @@ -9,7 +9,7 @@ Breadth First Search (BFS) Single-Source Shortest-Path (SSSP) ---------------------------------- -.. jaccard:: cugraph_sssp +.. doxygenfunction:: cugraph_sssp :project: libcugraph Path Extraction @@ -24,5 +24,7 @@ Extract Max Path Length Support ------- -.. doxygenfunction:: traversal - :project: libcugraph \ No newline at end of file +.. doxygengroup:: traversal + :project: libcugraph + :members: + :content-only: \ No newline at end of file diff --git a/docs/cugraph/source/api_docs/cugraph_cpp/centrality.rst b/docs/cugraph/source/api_docs/cugraph_cpp/centrality.rst new file mode 100644 index 00000000000..bd7933176a9 --- /dev/null +++ b/docs/cugraph/source/api_docs/cugraph_cpp/centrality.rst @@ -0,0 +1,45 @@ +Centrality +========== + +PageRank +-------- +.. doxygenfunction:: cugraph::pagerank + :project: libcugraph + +.. doxygenfunction:: cugraph::pagerank_allow_nonconvergence + :project: libcugraph + +Personalized PageRank +--------------------- +.. doxygenfunction:: cugraph::personalized_pagerank + :project: libcugraph + +.. doxygenfunction:: cugraph::personalized_pagerank_allow_nonconvergence + :project: libcugraph + +Eigenvector Centrality +---------------------- +.. doxygenfunction:: cugraph::eigenvector_centrality + :project: libcugraph + +Katz Centrality +--------------- +.. doxygenfunction:: cugraph::katz_centrality + :project: libcugraph + +Betweenness Centrality +---------------------- +.. doxygenfunction:: cugraph::betweenness_centrality + :project: libcugraph + +Edge Betweenness Centrality +--------------------------- +.. doxygenfunction:: cugraph::edge_betweenness_centrality + :project: libcugraph + +HITS Centrality +--------------- +.. doxygenfunction:: cugraph::hits + :project: libcugraph + + diff --git a/docs/cugraph/source/api_docs/cugraph_cpp/community.rst b/docs/cugraph/source/api_docs/cugraph_cpp/community.rst new file mode 100644 index 00000000000..ea267cf0922 --- /dev/null +++ b/docs/cugraph/source/api_docs/cugraph_cpp/community.rst @@ -0,0 +1,56 @@ +Community +========= + +.. role:: C++(code) + :language: cpp + :class: highlight + +``#include `` + +Triangle Counting +----------------- +.. doxygenfunction:: cugraph::triangle_count + :project: libcugraph + +Louvain +------- +.. doxygenfunction:: cugraph::louvain + :project: libcugraph + +Leiden +------ +.. doxygenfunction:: cugraph::leiden + :project: libcugraph + +ECG +--- +.. doxygenfunction:: cugraph::ecg + :project: libcugraph + +Extract Egonet +-------------- +.. doxygenfunction:: cugraph::extract_ego + :project: libcugraph + +Balanced Cut +------------ +.. doxygenfunction:: cugraph::balanced_cut_clustering + :project: libcugraph + +Spectral Clustering - Modularity Maximization +--------------------------------------------- +.. doxygenfunction:: cugraph::spectral_modularity_maximization + :project: libcugraph + +.. doxygenfunction:: cugraph::analyze_clustering_modularity + :project: libcugraph + +Spectral Clusteriong - Edge Cut +------------------------------- +.. doxygenfunction:: cugraph::analyze_clustering_edge_cut + :project: libcugraph + +.. doxygenfunction:: cugraph::analyze_clustering_ratio_cut + :project: libcugraph + + diff --git a/docs/cugraph/source/api_docs/cugraph_cpp/core.rst b/docs/cugraph/source/api_docs/cugraph_cpp/core.rst new file mode 100644 index 00000000000..acd5fa1f878 --- /dev/null +++ b/docs/cugraph/source/api_docs/cugraph_cpp/core.rst @@ -0,0 +1,14 @@ +Core +==== + + +Core Number +----------- +.. doxygenfunction:: cugraph::core_number + :project: libcugraph + +K-Core +------ +.. doxygenfunction:: cugraph::k_core + :project: libcugraph + diff --git a/docs/cugraph/source/api_docs/cugraph_cpp/index.rst b/docs/cugraph/source/api_docs/cugraph_cpp/index.rst index efea6e9501c..3594369ddf6 100644 --- a/docs/cugraph/source/api_docs/cugraph_cpp/index.rst +++ b/docs/cugraph/source/api_docs/cugraph_cpp/index.rst @@ -1,9 +1,16 @@ -=========================== -cuGraph C++ API -=========================== +============================= +cuGraph C++ API documentation +============================= + .. toctree:: :maxdepth: 3 :caption: API Documentation + centrality.rst + community.rst + core.rst + labeling.rst + sampling.rst similarity.rst + traversal.rst diff --git a/docs/cugraph/source/api_docs/cugraph_cpp/labeling.rst b/docs/cugraph/source/api_docs/cugraph_cpp/labeling.rst new file mode 100644 index 00000000000..9287665b4f2 --- /dev/null +++ b/docs/cugraph/source/api_docs/cugraph_cpp/labeling.rst @@ -0,0 +1,13 @@ +Components +========== + + +Weakly Connected Components +--------------------------- +.. doxygenfunction:: cugraph::weakly_connected_components + :project: libcugraph + +Strongly Connected Components +----------------------------- +.. doxygenfunction:: cugraph::strongly_connected_components + :project: libcugraph diff --git a/docs/cugraph/source/api_docs/cugraph_cpp/sampling.rst b/docs/cugraph/source/api_docs/cugraph_cpp/sampling.rst new file mode 100644 index 00000000000..37757b8b42c --- /dev/null +++ b/docs/cugraph/source/api_docs/cugraph_cpp/sampling.rst @@ -0,0 +1,31 @@ +Sampling +======== + +Uniform Random Walks +-------------------- +.. doxygenfunction:: cugraph::uniform_random_walks + :project: libcugraph + +Biased Random Walks +-------------------- +.. doxygenfunction:: cugraph::biased_random_walks + :project: libcugraph + +Random Walks via Node2Vec +------------------------- +.. doxygenfunction:: cugraph::node2vec_random_walks + :project: libcugraph + +Node2Vec +-------- +.. doxygenfunction:: cugraph::node2vec + :project: libcugraph + +Uniform Neighborhood Sampling +----------------------------- +.. doxygenfunction:: cugraph::uniform_neighbor_sample_with_edge_properties + :project: libcugraph + +.. doxygenfunction:: cugraph::uniform_neighbor_sample + :project: libcugraph + diff --git a/docs/cugraph/source/api_docs/cugraph_cpp/similarity.rst b/docs/cugraph/source/api_docs/cugraph_cpp/similarity.rst index 4d5b22d1c52..19faa14abcb 100644 --- a/docs/cugraph/source/api_docs/cugraph_cpp/similarity.rst +++ b/docs/cugraph/source/api_docs/cugraph_cpp/similarity.rst @@ -4,7 +4,7 @@ Similarity Jaccard ------- -.. doxygenfunction:: cugraph::jaccard +.. doxygenfunction:: cugraph::jaccard_coefficients :project: libcugraph Sorensen @@ -14,5 +14,5 @@ Sorensen Overlap ------- -.. doxygenfunction:: cugraph::overlap +.. doxygenfunction:: cugraph::overlap_coefficients :project: libcugraph diff --git a/docs/cugraph/source/api_docs/cugraph_cpp/traversal.rst b/docs/cugraph/source/api_docs/cugraph_cpp/traversal.rst new file mode 100644 index 00000000000..3cec1f9a1e7 --- /dev/null +++ b/docs/cugraph/source/api_docs/cugraph_cpp/traversal.rst @@ -0,0 +1,23 @@ +Traversal +========== + + +Breadth First Search (BFS) +-------------------------- +.. doxygenfunction:: cugraph::bfs + :project: libcugraph + +Single-Source Shortest-Path (SSSP) +---------------------------------- +.. doxygenfunction:: cugraph::sssp + :project: libcugraph + +Path Extraction +--------------- +.. doxygenfunction:: cugraph::extract_paths + :project: libcugraph + +Extract Max Path Length +----------------------- +.. doxygenfunction:: cugraph::extract_paths_result_get_max_path_length + :project: libcugraph diff --git a/docs/cugraph/source/api_docs/index.rst b/docs/cugraph/source/api_docs/index.rst index ea46e88b6fb..88a1a90b44f 100644 --- a/docs/cugraph/source/api_docs/index.rst +++ b/docs/cugraph/source/api_docs/index.rst @@ -12,8 +12,8 @@ This page provides a list of all publicly accessible Python modules with in the cugraph_c/index.rst cugraph_cpp/index.rst -.. cugraph-dgl/cugraph_dgl.rst -.. cugraph-pyg/cugraph_pyg.rst -.. service/index.rst + cugraph-dgl/cugraph_dgl.rst + cugraph-pyg/cugraph_pyg.rst + service/index.rst diff --git a/docs/cugraph/source/conf.py b/docs/cugraph/source/conf.py index 82fa44fbc27..c9711bd7b88 100644 --- a/docs/cugraph/source/conf.py +++ b/docs/cugraph/source/conf.py @@ -38,10 +38,10 @@ # ones. extensions = [ "breathe", + "numpydoc", "sphinx.ext.intersphinx", "sphinx.ext.autodoc", "sphinx.ext.autosummary", - "numpydoc", "sphinx_markdown_tables", 'sphinx.ext.doctest', 'sphinx.ext.linkcode', diff --git a/python/cugraph/cugraph/sampling/uniform_neighbor_sample.py b/python/cugraph/cugraph/sampling/uniform_neighbor_sample.py index 219854bb002..011f78a61e2 100644 --- a/python/cugraph/cugraph/sampling/uniform_neighbor_sample.py +++ b/python/cugraph/cugraph/sampling/uniform_neighbor_sample.py @@ -76,17 +76,17 @@ def uniform_neighbor_sample( ---------- G : cugraph.Graph cuGraph graph, which contains connectivity information as dask cudf - edge list dataframe + edge list dataframe. start_list : list or cudf.Series (int32) - a list of starting vertices for sampling + a list of starting vertices for sampling. fanout_vals : list (int32) List of branching out (fan-out) degrees per starting vertex for each hop level. with_replacement: bool, optional (default=True) - Flag to specify if the random sampling is done with replacement + Flag to specify if the random sampling is done with replacement. with_edge_properties: bool, optional (default=False) Deprecated. @@ -95,7 +95,7 @@ def uniform_neighbor_sample( with_batch_ids: bool, optional (default=False) Flag to specify whether batch ids are present in the start_list - Assumes they are the last column in the start_list dataframe + Assumes they are the last column in the start_list dataframe. random_state: int, optional Random seed to use when making sampling calls. @@ -112,12 +112,11 @@ def uniform_neighbor_sample( Defaults to True. prior_sources_behavior: str, optional (default=None) - Options are "carryover", and "exclude". + Options are 'carryover', and 'exclude'. Default will leave the source list as-is. Carryover will carry over sources from previous hops to the - current hop. - Exclude will exclude sources from previous hops from reappearing - as sources in future hops. + current hop. Exclude will exclude sources from previous hops from + reappearing as sources in future hops. deduplicate_sources: bool, optional (default=False) Whether to first deduplicate the list of possible sources @@ -191,6 +190,7 @@ def uniform_neighbor_sample( Contains the renumber maps for each batch renumber_df['offsets']: cudf.Series Contains the batch offsets for the renumber maps + """ if with_edge_properties: