As a powerful framework for graph representation learning, Graph Neural Networks (GNNs) have garnered significant attention in recent years. However, to the best of our knowledge, there has been no formal analysis of the logical expressiveness of GNNs as Boolean node classifiers over multi-relational graphs, where each edge carries a specific relation type. In this paper, we investigate $\mathcal{FOC}_2$, a fragment of first-order logic with two variables and counting quantifiers. On the negative side, we demonstrate that the R$^2$-GNN architecture, which extends the local message passing GNN by incorporating global readout, fails to capture $\mathcal{FOC}_2$ classifiers in the general case. Nevertheless, on the positive side, we establish that R$^2$-GNNs models are equivalent to $\mathcal{FOC}_2$ classifiers under certain restricted yet reasonable scenarios. To address the limitations of R$^2$-GNNs regarding expressiveness, we propose a simple graph transformation technique, akin to a preprocessing step, which can be executed in linear time. This transformation enables R$^2$-GNNs to effectively capture any $\mathcal{FOC}_2$ classifiers when applied to the "transformed" input graph. Moreover, we extend our analysis of expressiveness and graph transformation to temporal graphs, exploring several temporal GNN architectures and providing an expressiveness hierarchy for them. To validate our findings, we implement R$^2$-GNNs and the graph transformation technique and conduct empirical tests in node classification tasks against various well-known GNN architectures that support multi-relational or temporal graphs. Our experimental results consistently demonstrate that R$^2$-GNN with the graph transformation outperforms the baseline methods on both synthetic and real-world datasets
翻译:作为图表示学习的强大框架,图神经网络近年来受到广泛关注。然而,据我们所知,目前尚无关于 GNN 作为布尔节点分类器在多关系图(其中每条边携带特定关系类型)上逻辑表达能力的正式分析。本文研究了 $\mathcal{FOC}_2$,即包含两个变量和计数量词的一阶逻辑片段。从消极方面,我们证明 R$^2$-GNN 架构(通过引入全局读取扩展局部消息传递 GNN 的模型)在一般情况下无法捕捉 $\mathcal{FOC}_2$ 分类器。但从积极方面,我们确定 R$^2$-GNN 模型在某些受限但合理的场景下等同于 $\mathcal{FOC}_2$ 分类器。为解决 R$^2$-GNN 在表达能力上的局限性,我们提出一种简单的图变换技术,类似于预处理步骤,可在线性时间内执行。该变换使 R$^2$-GNN 在应用于“变换后”的输入图时,能够有效捕捉任意 $\mathcal{FOC}_2$ 分类器。此外,我们将表达能力和图变换的分析扩展到时序图,探索了多种时序 GNN 架构,并为其提供了表达能力层级。为验证研究结果,我们实现了 R$^2$-GNN 和图变换技术,并在节点分类任务中针对多种支持多关系或时序图的知名 GNN 架构进行实证测试。实验结果表明,结合图变换的 R$^2$-GNN 在合成数据集和真实数据集上均持续优于基线方法。