用法:
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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。