A multimodal problem has an objective-function landscape with more than one optimum. Unlike a unimodal landscape, it contains multiple valleys or peaks, so a search may find a local optimum rather than the global optimum. section 2.1.2
Use these distinctions when describing an optimization landscape:
- Unimodal problems have one clear global optimum. section 2.1.2
- Multimodal problems contain multiple optima and may challenge local search. section 2.1.2
- Deceptive functions contain a narrow global minimum and a broad, competitive local minimum that can attract algorithms. section 2.1.2
A plotted multimodal function
The function sin(x) × cos(y) produces a three-dimensional landscape with repeated peaks and valleys. Plotting it alongside unimodal and deceptive functions makes the landscape differences visible. section 2.1.2
Listing 2.1 Examples of objective functions
import numpy as np
import math
import matplotlib.pyplot as plt
def objective_unimodal(x, y): #1
return x**2.0 + y**2.0
def objective_multimodal(x, y): #2
return np.sin(x) * np.cos(y)
def objective_deceptive(x, y): #3
return (1-(abs((np.sin(math.pi*(x-2))*np.sin(math.pi*(y-2)))/
(math.pi*math.pi*(x-2)*(y-2))))**5)*(2+(x-7)**2+2*(y-7)**2)
fig = plt.figure(figsize = (25,25))
ax = fig.add_subplot(1,3,1, projection='3d')
x = np.arange(-3, 3, 0.01)
y = np.arange(-3, 3, 0.01)
X, Y = np.meshgrid(x, y)
Z = objective_unimodal(X, Y)
surf = ax.plot_surface(X, Y, Z, cmap=plt.cm.cividis)
ax.set_xlabel('x', fontsize=15)
ax.set_ylabel('y', fontsize=15)
ax.set_zlabel('Z', fontsize=15)
ax.set_title("Unimodal/Convex function", fontsize=18)
ax = fig.add_subplot(1,3,2, projection='3d')
Z = objective_multimodal(X, Y)
surf = ax.plot_surface(X, Y, Z, cmap=plt.cm.cividis)
ax.set_xlabel('x', fontsize=15)
ax.set_ylabel('y', fontsize=15)
ax.set_zlabel('Z', fontsize=15)
ax.set_title("Multimodal function", fontsize=18)
X, Y = np.meshgrid(x, y)
Z = objective_unimodal(X, Y)
ax = fig.add_subplot(1,3,3, projection='3d')
Z = objective_deceptive(X, Y)
surf = ax.plot_surface(X, Y, Z, cmap=plt.cm.cividis, antialiased=False)
ax.set_xlabel('x', fontsize=15)
ax.set_ylabel('y', fontsize=15)
ax.set_zlabel('Z', fontsize=15)
ax.set_title("Deceptive function", fontsize=18)
plt.show()
#1 Unimodal function
#2 Multimodal function
#3 Deceptive function
Inspect the Python listing to compare objective-function definitions and generate three-dimensional landscape plots. section 2.1.2
