Differentiation of Blackbox Combinatorial Solvers
Marin Vlastelica, Anselm Paulus, Vít Musil, Georg Martius, Michal Rolínek
TL;DR
The paper presents a principled method to differentiate through blackbox combinatorial solvers with linear objectives by introducing a continuous interpolation, f_lambda, that yields informative gradients for training. It enables backpropagation through exact solvers such as Gurobi, Blossom V, and Dijkstra by solving a perturbed input in a single forward pass during the backward step. The authors provide theoretical justifications and validate the approach on three tasks—shortest path, globe TSP, and MNIST-based min-cost matching—demonstrating strong generalization and learning capabilities beyond standard neural nets. This fusion of neural networks with classical combinatorial algorithms offers a practical pathway to end-to-end learning in problems with large combinatorial structure and global constraints.
Abstract
Achieving fusion of deep learning with combinatorial algorithms promises transformative changes to artificial intelligence. One possible approach is to introduce combinatorial building blocks into neural networks. Such end-to-end architectures have the potential to tackle combinatorial problems on raw input data such as ensuring global consistency in multi-object tracking or route planning on maps in robotics. In this work, we present a method that implements an efficient backward pass through blackbox implementations of combinatorial solvers with linear objective functions. We provide both theoretical and experimental backing. In particular, we incorporate the Gurobi MIP solver, Blossom V algorithm, and Dijkstra's algorithm into architectures that extract suitable features from raw inputs for the traveling salesman problem, the min-cost perfect matching problem and the shortest path problem. The code is available at https://github.com/martius-lab/blackbox-backprop.
