Abstract
Graph embedding techniques are essential for mapping complex network nodes into low-dimensional vectors for downstream tasks. However, traditional methods like DeepWalk and node2vec often suffer from locality bias, failing to capture "mesoscopic" community structures. We present Two Layer Walk (TLWalk), a novel hierarchical embedding algorithm that separates random walks into intra-community and inter-community layers. By explicitly modeling these relationships using bridging nodes and the Louvain algorithm, TLWalk achieves superior performance in link prediction, clustering, and classification across diverse datasets without requiring manual parameter tuning.
Introduction
Analyzing complex networks requires effective graph embeddings that capture both local and global structures. While existing methods excel at microscopic (node-level) and macroscopic (graph-level) patterns, they often struggle with the mesoscopic level—the communities. Traditional random walks tend to mix local and global signals, leading to a loss of critical community-level information. Furthermore, many community-preserving methods are computationally expensive or require extensive parameter tuning. TLWalk addresses these challenges by providing a scalable, parameter-free approach to ensure embeddings reflect the natural groupings within a network.
Methodology
TLWalk utilizes a hierarchical, two-layer random walk mechanism to capture community structures effectively.
- Community Detection: The algorithm first partitions the graph into communities using the Louvain algorithm, which optimizes the modularity score ($Q$).
- Layer Construction: The network is decomposed into two distinct layers: Intra-Community Subgraphs, which capture dense local connections, and an Inter-Community Subgraph, composed of "bridging nodes" that link different communities.
- Hierarchical Random Walks: Unlike standard walks, TLWalk selects a layer based on the starting node. Walks starting at bridging nodes explore the inter-community layer to capture global relationships, while walks starting at non-bridging nodes are restricted to their specific community to preserve dense local structures.
- Embedding Generation: These specialized sequences are processed via a Word2Vec (Skip-Gram) model to learn final node representations.
Theoretical analysis demonstrates that this approach overcomes locality bias and is mathematically equivalent to factorizing a shifted Pointwise Mutual Information (PMI) matrix.
Experimental Results and Discussion
TLWalk was evaluated against state-of-the-art methods like node2vec, DeepWalk, and GraphSAGE across social, biological, and academic datasets.
Performance Metrics
- Link Prediction: TLWalk consistently achieved the highest AUC scores. On the bio-WormNet-v3 dataset, it reached an AUC of 0.9915, outperforming M-NMF by 3.2%.
- Node Clustering: On the Polblogs dataset, TLWalk achieved 85.17% accuracy, significantly surpassing GraphSAGE (73.42%).
- Node Classification: In academic datasets like Texas, TLWalk maintained a competitive edge with 74.89% accuracy.
Robustness and Community Mixing
Using LFR benchmark networks, the authors tested how the algorithm handles varying degrees of community "mixing" ($\mu$). As shown in the figure below, TLWalk maintains high element-centric similarity even as the ratio of inter-community edges increases, whereas methods like Struc2Vec degrade rapidly.
Conclusion
TLWalk provides a robust, community-aware framework for graph embeddings. By prioritizing inter-community transitions for bridging nodes, it prevents local noise from drowning out global signals. While currently dependent on static community detection via Louvain, future work may involve adaptive community detection for dynamic networks and integrating this two-layer logic into Graph Neural Networks (GNNs) to mitigate over-smoothing issues.
Summary updated