This submission contains standard implementations of GA and PSO for minimizing the Himmelblau function. This function has 2 decision variables and is mutli-modal, i.e. it has 4 known minima within the bounds [-5, 5]. Thus, the answer would be any one among the 4 minima, and is different each time the codes are run.
The outputs of PSOHimmel.m and GAHimmel.m are:
1. Plot of worst, average, and best solutions against the elapsed iterations.
2. Plot of all candidates as a moving scatter plot on the search space.
3. Global minima where the run has converged.
Karl Ezra Pilario (2021). Minimizing the Himmelblau Function using GA and PSO (https://www.mathworks.com/matlabcentral/fileexchange/65811-minimizing-the-himmelblau-function-using-ga-and-pso), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.