用法:
cugraph.community.subgraph_extraction.subgraph(G, vertices)
計算僅包含指定頂點的現有圖的子圖。該算法適用於有向圖和無向圖,並且實際上並不遍曆邊,而是簡單地拉出所有在頂點上的邊,這些邊都包含在頂點列表中。
- G:cugraph.Graph
cuGraph 圖說明符
- vertices:cudf.Series 或 cudf.DataFrame
指定誘導子圖的頂點。對於multi-column 頂點,頂點應作為 cudf.DataFrame 提供
- Sg:cugraph.Graph
包含由給定頂點集誘導的子圖的圖對象。
參數:
返回:
例子:
>>> gdf = cudf.read_csv(datasets_path / 'karate.csv', ... delimiter = ' ', ... dtype=['int32', 'int32', 'float32'], ... header=None) >>> G = cugraph.Graph() >>> G.from_cudf_edgelist(gdf, source='0', destination='1') >>> verts = np.zeros(3, dtype=np.int32) >>> verts[0] = 0 >>> verts[1] = 1 >>> verts[2] = 2 >>> sverts = cudf.Series(verts) >>> Sg = cugraph.subgraph(G, sverts)
相關用法
- Python cugraph.community.spectral_clustering.spectralBalancedCutClustering用法及代碼示例
- Python cugraph.community.spectral_clustering.analyzeClustering_modularity用法及代碼示例
- Python cugraph.community.spectral_clustering.spectralModularityMaximizationClustering用法及代碼示例
- Python cugraph.community.spectral_clustering.analyzeClustering_edge_cut用法及代碼示例
- Python cugraph.community.spectral_clustering.analyzeClustering_ratio_cut用法及代碼示例
- Python cugraph.community.ecg.ecg用法及代碼示例
- Python cugraph.community.louvain.louvain用法及代碼示例
- Python cugraph.community.egonet.batched_ego_graphs用法及代碼示例
- Python cugraph.community.triangle_count.triangles用法及代碼示例
- Python cugraph.community.ktruss_subgraph.ktruss_subgraph用法及代碼示例
- Python cugraph.community.egonet.ego_graph用法及代碼示例
- Python cugraph.community.leiden.leiden用法及代碼示例
- Python cugraph.components.connectivity.strongly_connected_components用法及代碼示例
- Python cugraph.components.connectivity.connected_components用法及代碼示例
- Python cugraph.components.connectivity.weakly_connected_components用法及代碼示例
- Python cugraph.cores.k_core.k_core用法及代碼示例
- Python cugraph.cores.core_number.core_number用法及代碼示例
- Python cugraph.centrality.betweenness_centrality.betweenness_centrality用法及代碼示例
- Python cugraph.centrality.betweenness_centrality.edge_betweenness_centrality用法及代碼示例
- Python cugraph.centrality.katz_centrality.katz_centrality用法及代碼示例
注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cugraph.community.subgraph_extraction.subgraph。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。