In this tutorial I will show how to use Simulated Annealing for minimizing the Booth’s test function. Simulated Annealing is one of the most famous optimization algorithms that has been also implemented in MATLAB as a built-in function. The Booth’s test function is a famous test function for evaluating single objective optimization algorithms. It has two inputs ans one output. It is also bounded in range [-10 10] and the minimum is at [1 3]. By knowing the minimum point we can test the algorithm.

In this tutorial, I show implementation of the Booth’s single-objective test problem and optimize it using the built-in Simulated Annealing in MATLAB. The given objective function is a standard test function that helps a beginner user to understand the basic concept of optimization in MATLAB easier. The given objective function or fitness function has one vector input including ‘n=2’ variables and one output (objective values). I write two separate functions one for the fitness function and one for the main algorithm. I plot the best value function that illustrates the best value for the obtained solutions in a proper way. We use different setting of the algorithm using the ‘optimoptions’ function.

optimizing multi-objective ZDT1 test problem with 30 variables using Genetic Algorithm:

optimizing multi-objective ZDT1 test problem using Genetic Algorithm:

A simple optimization using Genetic Algorithm:

A simple constrained optimization using Genetic Algorithm:

A simple multi-objective optimization using Genetic Algorithm:

A mixed-integer optimization using Linear Programming:

A simple single-objective optimization using Particle Swarm Optimization Algorithm:

A simple single-objective optimization using Pattern Search: