CombOptNet: Fit the Right NP-Hard Problem by Learning Integer Programming Constraints
Anselm Paulus, Michal Rolínek, Vít Musil, Brandon Amos, Georg Martius
TL;DR
CombOptNet introduces a differentiable ILP layer that backpropagates through the solver to learn both cost terms and constraints, enabling end-to-end training for discrete optimization problems. The method constructs informative gradients for constraint updates via a descent-direction framework, a generalized active-set proxy, and a basis of integer neighbor directions, while representing constraints with learnable hyperplane parameters to preserve geometric meaning. It demonstrates strong performance across synthetic tasks (random constraints, weighted set covering, knapsack described by sentences) and a real-world deep keypoint matching task, often outperforming LP-relaxation baselines and approaching state-of-the-art dedicated solvers. The results highlight the potential of embedding universal combinatorial reasoning into neural architectures, enabling problem-specific learning of NP-hard formulations from raw data with practical implications for vision and language tasks.
Abstract
Bridging logical and algorithmic reasoning with modern machine learning techniques is a fundamental challenge with potentially transformative impact. On the algorithmic side, many NP-hard problems can be expressed as integer programs, in which the constraints play the role of their "combinatorial specification." In this work, we aim to integrate integer programming solvers into neural network architectures as layers capable of learning both the cost terms and the constraints. The resulting end-to-end trainable architectures jointly extract features from raw data and solve a suitable (learned) combinatorial problem with state-of-the-art integer programming solvers. We demonstrate the potential of such layers with an extensive performance analysis on synthetic data and with a demonstration on a competitive computer vision keypoint matching benchmark.
