Towards Accurate Subgraph Similarity Computation via Neural Graph Pruning

Linfeng Liu, Xu Han, Dawei Zhou, Li-Ping Liu · DOI

TL;DR

This paper introduces Prune4SED, a novel neural network for accurately computing subgraph similarity (specifically, Subgraph Edit Distance or SED). It tackles the challenge of graph pruning, a crucial but difficult-to-differentiate step in traditional SED calculation, by reformulating it as a differentiable node relabeling problem. This allows for end-to-end training and achieves state-of-the-art results on multiple benchmark datasets.

What Problem Does This Paper Address?

Subgraph similarity search is a fundamental problem in graph analysis, aiming to determine if a query graph is approximately contained within a larger target graph. This is crucial for applications ranging from drug discovery to computer vision. A key metric for this is the Subgraph Edit Distance (SED), which quantifies the minimum edits needed to transform a query graph into a subgraph of a target graph. However, computing SED exactly is NP-hard. Traditional methods often employ "pruning" to remove irrelevant parts of the target graph, significantly speeding up computation and improving accuracy. The challenge this paper addresses is how to effectively integrate this critical pruning step into neural network models for SED computation, as pruning is inherently a discrete and non-differentiable operation.

Methods

The core innovation of Prune4SED lies in its approach to graph pruning. Instead of treating pruning as a discrete selection process, the authors reframe it as a node relabeling problem. They introduce a special "pruned" label, effectively marking nodes for removal. To make this differentiable, they relax the discrete node labels into continuous "keep probabilities" for each node. This allows a neural network to learn these probabilities.

The Prune4SED model has three main components:

  1. Query-Aware Representation Learning: This component uses a multi-head attention mechanism to allow information from the query graph to influence the representation learning of the target graph. This ensures that the pruning process is guided by the specific query.
  2. Hard/Soft Pruning: This stage uses the learned keep probabilities. Hard pruning initially removes nodes with very low probabilities and their neighbors, while soft pruning uses the probabilities to scale node features, allowing for a more nuanced removal.
  3. Multi-Head SED Prediction: To account for the combinatorial nature of pruning and the potential for multiple good pruning strategies, the model employs a multi-head approach. Each "head" learns its own pruning parameters, and their predictions are averaged to produce the final SED estimate. This is inspired by multi-head attention in Transformers.

The entire model is designed for end-to-end training, optimizing all components simultaneously.

Datasets

The paper evaluates Prune4SED on seven benchmark datasets:

  • AIDS
  • CiteSeer
  • Cora_ML
  • Amazon
  • DBLP
  • PubMed
  • Protein

These datasets represent a variety of graph types, including chemical compounds, citation networks, and co-author networks. The authors describe how query-target pairs were generated for each dataset, often by sampling subgraphs or ego-nets.

Key Insights and Ideas

  • Pruning as Differentiable Relabeling: The most significant insight is the successful conversion of the discrete graph pruning problem into a differentiable node relabeling problem. This is the key enabler for integrating pruning into neural networks.
  • Query-Guided Pruning is Crucial: The query-aware representation learning component is vital. It demonstrates that pruning should not be a static process but must be dynamically guided by the specific query graph to be effective.
  • Multi-Head Pruning for Robustness: Employing multiple pruning heads allows the model to explore diverse pruning strategies, leading to more robust and accurate SED predictions, especially when dealing with the combinatorial complexity of graph matching.
  • Pruning's Importance for SED: The experimental results strongly suggest that pruning is not just an optimization trick but a fundamental necessity for achieving accurate SED predictions with neural models, especially when target graphs are significantly larger than query graphs.

Key Results

  • State-of-the-Art Performance: Prune4SED achieves state-of-the-art results across all seven benchmark datasets, outperforming both non-neural and existing neural methods in terms of Root Mean Squared Error (RMSE).
  • Significant Improvement: It shows an average of 23% improvement over the previous best neural model, NeuroSED.
  • Effective Pruning: Analysis of pruned graphs shows that the model effectively removes a significant number of irrelevant nodes, and the pruning strategy is indeed influenced by the query graph.
  • Scalability: While Prune4SED is slower than NeuroSED, its computation time is not directly dependent on graph size, offering advantages for large-scale problems.
  • Molecular Fragment Search: The model demonstrates promising results in molecular fragment containment search, accurately retrieving molecules containing specific functional groups.

Limitations and Future Work

  • Computational Cost: Prune4SED is computationally more expensive than simpler neural models like NeuroSED due to its more complex architecture involving multiple attention and pruning stages.
  • Hyperparameter Sensitivity: While the paper suggests the hyper-parameters for pruning (top-k and h-hop) are relatively easy to tune, their impact on performance is still a factor.
  • Future Work: The authors suggest exploring different GNN architectures and further optimizing network architectures to reduce computation time. They also leave the extension to graphs with edge labels as future work.

Summary updated

BibTeX
@article{liu2022towards,
  author = {Linfeng Liu and Xu Han and Dawei Zhou and Li-Ping Liu},
  title = {{Towards Accurate Subgraph Similarity Computation via Neural Graph Pruning}},
  journal = {Accepted by TMLR},
  year = {2022},
  url = {https://openreview.net/forum?id=CfzIsWWBlo},
}
Figure