Abstract
Identifying the Maximum Common Subgraph (MCS) across multiple labeled graphs is a computationally intensive task essential for molecular motif discovery. This paper presents an exact algorithm that utilizes modular product constructions and a novel graph-ordering strategy. By leveraging similarity kernels to prioritize comparisons of dissimilar graphs, the approach significantly reduces the search space. Experimental results on molecular datasets demonstrate a reduction in mean computation time from over an hour to under two seconds for complex 5-graph instances.
Introduction
Identifying the Maximum Common Subgraph (MCS) is a cornerstone of cheminformatics and bioinformatics. In drug discovery, finding the MCS of multiple molecules helps identify the "pharmacophore"—the essential structural component responsible for biological activity. While pairwise MCS (comparing two graphs) is a known NP-complete problem, extending this to multiple graphs simultaneously is significantly more challenging. Most existing tools rely on heuristics that may sacrifice optimality or fail to scale. This research introduces a mathematically rigorous, exact method to find all connected, labeled maximum common subgraphs across a set of multiple graphs.
Methodology
The proposed algorithm, implemented in C++, combines several sophisticated graph theory techniques to maintain exactness while improving efficiency:
- Modular Product Graphs: The problem of finding a common subgraph is transformed into finding a "clique" (a fully connected cluster of nodes) within a larger auxiliary graph.
- Iterative Pairwise Comparison: The algorithm processes graphs two at a time, preserving all maximal intermediate solutions to ensure global optimality is maintained throughout the sequence.
- Pruning and Refinement: The researchers introduced a pruning heuristic that distinguishes between "type-1" edges (actual bonds) and "type-0" edges (non-edges). Removing unnecessary type-0 edges significantly shrinks the search space.
- Graph Ordering Strategy: The order of comparison is critical. The authors utilize graph kernels to measure similarity and greedily select pairs with the lowest similarity first.
The Role of Graph Similarity
The core insight of the paper is that graph kernels—such as Weisfeiler-Lehman (WL), Vertex Histogram (VH), and a custom "Minmax" measure—can predict the computational weight of a comparison. As shown in Figure 1, there is a clear correlation between similarity values and the number of common subgraphs ($y_l$). By comparing the most dissimilar graphs first, the algorithm generates smaller intermediate solution sets, effectively pruning the search tree early and preventing exponential explosion.
Experimental Results
The algorithm was evaluated using the ZINC dataset (500 molecular graphs) and the ChEMBL22 database (5,000 problem instances).
- Performance Gains: Without the greedy ordering strategy, the algorithm frequently timed out after an hour. With the "minmax" ordering and edge-removal refinements, the mean runtime for 5-graph instances dropped to between 0.25 and 1.99 seconds.
- Refinement Effectiveness: The "type-0" edge removal consistently improved performance across all tested similarity measures, proving to be a robust optimization.
- Exactness: Unlike previous approximate methods, this algorithm provides formal proofs of correctness for both labeled and connected cases, ensuring the results are the absolute mathematical maximums.
Conclusion
By combining modular product constructions with a similarity-based ordering strategy, the authors have developed a highly efficient tool for finding all connected maximum-sized common subgraphs. The use of graph kernels to "speed control" the search process represents a significant advancement in exact graph matching. While primarily tested on molecular graphs, the principles of this ordering strategy could potentially be adapted to larger networks or integrated into heuristic solvers to improve their performance.
Summary updated