Abstract
Community detection involves grouping the nodes of a network such that nodes in the same community are more densely connected to each other than to the rest of the network. Previous studies have focused mainly on identifying communities in networks using node connectivity. However, each node in a network may be associated with many attributes. Identifying communities in networks combining node attributes has become increasingly popular in recent years. Most existing methods operate on networks with attributes of binary, categorical, or numerical type only. In this study, we introduce kNN-enhance, a simple and flexible community detection approach that uses node attribute enhancement. This approach adds the k Nearest Neighbor (kNN) graph of node attributes to alleviate the sparsity and the noise effect of an original network, thereby strengthening the community structure in the network. We use two testing algorithms, kNN-nearest and kNN-Kmeans, to partition the newly generated, attribute-enhanced graph. Our analyses of synthetic and real world networks have shown that the proposed algorithms achieve better performance compared to existing state-of-the-art algorithms. Further, the algorithms are able to deal with networks containing different combinations of binary, categorical, or numerical attributes and could be easily extended to the analysis of massive networks.
Introduction
Community detection—identifying groups of nodes that are more densely connected to each other than to the rest of the network—is a cornerstone of network science. However, real-world networks are often "noisy" (containing spurious links) or "sparse" (missing many links that should exist based on shared interests or traits). While many nodes have associated attributes (like user profiles in a social network or keywords in a citation index), traditional algorithms often struggle to integrate this metadata effectively. Existing "hybrid" methods that try to model links and attributes simultaneously are often computationally expensive, sensitive to initialization, or restricted to a single type of attribute. The authors of this study sought a flexible, scalable way to use attributes to "de-noise" and "de-sparse" the network structure itself.
The kNN-enhance Methodology
The kNN-enhance approach follows a two-stage pipeline designed to strengthen the community signal within a network by leveraging node metadata.
1. Attribute Enhancement
The core innovation lies in constructing a $k$-Nearest Neighbor (kNN) graph based solely on node attributes. The similarity metric used depends on the attribute type:
- Binary attributes: Cosine similarity is employed.
- Numerical attributes: Normalized Euclidean distance is used.
This kNN graph is merged with the original network. If an edge exists in the kNN graph but not the original, it is added; otherwise, the original structure is preserved. This process effectively "thickens" the network, creating bridges between nodes that share similar traits but lack direct structural links.
2. Graph Partitioning
Once the enhanced graph is built, the researchers use K-rank-D (an extension of density-peak clustering) to identify community centers based on PageRank centrality and "dispersion" (distance to nodes with higher centrality). Two specific implementations for node assignment were tested:
- kNN-nearest: Assigns each remaining node to the community of its nearest neighbor with higher centrality.
- kNN-Kmeans: An iterative approach that clusters nodes based on a structural distance matrix derived from the enhanced graph.
Experimental Evaluation
The authors evaluated their approach using both synthetic benchmarks and diverse real-world datasets, including LFR Benchmarks, citation networks (Cora, Citeseer, PubMed Diabetes), and social media data (Sinanet).
Key Results
- Superior Accuracy: On LFR benchmarks with high mixing (where communities are hard to distinguish), kNN-enhance significantly outperformed 13 other state-of-the-art algorithms, including CESNA and PCL-DC, across metrics like Accuracy (ACC) and Normalized Mutual Information (NMI).
- Robustness to Noise: The method remained effective even when 50% of the node attributes were "flipped" (random noise), whereas purely attribute-based clustering (K-means) failed completely.
- Efficiency: In terms of runtime, kNN-enhance is orders of magnitude faster than probabilistic generative models. For a network of 10,000 nodes, kNN-enhance finished in approximately 400 seconds, while some probabilistic models took over 35 hours.
Discussion and Conclusion
The "aha moment" of this research is that complex joint probability distributions are not always necessary to combine links and attributes. Simply adding high-confidence links based on attribute similarity acts as a "bridge" that helps traditional structural algorithms see through the noise of a sparse network. Furthermore, this framework is agnostic to attribute types (categorical, binary, or numerical), making it highly versatile.
While the choice of the hyperparameter $k$ remains a consideration, and future work will focus on scaling to millions of nodes using fast approximate kNN construction, kNN-enhance represents a significant step forward in efficient, attribute-aware community detection.
Summary updated