How do I evaluate my objective function in parallel while using gamultiobj in matlab for multiobjective optimization?
3 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
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!
0 Comments
See Also
Categories
Find more on Multiobjective Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!