torch_geometric.nn.pool.graclus

graclus(edge_index: Tensor, weight: Optional[Tensor] = None, num_nodes: Optional[int] = None)[source]

一种贪婪的聚类算法,来自“Weighted Graph Cuts without Eigenvectors: A Multilevel Approach”论文,该算法选择一个未标记的顶点并将其与其未标记的邻居之一匹配(以最大化其边权重)。 GPU算法改编自“A GPU Algorithm for Greedy Graph Matching”论文。

Parameters:
  • edge_index (torch.Tensor) – The edge indices.

  • weight (torch.Tensor, optional) – 一维边权重。 (default: None)

  • num_nodes (int, optional) – 节点的数量, max_val + 1edge_index。(默认值:None

Return type:

torch.Tensor