To Switch or Not to Switch: Predicting the Benefit of Switching Between Algorithms Based on Trajectory Features

Diederick Vermetten, Hao Wang, Kevin Sim, Emma Hart

Abstract

In black-box optimization, selecting the optimal algorithm for a given problem is a significant challenge. This paper explores "Dynamic Algorithm Selection" (dynAS)—the ability to switch between optimization algorithms mid-run. By calculating landscape features from an algorithm's current search trajectory, we demonstrate that it is possible to predict whether switching to a different solver will improve performance. Our results show that this "on-the-fly" strategy adjustment can effectively navigate changing landscape characteristics, often outperforming the best static algorithm selection.

Introduction

The "No Free Lunch" theorem in optimization implies that no single algorithm is universally superior across all problem types. Traditional approaches to the Algorithm Selection Problem involve choosing a solver a priori. However, the local landscape of an optimization problem often evolves as the search progresses—for instance, transitioning from a rugged global terrain to a smooth valley near the optimum. This paper addresses the challenge of real-time pivoting: determining when and to what algorithm to switch based on data collected during the run.

Methodology

The authors propose a trajectory-based workflow for Dynamic Algorithm Selection (dynAS) consisting of four main components:

  1. Algorithm Portfolio: A diverse set of five algorithms was used, including Covariance Matrix Adaptation Evolution Strategy (CMA-ES), Differential Evolution (DE), and Particle Swarm Optimization (PSO).
  2. Trajectory-Based Features: Instead of expensive pre-run sampling, Exploratory Landscape Analysis (ELA) features are calculated using a sliding window of the most recently visited points (50 to 250 evaluations). This provides an "algorithm's eye view" of the local terrain.
  3. Warm-Starting: To ensure a smooth transition, "warm-starting" mechanisms transfer the best-found points and internal state memory from the active algorithm to the new one.
  4. Predictive Modeling: Random Forest regressors were trained to estimate the "relative benefit" of switching. The models predict how much a new algorithm would improve performance over a fixed horizon (e.g., the next 500 evaluations) compared to continuing with the current solver.

Experimental Setup

The approach was evaluated using the BBOB (Black-Box Optimization Benchmarking) suite, comprising 24 benchmark functions in 10 and 20 dimensions. A "leave-one-function-out" validation strategy was employed to test the model's ability to generalize to unseen problem types.

Results and Discussion

The dynamic switching configurations frequently outperformed the "Virtual Best Solver" (the single best static algorithm for a specific problem). The models successfully captured trends in switching benefits, even when the underlying performance data was noisy.

Convergence plots for the 24 BBOB benchmark functions, showing the performance of various algorithms and switching strategies.

Key insights include:

  • Feature Importance: SHAP value analysis revealed that the importance of specific trajectory features is context-dependent, varying based on the target algorithm.
  • Efficiency: "Cheap" ELA features, which require no additional function evaluations beyond the search itself, were sufficient for accurate predictions, making the method computationally viable for real-time applications.
  • Switching Costs: While beneficial, switching often incurs a minor "performance hit" as the new algorithm adjusts its internal state to the inherited data.

Conclusion

This research demonstrates that search trajectories contain sufficient information to characterize local landscapes and guide dynamic algorithm selection. Future work will focus on developing fully online policies with multiple switching points and integrating Reinforcement Learning to optimize switching logic further.

Summary updated

BibTeX
@inproceedings{vermetten2023switch,
  author = {Diederick Vermetten and Hao Wang and Kevin Sim and Emma Hart},
  title = {{To Switch or Not to Switch: Predicting the Benefit of Switching Between Algorithms Based on Trajectory Features}},
  booktitle = {EvoApplications@EvoStar},
  year = {2023},
  doi = {10.1007/978-3-031-30229-9\_22},
}
Figure