hi all
i successfully make a Matlab program for Genetic algorithm (without using elite feature) and achieve goal which was desired. i have tried for various number of chromosomes like.5,6,10 and 20. but didn't notice any significant change. i logically believe, there must me some impact on output response by increasing the number of chromosome. and my second question is i want to know, at which stage elite strategy is used and how. i am following the below link: http://www.mathworks.com/help/gads/how-the-genetic-algorithm-works.html in which a line is written "Some of the individuals in the current population that have lower fitness are chosen as elite. These elite individuals are passed to the next population." i am confused at this stage , means if a individual have low fitness then how it is processed to a next level?.
kindly share information if any one have, thanks in advance :)

 Réponse acceptée

Geoff Hayes
Geoff Hayes le 23 Oct 2014

0 votes

Mudasir - from your previous posts, I think that you have written your own version of the genetic algorithm and are not using that from the Global Optimization Toolbox. So depending upon how you have written the code to initialize the chromosomes, do the selection, do the crossover, do the mutation, then that all that will impact what happens when you increase the number of chromosomes (size of population). What do you observe about your initial population when you increase the size from 5 to 20? Do the genes in each chromosome vary significantly? How does the crossover affect the new chromosomes? When does convergence occur (i.e. at which generation)? I think that you will need to analyze the chromosomes to see how they change from one generation to the next. That analysis may explain why increasing the population size seems to have no affect on producing different/better results.
As for the elite strategy, the above link goes on to say that a fixed number of "elite children" are chosen for the next generation. These elite members have the best (i.e. lowest) fitness of the current generation and are "copied" in to the next generation as is. The remaining members of the next generation's population is made up of the children created through crossover and/or mutation. So this processing would occur prior to selection and crossover. See the example (from the link) for more details.

6 commentaires

Mudasir Ahmed
Mudasir Ahmed le 25 Oct 2014
yes sir you are right, i have written my own code depend on my task. sir, i am sending you my code in private message. sir my code is working properly but i want to improve it more to achieve fine results. means to converge at target by taking less number of iterations, by using elite or any other latest technique. in code, i have also used elite feature but i am not sure that i have written it in proper stage or not. kindly sir help me :)
Mudasir Ahmed
Mudasir Ahmed le 28 Oct 2014
hi sir, i have sent my code, i am waiting for your kind response. thanks in advance sir,
Geoff Hayes
Geoff Hayes le 28 Oct 2014
Mudasir - you have provided a lot of lines of code, none of which is commented. Because of the lack of comments, it isn't clear where the parent selection, crossover, and mutation occur.
You have chosen to use eval so often which makes it tricky to debug the code. I recommend that you remove all of the eval statements. That way you know what is happening at each iteration of the algorithm.
I know I have suggested in previous questions of yours that you can use a matrix to store all chromosome data, so I will suggest that again. This will make it easier for you to increase your population size (you won't have to create local variables for ch7, ch8, etc. whenever you add the seventh and eighth members of the population.
Mudasir Ahmed
Mudasir Ahmed le 28 Oct 2014
sorry sir, very soon i will send the code again using comments, i find eval command easy to use because it generates variable easily. i also try to find alternative of that too :)
Geoff Hayes
Geoff Hayes le 28 Oct 2014
Use matrices (or cell arrays) to manage your data rather than individual variables. It simplifies code considerably!
Emily Kambalame
Emily Kambalame le 5 Sep 2022
Modifié(e) : Emily Kambalame le 14 Nov 2022
Dear @Mudasir Ahmed please help me with the elitism NSGA 2 code. How can a certain percent of solutions be preserved from the merged parent and child population?

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by