Components#
Weakly Connected Components#
- cugraph_error_code_t cugraph_weakly_connected_components(
- const cugraph_resource_handle_t *handle,
- cugraph_graph_t *graph,
- bool_t do_expensive_check,
- cugraph_labeling_result_t **result,
- cugraph_error_t **error
Labels each vertex in the input graph with its (weakly-connected-)component ID.
The input graph must be symmetric. Component IDs can be arbitrary integers (they can be non-consecutive and are not ordered by component size or any other criterion).
- Parameters:
handle – [in] Handle for accessing resources
graph – [in] Pointer to graph
do_expensive_check – [in] A flag to run expensive checks for input arguments (if set to
true).result – [out] Opaque pointer to labeling results
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
Strongly Connected Components#
- cugraph_error_code_t cugraph_strongly_connected_components(
- const cugraph_resource_handle_t *handle,
- cugraph_graph_t *graph,
- bool_t do_expensive_check,
- cugraph_labeling_result_t **result,
- cugraph_error_t **error
Labels each vertex in the input graph with its (strongly-connected-)component ID.
The input graph may be asymmetric. Component IDs can be arbitrary integers (they can be non-consecutive and are not ordered by component size or any other criterion).
- Parameters:
handle – [in] Handle for accessing resources
graph – [in] Pointer to graph
do_expensive_check – [in] A flag to run expensive checks for input arguments (if set to
true).result – [out] Opaque pointer to labeling results
error – [out] Pointer to an error object storing details of any error. Will be populated if error code is not CUGRAPH_SUCCESS
Labeling Support Functions#
- cugraph_type_erased_device_array_view_t *cugraph_labeling_result_get_vertices(
)#
- cugraph_labeling_result_t *result
Get the vertex ids from the labeling result.
- Parameters:
result – [in] The result from a labeling algorithm
- Returns:
type erased array of vertex ids
- cugraph_type_erased_device_array_view_t *cugraph_labeling_result_get_labels(
)#
- cugraph_labeling_result_t *result
Get the label values from the labeling result.
- Parameters:
result – [in] The result from a labeling algorithm
- Returns:
type erased array of label values
- void cugraph_labeling_result_free(cugraph_labeling_result_t *result)#
Free labeling result.
- Parameters:
result – [in] The result from a labeling algorithm