Smart Predict-and-Optimize for Hard Combinatorial Optimization Problems

Jayanta Mandi, Emir Demirovic, Peter J. Stuckey, Tias Guns

In many real-world scenarios, the goal of machine learning is not just to predict a value, but to enable an optimal decision based on that prediction. A logistics company might predict traffic to find the fastest route, or a utility provider might predict energy prices to schedule production. Traditionally, this is handled as a two-stage "Predict-then-Optimize" pipeline: first, a model is trained to minimize prediction error (e.g., Mean Squared Error), and then an optimization algorithm solves the problem using those predictions.

However, standard machine learning models are often "decision-blind." They treat all prediction errors equally, failing to recognize that in optimization, some errors are significantly more costly than others. This paper, presented at AAAI-20, introduces a scalable approach to "decision-aware" learning for complex, NP-hard combinatorial problems.

The Fundamental Flaw of Predict-then-Optimize

The core issue with the traditional pipeline is that the loss functions used to train models, such as Mean Squared Error (MSE), are often poorly correlated with the actual "regret"—the loss in objective value resulting from a sub-optimal decision.

Figure 1: Comparison of MSE and Regret over training epochs. As MSE decreases, the actual decision regret can paradoxically increase, demonstrating the disconnect between prediction accuracy and decision quality.

While the Smart Predict-and-Optimize (SPO) framework was previously proposed to address this by integrating the optimization problem directly into the training loop, it faced a significant scaling challenge. SPO requires solving the optimization problem for every data point in every training epoch. For combinatorial problems—which are often NP-hard—this becomes computationally prohibitive as problem sizes grow.

Methodology: Scaling SPO for Hard Problems

The authors propose several strategies to make SPO practical for large-scale combinatorial tasks:

  1. SPO-relax (The Key Innovation): Instead of solving the full discrete combinatorial problem (e.g., an Integer Program) during training, the model solves its continuous relaxation (a Linear Program). This shifts the computational complexity from exponential to polynomial time. The authors demonstrate that the gradient signal from the relaxation is sufficient to guide the model toward high-quality discrete decisions.
  2. Warmstarting the Learning: The model is pre-trained using standard MSE loss for a few epochs. This provides a "head start" with reasonable predictions before transitioning to the more computationally intensive SPO loss.
  3. Solver Optimization: The training process reuses solutions from previous iterations or the "true" optimal solution to speed up the optimization solver within the training loop.
  4. SPO-gap: For instances where relaxation is insufficient, the authors suggest using solvers with a "gap tolerance," allowing for "good enough" solutions to be returned quickly during the training phase.

Experimental Evaluation

The researchers evaluated their approach on two primary domains:

  • Knapsack Problems: Synthetic instances where item values are predicted based on features, while weights and capacities remain fixed.
  • Energy-Cost Aware Scheduling: Utilizing real-world data from the Irish Single Electricity Market Operator (SEMO), this task involved scheduling 200 tasks across 10 machines with high-resolution time slots (288 per day), representing a significant scaling challenge.

Key Results and Insights

The experiments yielded several critical insights into the behavior of decision-aware models:

  • Relaxation is Informative: Surprisingly, training on a continuous relaxation (SPO-relax) performs almost identically to training on the full discrete problem (SPO-full) in terms of final decision quality.
  • Efficiency and Scalability: SPO-relax is orders of magnitude faster than SPO-full. In large scheduling instances, SPO-relax made training feasible where the full discrete approach would have taken weeks.
Figure 6: Test Regret vs. Training Time for the Weighted Knapsack problem. SPO-relax achieves low regret significantly faster than the full SPO approach, demonstrating its practical scalability.
  • Superior Performance: SPO-relax consistently outperformed both standard MSE-based models and the state-of-the-art Quadratic Programming Task Loss (QPTL) approach. While QPTL uses mathematical smoothing, SPO-relax proved more robust, particularly in high-capacity problems where smoothing can lead to sub-optimal, sparse solutions.

Conclusion

This work represents the first successful demonstration of a predict-and-optimize approach on large-scale combinatorial instances. By leveraging continuous relaxations, the authors bridge the gap between decision-blind machine learning and computationally expensive discrete optimization. The resulting framework allows for the training of models that are both efficient and highly effective at minimizing real-world regret in complex scheduling and resource allocation tasks.

Summary updated

BibTeX
@inproceedings{mandi2020smart,
  author = {Jayanta Mandi and Emir Demirovic and Peter J. Stuckey and Tias Guns},
  title = {{Smart Predict-and-Optimize for Hard Combinatorial Optimization Problems}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i02.5521},
}
Figure