Abstract
Measuring similarity between graphs is a cornerstone of graph-based machine learning, yet traditional Random Walk Kernels (RWKs) are hindered by high computational costs, typically scaling cubically with the number of nodes. We introduce Graph Voyagers (GVoys), a novel framework that achieves linear-time ($O(N)$) complexity for approximating general RWKs on sparse graphs. By leveraging shared random variables to couple walks across different graphs, GVoys avoids the memory-intensive construction of direct product graphs. Our method provides an unbiased estimator with sharp concentration bounds, enabling kernel computation on datasets significantly larger than previously feasible. Experimental results demonstrate that GVoys is up to 27x faster than existing baselines while maintaining high accuracy and robustness.
Introduction: Breaking the Cubic Complexity Barrier
Graph similarity metrics are vital for applications ranging from bioinformatics to social network analysis. RWKs are particularly effective as they quantify similarity based on common paths between graphs. However, the standard computation of RWKs relies on the "direct product graph"—a structure containing $N^2$ nodes for two graphs of size $N$. This leads to a "cubic wall," where exact algorithms require $O(N^3)$ to $O(N^6)$ time, making them impractical for large-scale real-world data.
Existing approximations often sacrifice generality, being limited to specific kernel types (e.g., geometric) or unable to handle node labels. GVoys addresses these limitations by providing a fast, unbiased, and general-purpose solution that scales linearly with the number of nodes, making it optimal for sparse graph structures.
Methodology: The Graph Voyagers (GVoys) Framework
The core innovation of GVoys is the elimination of the explicit product graph through a "coupling" mechanism. The framework is built upon three primary components:
- Graph Random Features (GRFs): Graphs are mapped into low-dimensional vector embeddings such that their dot product approximates the true kernel value.
- Shared Randomness for Coupling: To simulate a walk on the product graph implicitly, GVoys executes independent random walks on Graph A and Graph B using shared random "filters":
- $g$-variables: These synchronize the walks by ensuring only paths of identical length contribute to the similarity score.
- $z$-variables: These act as label filters, matching node sequences (e.g., atom types in molecules) across graphs.
- Unbiased Estimation: The dot product of these randomized embeddings is mathematically proven to be an unbiased estimator of the true RWK.
A key technical insight is the use of Rademacher variables (randomly assigned +1 or -1 values), which the authors identified as optimal for minimizing the variance of the kernel estimator. This randomized approach also enables "Implicit Graph Kernel Learning," where kernel coefficients are treated as trainable parameters and optimized end-to-end for specific downstream tasks.
Experimental Evaluation and Results
GVoys was evaluated on the TUDataset benchmark, including small-to-medium datasets (MUTAG, ENZYMES) and large sparse datasets (NCI1, D&D). Synthetic Erdős-Rényi graphs were also used to test scalability up to $2^{14}$ nodes.
Performance and Scalability
GVoys demonstrated a significant performance leap, running up to 27x faster than traditional fixed-point iteration methods on large graphs. While brute-force methods failed due to memory exhaustion on graphs with a few thousand nodes, GVoys successfully processed graphs with over 16,000 nodes.
Accuracy and Convergence
The randomized approximation proved to be highly accurate. On the MUTAG dataset, end-to-end learning of kernel coefficients yielded an 8.5% relative improvement in classification accuracy over standard geometric RWK baselines. Furthermore, the estimator shows strong convergence properties; as the number of random walks increases, the Mean Squared Error (MSE) relative to the exact kernel value drops rapidly.
Interestingly, the inherent "noise" in the randomized approximation appeared to act as a regularizer, occasionally leading to better generalization and higher classification accuracy than exact calculations.
Conclusion and Future Directions
GVoys represents a significant step forward in scalable graph similarity, offering $O(N)$ efficiency for sparse graphs. While the current framework assumes sparsity for optimal performance, it remains a versatile tool for general graph kernels. Future work will focus on deriving "unconditional" concentration bounds to further strengthen the theoretical guarantees of the estimator and exploring the sensitivity of hyperparameters like the halting probability ($p_{halt}$) across diverse data domains.
Summary updated