Hello everyone and welcome!

In this post, I’m going to show you a simple but very effective method to solve multi-objective optimization problems in Matlab.  It’s very easy to use this method and minimum programming skill is required.

This method is based on multi-objective optimization genetic algorithm solver in Matlab. If you want to download this Matlab code, go down to the end of the post.

In this video, we use unconstrained optimization problem to test its performance. For those who are interested in constrained multi-objective optimization, please check other videos related to multi-objective optimization on this channel.

Here are the details of the test function:

Let’s see how this multi-objective optimization genetic algorithm solver works.

For more videos like this, check my YouTube channel here.

Matlab code:

multi_objective_function.m

function Output = multi_objective_function(Input)

x1 = Input(1); % variable 1
x2 = Input(2); % variable 2
x3 = Input(3); % variable 3

F1 = 1 - exp(-((x1 - 1/sqrt(3))^2 + (x2 - 1/sqrt(3))^2 + (x3 - 1/sqrt(3))^2)); % objective 1
F2 = 1 - exp(-((x1 + 1/sqrt(3))^2 + (x2 + 1/sqrt(3))^2 + (x3 + 1/sqrt(3))^2)); % objective 2

Output = [F1 F2];

multi_objective_genetic_algorithm_solver.m

function [x,fval,exitflag,output,population,score] = multi_objective_genetic_algorithm_solver(nvars,lb,ub,PopulationSize_Data,MaxGenerations_Data,FunctionTolerance_Data,ConstraintTolerance_Data)
options = optimoptions('gamultiobj');
options = optimoptions(options,'PopulationSize', PopulationSize_Data);
options = optimoptions(options,'MaxGenerations', MaxGenerations_Data);
options = optimoptions(options,'FunctionTolerance', FunctionTolerance_Data);
options = optimoptions(options,'ConstraintTolerance', ConstraintTolerance_Data);
options = optimoptions(options,'CrossoverFcn', {  @crossoverintermediate [] });
options = optimoptions(options,'Display', 'off');
options = optimoptions(options,'PlotFcn', { @gaplotpareto });
[x,fval,exitflag,output,population,score] = ...
gamultiobj(@multi_objective_function,nvars,[],[],[],[],lb,ub,[],options);

Main_program.m

clc
clear all
close all

nvars = 3;
lb = [-4 -4 -4];
ub = [4 4 4];
PopulationSize_Data = 100; 
MaxGenerations_Data = 50; 
FunctionTolerance_Data = 0; 
ConstraintTolerance_Data = 0; 

[x,fval,exitflag,output,population,score] = multi_objective_genetic_algorithm_solver(nvars,lb,ub,PopulationSize_Data,MaxGenerations_Data,FunctionTolerance_Data,ConstraintTolerance_Data);

optimal_solution = x

P/s: If you find the post useful, share it to remember and to help other people as well.

Dr.Panda

View Comments

  • Hello! sir, I want to do optimization on the centrifugal compressor. so can you please make a video of at least the process of how to do it, that can be really very helpful.

    Thank you.

      • Hi, I'm Santhosh from studying masters in Taiwan. As part of my research, I want to do genetic algorithm optimization for centrifugal compressors. So could you please help me with that by making a video? that would be greatly helped me. Thanks in advance.

        • Hello, Santhosh! Thanks for your suggestion. May I see your problem formation, i.e. objective function(s) and constraints?

          • sir, can you send me your mail id so that I will send the objective functions and constraints to you.
            Eagerly waiting for your reply.
            Thank you.

  • sir , I have a multi objective function ,but i don’t know how to type it in matlab would you please help me

  • Hello Sir
    Can you do a video about MultiObjective Particle Swarm Optimization in the field of electrical enfineering.

  • Dear Dr.Panda,

    thank you for your educations.
    I need to create a fitness function from the MLP neural network to optimize using NSGA2.
    Can you help me write the fitness function from ANN?
    Do I have to load artificial neural network data into the NSGA2?
    Where?

    thank you so much

    Best regards

    Saeedeh Zarbakhsh
    saeedeh.zarbakhsh@yahoo.com

  • Hello sir, thank you very much for all your content. Maybe u could make a video on how to solve optimization problems using artificial immune systems? In fact, I'm trying to use The Danger Immune Algorithm to solve an optimization problem on how to avoid ship collisions. Your videos inspired me to start working on this project. Thank you.

Recent Posts

Adaptive Re-Start Hybrid Genetic Algorithm in Matlab

Hello everyone! In this post, I am going to show you my innovative version of…

5 months ago

Test Your Understanding About Genetic Algorithm (Test 2)

Hello everyone. Let’s take a test to check your understanding about genetic algorithm, with multiple…

5 months ago

Adaptive Restart Hybrid Genetic Algorithm

Hello everyone! In this post, I am going to show you my innovative version of…

6 months ago

Adaptive Re-Start Hybrid Genetic Algorithm (Test the Performance in Case Studies)

Hello everyone. In this post, I am going to show you my innovative version of…

1 year ago

Adaptive Re-Start Hybrid Genetic Algorithm in Matlab

Hello everyone! Let’s see how my innovative version of Genetic Algorithm, called Adaptive Re-start Hybrid…

1 year ago

Crypto Quiz (Test Your Knowledge About Cryptocurrency)

Hello everyone! Let’s take a short quiz, to test your knowledge about crypto-currency, or crypto.…

1 year ago