Algorithm Portfolio Design: Theory vs. Practice

Carla P. Gomes, Bart Selman

TL;DR

Instead of searching for a single "best" algorithm to solve hard combinatorial problems, why not run a portfolio of them? This paper demonstrates that combining different stochastic search strategies—or even multiple independent runs of the same algorithm—can dramatically reduce both expected runtime and computational risk, providing a rigorous theoretical foundation for the practical success of "random restarts."

What Problem Does This Paper Address?

Solving NP-complete combinatorial search problems (such as scheduling, timetabling, or hardware verification) is notoriously difficult because algorithm runtimes vary wildly across different problem instances, and even across different runs of the same randomized algorithm.

Traditionally, computer scientists try to engineer a single, highly tuned heuristic that dominates the problem space. However, a single algorithm rarely excels across all instances or time horizons. The authors address how to systematically design and evaluate algorithm portfolios—running multiple algorithms or configurations in parallel—to optimize overall performance and minimize the "risk" (variance) of hitting a catastrophic, worst-case runtime.

Methods

The authors use a complete, backtrack-style search procedure as their baseline and evaluate variations of the highly effective First-Fail and Brelaz heuristics for variable selection. They test four distinct strategies based on tie-breaking rules and value assignment:

  1. Brelaz-S: Standard Brelaz with systematic (lexicographical) value selection.
  2. Brelaz-R: Standard Brelaz with random value selection.
  3. R-Brelaz-S: Reverse Brelaz (preferring variables sharing constraints with the smallest number of unassigned variables) with systematic value selection.
  4. R-Brelaz-R: Reverse Brelaz with random value selection.

They mathematically model a portfolio of these algorithms running independently on $N$ processors without interprocess communication. By deriving the joint probability distribution of the portfolio's runtime, they can calculate its expected computational cost and standard deviation (risk).

Datasets

The methods are evaluated on the Quasigroup Completion Problem (QCP), an NP-complete problem from finite algebra that involves filling in the missing entries of a partially completed Latin square (similar to a generalized Sudoku puzzle). QCP is an ideal benchmark because the authors can precisely control both the computational difficulty and the structural complexity by varying the percentage of pre-assigned elements.

Key Insights and Ideas

  • The Dominance Trap: If one algorithm completely dominates another across an entire runtime distribution, combining them into a portfolio offers no benefit. Portfolios only shine when the performance profiles of different strategies cross.
  • Crossing Profiles: The authors discovered that on certain QCP instances, Brelaz-S is exceptionally good at finding solutions very quickly (in under 5 backtracks), but if it fails early, its performance degrades severely. Conversely, R-Brelaz-R is more robust over longer runs. This crossing of profiles creates a prime opportunity for portfolio exploitation.
  • The Processor Shift: The optimal portfolio mix changes dramatically based on the number of available processors. With few processors, you want the robust, long-term winner. With many processors, the optimal strategy shifts entirely to running multiple copies of the algorithm that excels at finding ultra-fast solutions.
  • Demystifying Random Restarts: This analysis provides a clear, decision-theoretic explanation for why "random restarts"—stopping an algorithm early and restarting it with a new random seed—is such a powerful technique in practical SAT and constraint satisfaction solvers.

Key Results

  • Phase Transition: The authors mapped a clear phase transition in QCP difficulty, showing that the median computational cost peaks sharply when approximately 42% of the elements are pre-assigned.
Figure 1: The Complexity of Quasigroup Completion
Figure 2: Phase Transition for the Completion Prob­
  • 2 Processors: The optimal portfolio consists of 2 copies of R-Brelaz-R, minimizing both expected backtracks and risk.
  • 5 Processors: A diverse mix becomes optimal. A portfolio of 2 Brelaz-S and 3 R-Brelaz-R copies lowers the expected runtime with only a minimal increase in risk.
  • 20 Processors: The optimal portfolio shifts completely to running 20 parallel copies of Brelaz-S. Because 20 processors give you 20 chances to hit that "ultra-fast" initial success window, the portfolio completely bypasses Brelaz-S's poor long-term behavior, outperforming a portfolio of the otherwise dominant R-Brelaz-R.

Limitations and Future Work

The primary limitation of this study is that it assumes completely independent parallel runs with zero interprocess communication. The authors note that a more general framework should explore interleaving execution on a single processor and allowing algorithms to share information (such as learned clauses or search space bounds) during execution to further optimize the portfolio's efficiency.

Summary updated

BibTeX
@misc{gomes2013algorithm,
  author = {Carla P. Gomes and Bart Selman},
  title = {{Algorithm Portfolio Design: Theory vs. Practice}},
  year = {2013},
  eprint = {1302.1541},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1302.1541},
}
Figure