用法:
cugraph.sampling.random_walks.random_walks(G, start_vertices, max_depth=None, use_padding=False)
计算‘start_vertices’中每个节点的随机游走
- G:cuGraph.Graph 或 networkx.Graph
图可以是有向图(DiGraph)或无向图(Graph)。图中的权重被忽略。如果需要考虑权重,请使用权重参数(目前不支持)
- start_vertices:int 或 list 或 cudf.Series 或 cudf.DataFrame
从中运行随机游走的单个节点或列表或 cudf.Series 节点。如果是 multi-column 顶点,它应该是一个 cudf.DataFrame
- max_depth:int,可选(默认=无)
随机游走的最大深度
- use_padding:布尔,可选(默认=假)
如果为 True,则返回填充路径,否则返回合并路径。
- vertex_paths:cudf.Series 或 cudf.DataFrame
包含随机游走中边/路径顶点的系列。
- edge_weight_paths: cudf.Series
包含由返回的 vertex_paths 表示的边的边权重的系列
- 尺寸:整数
在合并路径的情况下的路径大小。
参数:
返回:
例子:
>>> M = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ', ... dtype=['int32', 'int32', 'float32'], header=None) >>> G = cugraph.Graph() >>> G.from_cudf_edgelist(M, source='0', destination='1') >>> _, _, _ = cugraph.random_walks(G, M, 3)
相关用法
- Python cugraph.structure.symmetrize.symmetrize_df用法及代码示例
- Python cugraph.structure.symmetrize.symmetrize_ddf用法及代码示例
- Python cugraph.structure.convert_matrix.from_edgelist用法及代码示例
- Python cugraph.structure.convert_matrix.from_pandas_edgelist用法及代码示例
- Python cugraph.structure.convert_matrix.from_adjlist用法及代码示例
- Python cugraph.structure.symmetrize.symmetrize用法及代码示例
- Python cugraph.structure.convert_matrix.from_cudf_edgelist用法及代码示例
- Python cugraph.community.spectral_clustering.spectralBalancedCutClustering用法及代码示例
- Python cugraph.link_prediction.jaccard.jaccard用法及代码示例
- Python cugraph.link_prediction.wjaccard.jaccard_w用法及代码示例
- Python cugraph.community.ecg.ecg用法及代码示例
- Python cugraph.Graph.from_cudf_adjlist用法及代码示例
- Python cugraph.community.louvain.louvain用法及代码示例
- Python cugraph.tree.minimum_spanning_tree.maximum_spanning_tree用法及代码示例
- Python cugraph.centrality.betweenness_centrality.betweenness_centrality用法及代码示例
- Python cugraph.link_analysis.pagerank.pagerank用法及代码示例
- Python cugraph.dask.community.louvain.louvain用法及代码示例
- Python cugraph.traversal.bfs.bfs用法及代码示例
- Python cugraph.community.egonet.batched_ego_graphs用法及代码示例
- Python cugraph.tree.minimum_spanning_tree.minimum_spanning_tree用法及代码示例
注:本文由纯净天空筛选整理自rapids.ai大神的英文原创作品 cugraph.sampling.random_walks.random_walks。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。