用法:
cugraph.community.triangle_count.triangles(G)
計算輸入圖中的三角形數量(長度為 3 的循環)。
與 NetworkX 不同,此算法僅返回三角形的總數,而不是每個頂點的數量。
- G:cugraph.graph 或 networkx.Graph
cuGraph 圖說明符,應包含連接信息,(該算法中不使用邊權重)
- count:整數64
一個 64 位整數,其值給出圖中三角形的數量。
參數:
返回:
例子:
>>> 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') >>> count = cugraph.triangles(G)
相關用法
- Python cugraph.community.spectral_clustering.spectralBalancedCutClustering用法及代碼示例
- Python cugraph.community.ecg.ecg用法及代碼示例
- Python cugraph.community.louvain.louvain用法及代碼示例
- Python cugraph.community.egonet.batched_ego_graphs用法及代碼示例
- Python cugraph.community.spectral_clustering.analyzeClustering_modularity用法及代碼示例
- Python cugraph.community.spectral_clustering.spectralModularityMaximizationClustering用法及代碼示例
- Python cugraph.community.spectral_clustering.analyzeClustering_edge_cut用法及代碼示例
- Python cugraph.community.ktruss_subgraph.ktruss_subgraph用法及代碼示例
- Python cugraph.community.subgraph_extraction.subgraph用法及代碼示例
- Python cugraph.community.egonet.ego_graph用法及代碼示例
- Python cugraph.community.spectral_clustering.analyzeClustering_ratio_cut用法及代碼示例
- 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.triangle_count.triangles。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。