Cycle Invariant Positional Encoding for Graph Representation Learning

Zuoyu Yan, Tengfei Ma, Liangcai Gao, Zhi Tang, Chao Chen, Yusu Wang

Abstract

Cycles are fundamental elements in graph-structured data and have demonstrated their effectiveness in enhancing graph learning models. To encode such information into a graph learning framework, prior works often extract a summary quantity, ranging from the number of cycles to the more sophisticated persistence diagram summaries. However, more detailed information, such as which edges are encoded in a cycle, has not yet been used in graph neural networks. In this paper, we make one step towards addressing this gap, and propose a structure encoding module, called CycleNet, that encodes cycle information via edge structure encoding in a permutation invariant manner. To efficiently encode the space of all cycles, we start with a cycle basis (i.e., a minimal set of cycles generating the cycle space) which we compute via the kernel of the 1-dimensional Hodge Laplacian of the input graph. To guarantee the encoding is invariant w.r.t. the choice of cycle basis, we encode the cycle information via the orthogonal projector of the cycle basis, which is inspired by BasisNet proposed by Lim et al. We also develop a more efficient variant which however requires that the input graph has a unique shortest cycle basis. To demonstrate the effectiveness of the proposed module, we provide some theoretical understandings of its expressive power. Moreover, we show via a range of experiments that networks enhanced by our CycleNet module perform better in various benchmarks compared to several existing SOTA models.

Introduction

Standard Message Passing Neural Networks (MPNNs) are fundamentally limited by the Weisfeiler-Lehman (WL) isomorphism test, often failing to distinguish graphs with distinct global structures but identical local neighborhoods. Cycles, such as rings in molecules or triadic closures in social networks, are critical structural features that MPNNs frequently overlook. While previous attempts to incorporate cycle information have used cycle counting or simplicial complexes, these methods often lack edge-specific detail or suffer from high computational costs. This work introduces CycleNet, a module designed to encode the specific role of each edge within a graph's cycle space, providing a form of "positional encoding" for edges that enhances the expressive power of GNNs.

Methodology: CycleNet and CycleNet-PEOI

The authors propose two distinct architectures to capture cycle information effectively:

  1. CycleNet (Basis-Invariant): This approach utilizes Hodge Theory to represent the cycle space. By computing the kernel of the 1-dimensional Hodge Laplacian ($\Delta_1$), a cycle basis is identified. To ensure the representation is independent of the specific basis chosen, CycleNet employs an orthogonal projector ($\Gamma\Gamma^T$). This basis-invariant encoding is then processed through an Invariant Graph Network (IGN).
  2. CycleNet-PEOI (Efficient Variant): For graphs with a unique Shortest Cycle Basis (SCB)—a common property in molecular data—a more efficient variant is introduced. It uses a Permutation Equivariant and Order Invariant (PEOI) MLP-based architecture. This version achieves linear complexity relative to the number of edges, making it highly scalable.
Overview of the CycleNet and CycleNet-PEOI architectures, illustrating the transition from input graph to Hodge Laplacian/SCB encoding.

Experimental Results

CycleNet was evaluated on a variety of benchmarks, ranging from synthetic expressiveness tests to molecular chemistry.

Expressive Power

A key highlight is the model's performance on notoriously difficult synthetic datasets like Cai-Fürer-Immerman (CFI) and Strongly Regular (SR) graphs. As shown in the table below, CycleNet variants achieve perfect accuracy where standard GIN and even some higher-order models like PPGN fail.

Performance comparison on synthetic datasets (3-CFI, 4-CFI, SR), demonstrating CycleNet's superior expressiveness and efficiency.

Molecular Benchmarks and Efficiency

On the ZINC dataset, adding CycleNet to a GIN backbone reduced the Mean Absolute Error (MAE) from 0.220 to 0.153. When paired with the Cellular Weisfeiler-Lehman Network (CWN), it achieved a state-of-the-art MAE of 0.068. Furthermore, CycleNet-PEOI demonstrated significant speedups; on SR graphs, it ran nearly 10 times faster than CWN while maintaining 100% accuracy.

Conclusion

CycleNet bridges algebraic topology and graph learning by leveraging the Hodge Laplacian to create a principled edge-level cycle encoding. By treating cycles as a space rather than just a count, the model achieves expressive power beyond the 3-WL test. While the efficient PEOI variant relies on the uniqueness of the shortest cycle basis, the overall framework provides a robust and scalable way to incorporate global structural information into GNNs. Future work may extend these concepts to higher-dimensional simplicial structures or dynamic graph environments.

Summary updated

BibTeX
@inproceedings{yan2023cycle,
  author = {Zuoyu Yan and Tengfei Ma and Liangcai Gao and Zhi Tang and Chao Chen and Yusu Wang},
  title = {{Cycle Invariant Positional Encoding for Graph Representation Learning}},
  booktitle = {LoG},
  year = {2023},
  url = {https://openreview.net/forum?id=7BQZyQERuP},
}
Figure