Graph node matching for edit distance

Aldo Moscatelli, Jason Piquenot, Maxime Bérar, Pierre Héroux, Sébastien AdamPattern Recognition Letters 2024

TL;DR

This paper introduces GNOME, a novel deep learning architecture that approximates the Graph Edit Distance (GED) by learning node embeddings and then using optimal transport to match them. GNOME achieves state-of-the-art results on several benchmarks, offering a more efficient and explainable alternative to traditional GED computation.

What Problem Does This Paper Address?

Computing the exact Graph Edit Distance (GED) between two graphs is a computationally expensive problem, classified as NP-hard. This makes it infeasible for large graphs, which are common in many real-world applications like social network analysis, molecular modeling, and recommendation systems. While approximate methods exist, they often sacrifice accuracy or explainability. This paper aims to bridge this gap by proposing a deep learning approach that efficiently approximates GED while retaining its desirable properties, such as explainability through edit paths.

Methods

GNOME employs a three-block Siamese architecture:

  1. Graph Encoding Block: This block enriches node features with positional encodings, specifically using the Random-Walk (RW) descriptor. This helps the model distinguish between nodes that might appear symmetric in the graph structure, improving the expressiveness of the embeddings.
  2. Embedding Block: This block utilizes Siamese Graph Isomorphism Networks (GINs). GINs are chosen for their expressiveness and linear time complexity. The Siamese structure ensures that both graphs in a pair are processed identically, generating node-level embeddings. The architecture aggregates information from multiple layers to create a multi-granular representation of each node.
  3. Matching Block: This block takes the node embeddings from both graphs and uses a Linear Sum Assignment Problem (LSAP) solver to find the optimal matching between nodes. LSAP is a well-established method for bipartite matching and, when used with a distance metric, helps preserve the theoretical properties of a distance. The output of LSAP provides a similarity score, which is then used to approximate the GED. The paper also details how LSAP is adapted for graphs of different sizes by introducing dummy nodes.

Datasets

The paper evaluates GNOME on three benchmark datasets:

  • AIDS: Graphs representing molecular compounds.
  • LINUX: A dataset of graphs used in previous graph similarity research.
  • IMDB-MULTI: Relational datasets of ego networks from IMDB movies, where nodes represent actors and edges represent co-appearances in movies.

The ground-truth GED values for LINUX and AIDS were computed using an ILP method, while for IMDB, they were approximated using upper bounds (Beam, Hungarian, VJ) due to the dataset's size.

Key Insights and Ideas

  • Positional Encoding for Symmetry Breaking: The use of Random-Walk (RW) positional encoding is crucial for distinguishing nodes in graphs with high symmetry, which is a common challenge for GNNs and can lead to inaccurate embeddings.
  • Node-Level Matching for Explainability: By performing matching at the node level using LSAP, GNOME can reconstruct an edit path, providing insights into why two graphs are considered similar or dissimilar, a feature often missing in graph-level matching approaches.
  • LSAP for Metric Properties: The paper demonstrates that using LSAP with a distance function helps preserve important metric properties of the GED, such as positivity and triangle inequality, which are often lost in other deep learning approximations.
  • Trade-off Between Expressiveness and Efficiency: GNOME strikes a balance between the expressive power of GNNs and the computational efficiency of LSAP, offering a practical solution for large-scale graph similarity tasks.

Key Results

  • GNOME consistently achieves top-3 performance among deep learning-based methods across various metrics (MAE, MSE, Spearman's ρ, Kendall's τ, p@10, p@20) on the AIDS, LINUX, and IMDB datasets.
  • The GNOME-RW variant, which includes RW positional encoding, shows improved performance on AIDS and LINUX datasets, highlighting the benefit of this feature. However, its impact is less pronounced on IMDB due to the dataset's highly symmetric clique structures.
  • The model demonstrates good ranking preservation on the tested datasets, indicating its suitability for graph retrieval tasks.
  • The architecture is fully differentiable, enabling end-to-end learning.

Limitations and Future Work

  • Positivity Guarantee: The paper acknowledges that the deep learning architecture does not strictly guarantee the positivity property of a distance (i.e., ged(x, y) > 0 for x ≠ y) because node embeddings might be generated such that their comparison results in zero. However, they state that other metric properties hold.
  • Edge Matching: The authors suggest that incorporating edge matching more explicitly into the embedding or matching blocks could lead to finer predictions and more accurate edit path outputs.
  • Task-Driven Metrics: GNOME's architecture is flexible enough to learn other task-dependent graph distances beyond GED, which could be a promising avenue for future research.
  • Computational Cost: While more efficient than exact GED computation, the LSAP step still has a cubic complexity in the number of nodes, which could be a bottleneck for extremely large graphs.

Summary updated

BibTeX
@article{moscatelli2024graph,
  author = {Aldo Moscatelli and Jason Piquenot and Maxime Bérar and Pierre Héroux and Sébastien Adam},
  title = {{Graph node matching for edit distance}},
  journal = {Pattern Recognition Letters},
  year = {2024},
  doi = {10.1016/j.patrec.2024.05.020},
}
Figure