# binary multiobjective optimization with genetic algorism

7 views (last 30 days)
Cheol-Joo Cho on 18 Jan 2021
Answered: Tushar Behera on 3 Oct 2022
Hi,
I have tried to write a matlab code to solve the binary multiobjective optimization problem using the genetic algorithm. I am using the matlab built-in function "gamultobj", expecting to obtain the nultiple pareto points with the values of decision variables of {0,1}. I will very appreciate if you let me know the tips for coding it. Thanks.

Tushar Behera on 3 Oct 2022
Hi Cheol-Joo Cho,
I believe you want to implement genetic algorithm to solve a multi objective optimization problem where the decision variables are binary using MATLAB.
You can run the below command in command window to see an example using “gamultiobj” function.
>>openExample('globaloptim/gamultiobjoptionsdemo')
Apart from that you can also use “ga” which is an inbuilt function in Optimization Toolbox to implement genetic algorithm to solve your multi-objective problem.
>>[x,fval,exitflag] = ga(fitnessfcn,nvars,A,b,[],[],lb,ub,nonlcon,IntCon,options)
Here Intcon will help you to set your decision variables as integers. IntCon is a vector of positive integers that contains the x components that are integer valued. For example, if you want to restrict x(2) and x(10) to be integers, set IntCon to [2,10].
To set the binary constraints in “ga", you can set the lower and upper bounds to 0 and 1 respectively.
Thanks, and regards,
Tushar Behera

### Categories

Find more on Genetic Algorithm 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!

Translated by