Graph Functions#
-
template<typename vertex_t, typename edge_t, bool multi_gpu>
std::enable_if_t<multi_gpu, std::tuple<rmm::device_uvector<vertex_t>, renumber_meta_t<vertex_t, edge_t, multi_gpu>>> renumber_edgelist( - raft::handle_t const &handle,
- std::optional<rmm::device_uvector<vertex_t>> &&local_vertices,
- std::vector<vertex_t*> const &edgelist_srcs,
- std::vector<vertex_t*> const &edgelist_dsts,
- std::vector<edge_t> const &edgelist_edge_counts,
- std::optional<std::vector<std::vector<edge_t>>> const &edgelist_intra_partition_segment_offsets,
- bool store_transposed,
- std::optional<large_buffer_type_t> large_vertex_buffer_type = std::nullopt,
- std::optional<large_buffer_type_t> large_edge_buffer_type = std::nullopt,
- bool do_expensive_check = false
renumber edgelist (multi-GPU)
- Deprecated:
This API is deprecated and replaced by
renumber_edgelisttakingedgelist_srcsandedgelist_dstsinstd::vectors ofrmm::device_uvectors (withoutedgelist_edge_counts) and returning the renumbered edge sources and destinations.
This function assumes that vertices are pre-shuffled to their target processes and edges are pre-shuffled to their target processess and edge partitions using compute_gpu_id_from_vertex_t and compute_gpu_id_from_ext_edge_endpoints_t & compute_partition_id_from_ext_edge_endpoints_t functors, respectively.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
local_vertices – If valid, part of the entire set of vertices in the graph to be renumbered. This parameter can be used to include isolated vertices. Applying the compute_gpu_id_from_vertex_t to every vertex should return the local GPU ID for this function to work (vertices should be pre-shuffled).
edgelist_srcs – Pointers (one pointer per local edge partition assigned to this process) to edge source vertex IDs. Source IDs are updated in-place ([INOUT] parameter). Applying the compute_gpu_id_from_ext_edge_endpoints_t functor to every (destination ID, source ID) pair (if store_transposed = true) or (source ID, destination ID) pair (if store_transposed = false) should return the local GPU ID for this function to work (edges should be pre-shuffled). Applying the compute_partition_id_from_ext_edge_endpoints_t to every (destination ID, source ID) pair (if store_transposed = true) or (source ID, destination ID) pair (if store_transposed = false) should also return the corresponding edge partition ID. The best way to enforce this is to use shuffle_ext_vertex_pairs_to_local_gpu_by_edge_partitioning & groupby_and_count_edgelist_by_local_partition_id.
edgelist_dsts – Pointers (one pointer per local edge partition assigned to this process) to edge destination vertex IDs. Destination IDs are updated in-place ([INOUT] parameter).
edgelist_edge_counts – Edge counts (one count per local edge partition assigned to this process).
edgelist_intra_partition_segment_offsets – If valid, store segment offsets within a local edge partition; a local edge partition can be further segmented by applying the compute_gpu_id_from_vertex_t function to edge minor vertex IDs. This optinoal information is used for further memory footprint optimization if provided.
store_transposed – Should be true if renumbered edges will be used to create a graph with store_transposed = true. Should be false if the edges will be used to create a graph with store_transposed = false.
large_vertex_buffer_type – Flag indicating the large buffer type to use when we need to create a per-vertex device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The returned renumber map (storing vertex IDs before renumbering) will also be stored in the buffer type dictated by this parameter.
large_edge_buffer_type – Flag indicating the large buffer type to use when we need to create a per-edge device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used).
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
std::tuple<rmm::device_uvector<vertex_t>, renumber_meta_t<vertex_t, edge_t, multi_gpu>> Tuple of labels (vertex IDs before renumbering) for the entire set of vertices (assigned to this process in multi-GPU) and meta-data collected while renumbering. The meta-data includes total number of vertices, total number of edges, partition_t object storing graph partitioning information, vertex partition segment offsets (a vertex partition is partitioned to multiple segments based on vertex degrees), and the number of local unique edge major & minor vertex IDs. This meta-data is expected to be used in graph construction & graph primitives.
-
template<typename vertex_t, typename edge_t, bool multi_gpu>
std::enable_if_t<multi_gpu, std::tuple<rmm::device_uvector<vertex_t>, std::vector<rmm::device_uvector<vertex_t>>, std::vector<rmm::device_uvector<vertex_t>>, renumber_meta_t<vertex_t, edge_t, multi_gpu>>> renumber_edgelist( - raft::handle_t const &handle,
- std::optional<rmm::device_uvector<vertex_t>> &&local_vertices,
- std::vector<rmm::device_uvector<vertex_t>> &&edgelist_srcs,
- std::vector<rmm::device_uvector<vertex_t>> &&edgelist_dsts,
- std::optional<std::vector<std::vector<edge_t>>> const &edgelist_intra_partition_segment_offsets,
- bool store_transposed,
- std::optional<large_buffer_type_t> large_vertex_buffer_type = std::nullopt,
- std::optional<large_buffer_type_t> large_edge_buffer_type = std::nullopt,
- bool do_expensive_check = false
renumber edgelist (multi-GPU)
This function assumes that vertices are pre-shuffled to their target processes and edges are pre-shuffled to their target processess and edge partitions using compute_gpu_id_from_vertex_t and compute_gpu_id_from_ext_edge_endpoints_t & compute_partition_id_from_ext_edge_endpoints_t functors, respectively.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
local_vertices – If valid, part of the entire set of vertices in the graph to be renumbered. This parameter can be used to include isolated vertices. Applying the compute_gpu_id_from_vertex_t to every vertex should return the local GPU ID for this function to work (vertices should be pre-shuffled).
edgelist_srcs – Vectors (one vector per local edge partition assigned to this process) of edge source vertex IDs. Applying the compute_gpu_id_from_ext_edge_endpoints_t functor to every (destination ID, source ID) pair (if store_transposed = true) or (source ID, destination ID) pair (if store_transposed = false) should return the local GPU ID for this function to work (edges should be pre-shuffled). Applying the compute_partition_id_from_ext_edge_endpoints_t to every (destination ID, source ID) pair (if store_transposed = true) or (source ID, destination ID) pair (if store_transposed = false) should also return the corresponding edge partition ID. The best way to enforce this is to use shuffle_ext_vertex_pairs_to_local_gpu_by_edge_partitioning & groupby_and_count_edgelist_by_local_partition_id.
edgelist_dsts – Vectors (one vector per local edge partition assigned to this process) of edge destination vertex IDs.
edgelist_intra_partition_segment_offsets – If valid, store segment offsets within a local edge partition; a local edge partition can be further segmented by applying the compute_gpu_id_from_vertex_t function to edge minor vertex IDs. This optinoal information is used for further memory footprint optimization if provided.
store_transposed – Should be true if renumbered edges will be used to create a graph with store_transposed = true. Should be false if the edges will be used to create a graph with store_transposed = false.
large_vertex_buffer_type – Flag indicating the large buffer type to use when we need to create a per-vertex device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The returned renumber map (storing vertex IDs before renumbering) will also be stored in the buffer type dictated by this parameter.
large_edge_buffer_type – Flag indicating the large buffer type to use when we need to create a per-edge device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used).
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of labels (vertex IDs before renumbering) for the entire set of vertices assigned to this process, renumbered edge sources and destinations (one vector per local edge partition assigned to this process), and meta-data collected while renumbering. The meta-data includes total number of vertices, total number of edges, partition_t object storing graph partitioning information, vertex partition segment offsets (a vertex partition is partitioned to multiple segments based on vertex degrees), and the number of local unique edge major & minor vertex IDs. This meta-data is expected to be used in graph construction & graph primitives.
-
template<typename vertex_t, typename edge_t, bool multi_gpu>
std::enable_if_t<!multi_gpu, std::tuple<rmm::device_uvector<vertex_t>, renumber_meta_t<vertex_t, edge_t, multi_gpu>>> renumber_edgelist( - raft::handle_t const &handle,
- std::optional<rmm::device_uvector<vertex_t>> &&vertices,
- vertex_t *edgelist_srcs,
- vertex_t *edgelist_dsts,
- edge_t num_edgelist_edges,
- bool store_transposed,
- std::optional<large_buffer_type_t> large_vertex_buffer_type = std::nullopt,
- std::optional<large_buffer_type_t> large_edge_buffer_type = std::nullopt,
- bool do_expensive_check = false
renumber edgelist (single-GPU)
- Deprecated:
This API is deprecated and replaced by
renumber_edgelisttakingedgelist_srcsandedgelist_dstsinrmm::device_uvectors (withoutnum_edgelist_edges) and returning the renumbered edge sources and destinations.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
vertices – If valid, vertices in the graph to be renumbered. This parameter can be used to include isolated vertices.
edgelist_srcs – A pointer to edge source vertex IDs. Source IDs are updated in-place ([INOUT] parameter).
edgelist_dsts – A pointer to edge destination vertex IDs. Destination IDs are updated in-place ([INOUT] parameter).
num_edgelist_edges – Number of edges in the edgelist.
store_transposed – Should be true if renumbered edges will be used to create a graph with store_transposed = true. Should be false if the edges will be used to create a graph with store_transposed = false.
large_vertex_buffer_type – Flag indicating the large buffer type to use when we need to create a per-vertex device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The returned renumber map (storing vertex IDs before renumbering) will also be stored in the buffer type dictated by this parameter.
large_edge_buffer_type – Flag indicating the large buffer type to use when we need to create a per-edge device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used).
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
std::tuple<rmm::device_uvector<vertex_t>, renumber_meta_t<vertex_t, edge_t, multi_gpu>> Tuple of labels (vertex IDs before renumbering) for the entire set of vertices and meta-data collected while renumbering. The meta-data includes vertex partition segment offsets (a vertex partition is partitioned to multiple segments based on vertex degrees). This meta-data is expected to be used in graph construction & graph primitives.
-
template<typename vertex_t, typename edge_t, bool multi_gpu>
std::enable_if_t<!multi_gpu, std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, renumber_meta_t<vertex_t, edge_t, multi_gpu>>> renumber_edgelist( - raft::handle_t const &handle,
- std::optional<rmm::device_uvector<vertex_t>> &&vertices,
- rmm::device_uvector<vertex_t> &&edgelist_srcs,
- rmm::device_uvector<vertex_t> &&edgelist_dsts,
- bool store_transposed,
- std::optional<large_buffer_type_t> large_vertex_buffer_type = std::nullopt,
- std::optional<large_buffer_type_t> large_edge_buffer_type = std::nullopt,
- bool do_expensive_check = false
renumber edgelist (single-GPU)
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
vertices – If valid, vertices in the graph to be renumbered. This parameter can be used to include isolated vertices.
edgelist_srcs – Edge source vertex IDs.
edgelist_dsts – Edge destination vertex IDs.
store_transposed – Should be true if renumbered edges will be used to create a graph with store_transposed = true. Should be false if the edges will be used to create a graph with store_transposed = false.
large_vertex_buffer_type – Flag indicating the large buffer type to use when we need to create a per-vertex device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The returned renumber map (storing vertex IDs before renumbering) will also be stored in the buffer type dictated by this parameter.
large_edge_buffer_type – Flag indicating the large buffer type to use when we need to create a per-edge device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used).
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of labels (vertex IDs before renumbering) for the entire set of vertices, renumbered edge sources and destinations, and meta-data collected while renumbering. The meta-data includes vertex partition segment offsets (a vertex partition is partitioned to multiple segments based on vertex degrees). This meta-data is expected to be used in graph construction & graph primitives.
-
template<typename vertex_t, bool multi_gpu>
void renumber_ext_vertices( - raft::handle_t const &handle,
- vertex_t *vertices,
- size_t num_vertices,
- vertex_t const *renumber_map_labels,
- vertex_t local_int_vertex_first,
- vertex_t local_int_vertex_last,
- bool do_expensive_check = false
Renumber external vertices to internal vertices based on the provided
renumber_map_labels.- Deprecated:
This API is deprecated and replaced by
renumber_ext_verticestaking a graph view, taking and returningverticesin anrmm::device_uvector, and takingrenumber_map_labelsin avertex_property_view_t.
Note cugraph::invalid_id<vertex_t>::value remains unchanged.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
vertices – Pointer to the vertices to be renumbered. The input external vertices are renumbered to internal vertices in-place.
num_vertices – Number of vertices to be renumbered.
renumber_map_labels – Pointer to the external vertices corresponding to the internal vertices in the range [
local_int_vertex_first,local_int_vertex_last).local_int_vertex_first – The first local internal vertex (inclusive, assigned to this process in multi-GPU).
local_int_vertex_last – The last local internal vertex (exclusive, assigned to this process in multi-GPU).
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
rmm::device_uvector<vertex_t> renumber_ext_vertices( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- rmm::device_uvector<vertex_t> &&vertices,
- vertex_property_view_t<vertex_t, vertex_t const*> renumber_map_labels,
- bool do_expensive_check = false
Renumber external vertices to internal vertices based on the provided
renumber_map_labels.Note cugraph::invalid_id<vertex_t>::value remains unchanged.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the graph the vertices belong to.
vertices – The external vertices to be renumbered (in multi-GPU, these vertices are not necessarily local to this process).
renumber_map_labels – View object holding the external vertices corresponding to the local internal vertices of
graph_view.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
The renumbered (internal) vertices.
-
template<typename vertex_t>
void unrenumber_local_int_vertices( - raft::handle_t const &handle,
- vertex_t *vertices,
- size_t num_vertices,
- vertex_t const *renumber_map_labels,
- vertex_t local_int_vertex_first,
- vertex_t local_int_vertex_last,
- bool do_expensive_check = false
Unrenumber local internal vertices to external vertices based on the providied
renumber_map_labels.- Deprecated:
This API is deprecated and replaced by
unrenumber_local_int_verticestaking and returningverticesin anrmm::device_uvectorand takingrenumber_map_labelsin avertex_property_view_t.
Note cugraph::invalid_id<vertex_t>::value remains unchanged.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
vertices – Pointer to the local internal vertices to be unrenumbered. Each input element should be in [
local_int_vertex_first,local_int_vertex_last). The input internal vertices are renumbered to external vertices in-place.num_vertices – Number of vertices to be unrenumbered.
renumber_map_labels – Pointer to the external vertices corresponding to the internal vertices in the range [
local_int_vertex_first,local_int_vertex_last).local_int_vertex_first – The first local internal vertex (inclusive, assigned to this process in multi-GPU).
local_int_vertex_last – The last local internal vertex (exclusive, assigned to this process in multi-GPU).
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
rmm::device_uvector<vertex_t> unrenumber_local_int_vertices( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- rmm::device_uvector<vertex_t> &&vertices,
- vertex_property_view_t<vertex_t, vertex_t const*> renumber_map_labels,
- bool do_expensive_check = false
Unrenumber local internal vertices to external vertices based on the providied
renumber_map_labels.Note cugraph::invalid_id<vertex_t>::value remains unchanged.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the graph whose local vertices are unrenumbered.
vertices – The local internal vertices (of
graph_view) to be unrenumbered.renumber_map_labels – View object holding the external vertices corresponding to the local internal vertices of
graph_view.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
The unrenumbered (external) vertices.
-
template<typename vertex_t, bool multi_gpu>
void unrenumber_int_vertices( - raft::handle_t const &handle,
- vertex_t *vertices,
- size_t num_vertices,
- vertex_t const *renumber_map_labels,
- raft::host_span<vertex_t const> vertex_partition_range_lasts,
- bool do_expensive_check = false
Unrenumber (possibly non-local) internal vertices to external vertices based on the providied
renumber_map_labels.- Deprecated:
This API is deprecated and replaced by
unrenumber_int_verticestaking a graph view, taking and returningverticesin anrmm::device_uvector, and takingrenumber_map_labelsin avertex_property_view_t.
Note cugraph::invalid_id<vertex_t>::value remains unchanged.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
vertices – Pointer to the internal vertices to be unrenumbered. The input internal vertices are renumbered to external vertices in-place.
num_vertices – Number of vertices to be unrenumbered.
renumber_map_labels – Pointer to the external vertices corresponding to the internal vertices in the range [
local_int_vertex_first,local_int_vertex_last).vertex_partition_range_lasts – Last local internal vertices (exclusive, assigned to each process in multi-GPU).
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
rmm::device_uvector<vertex_t> unrenumber_int_vertices( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- rmm::device_uvector<vertex_t> &&vertices,
- vertex_property_view_t<vertex_t, vertex_t const*> renumber_map_labels,
- bool do_expensive_check = false
Unrenumber (possibly non-local) internal vertices to external vertices based on the providied
renumber_map_labels.Note cugraph::invalid_id<vertex_t>::value remains unchanged.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the graph the vertices belong to.
vertices – The internal vertices (of
graph_view) to be unrenumbered (in multi-GPU, these vertices are not necessarily local to this process).renumber_map_labels – View object holding the external vertices corresponding to the local internal vertices of
graph_view.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
The unrenumbered (external) vertices.
-
template<typename vertex_t, bool store_transposed, bool multi_gpu>
std::enable_if_t<multi_gpu, void> unrenumber_local_int_edges( - raft::handle_t const &handle,
- std::vector<vertex_t*> const &edgelist_srcs,
- std::vector<vertex_t*> const &edgelist_dsts,
- std::vector<size_t> const &edgelist_edge_counts,
- vertex_t const *renumber_map_labels,
- raft::host_span<vertex_t const> vertex_partition_range_lasts,
- std::optional<std::vector<std::vector<size_t>>> const &edgelist_intra_partition_segment_offsets,
- bool do_expensive_check = false
Unrenumber local edges’ internal source & destination IDs to external IDs based on the provided
renumber_map_labels(multi-GPU).- Deprecated:
This API is deprecated and replaced by
unrenumber_local_int_edgestaking a graph view, taking and returningedgelist_srcsandedgelist_dstsinrmm::device_uvectors with edge partition offsets, and takingrenumber_map_labelsin avertex_property_view_t.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms. @params edgelist_srcs Pointers (one pointer per local edge partition assigned to this process) to the local internal source vertex IDs to be unrenumbered. The input source vertex IDs are renumbered to external IDs in-place. @params edgelist_dsts Pointers (one pointer per local edge partition assigned to this process) to the local internal destination vertex IDs to be unrenumbered. The input destination vertex IDs are renumbered to external IDs in-place.
edgelist_edge_counts – Edge counts (one count per local edge partition assigned to this process).
renumber_map_labels – Pointer to the external vertices corresponding to the internal vertices in the range assigned to this process.
vertex_partition_range_lasts – Last local internal vertices (exclusive, assigned to each process in multi-GPU).
edgelist_intra_partition_segment_offsets – If valid, store segment offsets within a local edge partition; a local edge partition can be further segmented by applying the compute_gpu_id_from_vertex_t function to edge minor vertex IDs. This optinoal information is used for further memory footprint optimization if provided.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
-
template<typename vertex_t, typename edge_t, bool store_transposed>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>> unrenumber_local_int_edges( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, true> const &graph_view,
- rmm::device_uvector<vertex_t> &&edgelist_srcs,
- rmm::device_uvector<vertex_t> &&edgelist_dsts,
- std::vector<size_t> const &edgelist_partition_offsets,
- vertex_property_view_t<vertex_t, vertex_t const*> renumber_map,
- std::optional<std::vector<std::vector<size_t>>> const &edgelist_intra_partition_segment_offsets,
- bool do_expensive_check = false
Unrenumber local edges’ internal source & destination IDs to external IDs based on the provided
renumber_map(multi-GPU).- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the graph the edges belong to.
edgelist_srcs – The local internal source vertex IDs to be unrenumbered. Edges belonging to the i’th local edge partition of
graph_vieware stored in the range [edgelist_partition_offsets[i],edgelist_partition_offsets[i + 1]).edgelist_dsts – The local internal destination vertex IDs to be unrenumbered (partitioned in the same way as
edgelist_srcs).edgelist_partition_offsets – Offsets (size = the number of local edge partitions + 1) to the edge partition boundaries in
edgelist_srcsandedgelist_dsts.renumber_map – View object holding the external vertices corresponding to the local internal vertices of
graph_view.edgelist_intra_partition_segment_offsets – If valid, store segment offsets within a local edge partition; a local edge partition can be further segmented by applying the compute_gpu_id_from_vertex_t function to edge minor vertex IDs. This optinoal information is used for further memory footprint optimization if provided.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of the unrenumbered (external) source and destination vertex IDs.
-
template<typename vertex_t, bool store_transposed, bool multi_gpu>
std::enable_if_t<!multi_gpu, void> unrenumber_local_int_edges( - raft::handle_t const &handle,
- vertex_t *edgelist_srcs,
- vertex_t *edgelist_dsts,
- size_t num_edgelist_edges,
- vertex_t const *renumber_map_labels,
- vertex_t num_vertices,
- bool do_expensive_check = false
Unrenumber local edges’ internal source & destination IDs to external IDs based on the provided
renumber_map_labels(single-GPU).- Deprecated:
This API is deprecated and replaced by
unrenumber_local_int_edgestaking a graph view, taking and returningedgelist_srcsandedgelist_dstsinrmm::device_uvectors, and takingrenumber_map_labelsin avertex_property_view_t.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms. @params edgelist_srcs Pointer to the local internal source vertex IDs to be unrenumbered. The input source vertex IDs are renumbered to external IDs in-place. @params edgelist_dsts Pointer to the local internal destination vertex IDs to be unrenumbered. The input destination vertex IDs are renumbered to external IDs in-place.
num_edgelist_edges – Number of edges in the edge list.
renumber_map_labels – Pointer to the external vertices corresponding to the internal vertices.
num_vertices – Number of vertices to be unrenumbered.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
-
template<typename vertex_t, typename edge_t, bool store_transposed>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>> unrenumber_local_int_edges( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, false> const &graph_view,
- rmm::device_uvector<vertex_t> &&edgelist_srcs,
- rmm::device_uvector<vertex_t> &&edgelist_dsts,
- vertex_property_view_t<vertex_t, vertex_t const*> renumber_map,
- bool do_expensive_check = false
Unrenumber local edges’ internal source & destination IDs to external IDs based on the provided
renumber_map(single-GPU).- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the graph the edges belong to.
edgelist_srcs – The internal source vertex IDs to be unrenumbered.
edgelist_dsts – The internal destination vertex IDs to be unrenumbered.
renumber_map – View object holding the external vertices corresponding to the internal vertices of
graph_view.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of the unrenumbered (external) source and destination vertex IDs.
-
template<typename vertex_t, bool multi_gpu>
void renumber_local_ext_vertices( - raft::handle_t const &handle,
- vertex_t *vertices,
- size_t num_vertices,
- vertex_t const *renumber_map_labels,
- vertex_t local_int_vertex_first,
- vertex_t local_int_vertex_last,
- bool do_expensive_check = false
Renumber local external vertices to internal vertices based on the provided
renumber_map_labels.- Deprecated:
This API is deprecated and replaced by
renumber_local_ext_verticestaking a graph view, taking and returningverticesin anrmm::device_uvector, and takingrenumber_map_labelsin avertex_property_view_t.
Note cugraph::invalid_id<vertex_t>::value remains unchanged.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
vertices – Pointer to the vertices to be renumbered. The input external vertices are renumbered to internal vertices in-place.
num_vertices – Number of vertices to be renumbered.
renumber_map_labels – Pointer to the external vertices corresponding to the internal vertices in the range [
local_int_vertex_first,local_int_vertex_last).local_int_vertex_first – The first local internal vertex (inclusive, assigned to this process in multi-GPU).
local_int_vertex_last – The last local internal vertex (exclusive, assigned to this process in multi-GPU).
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
rmm::device_uvector<vertex_t> renumber_local_ext_vertices( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- rmm::device_uvector<vertex_t> &&vertices,
- vertex_property_view_t<vertex_t, vertex_t const*> renumber_map_labels,
- bool do_expensive_check = false
Renumber local external vertices to internal vertices based on the provided
renumber_map_labels.Note cugraph::invalid_id<vertex_t>::value remains unchanged.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the graph the vertices belong to.
vertices – The local external vertices to be renumbered (these vertices should map to the local internal vertices of
graph_view).renumber_map_labels – View object holding the external vertices corresponding to the local internal vertices of
graph_view.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
The renumbered (internal) vertices.
-
template<typename vertex_t, typename edge_t, typename weight_t, typename edge_type_t, bool store_transposed, bool multi_gpu>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::optional<rmm::device_uvector<weight_t>>, std::optional<rmm::device_uvector<edge_t>>, std::optional<rmm::device_uvector<edge_type_t>>> decompress_to_edgelist( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- std::optional<edge_property_view_t<edge_t, weight_t const*>> edge_weight_view,
- std::optional<edge_property_view_t<edge_t, edge_t const*>> edge_id_view,
- std::optional<edge_property_view_t<edge_t, edge_type_t const*>> edge_type_view,
- std::optional<raft::device_span<vertex_t const>> renumber_map,
- std::optional<large_buffer_type_t> large_buffer_type = std::nullopt,
- bool do_expensive_check = false
Construct the edge list from the graph view object.
- Deprecated:
This API is deprecated and replaced by
decompress_to_edgelisttaking edge property views in astd::vectorandrenumber_mapin avertex_property_view_tand returning edge property values in astd::vector.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
edge_type_t – Type of edge types. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the graph to be decompressed.
edge_weight_view – Optional view object holding edge weights for
graph_view.edge_id_view – Optional view object holding edge ids for
graph_view.edge_type_view – Optional view object holding edge types for
graph_view.renumber_map – If valid, return the renumbered edge list based on the provided
renumber_maplarge_buffer_type – Flag indicating the large buffer type to use when we need to create a large device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The returned edge list will also be stored in the buffer type dictated by this parameter.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of edge sources, destinations, (optional) edge weights (if
edge_weight_view.has_value()is true) and (optional) edge ids (ifedge_id_view.has_value()is true).
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::vector<arithmetic_device_uvector_t>> decompress_to_edgelist( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- std::vector<edge_arithmetic_property_view_t<edge_t>> const &edge_property_views,
- std::optional<vertex_property_view_t<vertex_t, vertex_t const*>> renumber_map,
- std::optional<large_buffer_type_t> large_buffer_type = std::nullopt,
- bool do_expensive_check = false
Construct the edge list from the graph view object.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the graph to be decompressed.
edge_property_views – View objects holding edge property values (e.g. edge weights, IDs, or types) for
graph_view.renumber_map – If valid, return the renumbered edge list based on the provided
renumber_map(view object holding the external vertex IDs of the local vertices)large_buffer_type – Flag indicating the large buffer type to use when we need to create a large device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The returned edge list will also be stored in the buffer type dictated by this parameter.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of edge sources, destinations, and edge property values (one vector per element of
edge_property_views, in the same order).
-
template<typename vertex_t, typename edge_t, typename weight_t, typename edge_type_t, typename time_stamp_t, bool store_transposed, bool multi_gpu>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::optional<rmm::device_uvector<weight_t>>, std::optional<rmm::device_uvector<edge_t>>, std::optional<rmm::device_uvector<edge_type_t>>, std::optional<rmm::device_uvector<time_stamp_t>>, std::optional<rmm::device_uvector<time_stamp_t>>> symmetrize_edgelist( - raft::handle_t const &handle,
- rmm::device_uvector<vertex_t> &&edgelist_srcs,
- rmm::device_uvector<vertex_t> &&edgelist_dsts,
- std::optional<rmm::device_uvector<weight_t>> &&edgelist_weights,
- std::optional<rmm::device_uvector<edge_t>> &&edgelist_edge_ids,
- std::optional<rmm::device_uvector<edge_type_t>> &&edgelist_edge_types,
- std::optional<rmm::device_uvector<time_stamp_t>> &&edgelist_edge_start_times,
- std::optional<rmm::device_uvector<time_stamp_t>> &&edgelist_edge_end_times,
- bool reciprocal,
- bool do_expensive_check = false
Symmetrize edgelist.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
edge_type_t – Type of edge type identifiers. Needs to be an integral type.
time_stamp_t – Type of time. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
edgelist_srcs – Vector of edge source vertex IDs. If multi-GPU, applying the compute_gpu_id_from_ext_edge_endpoints_t to every edge should return the local GPU ID for this function to work (edges should be pre-shuffled).
edgelist_dsts – Vector of edge destination vertex IDs.
edgelist_weights – Vector of edge weights.
edgelist_edge_ids – Vector of edge ids
edgelist_edge_types – Vector of edge types
edgelist_edge_start_times – Vector of edge start times
edgelist_edge_end_times – Vector of edge end times
reciprocal – Flag indicating whether to keep (if set to
false) or discard (if set totrue) edges that appear only in one direction.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of symmetrized sources, destinations, optional weights, optional edge ids, optional edge types, optional edge start times and optional edge end times
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::optional<edge_property_t<edge_t, weight_t>>, std::optional<rmm::device_uvector<vertex_t>>> symmetrize_graph( - raft::handle_t const &handle,
- graph_t<vertex_t, edge_t, store_transposed, multi_gpu> &&graph,
- std::optional<edge_property_t<edge_t, weight_t>> &&edge_weights,
- std::optional<rmm::device_uvector<vertex_t>> &&renumber_map,
- bool reciprocal = false,
- bool do_expensive_check = false
Symmetrize the input graph.
- Deprecated:
This API is deprecated and replaced by
symmetrize_graphtaking and returning the renumber map in avertex_property_t.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph – Graph object to be symmetrized.
edge_weights – Optional owning object holding edge weights for
graph.renumber_map – Renumber map to recover the original vertex IDs from the renumbered vertex IDs. This should be valid if multi-GPU.
reciprocal – If true, an edge is kept only when the reversed edge also exists. If false, keep (and symmetrize) all the edges that appear only in one direction.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Return a symmetrized graph, an owning object holding edge weights (if
edge_weights.has_value()is true) and a new renumber map (to recover the original vertex IDs, ifrenumber_map.has_value()is true).
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::optional<edge_property_t<edge_t, weight_t>>, std::optional<vertex_property_t<vertex_t, vertex_t>>> symmetrize_graph( - raft::handle_t const &handle,
- graph_t<vertex_t, edge_t, store_transposed, multi_gpu> &&graph,
- std::optional<edge_property_t<edge_t, weight_t>> &&edge_weights,
- std::optional<vertex_property_t<vertex_t, vertex_t>> &&renumber_map,
- bool reciprocal = false,
- bool do_expensive_check = false
Symmetrize the input graph.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph – Graph object to be symmetrized.
edge_weights – Optional owning object holding edge weights for
graph.renumber_map – Renumber map to recover the original vertex IDs from the renumbered vertex IDs (stored in a vertex_property_t). This should be valid if multi-GPU.
reciprocal – If true, an edge is kept only when the reversed edge also exists. If false, keep (and symmetrize) all the edges that appear only in one direction.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Return a symmetrized graph, an owning object holding edge weights (if
edge_weights.has_value()is true) and a new renumber map (stored in a vertex_property_t, to recover the original vertex IDs, ifrenumber_map.has_value()is true).
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::optional<edge_property_t<edge_t, weight_t>>, std::optional<rmm::device_uvector<vertex_t>>> transpose_graph( - raft::handle_t const &handle,
- graph_t<vertex_t, edge_t, store_transposed, multi_gpu> &&graph,
- std::optional<edge_property_t<edge_t, weight_t>> &&edge_weights,
- std::optional<rmm::device_uvector<vertex_t>> &&renumber_map,
- bool do_expensive_check = false
Transpose the input graph.
- Deprecated:
This API is deprecated and replaced by
transpose_graphtaking and returning the renumber map in avertex_property_t.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph – Graph object to be transposed.
edge_weights – Optional owning object holding edge weights for
graph.renumber_map – Renumber map to recover the original vertex IDs from the renumbered vertex IDs. This should be valid if multi-GPU.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Return a transposed graph, an owning object holding edge weights (if
edge_weights.has_value()is true) and a new renumber map (to recover the original vertex IDs, ifrenumber_map.has_value()is true).
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::optional<edge_property_t<edge_t, weight_t>>, std::optional<vertex_property_t<vertex_t, vertex_t>>> transpose_graph( - raft::handle_t const &handle,
- graph_t<vertex_t, edge_t, store_transposed, multi_gpu> &&graph,
- std::optional<edge_property_t<edge_t, weight_t>> &&edge_weights,
- std::optional<vertex_property_t<vertex_t, vertex_t>> &&renumber_map,
- bool do_expensive_check = false
Transpose the input graph.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph – Graph object to be transposed.
edge_weights – Optional owning object holding edge weights for
graph.renumber_map – Renumber map to recover the original vertex IDs from the renumbered vertex IDs (stored in a vertex_property_t). This should be valid if multi-GPU.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Return a transposed graph, an owning object holding edge weights (if
edge_weights.has_value()is true) and a new renumber map (stored in a vertex_property_t, to recover the original vertex IDs, ifrenumber_map.has_value()is true).
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, !store_transposed, multi_gpu>, std::optional<edge_property_t<edge_t, weight_t>>, std::optional<rmm::device_uvector<vertex_t>>> transpose_graph_storage( - raft::handle_t const &handle,
- graph_t<vertex_t, edge_t, store_transposed, multi_gpu> &&graph,
- std::optional<edge_property_t<edge_t, weight_t>> &&edge_weights,
- std::optional<rmm::device_uvector<vertex_t>> &&renumber_map,
- bool do_expensive_check = false
Transpose the storage format (no change in an actual graph topology).
- Deprecated:
This API is deprecated and replaced by
transpose_graph_storagetaking and returning the renumber map in avertex_property_t.
In SG, convert between CSR and CSC. In multi-GPU, currently convert between CSR + DCSR hybrid and CSC + DCSC hybrid (but the internal representation in multi-GPU is subject to change).
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph – Graph object to transpose its storage format.
edge_weights – Optional owning object holding edge weights for
graph.renumber_map – Renumber map to recover the original vertex IDs from the renumbered vertex IDs. This should be valid if multi-GPU.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
std::tuple<graph_t<vertex_t, edge_t, weight_t, !store_transposed, multi_gpu>,
- Returns:
Return a storage transposed graph, an owning object holding edge weights (if
edge_weights.has_value()is true) and a new renumber map (to recover the original vertex IDs, ifrenumber_map.has_value()is true).
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, !store_transposed, multi_gpu>, std::optional<edge_property_t<edge_t, weight_t>>, std::optional<vertex_property_t<vertex_t, vertex_t>>> transpose_graph_storage( - raft::handle_t const &handle,
- graph_t<vertex_t, edge_t, store_transposed, multi_gpu> &&graph,
- std::optional<edge_property_t<edge_t, weight_t>> &&edge_weights,
- std::optional<vertex_property_t<vertex_t, vertex_t>> &&renumber_map,
- bool do_expensive_check = false
Transpose the storage format (no change in an actual graph topology).
In SG, convert between CSR and CSC. In multi-GPU, currently convert between CSR + DCSR hybrid and CSC + DCSC hybrid (but the internal representation in multi-GPU is subject to change).
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph – Graph object to transpose its storage format.
edge_weights – Optional owning object holding edge weights for
graph.renumber_map – Renumber map to recover the original vertex IDs from the renumbered vertex IDs (stored in a vertex_property_t). This should be valid if multi-GPU.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
std::tuple<graph_t<vertex_t, edge_t, weight_t, !store_transposed, multi_gpu>,
- Returns:
Return a storage transposed graph, an owning object holding edge weights (if
edge_weights.has_value()is true) and a new renumber map (stored in a vertex_property_t, to recover the original vertex IDs, ifrenumber_map.has_value()is true).
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::optional<edge_property_t<edge_t, weight_t>>, std::optional<rmm::device_uvector<vertex_t>>> coarsen_graph( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- std::optional<edge_property_view_t<edge_t, weight_t const*>> edge_weight_view,
- vertex_t const *labels,
- bool renumber,
- bool do_expensive_check = false
Compute the coarsened graph.
- Deprecated:
This API is deprecated and replaced by
coarsen_graphtakinglabelsin avertex_property_view_tand returning the renumber map in avertex_property_t.
Aggregates the vertices with the same label to a new vertex in the output coarsened graph. Multi-edges in the coarsened graph are collapsed to a single edge with its weight equal to the sum of multi-edge weights.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to be coarsened.
edge_weight_view – Optional view object holding edge weights for
graph_view.labels – Vertex labels (assigned to this process in multi-GPU) to be used in coarsening.
renumber – Flag indicating whether to renumber vertices or not (must be true if
multi_gpuis true). Settingrenumberto false is highly discouraged except for testing as this negatively affects the performance and memory footprint. Ifrenumberis set to true,labelsshould have only non-negative integers and the number of vertices is assumed to be the maximum element inlabels(reduced over the entire set of GPUs in multi-GPU) + 1. This may produce many isolated vertices if the number of unique elements (over the entire set of GPUs in multi-GPU) inlabelsis much smaller than the assumed number of vertices.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of the coarsened graph, coarsened graph edge weights (if
edge_weight_view.has_value()is true) and the renumber map (ifrenumberis true).
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::optional<edge_property_t<edge_t, weight_t>>, std::optional<vertex_property_t<vertex_t, vertex_t>>> coarsen_graph( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- std::optional<edge_property_view_t<edge_t, weight_t const*>> edge_weight_view,
- vertex_property_view_t<vertex_t, vertex_t const*> labels,
- bool renumber,
- bool do_expensive_check = false
Compute the coarsened graph.
Aggregates the vertices with the same label to a new vertex in the output coarsened graph. Multi-edges in the coarsened graph are collapsed to a single edge with its weight equal to the sum of multi-edge weights.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to be coarsened.
edge_weight_view – Optional view object holding edge weights for
graph_view.labels – View object holding vertex labels (for the local vertex partition range) to be used in coarsening.
renumber – Flag indicating whether to renumber vertices or not (must be true if
multi_gpuis true). Settingrenumberto false is highly discouraged except for testing as this negatively affects the performance and memory footprint. Ifrenumberis set to true,labelsshould have only non-negative integers and the number of vertices is assumed to be the maximum element inlabels(reduced over the entire set of GPUs in multi-GPU) + 1. This may produce many isolated vertices if the number of unique elements (over the entire set of GPUs in multi-GPU) inlabelsis much smaller than the assumed number of vertices.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of the coarsened graph, coarsened graph edge weights (if
edge_weight_view.has_value()is true) and the renumber map (stored in a vertex_property_t, ifrenumberis true).
-
template<typename vertex_t, bool multi_gpu>
void relabel( - raft::handle_t const &handle,
- std::tuple<vertex_t const*, vertex_t const*> old_new_label_pairs,
- vertex_t num_label_pairs,
- vertex_t *labels,
- vertex_t num_labels,
- bool skip_missing_labels,
- bool do_expensive_check = false
Relabel old labels to new labels.
- Deprecated:
This API is deprecated and replaced by
relabeltaking old and new labels inraft::device_spanobjects partitioned following the internal or external vertex partitioning and taking and returninglabelsin anrmm::device_uvector.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
old_new_label_pairs – Pairs of an old label and the corresponding new label (each process holds only part of the entire old labels and the corresponding new labels; partitioning can be arbitrary).
num_label_pairs – Number of (old, new) label pairs.
labels – Labels to be relabeled. This initially holds old labels. Old labels are updated to new labels in-place ([INOUT] parameter).
num_labels – Number of labels to be relabeled.
skip_missing_labels – Flag dictating the behavior on missing labels (
labelscontains old labels missing inold_new_label_pairs). If set to true, missing elements are skipped (not relabeled). If set to false, undefined behavior (ifdo_expensive_checkis set to true, this function will throw an exception).do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
rmm::device_uvector<vertex_t> New labels corresponding to the
old_labels.
-
template<typename vertex_t, bool multi_gpu>
rmm::device_uvector<vertex_t> relabel( - raft::handle_t const &handle,
- raft::device_span<vertex_t const> old_labels,
- raft::device_span<vertex_t const> new_labels,
- rmm::device_uvector<vertex_t> &&labels,
- std::optional<raft::host_span<vertex_t const>> vertex_partition_range_lasts,
- bool skip_missing_labels,
- bool do_expensive_check = false
Relabel old labels to new labels.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
old_labels – Old labels (each process holds only part of the entire old labels). Should be unique across all processes. In multi-GPU, if
vertex_partition_range_lasts.has_value()is true, each process should hold the old labels belonging to its local vertex partition range (internal vertex partitioning). Otherwise, each process should hold the old labels mapped to the process by the external vertex partitioning.new_labels – New labels corresponding to the old labels in
old_labels. Should have the same size asold_labels.labels – Labels to be relabeled. This holds old labels.
vertex_partition_range_lasts – Last (exclusive) vertex IDs of the vertex partition ranges (ordered by vertex partition ID) to use the internal vertex partitioning for
old_labels. If std::nullopt,old_labelsshould follow the external vertex partitioning. Ignored in single-GPU.skip_missing_labels – Flag dictating the behavior on missing labels (
labelscontains old labels missing inold_labels). If set to true, missing elements are skipped (not relabeled). If set to false, undefined behavior (ifdo_expensive_checkis set to true, this function will throw an exception).do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
rmm::device_uvector<vertex_t> New labels corresponding to the old labels in
labels.
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::optional<rmm::device_uvector<weight_t>>, rmm::device_uvector<size_t>> extract_induced_subgraphs( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- std::optional<edge_property_view_t<edge_t, weight_t const*>> edge_weight_view,
- raft::device_span<size_t const> subgraph_offsets,
- raft::device_span<vertex_t const> subgraph_vertices,
- bool do_expensive_check = false
extract induced subgraph(s).
- Deprecated:
This API is deprecated and replaced by
extract_induced_subgraphstaking edge property views in astd::vectorand returning edge sources, edge destinations, and edge property values in astd::vector.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object, we extract induced subgraphs from
graph_view.edge_weight_view – Optional view object holding edge weights for
graph_view.subgraph_offsets – Span pointing to subgraph vertex offsets
subgraph_vertices – Span pointing to subgraph vertices.
subgraph_offsetsandsubgraph_verticesprovide vertex sets (or local vertex sets in multi-GPU) forsubgraph_offsets.size()- 1 subgraphs to extract. For the i’th subgraph to extract, one can extract the (local-)vertex set by accessing a subset ofsubgraph_vertices, where the range of the subset is [subgraph_offsetes[i],subgraph_offsets[i + 1]). In multi-GPU, the vertex set for each subgraph is distributed in multiple-GPUs and each GPU holds only the vertices that are local to the GPU.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Quadraplet of edge major (destination if
store_transposedis true, source otherwise) vertices, edge minor (source ifstore_transposedis true, destination otherwise) vertices, edge weights (ifedge_weight_view.has_value()is true), and edge offsets for each induced subgraphs (size == num_subgraphs + 1). The sizes of the edge major & minor vertices are edge_offsets[num_subgraphs].
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::vector<arithmetic_device_uvector_t>, rmm::device_uvector<size_t>> extract_induced_subgraphs( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- std::vector<edge_arithmetic_property_view_t<edge_t>> const &edge_property_views,
- raft::device_span<size_t const> subgraph_offsets,
- raft::device_span<vertex_t const> subgraph_vertices,
- bool do_expensive_check = false
extract induced subgraph(s).
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object, we extract induced subgraphs from
graph_view.edge_property_views – View objects holding edge property values (e.g. edge weights, IDs, or types) for
graph_view.subgraph_offsets – Span pointing to subgraph vertex offsets
subgraph_vertices – Span pointing to subgraph vertices.
subgraph_offsetsandsubgraph_verticesprovide vertex sets (or local vertex sets in multi-GPU) forsubgraph_offsets.size()- 1 subgraphs to extract. For the i’th subgraph to extract, one can extract the (local-)vertex set by accessing a subset ofsubgraph_vertices, where the range of the subset is [subgraph_offsetes[i],subgraph_offsets[i + 1]). In multi-GPU, the vertex set for each subgraph is distributed in multiple-GPUs and each GPU holds only the vertices that are local to the GPU.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Quadruplet of edge sources, edge destinations, edge property values (one vector per element of
edge_property_views, in the same order), and edge offsets for each induced subgraph (size == num_subgraphs + 1). The sizes of the edge sources, destinations, and property values are edge_offsets[num_subgraphs].
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::vector<edge_arithmetic_property_t<edge_t>>, std::optional<rmm::device_uvector<vertex_t>>> create_graph_from_edgelist( - raft::handle_t const &handle,
- std::optional<rmm::device_uvector<vertex_t>> &&vertices,
- rmm::device_uvector<vertex_t> &&edgelist_srcs,
- rmm::device_uvector<vertex_t> &&edgelist_dsts,
- std::vector<arithmetic_device_uvector_t> &&edgelist_edge_properties,
- graph_properties_t graph_properties,
- bool renumber,
- std::optional<large_buffer_type_t> large_vertex_buffer_type = std::nullopt,
- std::optional<large_buffer_type_t> large_edge_buffer_type = std::nullopt,
- bool do_expensive_check = false
create a graph from (the optional vertex list and) the given edge list (with optional edge IDs and types).
- Deprecated:
This API is deprecated and replaced by
create_graph, which returns the renumber map in avertex_property_t.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
vertices – If valid, part of the entire set of vertices in the graph to be renumbered. This parameter can be used to include isolated vertices. If
renumberis false andverticesis valid,verticeselements should be consecutive integers starting from 0. If multi-GPU, applying the compute_gpu_id_from_vertex_t to every vertex should return the local GPU ID for this function to work (vertices should be pre-shuffled).edgelist_srcs – Vector of edge source vertex IDs. If multi-GPU, applying the compute_gpu_id_from_ext_edge_endpoints_t to every edge should return the local GPU ID for this function to work (edges should be pre-shuffled).
edgelist_dsts – Vector of edge destination vertex IDs.
edgelist_edge_properties – Vector of edge properties for edges
graph_properties – Properties of the graph represented by the input (optional vertex list and) edge list.
renumber – Flag indicating whether to renumber vertices or not (must be true if
multi_gpuis true).large_vertex_buffer_type – Flag indicating the large buffer type to use when we need to create a per-vertex device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The per-vertex vectors in the created graph will also be stored in the buffer type dictated by this parameter.
large_edge_buffer_type – Flag indicating the large buffer type to use when we need to create a per-edge device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The per-edge vectors in the created graph will also be stored in the buffer type dictated by this parameter.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of the generated graph and optional edge_property_t objects storing the provided edge properties and a renumber map (if
renumberis true).
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::vector<edge_arithmetic_property_t<edge_t>>, std::optional<vertex_property_t<vertex_t, vertex_t>>> create_graph( - raft::handle_t const &handle,
- std::optional<rmm::device_uvector<vertex_t>> &&vertices,
- rmm::device_uvector<vertex_t> &&edgelist_srcs,
- rmm::device_uvector<vertex_t> &&edgelist_dsts,
- std::vector<arithmetic_device_uvector_t> &&edgelist_edge_properties,
- graph_properties_t graph_properties,
- bool renumber,
- std::optional<large_buffer_type_t> large_vertex_buffer_type = std::nullopt,
- std::optional<large_buffer_type_t> large_edge_buffer_type = std::nullopt,
- bool do_expensive_check = false
create a graph from (the optional vertex list and) the given edge list (with optional edge IDs and types).
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
vertices – If valid, part of the entire set of vertices in the graph to be renumbered. This parameter can be used to include isolated vertices. If
renumberis false andverticesis valid,verticeselements should be consecutive integers starting from 0. If multi-GPU, applying the compute_gpu_id_from_vertex_t to every vertex should return the local GPU ID for this function to work (vertices should be pre-shuffled).edgelist_srcs – Vector of edge source vertex IDs. If multi-GPU, applying the compute_gpu_id_from_ext_edge_endpoints_t to every edge should return the local GPU ID for this function to work (edges should be pre-shuffled).
edgelist_dsts – Vector of edge destination vertex IDs.
edgelist_edge_properties – Vector of edge properties for edges
graph_properties – Properties of the graph represented by the input (optional vertex list and) edge list.
renumber – Flag indicating whether to renumber vertices or not (must be true if
multi_gpuis true).large_vertex_buffer_type – Flag indicating the large buffer type to use when we need to create a per-vertex device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The per-vertex vectors in the created graph will also be stored in the buffer type dictated by this parameter.
large_edge_buffer_type – Flag indicating the large buffer type to use when we need to create a per-edge device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The per-edge vectors in the created graph will also be stored in the buffer type dictated by this parameter.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of the generated graph and optional edge_property_t objects storing the provided edge properties and a renumber map (if
renumberis true) stored in a vertex_property_t.
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::vector<edge_arithmetic_property_t<edge_t>>, std::optional<rmm::device_uvector<vertex_t>>> create_graph_from_edgelist( - raft::handle_t const &handle,
- std::optional<rmm::device_uvector<vertex_t>> &&vertices,
- std::vector<rmm::device_uvector<vertex_t>> &&edgelist_srcs,
- std::vector<rmm::device_uvector<vertex_t>> &&edgelist_dsts,
- std::vector<std::vector<arithmetic_device_uvector_t>> &&edgelist_edge_properties,
- graph_properties_t graph_properties,
- bool renumber,
- std::optional<large_buffer_type_t> large_vertex_buffer_type = std::nullopt,
- std::optional<large_buffer_type_t> large_edge_buffer_type = std::nullopt,
- bool do_expensive_check = false
create a graph from (the optional vertex list and) the given edge list (with optional edge IDs and types).
- Deprecated:
This API is deprecated and replaced by
create_graph, which returns the renumber map in avertex_property_t.
This version takes edge list in multiple chunks (e.g. edge data from multiple files).
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
vertices – If valid, part of the entire set of vertices in the graph to be renumbered. This parameter can be used to include isolated vertices. If
renumberis false andverticesis valid,verticeselements should be consecutive integers starting from 0. If multi-GPU, applying the compute_gpu_id_from_vertex_t to every vertex should return the local GPU ID for this function to work (vertices should be pre-shuffled).edgelist_srcs – Vectors of edge source vertex IDs. If multi-GPU, applying the compute_gpu_id_from_ext_edge_endpoints_t to every edge should return the local GPU ID for this function to work (edges should be pre-shuffled).
edgelist_dsts – Vectors of edge destination vertex IDs.
edgelist_edge_properties – Vector of edge properties for edges
graph_properties – Properties of the graph represented by the input (optional vertex list and) edge list.
renumber – Flag indicating whether to renumber vertices or not (must be true if
multi_gpuis true).large_vertex_buffer_type – Flag indicating the large buffer type to use when we need to create a per-vertex device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The per-vertex vectors in the created graph will also be stored in the buffer type dictated by this parameter.
large_edge_buffer_type – Flag indicating the large buffer type to use when we need to create a per-edge device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The per-edge vectors in the created graph will also be stored in the buffer type dictated by this parameter.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of the generated graph and optional edge_property_t objects storing the provided edge properties and a renumber map (if
renumberis true).
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
std::tuple<graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::vector<edge_arithmetic_property_t<edge_t>>, std::optional<vertex_property_t<vertex_t, vertex_t>>> create_graph( - raft::handle_t const &handle,
- std::optional<rmm::device_uvector<vertex_t>> &&vertices,
- std::vector<rmm::device_uvector<vertex_t>> &&edgelist_srcs,
- std::vector<rmm::device_uvector<vertex_t>> &&edgelist_dsts,
- std::vector<std::vector<arithmetic_device_uvector_t>> &&edgelist_edge_properties,
- graph_properties_t graph_properties,
- bool renumber,
- std::optional<large_buffer_type_t> large_vertex_buffer_type = std::nullopt,
- std::optional<large_buffer_type_t> large_edge_buffer_type = std::nullopt,
- bool do_expensive_check = false
create a graph from (the optional vertex list and) the given edge list (with optional edge IDs and types).
This version takes edge list in multiple chunks (e.g. edge data from multiple files).
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
vertices – If valid, part of the entire set of vertices in the graph to be renumbered. This parameter can be used to include isolated vertices. If
renumberis false andverticesis valid,verticeselements should be consecutive integers starting from 0. If multi-GPU, applying the compute_gpu_id_from_vertex_t to every vertex should return the local GPU ID for this function to work (vertices should be pre-shuffled).edgelist_srcs – Vectors of edge source vertex IDs. If multi-GPU, applying the compute_gpu_id_from_ext_edge_endpoints_t to every edge should return the local GPU ID for this function to work (edges should be pre-shuffled).
edgelist_dsts – Vectors of edge destination vertex IDs.
edgelist_edge_properties – Vector of edge properties for edges
graph_properties – Properties of the graph represented by the input (optional vertex list and) edge list.
renumber – Flag indicating whether to renumber vertices or not (must be true if
multi_gpuis true).large_vertex_buffer_type – Flag indicating the large buffer type to use when we need to create a per-vertex device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The per-vertex vectors in the created graph will also be stored in the buffer type dictated by this parameter.
large_edge_buffer_type – Flag indicating the large buffer type to use when we need to create a per-edge device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The per-edge vectors in the created graph will also be stored in the buffer type dictated by this parameter.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of the generated graph and optional edge_property_t objects storing the provided edge properties and a renumber map (if
renumberis true) stored in a vertex_property_t.
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>> get_two_hop_neighbors( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- std::optional<raft::device_span<vertex_t const>> start_vertices,
- bool do_expensive_check = false
Find all 2-hop neighbors in the graph.
Find pairs of vertices in the input graph such that each pair is connected by a path that is two hops in length.
- Throws:
cugraph::logic_error – when an error occurs.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph – The input graph object
start_vertices – Optional list of starting vertices to discover two-hop neighbors of
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
tuple containing pairs of vertices that are 2-hops apart.
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
vertex_property_t<vertex_t, edge_t> compute_in_degrees( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- bool do_expensive_check = false
Compute per-vertex incoming edge degrees.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to compute per-vertex incoming edge degrees.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Incoming edge degrees for the vertices assigned to this process.
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
vertex_property_t<vertex_t, edge_t> compute_out_degrees( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- bool do_expensive_check = false
Compute per-vertex outgoing edge degrees.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to compute per-vertex outgoing edge degrees.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Outgoing edge degrees for the vertices assigned to this process.
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
rmm::device_uvector<weight_t> compute_in_weight_sums( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- edge_property_view_t<edge_t, weight_t const*> edge_weight_view
Compute per-vertex incoming edge weight sums.
- Deprecated:
This API is deprecated and replaced by
compute_in_weight_sumsreturning avertex_property_t.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to compute per-vertex incoming edge weight sums.
edge_weight_view – View object holding edge weights for
graph_view.
- Returns:
Incoming edge weight sums for each vertex.
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
vertex_property_t<vertex_t, weight_t> compute_in_weight_sums( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- edge_property_view_t<edge_t, weight_t const*> edge_weight_view,
- bool do_expensive_check
Compute per-vertex incoming edge weight sums.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to compute per-vertex incoming edge weight sums.
edge_weight_view – View object holding edge weights for
graph_view.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Incoming edge weight sums for the vertices assigned to this process.
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
rmm::device_uvector<weight_t> compute_out_weight_sums( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- edge_property_view_t<edge_t, weight_t const*> edge_weight_view
Compute per-vertex outgoing edge weight sums.
- Deprecated:
This API is deprecated and replaced by
compute_out_weight_sumsreturning avertex_property_t.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to compute per-vertex outgoing edge weight sums.
edge_weight_view – View object holding edge weights for
graph_view.
- Returns:
Outgoing edge weight sums for each vertex.
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
vertex_property_t<vertex_t, weight_t> compute_out_weight_sums( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- edge_property_view_t<edge_t, weight_t const*> edge_weight_view,
- bool do_expensive_check
Compute per-vertex outgoing edge weight sums.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to compute per-vertex outgoing edge weight sums.
edge_weight_view – View object holding edge weights for
graph_view.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Outgoing edge weight sums for the vertices assigned to this process.
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
weight_t compute_max_in_weight_sum( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- edge_property_view_t<edge_t, weight_t const*> edge_weight_view,
- bool do_expensive_check = false
Compute maximum per-vertex incoming edge weight sums.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to compute the maximum per-vertex incoming edge weight sums.
edge_weight_view – View object holding edge weights for
graph_view.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Maximum per-vertex incoming edge weight sums.
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
weight_t compute_max_out_weight_sum( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- edge_property_view_t<edge_t, weight_t const*> edge_weight_view,
- bool do_expensive_check = false
Compute maximum per-vertex outgoing edge weight sums.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to compute the maximum per-vertex outgoing edge weight sums.
edge_weight_view – View object holding edge weights for
graph_view.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Maximum per-vertex outgoing edge weight sums.
-
template<typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu>
weight_t compute_total_edge_weight( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- edge_property_view_t<edge_t, weight_t const*> edge_weight_view,
- bool do_expensive_check = false
Sum the weights of the entire set of edges.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to sum the edge weights.
edge_weight_view – View object holding edge weights for
graph_view.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Sum of the weights of the entire set of edges.
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
rmm::device_uvector<vertex_t> select_random_vertices( - raft::handle_t const &handle,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- std::optional<raft::device_span<vertex_t const>> given_set,
- raft::random::RngState &rng_state,
- size_t select_count,
- bool with_replacement,
- bool sort_vertices,
- bool do_expensive_check = false
Select random vertices.
- Deprecated:
This API is deprecated and replaced by the overload below that takes
rng_stateright afterhandle.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weights. Needs to be a floating point type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
graph_view – Graph view object of the input graph to select random vertices from.
given_set – Distributed set to sample from. If
given_setis not specified, sample from the entire vertex range provided bygraph_view.rng_state – The RngState instance holding pseudo-random number generator state.
select_count – The number of vertices to select from the graph
with_replacement – If true, select with replacement, if false select without replacement
sort_vertices – If true, return the sorted vertices (in the ascending order).
- Returns:
Device vector of selected vertices.
-
template<typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu>
rmm::device_uvector<vertex_t> select_random_vertices( - raft::handle_t const &handle,
- raft::random::RngState &rng_state,
- graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu> const &graph_view,
- std::optional<raft::device_span<vertex_t const>> given_set,
- size_t select_count,
- bool with_replacement,
- bool sort_vertices,
- bool do_expensive_check = false
Select random vertices.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
store_transposed – Flag indicating whether to use sources (if false) or destinations (if true) as major indices in storing edges using a 2D sparse matrix.
multi_gpu – Flag indicating whether template instantiation should target single-GPU (false) or multi-GPU (true).
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
rng_state – The RngState instance holding pseudo-random number generator state.
graph_view – Graph view object of the input graph to select random vertices from.
given_set – Distributed set to sample from. If
given_setis not specified, sample from the entire vertex range provided bygraph_view.select_count – The number of vertices to select from the graph
with_replacement – If true, select with replacement, if false select without replacement
sort_vertices – If true, return the sorted vertices (in the ascending order).
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Device vector of selected vertices.
-
template<typename vertex_t, typename edge_t, typename weight_t, typename edge_type_t, typename time_stamp_t>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::optional<rmm::device_uvector<weight_t>>, std::optional<rmm::device_uvector<edge_t>>, std::optional<rmm::device_uvector<edge_type_t>>, std::optional<rmm::device_uvector<time_stamp_t>>, std::optional<rmm::device_uvector<time_stamp_t>>> remove_self_loops( - raft::handle_t const &handle,
- rmm::device_uvector<vertex_t> &&edgelist_srcs,
- rmm::device_uvector<vertex_t> &&edgelist_dsts,
- std::optional<rmm::device_uvector<weight_t>> &&edgelist_weights,
- std::optional<rmm::device_uvector<edge_t>> &&edgelist_edge_ids,
- std::optional<rmm::device_uvector<edge_type_t>> &&edgelist_edge_types,
- std::optional<rmm::device_uvector<time_stamp_t>> &&edgelist_edge_start_times,
- std::optional<rmm::device_uvector<time_stamp_t>> &&edgelist_edge_end_times,
- std::optional<large_buffer_type_t> large_buffer_type = std::nullopt,
- bool do_expensive_check = false
Remove self loops from an edge list.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weight. Currently float and double are supported.
edge_type_t – Type of edge type. Needs to be an integral type.
time_stamp_t – Type of time. Needs to be an integral type.
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
edgelist_srcs – List of source vertex ids
edgelist_dsts – List of destination vertex ids
edgelist_weights – Optional list of edge weights
edgelist_edge_ids – Optional list of edge ids
edgelist_edge_types – Optional list of edge types
edgelist_edge_start_times – Optional list of edge start times
edgelist_edge_end_times – Optional list of edge end times
large_buffer_type – Flag indicating the large buffer type to use when we need to create a large device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The returned edge list will also be stored in the buffer type dictated by this parameter.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of vectors storing edge sources, destinations, optional weights, optional edge ids, optional edge types, optional edge start times and optional edge end times.
-
template<typename vertex_t, typename edge_t, typename weight_t, typename edge_type_t, typename time_stamp_t>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::optional<rmm::device_uvector<weight_t>>, std::optional<rmm::device_uvector<edge_t>>, std::optional<rmm::device_uvector<edge_type_t>>, std::optional<rmm::device_uvector<time_stamp_t>>, std::optional<rmm::device_uvector<time_stamp_t>>> remove_multi_edges( - raft::handle_t const &handle,
- rmm::device_uvector<vertex_t> &&edgelist_srcs,
- rmm::device_uvector<vertex_t> &&edgelist_dsts,
- std::optional<rmm::device_uvector<weight_t>> &&edgelist_weights,
- std::optional<rmm::device_uvector<edge_t>> &&edgelist_edge_ids,
- std::optional<rmm::device_uvector<edge_type_t>> &&edgelist_edge_types,
- std::optional<rmm::device_uvector<time_stamp_t>> &&edgelist_edge_start_times,
- std::optional<rmm::device_uvector<time_stamp_t>> &&edgelist_edge_edge_times,
- bool keep_min_value_edge = false,
- std::optional<large_buffer_type_t> large_buffer_type = std::nullopt,
- bool do_expensive_check = false
Remove all but one edge when a multi-edge exists.
When a multi-edge exists, one of the edges will remain. If
keep_min_value_edgeis false, an arbitrary edge will be selected among the edges in the multi-edge. Ifkeep_min_value_edgeis true, the edge with the minimum value will be selected. The edge weights will be first compared (ifedgelist_weights.has_value()is true); edge IDs will be compared next (ifedgelist_edge_ids.has_value()is true); and edge types (ifedgelist_edge_types.has_value()is true) will compared last.In an MG context it is assumed that edges have been shuffled to the proper GPU, in which case any multi-edges will be on the same GPU.
This version takes edges in a single chunk.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weight. Currently float and double are supported.
edge_type_t – Type of edge type. Needs to be an integral type.
time_stamp_t – Type of time. Needs to be an integral type.
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
edgelist_srcs – List of source vertex ids
edgelist_dsts – List of destination vertex ids
edgelist_weights – Optional list of edge weights
edgelist_edge_ids – Optional list of edge ids
edgelist_edge_types – Optional list of edge types
edgelist_edge_start_times – Optional list of edge start times
edgelist_edge_end_times – Optional list of edge end times
keep_min_value_edge – Flag indicating whether to keep an arbitrary edge (false) or the minimum value edge (true) among the edges in a multi-edge. Relevant only if
edgelist_weights.has_value()|edgelist_edge_ids.has_value()|edgelist_edge_types.has_value()|edgelist_edge_start_times.has_value()|edgelist_edge_end_times.has_value()istrue. If each edge has more than one property values, edge property values are compared in the order of weight (if valid), edge ID (if valid), edge type (if valid), edge start time (if valid) and edge end time (if valid). Setting this to true incurs performance overhead as this requires more comparisons.large_buffer_type – Flag indicating the large buffer type to use when we need to create a large device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The returned edge list will also be stored in the buffer type dictated by this parameter.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of rmm::device_uvector objects storing edge sources, destinations, optional weights, optional edge ids, optional edge types, optional edge start times and optional edge end times.
-
template<typename vertex_t, typename edge_t, typename weight_t, typename edge_type_t, typename time_stamp_t>
std::tuple<std::vector<rmm::device_uvector<vertex_t>>, std::vector<rmm::device_uvector<vertex_t>>, std::optional<std::vector<rmm::device_uvector<weight_t>>>, std::optional<std::vector<rmm::device_uvector<edge_t>>>, std::optional<std::vector<rmm::device_uvector<edge_type_t>>>, std::optional<std::vector<rmm::device_uvector<time_stamp_t>>>, std::optional<std::vector<rmm::device_uvector<time_stamp_t>>>> remove_multi_edges( - raft::handle_t const &handle,
- std::vector<rmm::device_uvector<vertex_t>> &&edgelist_srcs,
- std::vector<rmm::device_uvector<vertex_t>> &&edgelist_dsts,
- std::optional<std::vector<rmm::device_uvector<weight_t>>> &&edgelist_weights,
- std::optional<std::vector<rmm::device_uvector<edge_t>>> &&edgelist_edge_ids,
- std::optional<std::vector<rmm::device_uvector<edge_type_t>>> &&edgelist_edge_types,
- std::optional<std::vector<rmm::device_uvector<time_stamp_t>>> &&edgelist_edge_start_times,
- std::optional<std::vector<rmm::device_uvector<time_stamp_t>>> &&edgelist_edge_edge_times,
- bool keep_min_value_edge = false,
- std::optional<large_buffer_type_t> large_buffer_type = std::nullopt,
- bool do_expensive_check = false
Remove all but one edge when a multi-edge exists.
When a multi-edge exists, one of the edges will remain. If
keep_min_value_edgeis false, an arbitrary edge will be selected among the edges in the multi-edge. Ifkeep_min_value_edgeis true, the edge with the minimum value will be selected. The edge weights will be first compared (ifedgelist_weights.has_value()is true); edge IDs will be compared next (ifedgelist_edge_ids.has_value()is true); and edge types (ifedgelist_edge_types.has_value()is true) will compared last.In an MG context it is assumed that edges have been shuffled to the proper GPU, in which case any multi-edges will be on the same GPU.
This version takes edges in multiple chunks.
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
edge_t – Type of edge identifiers. Needs to be an integral type.
weight_t – Type of edge weight. Currently float and double are supported.
edge_type_t – Type of edge type. Needs to be an integral type.
time_stamp_t – Type of time. Needs to be an integral type.
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
edgelist_srcs – Vector of source vertex id lists (one vector element per edge chunk)
edgelist_dsts – Vector of destination vertex id lists (one vector element per edge chunk)
edgelist_weights – Optional vector of edge weight lists (one vector element per edge chunk)
edgelist_edge_ids – Optional vector of edge id lists (one vector element per edge chunk)
edgelist_edge_types – Optional vector of edge type lists (one vector element per edge chunk)
edgelist_edge_start_times – Optional vector of edge start time lists (one vector element per edge chunk)
edgelist_edge_end_times – Optional vector of edge end time lists (one vector element per edge chunk)
keep_min_value_edge – Flag indicating whether to keep an arbitrary edge (false) or the minimum value edge (true) among the edges in a multi-edge. Relevant only if
edgelist_weights.has_value()|edgelist_edge_ids.has_value()|edgelist_edge_types.has_value()|edgelist_edge_start_times.has_value()|edgelist_edge_end_times.has_value()istrue. If each edge has more than one property values, edge property values are compared in the order of weight (if valid), edge ID (if valid), edge type (if valid), edge start time (if valid) and edge end time (if valid). Setting this to true incurs performance overhead as this requires more comparisons.large_buffer_type – Flag indicating the large buffer type to use when we need to create a large device-accessible vector object (if the value is std::nullopt, the default RMM per-device memory resource is used). The returned edge list will also be stored in the buffer type dictated by this parameter.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Tuple of std::vector objects holding rmm::device_uvector objects (# device_uvector objets per std::vector = # edge chunks) storing edge sources, destinations, optional weights, optional edge ids, optional edge types, optional edge start times and optional edge end times.
-
template<typename vertex_t>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::vector<cugraph::arithmetic_device_uvector_t>> shuffle_ext_edges( - raft::handle_t const &handle,
- rmm::device_uvector<vertex_t> &&edge_srcs,
- rmm::device_uvector<vertex_t> &&edge_dsts,
- std::vector<cugraph::arithmetic_device_uvector_t> &&edge_properties,
- bool store_transposed,
- std::optional<large_buffer_type_t> large_buffer_type = std::nullopt
Shuffle external edges to the owning GPUs (by edge partitioning).
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
edge_srcs – Vector of source vertex ids
edge_dsts – Vector of destination vertex ids
edge_properties – Vector of edge properties, each element is an arithmetic device vector
store_transposed – Should be true if shuffled edges will be used with a cugraph::graph_t object with store_tranposed = true. Should be false otherwise.
- Returns:
Tuple of vectors storing edge sources, destinations, and edge properties
-
template<typename vertex_t>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>, std::vector<cugraph::arithmetic_device_uvector_t>> shuffle_int_edges( - raft::handle_t const &handle,
- rmm::device_uvector<vertex_t> &&majors,
- rmm::device_uvector<vertex_t> &&minors,
- std::vector<cugraph::arithmetic_device_uvector_t> &&edge_properties,
- bool store_transposed,
- raft::host_span<vertex_t const> vertex_partition_range_lasts,
- std::optional<large_buffer_type_t> large_buffer_type = std::nullopt
Shuffle internal edges to the owning GPUs (by edge partitioning).
- Template Parameters:
vertex_t – Type of vertex identifiers. Needs to be an integral type.
- Parameters:
handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.
edge_srcs – Vector of source vertex ids
edge_dsts – Vector of destination vertex ids
edge_properties – Vector of edge properties, each element is an arithmetic device vector
store_transposed – Should be true if shuffled edges will be used with a cugraph::graph_t object with store_tranposed = true. Should be false otherwise.
vertex_partition_range_lasts – Span of vertex partition range lasts (size = number of GPUs)
- Returns:
Tuple of vectors storing edge sources, destinations, and edge properties