# Hierarchical Cooperative Co-evolution (HCC)¶

class pypop7.optimizers.cc.hcc.HCC(problem, options)

Hierarchical Cooperative Co-evolution (HCC).

Parameters:
• problem (dict) –

problem arguments with the following common settings (keys):
• ’fitness_function’ - objective function to be minimized (func),

• ’ndim_problem’ - number of dimensionality (int),

• ’upper_boundary’ - upper boundary of search range (array_like),

• ’lower_boundary’ - lower boundary of search range (array_like).

• options (dict) –

optimizer options with the following common settings (keys):
• ’max_function_evaluations’ - maximum of function evaluations (int, default: np.Inf),

• ’max_runtime’ - maximal runtime to be allowed (float, default: np.Inf),

• ’seed_rng’ - seed for random number generation needed to be explicitly set (int);

and with the following particular setting (key):
• ’n_individuals’ - number of individuals/samples, aka population size (int, default: 100).

• ’sigma’ - initial global step-size (float, default: problem[‘upper_boundary’] - problem[‘lower_boundary’]/3.0),

• ’ndim_subproblem’ - dimensionality of subproblem for decomposition (int, default: 30).

Examples

Use the optimizer to minimize the well-known test function Rosenbrock:

``` 1>>> import numpy
2>>> from pypop7.benchmarks.base_functions import rosenbrock  # function to be minimized
3>>> from pypop7.optimizers.cc.hcc import HCC
4>>> problem = {'fitness_function': rosenbrock,  # define problem arguments
5...            'ndim_problem': 2,
6...            'lower_boundary': -5*numpy.ones((2,)),
7...            'upper_boundary': 5*numpy.ones((2,))}
8>>> options = {'max_function_evaluations': 5000,  # set optimizer options
9...            'seed_rng': 2022,
10...            'x': 3*numpy.ones((2,))}
11>>> hcc = HCC(problem, options)  # initialize the optimizer class
12>>> results = hcc.optimize()  # run the optimization process
13>>> # return the number of function evaluations and best-so-far fitness
14>>> print(f"HCC: {results['n_function_evaluations']}, {results['best_so_far_y']}")
15HCC: 5000, 0.0006576371426980234
```

For its correctness checking of coding, we cannot provide the code-based repeatability report, since this implementation combines two different papers. To our knowledge, few well-designed open-source code of CC is available for non-separable black-box optimization.

n_individuals

number of individuals/samples, aka population size.

Type:

int

sigma

initial global step-size.

Type:

float

ndim_subproblem

dimensionality of subproblem for decomposition.

Type:

int

References

Mei, Y., Omidvar, M.N., Li, X. and Yao, X., 2016. A competitive divide-and-conquer algorithm for unconstrained large-scale black-box optimization. ACM Transactions on Mathematical Software, 42(2), pp.1-24. https://dl.acm.org/doi/10.1145/2791291

Gomez, F.J. and Schmidhuber, J., 2005, June. Co-evolving recurrent neurons learn deep memory POMDPs. In Proceedings of Annual Conference on Genetic and Evolutionary Computation (pp. 491-498). ACM. https://dl.acm.org/doi/10.1145/1068009.1068092