End-to-End Learning for Optimization via Constraint-Enforcing Approximators

Rares Cristian, Pavithra Harsha, Georgia Perakis, Brian Leo Quanz, Ioannis SpantidakisAAAI 2023

Abstract

In many real-world applications, predictive methods are used to provide inputs for downstream optimization problems. It has been shown that using the downstream task-based objective to learn the intermediate predictive model is often better than using only intermediate task objectives, such as prediction error. The learning task in the former approach is referred to as end-to-end learning. The difficulty in end-to-end learning lies in differentiating through the optimization problem. Therefore, we propose a neural network architecture that can learn to approximately solve these optimization problems, particularly ensuring its output satisfies the feasibility constraints via alternate projections. We show these projections converge at a geometric rate to the exact projection. Our approach is more computationally efficient than existing methods as we do not need to solve the original optimization problem at each iteration. Furthermore, our approach can be applied to a wider range of optimization problems. We apply this to a shortest path problem for which the first stage forecasting problem is a computer vision task of predicting edge costs from terrain maps, a capacitated multi-product newsvendor problem, and a maximum matching problem. We show that this method out-performs existing approaches in terms of final task-based loss and training time.

Introduction

The "predict-then-optimize" framework is a cornerstone of modern industrial decision-making. In this paradigm, machine learning models forecast parameters—such as future demand or travel times—which then serve as inputs for downstream optimization tasks like inventory management or vehicle routing. Traditionally, these stages are decoupled: the predictive model is trained to minimize a statistical error (e.g., Mean Squared Error), while the optimizer treats these predictions as ground truth.

However, statistical accuracy does not always translate to decision quality. End-to-end (E2E) learning addresses this by training the predictive model directly on the final "task loss" (the actual cost of the decision). The primary hurdle is the non-differentiability of many optimization solvers. For instance, Linear Programming (LP) solutions often jump between vertices, resulting in gradients that are zero or undefined, which breaks standard backpropagation. Existing E2E workarounds are often computationally expensive because they require solving the full optimization problem at every training step.

Methodology: The ProjectNet Architecture

To overcome these challenges, we introduce ProjectNet, a differentiable, recurrent-style neural network that learns to approximate optimization solutions while strictly respecting feasibility constraints. By replacing expensive, non-differentiable solvers with a differentiable approximator, ProjectNet enables faster training and better decision quality.

The end-to-end learning pipeline using ProjectNet as a differentiable, constraint-enforcing optimizer.

Learned Update Rule and Iterative Refinement

ProjectNet functions as a "smart" version of Projected Gradient Descent (PGD). While standard PGD moves in the direction of the cost gradient, ProjectNet utilizes a learned update layer ($L$) to determine the optimal search direction based on the current state and predicted parameters. The model runs for a fixed number of iterations $T$. Crucially, we found that the model can be trained on a small number of steps ($T_0$) and then extrapolated during inference ($T_1 > T_0$) to achieve higher precision.

Constraint Enforcement via Dykstra’s Projections

To maintain feasibility, ProjectNet employs Dykstra’s projection algorithm. This method decomposes complex constraint sets into simpler, intersecting convex sets (e.g., equality constraints $Aw=b$ and non-negativity $w \ge 0$). By alternating projections between these sets, the model converges geometrically to a feasible solution.

Geometric illustration of the alternating projection method (Dykstra's algorithm) used in ProjectNet to ensure feasibility.

Experimental Evaluation

We evaluated ProjectNet across three distinct problem domains, demonstrating its efficiency and accuracy:

  • Warcraft Shortest Path: In this computer vision task, the model predicts movement costs from terrain maps. ProjectNet found the optimal path in 83% of test cases, making it competitive with state-of-the-art methods while being 19% faster to train.
  • Capacitated Multi-product Newsvendor: For this supply chain problem involving up to 100 products, ProjectNet was nearly 10x faster than OptNet (52s vs 504s per epoch) while achieving lower average costs.
  • Maximum Matching: Used to compare accuracy against traditional PGD on bipartite graphs, ProjectNet achieved a 12.5% improvement in regret.

Key Insights and Conclusion

ProjectNet demonstrates that perfect optimization is not required during training; instead, a differentiable approximation provides a "smoother" landscape for the predictor to learn from, preventing the "zero gradient" problem. By integrating constraint enforcement directly into the network architecture via Dykstra’s algorithm, ProjectNet offers a scalable and computationally efficient solution for end-to-end learning in complex, constrained environments.

Summary updated

BibTeX
@inproceedings{cristian2023end,
  author = {Rares Cristian and Pavithra Harsha and Georgia Perakis and Brian Leo Quanz and Ioannis Spantidakis},
  title = {{End-to-End Learning for Optimization via Constraint-Enforcing Approximators}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  url = {https://openreview.net/forum?id=aem29UfFs-},
}
Figure