genetic algorithm run time and result analysis

8 views (last 30 days)
Hello
i am using Genetic algorithm. my problem has
nvars=30,
population size = 400
size of initial population matrix = 50x30
max. generation = 200
the following is a plot of best fitness value optained at each generation. the dark dots are ''best value across a generation '' the lighter dots are ''mean value across a generation''
question 1 is; it takes very long time to reach this figure, more than 10 hours, is that normal for my code that has around 300 lines?
question 2: whould any one comment on the shape of output result, this is scattered but on the same area. may be the search space does not mutate enogh? i used the default options for mutation and crossover.
question 3: what options could be useful to reduce running time but get an accurate result, i can reduce the max generations and population size, but i want to lmite the run time to 15 min.
  15 Comments
Nourhan Elsayed
Nourhan Elsayed on 4 Oct 2020
Thank you Walter Roberson for your guidence
i used function handle on my task and i re-formated the whole problrm.
i devided it into two optimization problems, or two layers, one inside the other.
the outer layer i used ga algorithm and the inner layer i used fmincon algorithm. that gave me the figure below.
would you please check that. the process terminated because it reached maximum no of generations. i am asking , on the light of this output, do my problem is going on the right way. i know this information is not enough to judge. but i was watching the code during running and i noticed that my variables are changing , but unfortunatlty, i coudn't get out information about each generation
Walter Roberson
Walter Roberson on 4 Oct 2020
You might want to add an additional PlotFcn to plot the generation information. Or since you are only running 50 generations, change the 'Display' option to 'iter'

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!