Analysis of (1+1) EA on LeadingOnes with Constraints

Tobias Friedrich, Timo Kötzing, Aneta Neumann, Frank Neumann, Aishwarya Radhakrishnan

Abstract

This paper presents the first rigorous runtime analysis of simple evolutionary algorithms (EAs) applied to the LeadingOnes benchmark under cardinality and stochastic constraints. We investigate how the (1+1) EA behaves when restricted by a fixed budget of ones and how it responds to noisy constraint evaluations. Our findings include a tight mathematical bound for the deterministic case and a demonstration of the "sawtooth" failure pattern in stochastic environments. Crucially, we show that a modest increase in population size, specifically moving to a (10+1) EA, provides a necessary buffer that ensures stability and performance in the presence of noise.

Introduction

In the field of evolutionary computation, the "LeadingOnes" function is a fundamental benchmark used to understand how search heuristics navigate bit-string landscapes. The objective is simple: maximize the number of consecutive ones starting from the beginning of the string. However, real-world optimization problems are rarely unconstrained. Most practical applications involve limits on resources, capacity, or safety, often referred to as constraints.

This research bridges the gap between theoretical understanding and practical application by analyzing how simple EAs handle LeadingOnes when subjected to two types of constraints: cardinality constraints (a fixed budget of ones) and stochastic constraints (where the feasibility of a solution is subject to noise).

Problem Formulation and Methodology

Constraints

The study focuses on two primary constraint models:

  1. Cardinality Constraints: The algorithm must maximize LeadingOnes while ensuring the total number of ones in the bit string does not exceed a budget $B$.
  2. Stochastic (Chance) Constraints: The constraints are "noisy," meaning a solution's feasibility might fluctuate between iterations. This was modeled using Normal distributions for item weights and Uniform distributions for the constraint bounds themselves.

Algorithms

The researchers compared the standard (1+1) EA, which maintains a single parent and generates one offspring, against the (μ+1) EA, which maintains a small population of parents. The goal was to determine if population diversity could mitigate the risks associated with noisy constraint evaluations.

Analytical Tools

To derive formal runtime bounds, the authors employed drift analysis, specifically the additive drift theorem. This allowed them to model the algorithm's progress as a random walk, particularly when the search reaches the boundary of the feasible region.

Theoretical Results: The Deterministic Case

When a cardinality constraint $B$ is introduced, the (1+1) EA faces a unique challenge. Once the budget $B$ is reached, the algorithm cannot simply flip a zero to a one to increase the LeadingOnes count; it must simultaneously flip an existing one to a zero elsewhere to remain feasible. This creates a "boundary random walk."

The authors proved a tight runtime bound for this scenario: $$\Theta(n^2 + n(n-B) \log B)$$

This formula reveals that the difficulty of the problem scales not just with the string length $n$, but also with the distance between the budget and the total length. Interestingly, the research also showed that if the algorithm treats the number of zeros as a secondary objective to be minimized (lexicographic improvement), the runtime simplifies to a clean $\Theta(n^2)$.

Stochastic Constraints and the "Sawtooth" Effect

One of the most significant contributions of this paper is the identification of the "sawtooth" failure pattern in stochastic settings. In a noisy environment, a high-quality solution might be incorrectly flagged as "infeasible" due to a random sample.

For the (1+1) EA, this is catastrophic. Because it only keeps one individual, if that individual is discarded due to a noisy evaluation, the algorithm must fall back to a much earlier, lower-fitness solution. This leads to a fitness plot that rises steadily and then drops sharply—resembling the teeth of a saw—preventing the algorithm from ever reaching the global optimum.

The Population Buffer

The empirical results demonstrate that a small population acts as a vital buffer against this noise. By testing a (10+1) EA, the researchers found that the algorithm could maintain its progress even if one or two high-quality individuals were temporarily misidentified as infeasible.

In experiments with $n=100$ and $B=85$, the (1+1) EA failed to maintain stability, while the (10+1) EA consistently reached and held the maximum possible fitness. This suggests that for constrained optimization, even a tiny increase in population size can lead to a massive increase in robustness.

Conclusion and Future Work

This analysis provides a theoretical foundation for understanding constrained evolutionary search. It highlights that while simple heuristics are effective in deterministic settings, they are highly vulnerable to stochastic constraints. The "sawtooth" effect can be mitigated by introducing a small population, which serves as a form of algorithmic memory.

Future research directions include:

  • Exploring non-linear and more complex constraint types.
  • Developing general rules for scaling population size $\mu$ relative to the variance of the noise.
  • Applying these insights to more sophisticated algorithms like CMA-ES or multi-objective EAs.

Summary updated

BibTeX
@article{friedrich2025analysis,
  author = {Tobias Friedrich and Timo Kötzing and Aneta Neumann and Frank Neumann and Aishwarya Radhakrishnan},
  title = {{Analysis of (1+1) EA on LeadingOnes with Constraints}},
  journal = {Algorithmica},
  year = {2025},
  doi = {10.1007/s00453-025-01298-9},
}
Figure