Skip to main content
QUICK REVIEW

[Paper Review] SimGNN: A Neural Network Approach to Fast Graph Similarity Computation

Yunsheng Bai, Hao Ding|arXiv (Cornell University)|Aug 16, 2018
Advanced Graph Neural NetworksComputer Science53 references16 citations
TL;DR

SimGNN proposes a graph neural network-based approach to accelerate graph similarity computation, particularly for Graph Edit Distance (GED), by learning a differentiable, invariant, and inductive similarity function. It combines graph-level embeddings with pairwise node-level attention to achieve fast, accurate predictions, outperforming existing approximation algorithms and GNN baselines in speed and error rate on real-world datasets.

ABSTRACT

Graph similarity search is among the most important graph-based applications, e.g. finding the chemical compounds that are most similar to a query compound. Graph similarity computation, such as Graph Edit Distance (GED) and Maximum Common Subgraph (MCS), is the core operation of graph similarity search and many other applications, but very costly to compute in practice. Inspired by the recent success of neural network approaches to several graph applications, such as node or graph classification, we propose a novel neural network based approach to address this classic yet challenging graph problem, aiming to alleviate the computational burden while preserving a good performance. The proposed approach, called SimGNN, combines two strategies. First, we design a learnable embedding function that maps every graph into a vector, which provides a global summary of a graph. A novel attention mechanism is proposed to emphasize the important nodes with respect to a specific similarity metric. Second, we design a pairwise node comparison method to supplement the graph-level embeddings with fine-grained node-level information. Our model achieves better generalization on unseen graphs, and in the worst case runs in quadratic time with respect to the number of nodes in two graphs. Taking GED computation as an example, experimental results on three real graph datasets demonstrate the effectiveness and efficiency of our approach. Specifically, our model achieves smaller error rate and great time reduction compared against a series of baselines, including several approximation algorithms on GED computation, and many existing graph neural network based models. To the best of our knowledge, we are among the first to adopt neural networks to explicitly model the similarity between two graphs, and provide a new direction for future research on graph similarity computation and graph similarity search.

Motivation & Objective

  • To address the high computational cost of exact graph similarity computation, especially Graph Edit Distance (GED), which is NP-complete.
  • To develop a learnable, differentiable function that predicts similarity scores between graphs efficiently.
  • To ensure the model generalizes to unseen graphs and maintains invariance to node permutation.
  • To combine global graph-level embeddings with fine-grained node-level comparisons for improved accuracy.
  • To provide a scalable alternative to combinatorial approximation algorithms for GED and similar metrics.

Proposed method

  • Design a learnable graph embedding function using a GNN to map each graph into a fixed-size vector, preserving structural information.
  • Introduce a novel attention mechanism that emphasizes nodes most relevant to the target similarity metric, improving representation quality.
  • Implement a pairwise node comparison module that computes similarity at the node level between two graphs, supplementing global embeddings.
  • Train the model end-to-end using pairs of graphs and their ground-truth similarity scores (e.g., exact GED) to minimize prediction error.
  • Ensure representation invariance by making the model invariant to node permutation through symmetric aggregation and attention.
  • Use a Siamese-like architecture to process two graphs simultaneously and output a single similarity score.

Experimental results

Research questions

  • RQ1Can a deep neural network be effectively trained to predict graph similarity scores with high accuracy and low inference time?
  • RQ2How well can a GNN-based model generalize to unseen graphs when trained on a limited set of exact GED computations?
  • RQ3To what extent does incorporating both global graph embeddings and local node-level comparisons improve performance over global embeddings alone?
  • RQ4How does the attention mechanism enhance model performance by focusing on structurally significant nodes?
  • RQ5Can the proposed model achieve better trade-offs between speed and accuracy than existing approximation algorithms for GED?

Key findings

  • SimGNN achieves significantly lower error rates compared to multiple baseline approximation algorithms for Graph Edit Distance on three real-world datasets.
  • The model reduces computation time by orders of magnitude compared to exact GED computation, even outperforming state-of-the-art approximation methods in speed.
  • On average, SimGNN runs in quadratic time with respect to the number of nodes in the two graphs, making it scalable for medium-sized graphs.
  • The model generalizes well to unseen graphs, demonstrating strong inductive bias despite being trained only on small graphs.
  • The attention mechanism improves performance by focusing on structurally critical nodes, enhancing the model's sensitivity to relevant graph differences.
  • The combination of graph-level embeddings and pairwise node comparison leads to better performance than using either component in isolation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.