用法:
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。