Mixed-integer optimisation of graph neural networks for computer-aided molecular design

Tom McDonald, Calvin Tsay, Artur M. Schweidtmann, Neil Yorke-Smith

TL;DR

This paper introduces the first mathematical frameworks to embed Graph Neural Networks (GNNs) directly into mixed-integer optimization problems. By translating GNN architectures like GCN and GraphSAGE into linear and bilinear constraints, the authors enable the design of molecules with globally optimal properties, such as boiling points, while respecting physical laws like chemical valency.

What Problem Does This Paper Address?

In Computer-Aided Molecular Design (CAMD), researchers want to find the "perfect" molecule for a specific job—like a fuel that burns cleaner or a drug that binds more effectively. Traditionally, this was done using manual chemical descriptors (QSPR), which are limited by human intuition.

While modern Machine Learning, specifically Graph Neural Networks (GNNs), can learn these properties directly from molecular structures, they act as "black boxes." If you want to find the molecule that maximizes a property, you usually have to use "black-box" optimization (like Genetic Algorithms), which might get stuck in local optima. This paper tackles the challenge of global optimization: how do we mathematically formulate a GNN so that a solver can prove it has found the absolute best molecule within a defined search space?

Methods

The authors bridge the gap between deep learning and mathematical programming by converting GNN layers into constraints that a standard solver (like Gurobi) can understand:

  • ReLU as Constraints: They use "Big-M" formulations to represent the Rectified Linear Unit (ReLU) activation function as a set of linear inequalities using binary variables.
  • GraphSAGE to MILP: They show that the GraphSAGE architecture can be formulated as a Mixed-Integer Linear Program (MILP). This is efficient because linear problems are generally easier for solvers to handle.
  • GCN to MINLP: Because the Graph Convolutional Network (GCN) uses a normalization term based on node degrees (which change as you change the molecule's structure), it results in a Mixed-Integer Non-Linear Program (MINLP) with bilinear terms.
  • Physics-Informed Constraints: To ensure the solver doesn't suggest "impossible" molecules, they added constraints for:
  • Valency: Atoms must have the correct number of bonds (e.g., Carbon must have 4).
  • Connectivity: The molecule must be one single piece, not a collection of floating atoms.
  • Bond Types: Support for single, double, and triple bonds.
  • Bound Tightening: They adapted Feasibility-Based Bound Tightening (FBBT) to GNNs to help the solver prune the search space faster.

Datasets

The authors evaluated their approach on a dataset of organic molecules and their boiling points.

  • The training data included various organic compounds and refrigerants.
  • The model used a feature set of 14 descriptors per atom (element type, number of neighbors, hydrogen count, etc.).
  • The optimization task was to design molecules with 4 to 8 atoms that maximize or minimize boiling points.

Key Insights and Ideas

  • Linearity vs. Complexity: Surprisingly, even though GraphSAGE generates more constraints than GCN, it is often faster to solve because its formulation is purely linear (MILP), whereas GCN requires bilinear terms (MINLP).
  • Beyond the Training Set: The optimization successfully "discovered" molecules that were not in the original training data but are known to exist in reality.
  • The "Aha" Moment on Scalability: While GNNs are great at processing large graphs, optimizing over them is computationally expensive. The complexity grows with the number of nodes ($n$) and neurons ($n_k$), specifically $O(n^2 n_k)$ for GraphSAGE.
  • Global vs. Heuristic: In 83% of test cases, a standard Genetic Algorithm found a solution as good as the MILP solver in under two minutes. However, for the remaining 17%, the GA got stuck, proving the value of the deterministic MILP approach for finding true global optima.

Key Results

  • Discovery: The system generated 20 unique molecular structures. 12 were experimentally known, 2 were previously identified in literature as "hypothetical" (stable only under high pressure), and 6 appear to be novel candidates.
  • Accuracy: The GNNs achieved a mean absolute error (MAE) of approximately 6.65 K on boiling point predictions.
  • Solver Performance: For small molecules (4 atoms), the solver found optimal solutions in seconds to minutes. For larger molecules (8 atoms), the solver struggled to reach 0% optimality gap within 10 hours, highlighting the "curse of dimensionality" in discrete molecular spaces.

Limitations and Future Work

  • Scalability: The current approach is limited to relatively small molecules (up to ~8-10 atoms). Designing large proteins or complex polymers would currently be computationally prohibitive.
  • Steric Hindrance: The model currently ignores 3D spatial constraints (steric hindrance), meaning it might suggest molecules that are mathematically valid but physically strained or impossible to synthesize.
  • Future Directions: The authors suggest incorporating Optimisation-Based Bound Tightening (OBBT) and exploring more complex GNN layers (like Attention mechanisms) to improve both the speed and the accuracy of the molecular design process.

Summary updated

BibTeX
@article{mcdonald2024mixed,
  author = {Tom McDonald and Calvin Tsay and Artur M. Schweidtmann and Neil Yorke-Smith},
  title = {{Mixed-integer optimisation of graph neural networks for computer-aided molecular design}},
  journal = {Comput. Chem. Eng.},
  year = {2024},
  doi = {10.1016/j.compchemeng.2024.108660},
}
Figure