Graph Algorithms#

template<typename graph_t>
float gunrock::bfs::run(graph_t &G, typename graph_t::vertex_type &single_source, typename graph_t::vertex_type *distances, typename graph_t::vertex_type *predecessors, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#

Run Breadth-First Search algorithm on a given graph, G, starting from the source node, single_source. The resulting distances are stored in the distances pointer. All data must be allocated by the user, on the device (GPU) and passed in to this function.

Template Parameters:

graph_t – Graph type.

Parameters:
  • G – Graph object.

  • single_source – A vertex in the graph (integral type).

  • distances – Pointer to the distances array of size number of vertices.

  • predecessors – Pointer to the predecessors array of size number of vertices. (optional, wip)

  • context – Device context.

Returns:

float Time taken to run the algorithm.

template<typename graph_t>
float gunrock::bc::run(graph_t &G, typename graph_t::weight_type *bc_values)#
template<typename graph_t>
float gunrock::color::run(graph_t &G, typename graph_t::vertex_type *colors, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#
template<typename graph_t>
float gunrock::geo::run(graph_t &G, coordinates_t *coordinates, const unsigned int total_iterations, const unsigned int spatial_iterations = 1000, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#
template<typename graph_t, typename result_t>
float gunrock::hits::run(graph_t &G, unsigned int max_iterations, result_t &result, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#
template<typename graph_t>
float gunrock::kcore::run(graph_t &G, int *k_cores, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#
template<typename graph_t>
float gunrock::mst::run(graph_t &G, typename graph_t::weight_type *mst_weight, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#
template<typename graph_t>
float gunrock::ppr::run(graph_t &G, typename graph_t::vertex_type &seed, typename graph_t::weight_type *p, typename graph_t::weight_type &alpha, typename graph_t::weight_type &epsilon, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#
template<typename graph_t>
float gunrock::pr::run(graph_t &G, typename graph_t::weight_type alpha, typename graph_t::weight_type tol, typename graph_t::weight_type *p, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#
template<typename a_graph_t, typename b_graph_t, typename csr_t>
float gunrock::spgemm::run(a_graph_t &A, b_graph_t &B, csr_t &C, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#
template<typename graph_t>
float gunrock::spmv::run(graph_t &G, typename graph_t::weight_type *x, typename graph_t::weight_type *y, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#
template<typename graph_t>
float gunrock::sssp::run(graph_t &G, typename graph_t::vertex_type &single_source, typename graph_t::weight_type *distances, typename graph_t::vertex_type *predecessors, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#
template<typename graph_t>
float gunrock::tc::run(graph_t &G, bool reduce_all_triangles, typename graph_t::vertex_type *vertex_triangles_count, std::size_t *total_triangles_count, std::shared_ptr<gcuda::multi_context_t> context = std::shared_ptr<gcuda::multi_context_t>(new gcuda::multi_context_t(0)))#