Abstract
Graph Edit Distance (GED) is a fundamental metric for measuring dissimilarity between graph-structured data, yet its computation is NP-hard, limiting its application to small-scale problems. This paper introduces a refined Binary Linear Programming (BLP) formulation that significantly enhances the efficiency of exact GED calculations. By reducing the number of variables and constraints through a novel topological reframing, the proposed model (F2) handles directed, undirected, and fully attributed graphs. Experimental results demonstrate that this formulation is up to 100 times faster than naive models and provides high-quality lower-bound approximations through continuous relaxation.
Introduction
In domains ranging from bioinformatics and chemoinformatics to computer vision, data is increasingly represented as graphs. Comparing these structures requires a robust measure of dissimilarity. Graph Edit Distance (GED) serves as the "gold standard" for this task, defining the distance between two graphs as the minimum cost of a sequence of edit operations—vertex/edge substitutions, insertions, and deletions—required to transform one graph into another.
Despite its versatility, GED is computationally expensive. As the number of vertices increases, the search space for the optimal transformation path grows exponentially. Traditional exact methods, such as the A* algorithm, frequently suffer from memory saturation or prohibitive execution times for graphs exceeding 12–15 vertices. While mathematical programming approaches like Binary Linear Programming (BLP) offer an alternative, previous formulations were often restricted to simple undirected graphs or suffered from excessive constraint counts. This research addresses these limitations by providing a fast, generic, and exact BLP framework.
Methodology
The BLP Formulations
The authors present two distinct BLP models to solve the GED problem:
- F1 (The Didactic Model): This formulation explicitly maps every possible edit operation to a binary variable. While conceptually straightforward and useful for understanding the mapping of vertex and edge transformations, the explicit inclusion of deletion and insertion variables results in a high-dimensional search space that is computationally taxing for standard solvers.
- F2 (The Reduced Model): The primary contribution of this work is the realization that explicit variables for deletions and insertions are redundant. These operations can be deduced a posteriori from the substitution variables. By mathematically integrating the cost of deletions into the substitution costs and compressing topological consistency rules, the authors reduced the number of constraints from quadratic ($|E_1| \cdot |E_2|$) to linear ($|E_1| \cdot |V_2|$) relative to graph density. This significantly lowers the overhead for solvers like CPLEX.
Continuous Relaxations for Heuristic Bounds
Beyond exact solutions, the authors introduce F1LP and F2LP, which are continuous relaxations of the BLP models. By allowing variables to take any value between 0 and 1, these models provide a lower bound of the GED in polynomial time. This serves as a highly accurate heuristic for large-scale applications where exact solutions are unreachable.
Experimental Evaluation
Datasets
The models were evaluated across four diverse datasets to test robustness across different graph types:
- GREC: Architectural and electronic symbols (undirected, continuous attributes).
- MUTA (Mutagenicity): Molecular graphs (up to 70 vertices).
- PROT (Protein): Protein secondary structures (complex string-based attributes).
- ILPISO: A synthetic dataset specifically designed to evaluate performance on directed graphs, a category often neglected in GED literature.
Key Results
- Computational Efficiency: The optimized F2 formulation achieved a speedup of up to 100 times compared to the F1 model on the GREC dataset.
- Heuristic Accuracy: F2LP emerged as a superior approximate method, providing a mean deviation of only 7% from the exact solution. It outperformed popular heuristics like Beam Search by approximately 15% in accuracy.
- Scalability: While A* failed on larger graphs due to memory limits, the BLP models successfully provided the best-found solutions within a 300-second window, even when the global optimum could not be formally proven.
Discussion and Conclusion
The study highlights a fundamental trade-off in graph matching: the balance between accuracy and computational cost. While no single algorithm dominates all criteria, the F2 formulation represents a significant step forward in making exact GED calculations feasible for medium-sized graphs. Furthermore, the F2LP relaxation provides a powerful new tool for researchers requiring fast, high-quality lower bounds.
Future work will explore Binary Quadratic Programming (BQP) to further optimize topological constraints and investigate the use of these new bounds to accelerate nearest-neighbor searches in massive graph databases. By reducing the "headache" of graph matching, this formulation opens new doors for structural pattern recognition in complex data environments.
Summary updated