Learning Heuristic Selection with Dynamic Algorithm Configuration

David Speck, André Biedenkapp, Frank Hutter, Robert Mattmüller, Marius Lindauer

Abstract

In classical planning, the efficiency of search is heavily dependent on the choice of heuristic. While many heuristics exist, their performance varies significantly across different problem domains. This paper introduces a reinforcement learning approach to heuristic selection by framing it as a Dynamic Algorithm Configuration (DAC) problem. By learning a control policy that selects the most appropriate heuristic at each expansion step based on search dynamics, we demonstrate that dynamic selection can significantly outperform traditional static or round-robin methods, achieving superior coverage and theoretical exponential speedups.

Introduction

Classical planning relies on heuristics to estimate the distance from a given state to the goal. However, no single heuristic is universally optimal; a heuristic that excels in a "Logistics" domain may perform poorly in "Sokoban." To mitigate this, practitioners often employ multiple heuristics. Current state-of-the-art methods typically use Algorithm Selection (choosing one heuristic for the entire problem) or Alternation (cycling through a portfolio of heuristics).

These methods, however, ignore the internal dynamics of the search process. A heuristic's utility may fluctuate as the planner progresses toward the goal. This research addresses the challenge of making "on-the-fly" decisions, trusting different heuristics at different stages of the search to optimize performance.

Methods

The authors model heuristic selection as a DAC task, which is formalized as a contextual Markov Decision Process.

The Dynamic Algorithm Configuration (DAC) framework for heuristic selection, where a control policy adapts parameters based on planner state and reward.

The Learning Agent

A Double Deep Q-Network (DDQN) is employed to learn the control policy. To ensure the agent is domain-agnostic in its observations, it does not look at raw planning states. Instead, it observes "search dynamics" features, including the minimum, maximum, mean, and variance of heuristic values within the current open lists, as well as the temporal changes in these values.

Actions and Rewards

At each step, the agent selects one of four heuristics—$h_{ff}$, $h_{cg}$, $h_{cea}$, or $h_{add}$—to expand the next node. The reward signal is a simple "speed-trap": the agent receives -1 for every expansion step. To maximize the total reward, the agent must reach the goal in the fewest steps possible.

Experimental Setup

The approach was evaluated on six domains from the International Planning Competition (IPC): Barman, Blocksworld, Childsnack, Rovers, Sokoban, and VisitAll. For each domain, 200 unique problems were generated, with an even split between training and testing sets to evaluate the agent's ability to generalize strategies to unseen instances within the same domain.

Key Insights and Theoretical Results

Mathematically, the authors prove that DAC is a generalization of existing selection methods. An optimal DAC policy is guaranteed to perform at least as well as the best static selection or alternating schedule. Furthermore, they provide a theoretical proof that for specific planning tasks, a dynamic policy can be exponentially faster than any static policy by detecting search "traps" and switching to more informative heuristics.

t-SNE visualization of learned policies, showing distinct clusters by domain (a) and varying switching frequencies (b).

Analysis of the learned policies reveals "domain-specific personalities." For instance, in Sokoban, the agent learned to rely almost exclusively on $h_{ff}$. Conversely, in Barman, the agent developed a hybrid strategy, switching heuristics in approximately 28% of steps. This suggests that the RL agent successfully identifies when a domain requires a singular focus versus a diverse heuristic approach.

Results

The RL-based dynamic selection consistently outperformed baseline strategies on test instances:

  • Coverage: The RL agent achieved a total coverage score of 505.1, surpassing the standard Alternation strategy (488.2) and the best single heuristic (425.0 for $h_{ff}$).
  • Performance Gains: The most significant improvement occurred in Blocksworld, where the RL policy solved 92.9 instances compared to 83.7 for the alternating policy.
  • Surpassing the Oracle: Notably, the RL policy often outperformed a "Best-of-Portfolio" Oracle. This indicates that switching heuristics during the search provides a fundamental advantage over selecting the single best heuristic at the start of the search.

Conclusion and Future Work

While the results demonstrate the power of DAC in planning, several challenges remain. Currently, policies are domain-dependent, requiring separate training for each problem type. Future research will focus on developing domain-independent policies capable of zero-shot generalization to new domains. Additionally, reducing the computational overhead of the agent-planner communication and improving generalization to prevent overfitting in complex domains like Rovers are key priorities for future iterations of this framework.

Summary updated

BibTeX
@inproceedings{speck2021learning,
  author = {David Speck and André Biedenkapp and Frank Hutter and Robert Mattmüller and Marius Lindauer},
  title = {{Learning Heuristic Selection with Dynamic Algorithm Configuration}},
  booktitle = {ICAPS},
  year = {2021},
  url = {https://openreview.net/forum?id=WvXSReP6CIg},
}
Figure