[Paper Review] Differentiation of Blackbox Combinatorial Solvers
This paper proposes a differentiable backpropagation method for blackbox combinatorial solvers with linear objective functions, enabling end-to-end training of neural networks that embed exact solvers like Gurobi, Blossom V, and Dijkstra’s algorithm. The approach computes gradients via continuous interpolation of discrete solutions, achieving exact backward passes with only one additional solver call, and enables training of hybrid models that solve complex problems such as TSP, min-cost matching, and shortest path with state-of-the-art solver performance.
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.
Motivation & Objective
- To enable end-to-end training of neural networks that incorporate exact, unmodified combinatorial solvers as differentiable components.
- To overcome the fundamental challenge of backpropagating through piecewise constant, non-differentiable combinatorial solvers with linear objectives.
- To preserve the optimality and performance of high-quality solvers (e.g., Gurobi, Blossom V) while enabling gradient-based optimization.
- To provide a general method applicable to a wide range of problems, including TSP, min-cost perfect matching, shortest path, and integer programs.
Proposed method
- Introduces a continuous interpolation of discrete solutions using a convex combination of optimal solutions under perturbed weights.
- Derives a gradient of the loss with respect to input weights by leveraging the minimization structure of the combinatorial problem and the subdifferential of the optimal value function.
- Employs a novel mathematical technique based on loss-augmented inference and piecewise constant interpolation to compute gradients without modifying the solver.
- The backward pass requires only one additional call to the blackbox solver, matching the computational cost of the forward pass.
- The method is applicable to any combinatorial problem with a linear objective function, including TSP, min-cost matching, and shortest path.
- The approach is implemented using a hyperparameter λ to control the interpolation, ensuring gradient informativeness while maintaining solver fidelity.
Experimental results
Research questions
- RQ1Can we backpropagate through unmodified, blackbox combinatorial solvers with linear objectives without altering their internal logic or performance?
- RQ2Does the proposed method preserve the optimality and runtime efficiency of high-performance solvers like Gurobi and Blossom V in end-to-end training?
- RQ3Can hybrid neural architectures that embed exact solvers solve complex combinatorial tasks (e.g., TSP on Earth’s surface) that are beyond the reach of standard deep learning models?
- RQ4How does the performance of the method compare when using approximate solvers (e.g., OR-Tools) versus exact ones?
- RQ5What is the impact of the hyperparameter λ on gradient quality and training stability?
Key findings
- The method enables end-to-end training of neural networks that embed exact solvers such as Gurobi, Blossom V, and Dijkstra’s algorithm, achieving state-of-the-art performance on TSP, min-cost matching, and shortest path tasks.
- On the Globe TSP benchmark, the model achieved an average city placement error of 58 ± 7 km for k=40 cities, with the best results aligning closely with ground truth after Procrustes transformation.
- For the MNIST min-cost perfect matching task, the model achieved 100% accuracy on k=8 and k=16 with a fully convolutional network and λ=10.
- On the Warcraft shortest path dataset, the model achieved 99.3% test accuracy on k=30, demonstrating robust generalization to complex, real-world map structures.
- When using the approximate OR-Tools solver, the model achieved 84.4% test accuracy on k=10, approaching the upper bound of 88.6% when fed ground-truth locations, showing that the method is robust to solver suboptimality.
- The method maintains computational efficiency, with the backward pass costing only one additional solver call, matching the forward pass cost.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.