Skip to content

Commit

Permalink
Use MNMG version of ECG in python layer instead, and remove legacy EC…
Browse files Browse the repository at this point in the history
…G and Louvain (#4514)

This PR
- removes legacy ECG and Louvain code
- updates c_api, plc and python code to use MNMG ECG  instead of legacy version

Closes #2494

Authors:
  - Naim (https://github.com/naimnv)

Approvers:
  - Chuck Hastings (https://github.com/ChuckHastings)
  - Rick Ratzel (https://github.com/rlratzel)
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

URL: #4514
  • Loading branch information
naimnv authored Jul 8, 2024
1 parent 42c7ad7 commit 127d3be
Show file tree
Hide file tree
Showing 19 changed files with 178 additions and 1,676 deletions.
3 changes: 0 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ set(CUGRAPH_SOURCES
src/community/ecg_mg_v64_e64.cu
src/community/ecg_mg_v32_e32.cu
src/community/ecg_mg_v32_e64.cu
src/community/legacy/louvain.cu
src/community/legacy/ecg.cu
src/community/egonet_sg_v64_e64.cu
src/community/egonet_sg_v32_e32.cu
src/community/egonet_sg_v32_e64.cu
Expand Down Expand Up @@ -639,7 +637,6 @@ add_library(cugraph_c
src/c_api/induced_subgraph.cpp
src/c_api/capi_helper.cu
src/c_api/legacy_spectral.cpp
src/c_api/legacy_ecg.cpp
src/c_api/graph_helper_sg.cu
src/c_api/graph_helper_mg.cu
src/c_api/graph_generators.cpp
Expand Down
40 changes: 0 additions & 40 deletions cpp/include/cugraph/algorithms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,14 +544,6 @@ std::pair<size_t, weight_t> louvain(
weight_t threshold = weight_t{1e-7},
weight_t resolution = weight_t{1});

template <typename vertex_t, typename edge_t, typename weight_t>
std::pair<size_t, weight_t> louvain(
raft::handle_t const& handle,
legacy::GraphCSRView<vertex_t, edge_t, weight_t> const& graph_view,
vertex_t* clustering,
size_t max_level = 100,
weight_t resolution = weight_t{1});

/**
* @brief Louvain implementation, returning dendrogram
*
Expand Down Expand Up @@ -727,38 +719,6 @@ std::pair<size_t, weight_t> leiden(
weight_t resolution = weight_t{1},
weight_t theta = weight_t{1});

/**
* @brief Computes the ecg clustering of the given graph.
*
* ECG runs truncated Louvain on an ensemble of permutations of the input graph,
* then uses the ensemble partitions to determine weights for the input graph.
* The final result is found by running full Louvain on the input graph using
* the determined weights. See https://arxiv.org/abs/1809.05578 for further
* information.
*
* @throws cugraph::logic_error when an error occurs.
*
* @tparam vertex_t Type of vertex identifiers. Supported value : int (signed,
* 32-bit)
* @tparam edge_t Type of edge identifiers. Supported value : int (signed,
* 32-bit)
* @tparam weight_t Type of edge weights. Supported values : float or double.
*
* @param[in] handle Library handle (RAFT). If a communicator is set in the handle,
* @param[in] graph_coo input graph object (COO)
* @param[in] graph_csr input graph object (CSR)
* @param[in] min_weight The minimum weight parameter
* @param[in] ensemble_size The ensemble size parameter
* @param[out] clustering A device pointer to array where the partitioning should be
* written
*/
template <typename vertex_t, typename edge_t, typename weight_t>
void ecg(raft::handle_t const& handle,
legacy::GraphCSRView<vertex_t, edge_t, weight_t> const& graph,
weight_t min_weight,
vertex_t ensemble_size,
vertex_t* clustering);

/**
* @brief Computes the ecg clustering of the given graph.
*
Expand Down
31 changes: 0 additions & 31 deletions cpp/include/cugraph_c/community_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,37 +212,6 @@ cugraph_error_code_t cugraph_ecg(const cugraph_resource_handle_t* handle,
cugraph_hierarchical_clustering_result_t** result,
cugraph_error_t** error);

/**
* @brief Compute ECG clustering of the given graph
*
* ECG runs truncated Louvain on an ensemble of permutations of the input graph,
* then uses the ensemble partitions to determine weights for the input graph.
* The final result is found by running full Louvain on the input graph using
* the determined weights. See https://arxiv.org/abs/1809.05578 for further
* information.
*
* NOTE: This currently wraps the legacy ECG clustering implementation which is only
* available in Single GPU implementation.
*
* @param [in] handle Handle for accessing resources
* @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage
* @param [in] min_weight The minimum weight parameter
* @param [in] ensemble_size The ensemble size parameter
* @param [in] do_expensive_check
* A flag to run expensive checks for input arguments (if set to true)
* @param [out] result The result from the clustering algorithm
* @param [out] error Pointer to an error object storing details of any error. Will
* be populated if error code is not CUGRAPH_SUCCESS
* @return error code
*/
cugraph_error_code_t cugraph_legacy_ecg(const cugraph_resource_handle_t* handle,
cugraph_graph_t* graph,
double min_weight,
size_t ensemble_size,
bool_t do_expensive_check,
cugraph_hierarchical_clustering_result_t** result,
cugraph_error_t** error);

/**
* @brief Extract ego graphs
*
Expand Down
135 changes: 0 additions & 135 deletions cpp/src/c_api/legacy_ecg.cpp

This file was deleted.

Loading

0 comments on commit 127d3be

Please sign in to comment.