why do i get 50 outputs for multi objective genetic algorithm?

1 view (last 30 days)
hello, i am trying to use multi objective genetic algorithm. i have 3 vectors..each of size 11x1
i am getting an output... though the output is 50x2
could someone please explain why it is so...or is there any way to change it. i am new to matlab please help me with this thank you

Accepted Answer

Walter Roberson
Walter Roberson on 8 Feb 2018
gamultiobj returns a sampling of the Pareto fronts.
Your code needs to stop overwriting the parameter x in your fitness function: you are computing the same thing every time.
You are telling the optimizer that you have 2 variables but your computation is for a vector of length 11.
I wonder if what you are trying to optimize is some kind of mixing coefficients, in which case it might make sense to be optimizing on 2 or 3 variables.
  11 Comments
anu vru
anu vru on 8 Feb 2018
i understand your point now. for starters,each A1 and B1 and A2 and B2 have individual constraints, hence which ever is much further away from constraints in more suitable. second.. i also have a variable C which is constant. and by my formula..A()+B()-C=0 this is my actual objective though in ideal cases this is not possible hence finding the minimum values of A and B such that A()+B()=C
hence which ever output gives me a values closer to C is chosen to be optimum in my case.
for example, if A lies between (0.5-2.5) and B between(0.5-2) and my C is given as 3. then there can be many answers for A and B... 1 and 2 0.5 and 2.5 2.5 and 0.5
but optimum will be 1.5 and 1.5
Walter Roberson
Walter Roberson on 8 Feb 2018
"which ever is much further away from constraints in more suitable."
Each linear constraint defines a plane that divides the 11-dimensional solution space in two. Multiple linear constraints force the acceptable points to be "inside" all of the planes. Asking which point is furthest from the constraints would require finding the distance between the candidate point and all of the planes. That can be done, but it leads back to the question of how you decide which is best since you have multiple distances involved. Do you take the sum of squares of the euclidean distance to the closest point on each of the dividing planes? Even if the closest point on the plane is "outside" of the volume defined by the planes ?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!