Skip to content

Commit

Permalink
Remove legacy sssp implementation (rapidsai#2344)
Browse files Browse the repository at this point in the history
Legacy SSSP implementation should not be referenced any longer.

Authors:
  - Chuck Hastings (https://github.com/ChuckHastings)

Approvers:
  - Seunghwa Kang (https://github.com/seunghwak)

URL: rapidsai#2344
  • Loading branch information
ChuckHastings authored Jun 7, 2022
1 parent 00b8344 commit 52c1078
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 111 deletions.
1 change: 0 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ add_library(cugraph
src/structure/legacy/graph.cu
src/linear_assignment/hungarian.cu
src/traversal/legacy/bfs.cu
src/traversal/legacy/sssp.cu
src/link_prediction/jaccard.cu
src/link_prediction/overlap.cu
src/layout/force_atlas2.cu
Expand Down
30 changes: 0 additions & 30 deletions cpp/include/cugraph/algorithms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,36 +428,6 @@ template <typename VT, typename ET, typename WT>
std::unique_ptr<legacy::GraphCOO<VT, ET, WT>> get_two_hop_neighbors(
legacy::GraphCSRView<VT, ET, WT> const& graph);

/**
* @Synopsis Performs a single source shortest path traversal of a graph starting from a vertex.
*
* @throws cugraph::logic_error with a custom message when an error occurs.
*
* @tparam VT Type of vertex identifiers. Supported value : int (signed,
* 32-bit)
* @tparam ET Type of edge identifiers. Supported value : int (signed,
* 32-bit)
* @tparam WT Type of edge weights. Supported values : float or double.
*
* @param[in] graph cuGraph graph descriptor, should contain the connectivity
* information as a CSR
*
* @param[out] distances If set to a valid pointer, array of size V populated by distance
* of every vertex in the graph from the starting vertex. Memory is provided and owned by the
* caller.
*
* @param[out] predecessors If set to a valid pointer, array of size V populated by the SSSP
* predecessor of every vertex. Memory is provided and owned by the caller.
*
* @param[in] start_vertex The starting vertex for SSSP
*
*/
template <typename VT, typename ET, typename WT>
void sssp(legacy::GraphCSRView<VT, ET, WT> const& graph,
WT* distances,
VT* predecessors,
const VT source_vertex);

// FIXME: Internally distances is of int (signed 32-bit) data type, but current
// template uses data from VT, ET, WT from the legacy::GraphCSR View even if weights
// are not considered
Expand Down
76 changes: 0 additions & 76 deletions cpp/src/utilities/cython.cu
Original file line number Diff line number Diff line change
Expand Up @@ -957,54 +957,6 @@ std::unique_ptr<random_walk_coo_t> random_walks_to_coo(raft::handle_t const& han
return std::make_unique<random_walk_coo_t>(std::move(rw_coo));
}

// Wrapper for calling SSSP through a graph container
template <typename vertex_t, typename weight_t>
void call_sssp(raft::handle_t const& handle,
graph_container_t const& graph_container,
vertex_t* identifiers,
weight_t* distances,
vertex_t* predecessors,
const vertex_t source_vertex)
{
if (graph_container.graph_type == graphTypeEnum::GraphCSRViewFloat) {
graph_container.graph_ptr_union.GraphCSRViewFloatPtr->get_vertex_identifiers(
reinterpret_cast<int32_t*>(identifiers));
sssp( // handle, TODO: clarify: no raft_handle_t? why?
*(graph_container.graph_ptr_union.GraphCSRViewFloatPtr),
reinterpret_cast<float*>(distances),
reinterpret_cast<int32_t*>(predecessors),
static_cast<int32_t>(source_vertex));
} else if (graph_container.graph_type == graphTypeEnum::GraphCSRViewDouble) {
graph_container.graph_ptr_union.GraphCSRViewDoublePtr->get_vertex_identifiers(
reinterpret_cast<int32_t*>(identifiers));
sssp( // handle, TODO: clarify: no raft_handle_t? why?
*(graph_container.graph_ptr_union.GraphCSRViewDoublePtr),
reinterpret_cast<double*>(distances),
reinterpret_cast<int32_t*>(predecessors),
static_cast<int32_t>(source_vertex));
} else if (graph_container.graph_type == graphTypeEnum::graph_t) {
if (graph_container.edgeType == numberTypeEnum::int32Type) {
auto graph =
detail::create_graph<int32_t, int32_t, weight_t, false, true>(handle, graph_container);
cugraph::sssp(handle,
graph->view(),
reinterpret_cast<weight_t*>(distances),
reinterpret_cast<int32_t*>(predecessors),
static_cast<int32_t>(source_vertex));
} else if (graph_container.edgeType == numberTypeEnum::int64Type) {
auto graph =
detail::create_graph<vertex_t, int64_t, weight_t, false, true>(handle, graph_container);
cugraph::sssp(handle,
graph->view(),
reinterpret_cast<weight_t*>(distances),
reinterpret_cast<vertex_t*>(predecessors),
static_cast<vertex_t>(source_vertex));
} else {
CUGRAPH_FAIL("vertexType/edgeType combination unsupported");
}
}
}

// wrapper for weakly connected components:
//
template <typename vertex_t, typename weight_t>
Expand Down Expand Up @@ -1453,34 +1405,6 @@ template std::unique_ptr<random_walk_coo_t> random_walks_to_coo<int32_t, int64_t
template std::unique_ptr<random_walk_coo_t> random_walks_to_coo<int64_t, int64_t>(
raft::handle_t const& handle, random_walk_ret_t& rw_tri);

template void call_sssp(raft::handle_t const& handle,
graph_container_t const& graph_container,
int32_t* identifiers,
float* distances,
int32_t* predecessors,
const int32_t source_vertex);

template void call_sssp(raft::handle_t const& handle,
graph_container_t const& graph_container,
int32_t* identifiers,
double* distances,
int32_t* predecessors,
const int32_t source_vertex);

template void call_sssp(raft::handle_t const& handle,
graph_container_t const& graph_container,
int64_t* identifiers,
float* distances,
int64_t* predecessors,
const int64_t source_vertex);

template void call_sssp(raft::handle_t const& handle,
graph_container_t const& graph_container,
int64_t* identifiers,
double* distances,
int64_t* predecessors,
const int64_t source_vertex);

template void call_wcc<int32_t, float>(raft::handle_t const& handle,
graph_container_t const& graph_container,
int32_t* components);
Expand Down
4 changes: 0 additions & 4 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,6 @@ ConfigureTest(ERDOS_RENYI_GENERATOR_TEST generators/erdos_renyi_test.cpp)
ConfigureTest(LEGACY_BETWEENNESS_TEST centrality/legacy/betweenness_centrality_test.cu)
ConfigureTest(LEGACY_EDGE_BETWEENNESS_TEST centrality/legacy/edge_betweenness_centrality_test.cu)

###################################################################################################
# - SSSP tests ------------------------------------------------------------------------------------
ConfigureTest(LEGACY_SSSP_TEST traversal/legacy/sssp_test.cu)

###################################################################################################
# - BFS tests -------------------------------------------------------------------------------------
ConfigureTest(LEGACY_BFS_TEST traversal/legacy/bfs_test.cu)
Expand Down

0 comments on commit 52c1078

Please sign in to comment.