How do I evaluate my objective function in parallel while using gamultiobj in matlab for multiobjective optimization?

3 views (last 30 days)
I am using gamultiobj to do multiobjective optimization (where there are two objectives). The objective function takes some time to evaluate. So, I want to compute my fitness function (or objective function) in parallel. There population size is 100 in my problem. So, the fitness function has to work for 100 different populations which takes a lot of time. How can I compute the fitness function in parallel way? Any tips and suggestions would be appreciated.
Thank you.

Answers (1)

Milan Bansal
Milan Bansal on 6 Oct 2023
Hi Rajan Bhandari,
It is my understanding that you want to compute the objective functions in parallel while using "gamultiobj" solver for Multiobjective Optimization.
Please try using Parallel Computing Toolbox for this task. Refer to the following code for using Parallel Computing Toolbox for "gamultiobj" solver.
pool = parpool() % create parallel pool
options = optimoptions('gamultiobj', 'UseParallel', 'always'); % set options
[x, fval] = gamultiobj(fitnessFunction, numVariables, A, b, Aeq, beq, lb, ub, options);
Please note that for Multiobjective Optimization, solver optimizes several objective functions simultaneously which might require synchronization and communication between the workers leading to slower optimization when using Parallel Computing Toolbox. In such a case set the "UseParallel" option to "never" as shown below.
options = optimoptions('gamultiobj', 'UseParallel', 'never'); % set options
Please refer to the following documentation link to learn more about Multiobjective Optimization.
Please refer to the following documentation link to learn more about Parallel Computing Toolbox.
Hope this helps!

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!