Abstract
The design of Graph Neural Networks (GNNs) that operate on both homophilous and heterophilous graphs has received research attention in recent years. Existing heterophilous GNNs, particularly those designed in the spatial domain, lack a convincing theoretical or physical motivation. Inspired by an old-fashioned spring network model, we propose the Graph Spring Network (GSN), a universal GNN model that works for homophilous and heterophilous graphs. We show that the GSN framework can interpret many GNN models from the perspective of potential energy minimization of a spring network with respect to various metrics, which entrusts strong physical motivations to these models. We also conduct experiments to demonstrate the performance of our GSN model on real-world datasets.
Introduction
Most research into the expressive power of Graph Neural Networks (GNNs) relies on the Weisfeiler-Lehman (WL) graph isomorphism test. While useful, this approach leaves a gap in our understanding of the universality of spatial GNNs from a geometric and physical perspective. This paper introduces the Graph Spring Network (GSN) (also referred to as MetricGNN or MGNN), a framework that shifts the focus from traditional message-passing logic to the physics of spring networks and the mathematics of distance geometry.
A central challenge identified is congruent-insensitivity: the final classification layers of a GNN (typically MLPs) are invariant to rotations or translations of the node embedding matrix, provided the relative distances between nodes are preserved. A truly universal spatial GNN must be able to generate these "congruent" embeddings for any given graph structure.
Methodology: The Graph Spring Network
GSN frames the node embedding process as a Distance Geometry Problem, using a spring-network-inspired energy function to arrange nodes in a latent space.
The Spring Network Analogy
The model treats nodes as particles and edges as springs with specific "relaxed lengths." The objective is to minimize a stress function, effectively finding the equilibrium state of a physical spring network. In this latent space, the "relaxed length" of a spring determines whether nodes should be pulled together (homophily) or pushed apart (heterophily).
Learning the Metric Matrix
Instead of using fixed distances, GSN learns a metric matrix $M$ via an edge-attention mechanism. This matrix acts as a "program" for the GNN; by defining the optimal distances, the network "solves" the geometry to find the best embedding.
Propagation via Iteration
The propagation rule is derived using stationary point iteration rather than standard convolution. The update consists of two components:
- Topological Message: Aggregates features based on the graph structure (similar to GCN).
- Metric Message: Adjusts node positions based on the learned distances in the metric matrix.
The authors formally prove that if a GNN can generate embeddings congruent to any target matrix, it achieves "spatial universality."
Experimental Results
GSN was evaluated across 14 node classification datasets, including classic citation networks (Cora, CiteSeer), Wikipedia networks (Chameleon, Squirrel), and large-scale graphs like ogbn-arxiv.
- Superior Performance: GSN achieved an average rank of 1.57 across all datasets, the highest among all tested models (including GCNII, GAT, and LINKX). It outperformed baselines on 10 out of 14 datasets.
- Heterophily Handling: On the
Texasdataset, GSN achieved 90.00% accuracy, significantly outperforming GCN and GAT (both at 61.08%). - Synthetic Validation: On Stochastic Block Model (SBM) graphs, GSN successfully clustered nodes into distinct blocks based on the metric matrix, whereas standard models like APPNP failed to maintain the desired geometry.
Conclusion
GSN provides a robust physical and geometric foundation for spatial GNNs. By connecting GNNs to spring networks, it offers a natural mechanism for handling heterophily. While the current implementation relaxes the $O(n^2)$ complexity of the full Distance Geometry Problem to $O(m)$ by focusing on connected edges, future work may explore incorporating global metric information more efficiently through architectures like Graph Transformers.
Summary updated