NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Augmenting optimization-based molecular design with graph neural networks

Shiqiang Zhang, Juan S. Campos, Christian Feldmann, Frederik Sandfort, Miriam Mathea, Ruth Misener · DOI

TL;DR

This paper bridges the gap between deep learning and mathematical optimization by formulating Graph Neural Networks (GNNs) as Mixed-Integer Programs (MIP). By integrating these formulations into the open-source toolkit OMLT and introducing clever symmetry-breaking constraints, the authors enable the "inverse design" of complex molecules (up to 50 fragments) with guaranteed structural feasibility and optimized properties.

What Problem Does This Paper Address?

Computer-Aided Molecular Design (CAMD) is essentially a high-stakes game of "find the needle in the haystack." Researchers want to find a molecular structure that maximizes a specific property (like a specific scent or drug efficacy).

While GNNs are fantastic at predicting properties from a given molecular graph, using them to design a new graph is incredibly difficult. Most current methods use "black-box" optimization like genetic algorithms, which don't provide optimality guarantees and often struggle with the rigid "grammar" of chemistry (e.g., valency rules). The challenge is: how do you turn a GNN—a series of non-linear matrix operations—into a set of linear constraints that a mathematical solver can understand and optimize over?

Methods

The authors propose a framework that treats the molecular design problem as a Mixed-Integer Linear Programming (MILP) problem. Key technical contributions include:

  • Big-M GNN Formulation: They developed a "big-M" linear formulation for GNN layers (specifically SAGEConv). This allows the adjacency matrix (the "connections" in the molecule) to be a decision variable in the optimization.
  • OMLT Integration: They implemented these GNN encodings into the Optimization and Machine Learning Toolkit (OMLT), making it easier for other researchers to optimize over trained PyTorch Geometric models using the Pyomo modeling language.
  • Symmetry-Breaking Constraints: A major bottleneck in graph optimization is "isomorphism"—the fact that the same molecule can be represented by many different node indexings. The authors introduced constraints to enforce a unique indexing, drastically reducing the search space and speeding up the solver.
  • Fragment-Based Design: Instead of building molecules atom-by-atom, they use a fragment-based approach. By treating groups of atoms (like aromatic rings) as single units, they can design larger, more realistic molecules while maintaining chemical "aromacity" that atom-based models often miss.

Datasets

The study utilizes the Sharma et al. (2021) odorant dataset, which contains 4,682 molecules with olfactory annotations. The authors specifically focused on two case studies:

  1. Banana odor: Characterized by specific esters and aromatic fragments.
  2. Garlic odor: Characterized by sulfur-containing compounds and specific ring structures.

They used these datasets to train GNN surrogates that predict the probability of a molecule having a specific scent, which then served as the objective function for their optimization.

Key Insights and Ideas

  • The "MIP Wall" and Symmetry: The authors realized that the biggest hurdle wasn't just the GNN's non-linearity, but the combinatorial explosion caused by graph symmetry. Their symmetry-breaking constraints are the "secret sauce" that makes solving these problems tractable.
  • Fragments > Atoms: Moving to a fragment-based approach isn't just a shortcut; it's a way to bake chemical "common sense" into the optimization. It ensures that complex structures like benzene rings are treated as stable units rather than a collection of atoms that might be "broken" during optimization.
  • Practical Constraints: The paper emphasizes that a high GNN score isn't enough. They incorporate "Requirement" constraints (e.g., "no double bonds linked to aromatic rings" or "sulfur must only link to carbon") to ensure the designed molecules are chemically stable and synthesizable.

Key Results

  • Optimality: For smaller designs (up to 12 fragments), the framework consistently found the globally optimal molecule according to the GNN's prediction within a 10-hour time limit.
  • Scalability: While finding the absolute best molecule becomes difficult as size increases, the method successfully found feasible, high-scoring solutions for molecules with up to 50 fragments.
  • Complexity: At $N=50$ for garlic odor, the solver handled a staggering $9.57 \times 10^4$ variables and $4.67 \times 10^5$ constraints, demonstrating the robustness of the MILP approach when paired with modern solvers like Gurobi.

Limitations and Future Work

  • Non-linear Activations: While ReLU activations work perfectly with MILP, other functions like Sigmoid or Tanh require non-linear solvers, which are significantly slower and more complex to handle in a mixed-integer context.
  • Aggregation Limits: Currently, "mean" aggregation and GCNConv layers are difficult to linearize when the graph structure is not fixed, leading to non-linearities that the authors avoided in this specific MILP implementation.
  • Synthesizability: While the authors added many practical constraints, the "gold standard" would be integrating a more robust metric for how easy a molecule is to actually make in a lab.

Summary updated

BibTeX
@article{zhang2024augmenting,
  author = {Shiqiang Zhang and Juan S. Campos and Christian Feldmann and Frederik Sandfort and Miriam Mathea and Ruth Misener},
  title = {{Augmenting optimization-based molecular design with graph neural networks}},
  journal = {Comput. Chem. Eng.},
  year = {2024},
  doi = {10.1016/j.compchemeng.2024.108684},
}
Figure