Abstract
This paper presents the first rigorous computational complexity analysis of Genetic Programming (GP) applied to the sorting problem, a task characterized by dependent semantics. We analyze the (1+1) GP* algorithm using various fitness measures. Our results demonstrate that while the inversion-based fitness measure (INV) leads to polynomial optimization time, other common measures like Hamming distance (HAM) can result in exponential or infinite optimization times due to local optima caused by tree redundancy.
Introduction
Genetic Programming (GP) has proven effective in various domains, yet its theoretical foundations remain underdeveloped compared to other evolutionary algorithms. Most existing complexity analyses focus on problems with "isolated" semantics, where the contribution of a program component to overall fitness is independent of other components. This paper addresses this gap by examining the sorting problem, where the semantics of an element are inherently dependent on its position relative to others.
The (1+1) GP* Framework
The researchers employ a simplified (1+1) GP algorithm, a hill-climber that maintains a single tree-based program. In each iteration, it generates a child via the HVL-mutate'* operator. This operator can insert a new leaf, delete an existing leaf, or substitute one leaf for another.
A crucial aspect of the representation is the "expression" mechanism. A tree is converted into a list via in-order traversal, but only the first occurrence of any value is included in the final permutation. This allows for redundancy in the tree structure, which significantly impacts the search dynamics.
Fitness Measures and Complexity
The paper evaluates several fitness measures to determine the expected optimization time—the number of iterations required to reach the optimal sorted permutation $(1, 2, \dots, n)$:
- INV (Inversions): Counts the number of pairs in the incorrect relative order.
- HAM (Hamming Distance): Counts elements not in their exact correct spot.
- RUN, LAS, EXC: Other common measures of sortedness.
| Fitness Measure | Expected Optimization Time | Result Type |
|---|---|---|
| INV | $O(n^3 T_{max})$ | Polynomial |
| HAM, RUN, LAS, EXC | $\infty$ (Single-mutation) / $e^{\Omega(n)}$ (Multi-mutation) | Exponential/Infinite |
Note: $n$ is the number of elements, and $T_{max}$ is the maximum tree size reached.
The authors also established general lower bounds: regardless of the fitness measure, the GP requires at least $\Omega(n^2)$ steps if deletion is not allowed, and $\Omega(n)$ if it is. The polynomial bound for INV suggests it provides a sufficiently smooth fitness landscape. Conversely, measures like HAM create "flat" regions or local optima where the algorithm can become trapped.
The Impact of Redundancy and Bloat
A major finding is the "redundancy trap." Because GP can include multiple copies of the same variable, a tree can accumulate "bloat." For instance, if a tree contains many copies of a value that needs to be moved, the algorithm may need to perform a sequence of specific mutations to remove all redundant copies before progress can be made.
This phenomenon explains why single-mutation GP can fail completely (infinite time) on certain landscapes, while multi-mutation GP (using a Poisson distribution for the number of mutations) has a non-zero, albeit exponentially small, probability of escaping such traps by deleting multiple redundant nodes simultaneously.
Conclusion
This work establishes a theoretical baseline for GP on problems with dependent semantics. It highlights that the flexibility of tree-based representations comes with the risk of redundancy-induced local optima. Future research should investigate whether population-based GP or alternative mutation operators can mitigate these effects in more complex problem domains.
Summary updated