Hierarchy-Aware Neural Subgraph Matching with Enhanced Similarity Measure
Zhouyang Liu, Ning Liu, Yixin Chen, Jiezhong He, Menghan Jia, Dongsheng Li
TL;DR
This work tackles neural subgraph matching by addressing two core shortcomings of prior NSM methods: scale sensitivity in encoding and lack of discriminative ranking in scoring. It introduces NC-Iso, which combines a hierarchy-aware GNN encoder that preserves relative feature positions within node-rooted subtrees with a novel similarity measure, the similarity dominance ratio (SDR), for robust scoring. The scoring function $\Psi(Q,D)$ normalizes containment violations via $Compliance(Q,D)$ and quantifies similarity dominance through $SDR(Q,D)$, enabling effective ranking of matched pairs. Extensive experiments on nine datasets demonstrate strong generalization to larger graphs, scalability to large graphs, and competitiveness against both neural baselines and conventional subgraph matching algorithms, with code available for reproducibility. Overall, NC-Iso provides a practical, discriminative, and scalable solution for subgraph retrieval tasks in diverse domains.
Abstract
Subgraph matching is challenging as it necessitates time-consuming combinatorial searches. Recent Graph Neural Network (GNN)-based approaches address this issue by employing GNN encoders to extract graph information and hinge distance measures to ensure containment constraints in the embedding space. These methods significantly shorten the response time, making them promising solutions for subgraph retrieval. However, they suffer from scale differences between graph pairs during encoding, as they focus on feature counts but overlook the relative positions of features within node-rooted subtrees, leading to disturbed containment constraints and false predictions. Additionally, their hinge distance measures lack discriminative power for matched graph pairs, hindering ranking applications. We propose NC-Iso, a novel GNN architecture for neural subgraph matching. NC-Iso preserves the relative positions of features by building the hierarchical dependencies between adjacent echelons within node-rooted subtrees, ensuring matched graph pairs maintain consistent hierarchies while complying with containment constraints in feature counts. To enhance the ranking ability for matched pairs, we introduce a novel similarity dominance ratio-enhanced measure, which quantifies the dominance of similarity over dissimilarity between graph pairs. Empirical results on nine datasets validate the effectiveness, generalization ability, scalability, and transferability of NC-Iso while maintaining time efficiency, offering a more discriminative neural subgraph matching solution for subgraph retrieval. Code available at https://github.com/liuzhouyang/NC-Iso.
