Efficient Graph Edit Distance Computation and Verification via Anchor-aware Lower Bound Estimation

Lijun Chang, Xing Feng, Xuemin Lin, Lu Qin, Wenjie Zhang

TL;DR

Graph Edit Distance (GED) is a powerful metric for evaluating graph similarity, but its NP-hard nature has traditionally restricted its use to tiny graphs with fewer than 30 vertices. This paper introduces a unified search framework paired with novel "anchor-aware" lower bound estimation techniques that drastically prune the search space. The resulting algorithm, $AStar^+$-BMa, outperforms state-of-the-art methods by over four orders of magnitude and successfully scales to graphs with hundreds of vertices.

What Problem Does This Paper Address?

Graph similarity computation is a foundational operation in applications ranging from biochemical anomaly detection to video object retrieval. GED measures this similarity by calculating the minimum number of edit operations (vertex/edge insertions, deletions, and relabelings) needed to transform one graph into another.

Because exact GED computation is NP-hard, standard approaches rely on exploring a tree of potential vertex mappings. However, existing algorithms suffer from an exponential explosion of the search space, hitting a hard scalability wall at around 30 vertices. This paper tackles this bottleneck for both GED computation (finding the exact distance) and GED verification (determining if the distance falls within a user-specified threshold $\tau$).

Methods

The authors introduce a unified framework that structures vertex mapping as a prefix-shared search tree, which can be instantiated using either a best-first search ($AStar^+$) or a depth-first search ($DFS^+$) strategy.

The core innovation is the introduction of anchor-aware lower bound estimation. When evaluating a partial mapping between two graphs, the vertices are split into two categories:

  • Anchored vertices: Vertices that have already been matched.
  • Free vertices: Vertices that remain unmapped.

Traditional algorithms discard the structural constraints of anchored vertices when estimating the remaining cost. This paper introduces two tighter, anchor-aware lower bounds:

  1. $\delta^{LSa}$ (Anchor-aware Label Set-based): Refines standard label-set bounds by partitioning edges into cross-edges (connecting to anchored vertices) and inner-edges, calculating the edit distance for each component separately.
  2. $\delta^{BMa}$ (Anchor-aware Branch Match-based): Enhances branch-matching by forcing adjacent edges to respect the fixed mappings of anchored vertices. The optimal lower bound is computed efficiently using the Hungarian algorithm for bipartite matching.

The framework also utilizes an "expand all" strategy to trade a minimal amount of memory for a significant boost in time efficiency, avoiding redundant lower-bound recalculations for sibling nodes.

Datasets

The algorithms were evaluated on both real-world and synthetic graph datasets:

  • AIDS: An antivirus screen chemical compound dataset containing 42,687 graphs (average of 25.6 vertices and 27.6 edges).
  • PubChem: A massive chemical compound dataset containing 1 million graphs (average of 24 vertices and 25.8 edges).
  • Protein: A protein structure database consisting of 600 graphs (average of 32.6 vertices and 62 edges).
  • Synthetic Graphs ($G_R$): Generated via GraphGen to evaluate scalability, with vertex counts scaling from 10 up to 1,024.

Key Insights and Ideas

  • Exploiting History Pays Off: Tighter lower bounds are the key to conquering NP-hard graph problems. By simply remembering which vertices are already "anchored" and forcing the remaining edge mappings to respect them, the search space contracts dramatically.
  • Best-First Search Vindicated: Recent literature argued that depth-first search (DFS) was superior to best-first search ($A^*$) for GED computation due to the latter's high memory consumption. The authors prove that if you optimize memory management (storing states in constant space) and apply tight lower bounds, best-first search ($AStar^+$) maintains a much smaller search space and runs faster than DFS.
  • The Asymmetry of Verification: For verification tasks ($\text{GED} \le \tau$), if two graphs are highly dissimilar, $AStar^+$ and $DFS^+$ perform identically because the threshold $\tau$ forces aggressive pruning across the board. However, for similar graphs, $AStar^+$ finds the valid mapping much faster due to its greedy nature.

Key Results

  • Four Orders of Magnitude Speedup: The proposed $AStar^+$-BMa approach consistently outperforms state-of-the-art techniques like CSI_GED and DF_GED by more than four orders of magnitude in processing time.
  • Sub-Second Execution: On real-world PubChem graphs with 30 vertices where baseline methods timed out (taking over 3,000 seconds), $AStar^+$-BMa computed the exact GED in less than 0.1 seconds.
  • Unprecedented Scalability: In synthetic scalability tests, $AStar^+$-BMa successfully processed graphs with up to 1,024 vertices for GED verification tasks, completely shattering the traditional 30-vertex limit.

Limitations and Future Work

  • Uniform Edit Costs: The primary limitation acknowledged by the authors is their focus on uniform edit costs (where every insertion, deletion, or relabeling operation costs exactly 1). While they note that the anchor-aware framework can theoretically be extended to non-uniform cost functions, the detailed formulation and experimental validation are left for future work.
  • Impact on Graph Indexing: Many existing graph database index structures rely on older, slower GED verification algorithms to filter candidates. The authors suggest that integrating $AStar^+$-BMa into these indexing frameworks could fundamentally re-evaluate and improve the state-of-the-art in graph similarity search.

Summary updated

BibTeX
@misc{chang2017efficient,
  author = {Lijun Chang and Xing Feng and Xuemin Lin and Lu Qin and Wenjie Zhang},
  title = {{Efficient Graph Edit Distance Computation and Verification via Anchor-aware Lower Bound Estimation}},
  year = {2017},
  eprint = {1709.06810},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1709.06810},
}
Figure