Abstract: The expressivity of Graph Neural Networks (GNNs) has been studied broadly in recent years to reveal the design principles for more powerful GNNs. Graph canonization is known as a typical approach to distinguish non-isomorphic graphs, yet rarely adopted when developing expressive GNNs. This paper proposes to maximize the expressivity of GNNs by graph canonization, then the power of such GNNs is studied from the perspective of model stability. A stable GNN will map similar graphs to close graph representations in the vectorial space, and the stability of GNNs is critical to generalize their performance to unseen graphs. We theoretically reveal the trade-off of expressivity and stability in graph-canonization-enhanced GNNs. Then we introduce a notion of universal graph canonization as the general solution to address the trade-off and characterize a widely applicable sufficient condition to solve the universal graph canonization. A comprehensive set of experiments demonstrates the effectiveness of the proposed method. In many popular graph benchmark datasets, graph canonization successfully enhances GNNs and provides highly competitive performance, indicating the capability and great potential of proposed method in general graph representation learning. In graph datasets where the sufficient condition holds, GNNs enhanced by universal graph canonization consistently outperform GNN baselines and successfully improve the SOTA performance up to 31%, providing the optimal solution to numerous challenging real-world graph analytical tasks like gene network representation learning in bioinformatics.
Introduction: The Expressivity-Stability Dilemma
A fundamental challenge in Graph Representation Learning is balancing the "expressivity" of Graph Neural Networks (GNNs)—their ability to distinguish complex structural patterns—with their "stability"—their ability to generalize by mapping similar graphs to similar representations. Most standard GNNs are limited by the 1-dimensional Weisfeiler-Lehman (1-WL) test, failing to distinguish even simple non-isomorphic graphs. While higher-order GNNs attempt to break this limit, they often face prohibitive computational costs.
Graph Canonization: A Double-Edged Sword
Graph canonization offers a classical mathematical solution to the isomorphism problem by finding a unique, standard labeling for any graph. By assigning a fixed order to nodes, we can theoretically distinguish any two non-isomorphic graphs.
However, integrating canonization into deep learning is non-trivial. Standard tools like Nauty or Bliss are "unstable": a minor structural perturbation (like adding a single edge) can result in a completely different canonical ordering. This instability prevents GNNs from learning meaningful similarities between graphs, leading to poor generalization on unseen data.
Proposed Framework: GC-GNN and UGC-GNN
To address these challenges, the authors propose two architectures that leverage canonization while managing the stability trade-off.
- GC-GNN (Graph Canonization-enhanced GNN): This model uses standard canonization tools to generate discrete node colorings, which serve as one-hot positional encodings for the GNN. While GC-GNN achieves maximal expressivity, it is inherently unstable.
- UGC-GNN (Universal Graph Canonization GNN): To restore stability, the authors introduce Universal Graph Canonization (UGC). The core idea is to ensure "color consistency" across the entire dataset. If two graphs share a common subgraph, nodes within that subgraph should receive identical labels regardless of the global graph structure.
UGC becomes tractable under a "sufficient condition" where nodes have consistent identities across the dataset, such as specific genes in a biological network or regions in a brain atlas. By injecting this asymmetry into message-passing and readout layers, UGC-GNN maintains high expressivity without sacrificing stability.
Experimental Evaluation
The researchers evaluated their methods across synthetic benchmarks, TU datasets, and large-scale bioinformatics graphs.
- Synthetic Benchmarks: GC-GNN achieved near 100% accuracy on the EXP and CSL isomorphism tests, where standard models like GIN and GCN failed (staying at ~50%).
- Bioinformatics Breakthrough: On gene network datasets (Mayo, RosMap, Cancer), UGC-GNN outperformed all baselines, improving state-of-the-art (SOTA) performance by up to 31%.
- Efficiency: Unlike $O(n^k)$ higher-order GNNs, UGC-GNN maintains $O(n)$ space complexity. On the Cancer dataset, it was 4x faster than NGNN and 10x faster than PPGN per epoch, while avoiding the out-of-memory (OOM) issues that plagued subgraph-based methods on large graphs (3000+ nodes).
Conclusion and Future Work
This work highlights that maximizing expressivity via canonization is only half the battle; stability is the key to real-world performance. While UGC-GNN currently relies on pre-defined node identities, it sets a new benchmark for structured graph data in bioinformatics. Future research will focus on approximating universal canonization for general graphs where such identities are not naturally present, potentially unlocking the full power of canonization for all graph learning tasks.
Summary updated