Components#

2025-05-20

2 min read time

Applies to Linux

Weakly Connected Components#

rocgraph_status rocgraph_weakly_connected_components(
const rocgraph_handle_t *handle,
rocgraph_graph_t *graph,
rocgraph_bool do_expensive_check,
rocgraph_labeling_result_t **result,
rocgraph_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 ROCGRAPH_SUCCESS

Strongly Connected Components#

rocgraph_status rocgraph_strongly_connected_components(
const rocgraph_handle_t *handle,
rocgraph_graph_t *graph,
rocgraph_bool do_expensive_check,
rocgraph_labeling_result_t **result,
rocgraph_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 ROCGRAPH_SUCCESS

Labeling Support Functions#

rocgraph_type_erased_device_array_view_t *rocgraph_labeling_result_get_vertices(
rocgraph_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

rocgraph_type_erased_device_array_view_t *rocgraph_labeling_result_get_labels(
rocgraph_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 rocgraph_labeling_result_free(
rocgraph_labeling_result_t *result,
)#

Free labeling result.

Parameters:

result[in] The result from a labeling algorithm

struct rocgraph_labeling_result_t#
#include <rocgraph_labeling_result_t.h>

Opaque labeling result type.

Public Members

int32_t align_#

alignment variable