Flexible Graph Similarity Computation With A Proactive Optimization Strategy

Zhouyang Liu, Ning Liu, Yixin Chen, Jiezhong He, Dongsheng LiarXiv 2025 · DOI

Graph similarity computation is a fundamental task in data science, with applications ranging from drug discovery in bioinformatics to vulnerability detection in software engineering. The most robust metric for this task is Graph Edit Distance (GED), which measures the minimum cost to transform one graph into another through a sequence of edit operations (node/edge insertion, deletion, or substitution).

While GED is highly flexible—allowing users to assign different costs to different operations—it is computationally NP-hard. Recent deep learning approaches have attempted to approximate GED, but they typically face a trade-off: they are either computationally efficient but inaccurate, or accurate but prohibitively slow due to iterative matching processes. This paper introduces the Graph Edit Network (GEN), a model designed to bridge this gap by employing a proactive optimization strategy.

The Challenges: Cost Decoupling and Local Blindness

Existing learning-based GED methods generally follow a fine-grained paradigm: they embed nodes into vectors, calculate pairwise distances, and then apply iterative algorithms like Sinkhorn or Hungarian variants to find an alignment. The authors identify two primary flaws in this approach:

  1. Cost Decoupling: Most models calculate node matches based on embedding distances first, only applying specific operation costs as a post-processing step. This "Expense Gap" results in alignments that do not actually minimize the total user-defined cost.
  2. Local Blindness: Matching decisions are often made in isolation or require many iterations to incorporate global graph structure. This "Alignment Gap" forces models to rely on expensive iterative refinement to reach a near-optimal solution.

Proposed Method: Graph Edit Network (GEN)

GEN fundamentally rethinks the alignment process through a "one-step" strategy that integrates global guidance and cost awareness directly into the model architecture.

The GEN architecture featuring cost-aware matching and one-step alignment with global guidance.

Cost-Aware Matching Expense Estimation

Instead of treating operation costs as an afterthought, GEN uses a Multi-Layer Perceptron (MLP) to combine node embeddings with the actual operation cost vector provided by the user. This ensures the model understands the "price" of a mismatch during the alignment phase, allowing it to prioritize cheaper operations.

One-Step Alignment with Global Guidance

To eliminate the bottleneck of iterative refinement, GEN calculates a Global Cost Ratio. It identifies structurally critical nodes and propagates their "impact" across neighborhoods. This mechanism acts as a lightweight structural prior, providing the global context necessary to produce high-quality alignments in a single pass.

Experimental Results

The model was evaluated on several benchmarks, including chemical compounds (AIDS700nef), program dependence graphs (LINUX), and large synthetic graphs with up to 400 nodes to test scalability.

Comparison of Test MAE across AIDS700nef and LINUX datasets, demonstrating the superior accuracy of the proposed approach.

Key Findings

  • Accuracy: GEN consistently outperformed state-of-the-art baselines. On the LINUX dataset, it achieved a 30% reduction in Mean Absolute Error (MAE) and a 37.8% reduction in Root Mean Square Error (RMSE).
  • Efficiency: By avoiding iterative refinement, GEN achieved a throughput increase of up to 414x compared to GMN-match, making it suitable for real-time applications.
  • Scalability: On large synthetic graphs, GEN’s predictions remained tightly clustered around ground-truth values, whereas traditional baselines became increasingly inaccurate as graph size grew.

Conclusion

GEN represents a significant step forward in flexible graph similarity computation. By moving cost settings to the center of the matching process and utilizing global guidance for one-step alignment, it achieves a rare combination of high accuracy and extreme inference speed. Future work will focus on reducing memory overhead for massive graphs and improving the capture of complex cyclic structures within the GNN encoder.

Summary updated

BibTeX
@misc{liu2025flexible,
  author = {Zhouyang Liu and Ning Liu and Yixin Chen and Jiezhong He and Dongsheng Li},
  title = {{Flexible Graph Similarity Computation With A Proactive Optimization Strategy}},
  year = {2025},
  eprint = {2504.06533},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.06533},
}
Figure