Abstract
Graph clustering is a fundamental task in network analysis, yet it remains challenging due to the difficulty of determining the optimal number of clusters ($k$), integrating high-dimensional node attributes, and maintaining scalability on large-scale graphs. We introduce DGCLUSTER, a novel graph neural network (GNN) framework designed to perform graph clustering by directly optimizing for modularity maximization. DGCLUSTER is fully differentiable, scales linearly with the number of nodes, and does not require a predefined cluster count. Our evaluation across seven diverse real-world datasets demonstrates that DGCLUSTER achieves state-of-the-art performance in both unsupervised and semi-supervised scenarios.
Introduction
Traditional graph clustering algorithms often struggle with three primary hurdles. First, the "$K$" Problem: most methods require users to specify the number of clusters upfront, which is often unknown in real-world networks. Second, Attribute Integration: many algorithms focus solely on topology, neglecting rich node features. Third, Scalability: modularity maximization is NP-hard, and existing heuristics often fail to scale or integrate into modern deep learning pipelines.
DGCLUSTER addresses these issues by leveraging GNNs to find optimal community structures through a differentiable objective function that incorporates both graph topology and node attributes.
Methodology
The DGCLUSTER pipeline consists of four main stages:
- Node Representation Learning: A backbone GNN (e.g., GCN, GAT) generates initial node embeddings from the graph structure and attributes.
- Constrained Transformations: To enable soft membership, embeddings are transformed via normalization, tanh activation, and projection onto the surface of a unit sphere in the positive coordinate space. This ensures pairwise similarities (dot products) are bounded between 0 and 1.
- Differentiable Modularity Optimization: The classic modularity objective ($Q$) is reformulated using trace properties. By computing $Tr(X^T B X)$ instead of $Tr(B XX^T)$, the computational complexity is reduced to $O(N)$, where $N$ is the number of nodes.
- Clustering and Hard Assignment: The model minimizes a joint loss combining modularity maximization with an optional auxiliary information loss ($\lambda$). Final "hard" clusters are obtained using the BIRCH algorithm, which is memory-efficient and automatically determines the number of clusters.
Experimental Evaluation
We evaluated DGCLUSTER on seven datasets, including citation networks (Cora, CiteSeer, PubMed), co-purchase networks (Amazon PC, Photo), and co-authorship networks (CS, Physics).
Results and Discussion
DGCLUSTER consistently outperforms established baselines such as DMoN, NOCD, and DiffPool. As shown in the performance summary below, DGCLUSTER achieves superior modularity ($Q$) and significantly lower conductance ($C$), indicating more cohesive and better-separated communities. For instance, on the Cora dataset, DGCLUSTER achieves a conductance of 8.4, a marked improvement over DMoN's 12.2.
Impact of Auxiliary Information
A key strength of DGCLUSTER is its flexibility in semi-supervised settings. By adjusting the weight of auxiliary information ($\lambda$), the model can incorporate partial labels or constraints. As illustrated in the following figure, increasing $\lambda$ leads to significant improvements in Normalized Mutual Information (NMI) while maintaining high modularity scores across various datasets.
Conclusion
DGCLUSTER provides a scalable and flexible solution for attributed graph clustering. By reformulating modularity maximization as a differentiable objective, it eliminates the need for a predefined $k$ and handles large-scale graphs efficiently. Future work will explore extending this framework to directed and temporal graphs, as well as further integrating the hard assignment step into the neural architecture.
Summary updated