跳到主要内容
Ctrl+K

cugraph-docs 25.04.00 文档

  • cuGraph 简介
  • nx-cugraph
  • 安装
  • 教程
  • 图支持
    • WholeGraph
    • 参考
    • 开发者资源
    • API 参考
  • GitHub
  • Twitter
主页
cugraph
cucimcudf-javacudfcugraphcumlcuprojcuspatialcuvscuxfilterdask-cudadask-cudfkvikiolibcudflibcumllibcuprojlibcuspatiallibkvikiolibrmmlibucxxraftrapids-cmakerapidsmpfrmm
stable (25.04)
nightly (25.06)stable (25.04)legacy (25.02)
  • cuGraph 简介
  • nx-cugraph
  • 安装
  • 教程
  • 图支持
  • WholeGraph
  • 参考
  • 开发者资源
  • API 参考
  • GitHub
  • Twitter

节导航

核心图 API 文档

  • cugraph API 参考
    • 图类
      • cugraph.Graph
      • cugraph.MultiGraph
      • cugraph.Graph.from_cudf_adjlist
      • cugraph.Graph.from_cudf_edgelist
      • cugraph.Graph.from_dask_cudf_edgelist
      • cugraph.Graph.from_pandas_adjacency
      • cugraph.Graph.from_pandas_edgelist
      • cugraph.Graph.from_numpy_array
      • cugraph.Graph.from_numpy_matrix
      • cugraph.Graph.add_internal_vertex_id
      • cugraph.Graph.add_nodes_from
      • cugraph.Graph.clear
      • cugraph.Graph.unrenumber
      • cugraph.symmetrize
      • cugraph.symmetrize_ddf
      • cugraph.symmetrize_df
      • cugraph.from_adjlist
      • cugraph.from_cudf_edgelist
      • cugraph.from_edgelist
      • cugraph.from_numpy_array
      • cugraph.from_numpy_matrix
      • cugraph.from_pandas_adjacency
      • cugraph.from_pandas_edgelist
      • cugraph.to_numpy_array
      • cugraph.to_numpy_matrix
      • cugraph.to_pandas_adjacency
      • cugraph.to_pandas_edgelist
      • cugraph.structure.NumberMap
      • cugraph.structure.NumberMap.from_internal_vertex_id
      • cugraph.structure.NumberMap.to_internal_vertex_id
      • cugraph.structure.NumberMap.add_internal_vertex_id
      • cugraph.structure.NumberMap.compute_vals
      • cugraph.structure.NumberMap.compute_vals_types
      • cugraph.structure.NumberMap.generate_unused_column_name
      • cugraph.structure.NumberMap.renumber
      • cugraph.structure.NumberMap.renumber_and_segment
      • cugraph.structure.NumberMap.set_renumbered_col_names
      • cugraph.structure.NumberMap.unrenumber
      • cugraph.structure.NumberMap.vertex_column_size
      • cugraph.hypergraph
    • 图实现
      • cugraph.structure.graph_implementation.simpleGraphImpl.view_edge_list
      • cugraph.structure.graph_implementation.simpleGraphImpl.delete_edge_list
      • cugraph.structure.graph_implementation.simpleGraphImpl.view_adj_list
      • cugraph.structure.graph_implementation.simpleGraphImpl.view_transposed_adj_list
      • cugraph.structure.graph_implementation.simpleGraphImpl.delete_adj_list
      • cugraph.structure.graph_implementation.simpleGraphImpl.enable_batch
      • cugraph.structure.graph_implementation.simpleGraphImpl.get_two_hop_neighbors
      • cugraph.structure.graph_implementation.simpleGraphImpl.number_of_vertices
      • cugraph.structure.graph_implementation.simpleGraphImpl.number_of_nodes
      • cugraph.structure.graph_implementation.simpleGraphImpl.number_of_edges
      • cugraph.structure.graph_implementation.simpleGraphImpl.in_degree
      • cugraph.structure.graph_implementation.simpleGraphImpl.out_degree
      • cugraph.structure.graph_implementation.simpleGraphImpl.degree
      • cugraph.structure.graph_implementation.simpleGraphImpl.degrees
      • cugraph.structure.graph_implementation.simpleGraphImpl.has_edge
      • cugraph.structure.graph_implementation.simpleGraphImpl.has_node
      • cugraph.structure.graph_implementation.simpleGraphImpl.has_self_loop
      • cugraph.structure.graph_implementation.simpleGraphImpl.edges
      • cugraph.structure.graph_implementation.simpleGraphImpl.nodes
      • cugraph.structure.graph_implementation.simpleGraphImpl.neighbors
      • cugraph.structure.graph_implementation.simpleGraphImpl.vertex_column_size
    • 属性图
      • cugraph.experimental.PropertySelection
      • cugraph.experimental.PropertyGraph
      • cugraph.experimental.PropertyGraph.add_edge_data
      • cugraph.experimental.PropertyGraph.add_vertex_data
      • cugraph.experimental.PropertyGraph.annotate_dataframe
      • cugraph.experimental.PropertyGraph.edge_props_to_graph
      • cugraph.experimental.PropertyGraph.extract_subgraph
      • cugraph.experimental.PropertyGraph.get_edge_data
      • cugraph.experimental.PropertyGraph.get_num_edges
      • cugraph.experimental.PropertyGraph.get_num_vertices
      • cugraph.experimental.PropertyGraph.get_vertex_data
      • cugraph.experimental.PropertyGraph.get_vertices
      • cugraph.experimental.PropertyGraph.has_duplicate_edges
      • cugraph.experimental.PropertyGraph.is_multigraph
      • cugraph.experimental.PropertyGraph.renumber_edges_by_type
      • cugraph.experimental.PropertyGraph.renumber_vertices_by_type
      • cugraph.experimental.PropertyGraph.select_edges
      • cugraph.experimental.PropertyGraph.select_vertices
    • 中心性
      • cugraph.centrality.betweenness_centrality
      • cugraph.centrality.edge_betweenness_centrality
      • cugraph.dask.centrality.betweenness_centrality
      • cugraph.centrality.katz_centrality
      • cugraph.dask.centrality.katz_centrality.katz_centrality
      • cugraph.centrality.degree_centrality
      • cugraph.centrality.eigenvector_centrality
      • cugraph.dask.centrality.eigenvector_centrality.eigenvector_centrality
    • 社区
      • cugraph.batched_ego_graphs
      • cugraph.ego_graph
      • cugraph.ecg
      • cugraph.k_truss
      • cugraph.ktruss_subgraph
      • cugraph.leiden
      • cugraph.louvain
      • cugraph.dask.community.louvain.louvain
      • cugraph.analyzeClustering_edge_cut
      • cugraph.analyzeClustering_modularity
      • cugraph.analyzeClustering_ratio_cut
      • cugraph.spectralBalancedCutClustering
      • cugraph.spectralModularityMaximizationClustering
      • cugraph.subgraph
      • cugraph.triangle_count
    • 组件
      • cugraph.connected_components
      • cugraph.strongly_connected_components
      • cugraph.weakly_connected_components
      • cugraph.dask.components.connectivity.weakly_connected_components
    • 核心
      • cugraph.core_number
      • cugraph.k_core
    • 布局
      • cugraph.force_atlas2
    • 线性分配
      • cugraph.hungarian
      • cugraph.dense_hungarian
    • 链接分析
      • cugraph.hits
      • cugraph.dask.link_analysis.hits.hits
      • cugraph.pagerank
      • cugraph.dask.link_analysis.pagerank.pagerank
    • 链接预测
      • cugraph.jaccard
      • cugraph.jaccard_coefficient
      • cugraph.overlap
      • cugraph.overlap_coefficient
      • cugraph.sorensen
      • cugraph.sorensen_coefficient
    • 采样
      • cugraph.random_walks
      • cugraph.ego_graph
      • cugraph.uniform_neighbor_sample
      • cugraph.node2vec
    • 遍历
      • cugraph.bfs
      • cugraph.bfs_edges
      • cugraph.dask.traversal.bfs.bfs
      • cugraph.filter_unreachable
      • cugraph.shortest_path
      • cugraph.shortest_path_length
      • cugraph.sssp
      • cugraph.dask.traversal.sssp.sssp
    • 树
      • cugraph.tree.minimum_spanning_tree.minimum_spanning_tree
      • cugraph.tree.minimum_spanning_tree.maximum_spanning_tree
    • 生成器
      • cugraph.generators.rmat
    • DASK MG 辅助函数
      • cugraph.dask.comms.comms.initialize
      • cugraph.dask.comms.comms.destroy
      • cugraph.dask.comms.comms.is_initialized
      • cugraph.dask.comms.comms.get_comms
      • cugraph.dask.comms.comms.get_workers
      • cugraph.dask.comms.comms.get_session_id
      • cugraph.dask.comms.comms.get_2D_partition
      • cugraph.dask.comms.comms.get_default_handle
      • cugraph.dask.comms.comms.get_handle
      • cugraph.dask.comms.comms.get_worker_id
      • cugraph.dask.common.read_utils.get_chunksize
    • cuGraph 的多 GPU 支持
  • pylibcugraph API 参考
    • pylibcugraph.eigenvector_centrality
    • pylibcugraph.katz_centrality
    • pylibcugraph.strongly_connected_components
    • pylibcugraph.weakly_connected_components
    • pylibcugraph.pagerank
    • pylibcugraph.hits
    • pylibcugraph.node2vec
    • pylibcugraph.bfs
    • pylibcugraph.sssp
  • cuGraph C API 文档
    • 中心性
    • 社区
    • 核心
    • 组件
    • 采样
    • 相似性
    • 遍历
  • cuGraph C++ API
    • 算法
      • 中心性
      • 社区
      • 采样
      • 相似性
      • 遍历
      • 线性
      • 链接分析
      • 布局
      • 树
      • 实用函数
    • 图函数
    • 图生成器
    • 传统图函数
    • 采样函数
    • 集合包装器
    • 低级 cuGraph C++ API

图神经网络 API 文档

  • cugraph-dgl API 参考
    • cugraph_dgl.convert.cugraph_storage_from_heterograph
    • cugraph_dgl.cugraph_storage.CuGraphStorage
  • cugraph-pyg API 参考
    • cugraph_pyg.data.dask_graph_store.DaskGraphStore
    • cugraph_pyg.data.graph_store.GraphStore
    • cugraph_pyg.data.feature_store.TensorDictFeatureStore
    • cugraph_pyg.data.feature_store.WholeFeatureStore
    • cugraph_pyg.loader.dask_node_loader.DaskNeighborLoader
    • cugraph_pyg.loader.dask_node_loader.BulkSampleLoader
    • cugraph_pyg.loader.node_loader.NodeLoader
    • cugraph_pyg.loader.neighbor_loader.NeighborLoader
    • cugraph_pyg.sampler.sampler.BaseSampler
    • cugraph_pyg.sampler.sampler.SampleReader
    • cugraph_pyg.sampler.sampler.HomogeneousSampleReader
    • cugraph_pyg.sampler.sampler.SampleIterator

额外图包 API 文档

  • cugraph-service API 参考
    • cugraph-service-client API 参考
    • cugraph-service-server API 参考
  • API 参考
  • cuGraph C++ API
  • 算法
  • 链接分析

链接分析#

template<typename vertex_t, typename edge_t, typename weight_t, typename result_t, bool multi_gpu>
void pagerank(raft::handle_t const &handle, graph_view_t<vertex_t, edge_t, true, multi_gpu> const &graph_view, std::optional<edge_property_view_t<edge_t, weight_t const*>> edge_weight_view, std::optional<weight_t const*> precomputed_vertex_out_weight_sums, std::optional<vertex_t const*> personalization_vertices, std::optional<result_t const*> personalization_values, std::optional<vertex_t> personalization_vector_size, result_t *pageranks, result_t alpha, result_t epsilon, size_t max_iterations = 500, bool has_initial_guess = false, bool do_expensive_check = false)#

计算 PageRank 分数。

已弃用

此 API 将被弃用,以被下方返回算法元数据的新版本取代。

此函数计算一般(如果 personalization_vertices 是 nullptr)或个性化(如果 personalization_vertices 不是 nullptr)的 PageRank 分数。

抛出:

cugraph::logic_error – 在输入参数错误或在达到 max_iterations 前未能收敛时。

模板参数:
  • vertex_t – 顶点标识符的类型。需要是整数类型。

  • edge_t – 边标识符的类型。需要是整数类型。

  • weight_t – 边权重的类型。需要是浮点类型。

  • result_t – PageRank 分数的类型。

  • multi_gpu – 标志,指示模板实例化是针对单 GPU (false) 还是多 GPU (true)。

参数:
  • handle – RAFT handle 对象,用于封装资源(例如 CUDA 流、通信器以及各种 CUDA 库的句柄)以运行图算法。

  • graph_view – 图视图对象。

  • edge_weight_view – 可选视图对象,存储 graph_view 的边权重。如果 edge_weight_view.has_value() == false,则假定边权重为 1.0。

  • precomputed_vertex_out_weight_sums – 指向数组的指针,该数组存储顶点的出边权重总和(用于重用),或者为 std::nullopt。如果为 std::nullopt,则重新计算这些值。在此函数外部计算这些值可以减少内存分配/释放次数,并且用户可以使用同一图的不同个性化向量重复计算 PageRank 分数。

  • personalization_vertices – 指向数组的指针,该数组存储个性化顶点标识符(计算个性化 PageRank),或者为 std::nullopt(计算一般 PageRank)。

  • personalization_values – 指向数组的指针,该数组存储个性化集中顶点的个性化值。仅当 personalization_vertices 不是 std::nullopt 时相关。

  • personalization_vector_size – 个性化集的大小。如果 @personalization_vertices 不是 std::nullopt,则 personalization_vertices 和 personalization_values 指向的数组大小应为 personalization_vector_size。

  • pageranks – 指向输出 PageRank 分数数组的指针。

  • alpha – PageRank 阻尼因子。

  • epsilon – 用于检查收敛的误差容忍度。如果连续两次迭代之间 PageRank 值差异的总和小于图中顶点数乘以 epsilon,则假定收敛。

  • max_iterations – PageRank 最大迭代次数。

  • has_initial_guess – 如果设置为 true,则 PageRank 输出数组(由 pageranks 指向)中的值用作初始 PageRank 值。如果为 false,则初始 PageRank 值设置为 1.0 除以图中的顶点数。

  • do_expensive_check – 一个标志,用于对输入参数运行昂贵的检查(如果设置为 true)。

template<typename vertex_t, typename edge_t, typename weight_t, typename result_t, bool multi_gpu>
std::tuple<rmm::device_uvector<result_t>, centrality_algorithm_metadata_t> pagerank(raft::handle_t const &handle, graph_view_t<vertex_t, edge_t, true, multi_gpu> const &graph_view, std::optional<edge_property_view_t<edge_t, weight_t const*>> edge_weight_view, std::optional<raft::device_span<weight_t const>> precomputed_vertex_out_weight_sums, std::optional<std::tuple<raft::device_span<vertex_t const>, raft::device_span<result_t const>>> personalization, std::optional<raft::device_span<result_t const>> initial_pageranks, result_t alpha, result_t epsilon, size_t max_iterations = 500, bool do_expensive_check = false)#

计算 PageRank 分数。

.*

此函数计算一般(如果 personalization_vertices 是 nullptr)或个性化(如果 personalization_vertices 不是 nullptr)的 PageRank 分数。

抛出:

cugraph::logic_error – 在输入参数错误或在达到 max_iterations 前未能收敛时。

模板参数:
  • vertex_t – 顶点标识符的类型。需要是整数类型。

  • edge_t – 边标识符的类型。需要是整数类型。

  • weight_t – 边权重的类型。需要是浮点类型。

  • result_t – PageRank 分数的类型。

  • multi_gpu – 标志,指示模板实例化是针对单 GPU (false) 还是多 GPU (true)。

参数:
  • handle – RAFT handle 对象,用于封装资源(例如 CUDA 流、通信器以及各种 CUDA 库的句柄)以运行图算法。

  • graph_view – 图视图对象。

  • edge_weight_view – 可选视图对象,存储 graph_view 的边权重。如果 edge_weight_view.has_value() == false,则假定边权重为 1.0。

  • precomputed_vertex_out_weight_sums – 指向数组的指针,该数组存储顶点的出边权重总和(用于重用),或者为 std::nullopt。如果为 std::nullopt,则重新计算这些值。在此函数外部计算这些值可以减少内存分配/释放次数,并且用户可以使用同一图的不同个性化向量重复计算 PageRank 分数。

  • personalization – 可选元组,包含顶点的设备跨度,其中包含顶点标识符和个性化值(计算个性化 PageRank),或 std::nullopt(计算一般 PageRank)。

  • initial_pageranks – 可选设备跨度,包含初始 PageRank 值。如果指定,此数组将用作初始值,并且 PageRank 值将在原地更新。如果未指定,则初始值将设置为 1.0 除以图中的顶点数,并且返回值将包含一个包含结果 PageRank 值的 rmm::device_uvector。

  • alpha – PageRank 阻尼因子。

  • epsilon – 用于检查收敛的误差容忍度。如果连续两次迭代之间 PageRank 值差异的总和小于图中顶点数乘以 epsilon,则假定收敛。

  • max_iterations – PageRank 最大迭代次数。

  • do_expensive_check – 一个标志,用于对输入参数运行昂贵的检查(如果设置为 true)。

返回:

包含可选 PageRank 结果(如果 initial_pageranks 设置为 std::nullopt 则填充)以及指示运行多少次迭代以及算法是否收敛的元数据的元数据结构的元组。

template<typename vertex_t, typename edge_t, typename result_t, bool multi_gpu>
std::tuple<result_t, size_t> hits(raft::handle_t const &handle, graph_view_t<vertex_t, edge_t, true, multi_gpu> const &graph_view, result_t *hubs, result_t *authorities, result_t epsilon, size_t max_iterations, bool has_initial_hubs_guess, bool normalize, bool do_expensive_check)#

计算 HITS 分数。

.*

此函数计算图中顶点的 HITS 分数

抛出:

cugraph::logic_error – 在输入参数错误时

模板参数:
  • vertex_t – 顶点标识符的类型。需要是整数类型。

  • edge_t – 边标识符的类型。需要是整数类型。

  • multi_gpu – 标志,指示模板实例化是针对单 GPU (false) 还是多 GPU (true)。

参数:
  • handle – RAFT handle 对象,用于封装资源(例如 CUDA 流、通信器以及各种 CUDA 库的句柄)以运行图算法。

  • graph_view – 图视图对象。

  • hubs – 指向输入/输出 hub 分数数组的指针。

  • authorities – 指向输出 authorities 分数数组的指针。

  • epsilon – 用于检查收敛的误差容忍度。如果连续两次迭代之间 hub 值差异的总和小于 epsilon,则假定收敛。

  • max_iterations – HITS 最大迭代次数。

  • has_initial_guess – 如果设置为 true,则 hubs 输出数组(由 hubs 指向)中的值用作初始 hub 值。如果为 false,则初始 hub 值设置为 1.0 除以图中的顶点数。

  • normalize – 如果设置为 true,则在返回之前对最终的 hub 和 authority 分数进行归一化(返回的 hub 和 authority 分数数组的 L1 范数为 1.0)。

  • do_expensive_check – 一个标志,用于对输入参数运行昂贵的检查(如果设置为 true)。

返回:

std::tuple<result_t, size_t> 包含最后两次迭代的 hub 分数差异总和以及达到最终结果所需的总迭代次数的元组

上一页

线性

下一页

布局

在此页上
  • pagerank()
  • pagerank()
  • hits()

此页

  • 显示源

© 版权所有 2024, NVIDIA Corporation。

使用 Sphinx 8.1.3 创建。

使用 PyData Sphinx Theme 0.16.1 构建。