KDD2025

Improving Subgraph Matching by Combining Algorithms and Graph Neural Networks

Shuyang Guo, Wenjin Xie, Ping Lu, Ting Deng, Richong Zhang, Jianxin Li, Xiangping Huang, Zhongyi Liu

Abstract

Homomorphism is an important structure-preserving mapping between graphs. Given a graph ๐บ and a pattern ๐‘„, the subgraph homomorphism problem is to find a mapping ๐œ‘ from ๐‘„ to ๐บ such that adjacent vertices of ๐‘„ are mapped to adjacent vertices in ๐บ. Unlike the subgraph isomorphic mapping that is injective, homomorphism allows multiple vertices in ๐‘„ to map to the same vertex in ๐บ, increasing complexity. We develop HFrame, the first GNN-based framework for subgraph homomorphism, by combining algorithms and machine learning. We show that HFrame is more expressive than the vanilla GNN, i.e., HFrame can distinguish more graph pairs (๐‘„, ๐บ) such that ๐‘„ is not homomorphic to ๐บ. Moreover, we provide a generalization error bound for HFrame. Using real-life and synthetic graphs, we show that HFrame is up to 101.91ร— faster than exact matching algorithms, and its average accuracy can reach 0.962. CCS Concepts โ€ข Computing methodologies โ†’ Neural networks; Model development and analysis.