What Are Good Positional Encodings for Directed Graphs?

Yinan Huang, Haoyu Wang, Pan Li
7/30/2024
16 citations
cs.LG
gnn

Official code: Graph-COM/Multi-q-Maglap (10 stars, Python, last commit 2024-05-28).

Abstract

Positional encodings (PEs) are essential for building powerful and expressive graph neural networks and graph transformers, as they effectively capture the relative spatial relationships between nodes. Although extensive research has been devoted to PEs in undirected graphs, PEs for directed graphs remain relatively unexplored.

Show full abstract

This work seeks to address this gap. We first introduce the notion of Walk Profile, a generalization of walk-counting sequences for directed graphs. A walk profile encompasses numerous structural features crucial for directed graph-relevant applications, such as program analysis and circuit performance prediction. We identify the limitations of existing PE methods in representing walk profiles and propose a novel Multi-q Magnetic Laplacian PE, which extends the Magnetic Laplacian eigenvector-based PE by incorporating multiple potential factors. The new PE can provably express walk profiles. Furthermore, we generalize prior basis-invariant neural networks to enable the stable use of the new PE in the complex domain. Our numerical experiments validate the expressiveness of the proposed PEs and demonstrate their effectiveness in solving sorting network satisfiability and performing well on general circuit benchmarks. Our code is available at https://github.com/Graph-COM/Multi-q-Maglap.

View on arXivView PDF

Code Implementations(1)

101Python, ShellMay 28, 20242 years ago

Similar Papers

Cite this paper

@article{huang2024what,
  title  = {What Are Good Positional Encodings for Directed Graphs?},
  author = {Yinan Huang and Haoyu Wang and Pan Li},
  year   = {2024},
  eprint = {2407.20912},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.20912v2},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.20912.svg)](https://codeofpaper.com/paper/2407.20912)

Discussion