27#ifndef _H_GRB_PREGEL_CONNECTEDCOMPONENTS
28#define _H_GRB_PREGEL_CONNECTEDCOMPONENTS
35 namespace algorithms {
47 template<
typename VertexIDType >
82 VertexIDType ¤t_max_ID,
83 const VertexIDType &incoming_message,
84 VertexIDType &outgoing_message,
85 const Data ¶meters,
89 if( pregel.
round > 0 ) {
92 }
else if( current_max_ID < incoming_message ) {
93 current_max_ID = incoming_message;
99 outgoing_message = current_max_ID;
124 template<
typename PregelType >
128 const size_t max_steps = 0,
129 size_t *
const steps_taken =
nullptr
136 grb::RC ret = grb::set< grb::descriptors::use_index >( group_ids, 1 );
163 *steps_taken = steps;
A GraphBLAS vector.
Definition: vector.hpp:64
Standard identity for the maximum operator.
Definition: identities.hpp:124
A Pregel run-time instance.
Definition: pregel.hpp:340
size_t num_vertices() const noexcept
Queries the maximum vertex ID for programs running on this Pregel instance.
Definition: pregel.hpp:928
This operator takes the maximum of the two input parameters and writes the result to the output varia...
Definition: ops.hpp:243
size_t size(const Vector< DataType, backend, Coords > &x) noexcept
Request the size of a given vector.
Definition: io.hpp:235
constexpr const SparsificationStrategy out_sparsify
What sparsification strategy should be applied to the outgoing messages.
Definition: pregel.hpp:242
The ALP/GraphBLAS namespace.
Definition: graphblas.hpp:452
RC
Return codes of ALP primitives.
Definition: rc.hpp:47
@ MISMATCH
One or more of the ALP/GraphBLAS objects passed to the primitive that returned this error have mismat...
Definition: rc.hpp:90
@ SUCCESS
Indicates the primitive has executed successfully.
Definition: rc.hpp:54
This file defines a vertex-centric programming API called ALP/Pregel, which automatically translates ...
This vertex-centric Connected Components algorithm does not require any algorithm parameters.
Definition: pregel_connected_components.hpp:54
A vertex-centric Connected Components algorithm.
Definition: pregel_connected_components.hpp:48
static grb::RC execute(grb::interfaces::Pregel< PregelType > &pregel, grb::Vector< VertexIDType > &group_ids, const size_t max_steps=0, size_t *const steps_taken=nullptr)
A convenience function that, given a Pregel instance, executes the program.
Definition: pregel_connected_components.hpp:125
static void program(VertexIDType ¤t_max_ID, const VertexIDType &incoming_message, VertexIDType &outgoing_message, const Data ¶meters, grb::interfaces::PregelState &pregel)
The vertex-centric program for computing connected components.
Definition: pregel_connected_components.hpp:81
The state of the vertex-center Pregel program that the user may interface with.
Definition: pregel.hpp:266
bool & voteToHalt
Represents whether this (active) vertex votes to terminate the program.
Definition: pregel.hpp:291
const size_t & indegree
The in-degree of this vertex.
Definition: pregel.hpp:311
const size_t & round
The current round the vertex-centric program is currently executing.
Definition: pregel.hpp:316
const size_t & outdegree
The out-degree of this vertex.
Definition: pregel.hpp:306