Pattern Search (Hooke and Jeeves)¶
An implementation of wellknown Hooke and Jeeves Pattern Search [11] for singleobjective optimization which makes use of exploration and pattern moves in an alternating manner. For now, we like to refer to Wikipedia for more information such as pseudo code and visualizations in the search space.
[1]:
from pymoo.algorithms.so_pattern_search import PatternSearch
from pymoo.factory import get_problem
from pymoo.optimize import minimize
problem = get_problem("ackley", n_var=30)
algorithm = PatternSearch()
res = minimize(problem,
algorithm,
seed=1,
verbose=False)
print("Best solution found: \nX = %s\nF = %s" % (res.X, res.F))
Best solution found:
X = [9.27771855e14 2.97851640e14 1.26925499e15 8.91408665e14
1.19684856e14 6.66560896e14 8.11832539e14 8.68501150e14
6.93977971e14 8.47269999e14 1.22541465e13 1.15618649e13
5.49523346e14 4.71786414e14 8.61731588e14 6.07986908e14
1.00688146e13 3.36770408e14 3.38081544e14 8.86496611e14
5.67424639e14 7.34497267e14 7.59578144e14 2.42403699e14
3.69602818e14 6.67519772e14 4.79715018e14 2.70083653e14
1.01982970e13 8.13052041e14]
F = [2.88213897e13]
API¶

class
pymoo.algorithms.so_pattern_search.
PatternSearch
(self, explr_delta=0.25, explr_rho=0.5, pattern_step=2, eps=1e5, display=PatternSearchDisplay(), **kwargs) An implementation of wellknown Hooke and Jeeves Pattern Search.
 Parameters
 x0numpy.array
The initial value where the local search should be initiated. If not provided n_sample_points are created created using latin hypercube sampling and the best solution found is set to x0.
 n_sample_pointsint
Number of sample points to be used to determine the initial search point. (Only used of x0 is not provided)
 explr_deltafloat
The delta values which is used for the exploration move. If lower and upper bounds are provided the value is in relation to the overall search space. For instance, a value of 0.25 means that initially the pattern is created in 25% distance of the initial search point.
 explr_rhofloat
If the move was unsuccessful then the delta value is reduced by multiplying it with the value provided. For instance, explr_rho implies that with a value of delta/2 is continued.
 pattern_stepfloat
After the exploration move the new center is determined by following a promising direction. This value defines how large to step on this direction will be.
 epsfloat
This value is used for an additional termination criterion. When all delta values (maximum move along each variable) is less than epsilon the algorithm is terminated. Otherwise, the default termination criteria are also used.