SimGNN: A Neural Network Approach to Fast Graph Similarity Computation

Yunsheng Bai,Hao Ding,Song Bian,Ting Chen,Yizhou Sun,Wei Wang
2020-03-02
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.
Machine Learning
What problem does this paper attempt to address?
The paper attempts to address the problem of efficiently and accurately computing graph similarity (or graph distance) in large-scale graph data, particularly in application scenarios such as finding the most similar chemical compounds to a query compound in fields like chemistry and bioinformatics. Core operations for graph similarity computation, such as Graph Edit Distance (GED) and Maximum Common Subgraph (MCS), are theoretically important but very time-consuming in practical applications. To solve this problem, the paper proposes a new method based on neural networks—SimGNN, which aims to reduce the computational burden while maintaining good performance. Specifically, SimGNN combines two strategies: 1. **Graph-level Embedding**: A learnable embedding function is designed to map each graph to an embedding vector, which provides a global summary of the graph. A new attention mechanism is introduced to emphasize nodes that are important under specific similarity measures. 2. **Node Pair Comparison**: A pairwise node comparison method is designed to complement the graph-level embedding by providing fine-grained node-level information. Through these two strategies, SimGNN is able to improve the accuracy of graph similarity computation while maintaining efficiency. Experimental results show that SimGNN not only achieves higher accuracy on three real-world graph datasets but also significantly reduces computation time, outperforming various existing baseline methods.