NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

The (Un)Scalability of Heuristic Approximators for NP-Hard Search Problems

Sumedh Pendurkar, Taoan Huang, Sven Koenig, Guni Sharon

TL;DR

Recent work has used deep neural networks to learn heuristic functions that guide $A^*$ search for NP-hard combinatorial optimization problems. This paper demonstrates—both theoretically and empirically—that approximating the optimal heuristic with high precision requires neural network sizes that scale exponentially with problem instance size, suggesting that simply training bigger models to approximate optimal costs cannot scale to large combinatorial problems.

What Problem Does This Paper Address?

The $A^*$ algorithm is a cornerstone of combinatorial search. When provided with the completely informed heuristic $h^*(s)$—which outputs the exact remaining cost to reach the goal—$A^*$ runs in time polynomial in the branching factor and solution path length, effectively bypassing combinatorial explosion.

Because of this property, recent high-profile approaches (such as DeepCubeA) train deep neural networks as universal function approximators to predict $h^*(s)$. However, this raises a fundamental theoretical tension: if an NP-hard problem could be solved in polynomial time using an exact or near-exact heuristic, then evaluating that heuristic must itself be NP-hard (unless $\text{P} = \text{NP}$). Since feedforward neural network inference runs in time polynomial in the number of network parameters, this implies that a neural network computing high-precision heuristics cannot remain polynomial in size. The authors set out to investigate whether and how network sizes blow up in practice across varying problem sizes.

Methods

The authors evaluate how model complexity scales when fitting $h^*(s)$:

  • Theoretical Formulation: Under standard reductions where edge costs are discrete multiples of $\epsilon > 0$ and the branching factor and path length grow polynomially, any heuristic approximation within precision $p < \epsilon/2$ yields the exact cost. Hence, computing such an approximation in polynomial time would imply $\text{P} = \text{NP}$.
  • Network Topologies: They test two standard universal approximation architectures:
  • Fixed-depth: 1 hidden layer with variable width (number of neurons).
  • Fixed-width: Hidden layer width fixed to input dimension plus 3, with variable depth (number of layers) and residual connections.
  • Search for Minimal Model Size: Using binary search paired with the Adam optimizer (up to 300 epochs, repeated across 5 runs), the authors find the smallest parameter count that achieves a predefined loss threshold on the training set.
  • Loss Variations: They benchmark standard Mean Squared Error (MSE), classification via categorical cross-entropy, and a relative "scaled loss" reflecting suboptimality in $A^*$.

Datasets

The authors benchmarked three classic NP-hard minimum-cost path problems:

  1. Pancake Sorting ("Pancake"): Flipping prefixes of stacked pancakes to sort them. Training states were generated via random walks backward from the goal, with ground-truth $h^*$ computed via $A^*$ using the landmark gap heuristic.
  2. Travelling Salesperson Problem ("TSP"): Asymmetric TSP on complete directed graphs with uniformly sampled edge weights ($\epsilon = 0.1$). Ground-truth tour costs were computed using the Held–Karp dynamic programming algorithm (evaluating start states).
  3. Blocks World ("BW"): Moving numbered blocks between stacks and a table to reach an ordered single-stack configuration. Ground-truth values were computed via $A^*$.

For each instance size, datasets contained 1,000,000 states (80% train, 20% test).

Key Insights and Ideas

  • Exponential Parameter Growth (Phase 1): Across all three problems, the minimum number of parameters required to meet a fixed training loss threshold grows linearly on a logarithmic scale relative to instance size, reflecting exponential growth.
  • Stagnation and Generalization Breakdown (Phase 2): For Pancake (around size 12) and TSP (around size 7), parameter scaling plateaus because models stop being able to fit the training set within epoch budgets. Simultaneously, test loss explodes. Because the state space grows factorially/exponentially, the fixed sample of 1M states covers a vanishingly small fraction of states, and the networks fail to generalize to unseen states.
  • Robust Across Architectures and Losses: This exponential scaling trend is structural: it persists regardless of whether models are scaled by width or depth, and whether trained using regression, classification, or relative error losses.

Key Results

  • Parameter Explosion: For fixed-depth networks on TSP, increasing problem size from 4 to 7 cities drove the required parameters from roughly $10^2$ to over $10^5$. On Pancake, scaling from 4 to 12 pancakes increased required parameters from $\sim 10^2$ to nearly $10^5$.
  • Generalization Failure: In TSP, as instance size exceeded 7, test error increased sharply from below $0.5$ to over $1.75$ MSE despite training error remaining below the $0.35$ threshold.
  • Consistency Across Thresholds: Loosening the loss threshold shifted the parameter curve downward (fewer parameters needed for coarser targets), but the exponential slope persisted across all thresholds tested.

Limitations and Future Work

  • Computational Bottlenecks: For Blocks World, instances beyond size 12 could not be verified due to the exponential cost of generating ground-truth $h^*$ labels with exact solvers.
  • Simplified TSP Sampling: The TSP experiments evaluated only the start states of tours rather than arbitrary intermediate search states.
  • Alternative ML-Search Integrations: The findings specifically target universal function approximators trying to predict high-precision, optimal heuristics across broad state spaces. The authors suggest future research should pivot away from learning complete heuristics to other paradigms, such as learning search policies, coarse inadmissible heuristics, or machine-learning-guided search space pruning.

Summary updated

BibTeX
@inproceedings{pendurkar2022un,
  author = {Sumedh Pendurkar and Taoan Huang and Sven Koenig and Guni Sharon},
  title = {{The (Un)Scalability of Heuristic Approximators for NP-Hard Search Problems}},
  booktitle = {ICBINB @ NeurIPS},
  year = {2022},
  url = {https://openreview.net/forum?id=33wyZ4xTIx},
}
Figure