Abstract
Combining machine learning and constrained optimization, Predict+Optimize (P+O) tackles optimization problems containing parameters that are unknown at the time of solving. Prior works focus on cases with unknowns only in the objectives. A new framework was recently proposed to cater for unknowns also in constraints by introducing a loss function, called Post-hoc Regret, that takes into account the cost of correcting an unsatisfiable prediction. Since Post-hoc Regret is non-differentiable, the previous work computes only its approximation. While the notion of Post-hoc Regret is general, its specific implementation is applicable to only packing and covering linear programming problems. In this paper, we first show how to compute Post-hoc Regret exactly for any optimization problem solvable by a recursive algorithm satisfying simple conditions. Experimentation demonstrates substantial improvement in the quality of solutions as compared to the earlier approximation approach. Furthermore, we show experimentally the empirical behavior of different combinations of correction and penalty functions used in the Post-hoc Regret of the same benchmarks. Results provide insights for defining the appropriate Post-hoc Regret in different application scenarios.
Introduction
In the field of Predict+Optimize (P+O), the goal is to train machine learning models that produce predictions specifically tailored to yield the best possible downstream decisions. Traditionally, research in this area has focused on scenarios where the uncertainty lies within the objective function. However, many real-world applications involve uncertainty in the constraints—the rules that define what constitutes a valid solution. For example, a transit authority must schedule departures based on passenger demand that is not fully known until the day of travel.
A major challenge in P+O with unknown constraints is that a prediction error can lead to an infeasible solution. To address this, researchers introduced the concept of Post-hoc Regret (PHR), which quantifies the "cost" of a prediction by measuring the effort required to correct an infeasible solution into a feasible one, plus any loss in the objective value. Because PHR is mathematically non-differentiable and piecewise constant, previous attempts to optimize it relied on rough approximations. This paper introduces Branch & Learn with Post-hoc Correction (B&L-C), the first framework to compute and optimize PHR exactly.
The B&L-C Framework
The B&L-C framework extends the "Branch & Learn" methodology, which was originally designed for unknown objectives, to handle unknown constraints. The framework operates on the principle that for many combinatorial problems, the relationship between predicted parameters and the resulting optimal solutions can be mapped as piecewise linear or constant functions.
Exact Computation vs. Approximation
Unlike gradient-based methods that struggle with the "jumpy" nature of discrete optimization, B&L-C uses a coordinate descent approach. It treats the optimization problem as a function of the model's weights, allowing the learner to identify exactly how a change in weights will trigger a shift from one discrete decision to another. This exactness eliminates the errors introduced by the smoothing or relaxation techniques used in earlier approximation methods like IntOpt-C.
Correction and Penalty Mechanisms
A critical component of B&L-C is the post-hoc correction step. When a predicted constraint leads to an infeasible solution, the framework applies a Correction Function (e.g., removing items from a knapsack until it fits) and a Penalty Function (e.g., a cost associated with each removed item). The paper demonstrates that the choice of these functions fundamentally influences the model's predictive behavior and final performance.
Experimental Evaluation
The authors evaluated B&L-C against standard regression (MSE) and state-of-the-art approximation methods across three classic optimization problems:
- Maximum Flow Problem (MFP): Using real-world network topologies (POLSKA, USANet, GÉANT) with unknown edge capacities.
- 0-1 Knapsack: Using data from the ICON scheduling competition to simulate unknown item weights.
- Minimum Cost Vertex Cover (MCVC): Using ABILENE and PDH graph datasets with unknown costs and edge values.
Key Findings
- Superior Solution Quality: B&L-C significantly outperformed approximation-based methods. In Max Flow experiments, it achieved 6% to 13% lower regret than IntOpt-C. In the 0-1 Knapsack problem, B&L-C reduced regret by 29% to 55% compared to standard baselines.
- The Importance of Correction Strategy: The experiments revealed that how one chooses to "fix" a solution during training matters. For the Knapsack problem, different heuristics for removing items (e.g., value-to-weight ratio vs. weight alone) led to different levels of model robustness.
- Computational Trade-offs: The precision of B&L-C comes at a computational cost. For instance, on the USANet topology, B&L-C took 411 seconds to train compared to 132 seconds for approximation methods. This positions B&L-C as a high-quality solution for scenarios where decision accuracy is more critical than training speed.
Conclusion and Future Work
This research demonstrates that exact computation of Post-hoc Regret is not only possible for recursive optimization algorithms but also highly effective. By moving beyond approximations, B&L-C provides a more reliable bridge between machine learning predictions and constrained optimization.
Future research directions include improving the scalability of the coordinate descent approach to handle larger industrial-scale problems and developing automated methods for selecting optimal correction and penalty functions for specific domains. Additionally, extending the framework to non-recursive optimization algorithms remains an open and promising challenge.
Summary updated