Continuous optimization searches over decision variables that can take real-valued choices, such as vehicle speed, acceleration, or tire pressure. It contrasts with integer, discrete, mixed-integer, and combinatorial optimization. section 2.1.1
Classify a problem by the type and number of its decision variables:
- Use univariate optimization for one continuous variable, bivariate optimization for two, and multivariate optimization for several. section 2.1.1
- Separate continuous problems from integer or discrete problems; combine both variable types in mixed-integer optimization. section 2.1.1
- Recognize combinatorial optimization when solutions are sets, combinations, or permutations rather than real-valued vectors. section 2.1.1
Optimizing Himmelblau’s function
Himmelblau’s function provides a small nonconvex test problem with four identical local minima. Tabu search represents the objective and bounds, explores neighboring continuous solutions, and reports a near-zero solution after tuning iteration count, tabu tenure, neighborhood size, aspiration, and long-term memory. section 6.4
Listing 6.2 Solving Himmelblau’s function using tabu search
import numpy as np
from optalgotools.algorithms import TabuSearch #1
from optalgotools.problems import ProblemBase, ContinuousFunctionBase #2
def Himmelblau(x,y):
return (((x**2+y-11)**2) + (((x+y**2-7)**2))) #3
Himmelblau_bounds = np.asarray([[-6, 6], [-6, 6]]) #4
Himmelblau_obj = ContinuousFunctionBase(Himmelblau, Himmelblau_bounds) #5
ts = TabuSearch(max_iter=100, tabu_tenure=5, neighbor_size=50, use_aspiration=True,
aspiration_limit=2, use_longterm=False, debug=1) #6
ts.run(Himmelblau_obj) #7
#1 Import the generic tabu search solver from optalgotools.
#2 Import the continuous problem base
#3 Define the objective function.
#4 Define the bounds.
#5 Create a continuous function object.
#6 Define the TS solver. Add debug = 1 to print the initial and final solution.
#7 Run the solver.
Use the Python listing to see how a continuous objective, variable bounds, and tabu-search parameters become an executable optimization problem. section 6.4
