필터 지우기
필터 지우기

Genetic Algorithm takes sooooo long time, number of function evaluation huge

조회 수: 5 (최근 30일)
Pengfei
Pengfei 2012년 5월 29일
Hi, I'm using genetic algorithm to do a small black box solver based optimization, with nonlinear inequality constraints, upper and lower bounds. The size of population for each generation is 20 as default. However why GA displays the following info in the command window:
Generation f-count Best f(x) Max constraint Stall Generation
1 1040 .... ............ ....
2 2060 .... ........... .........
3 3080 ..... ....... .......
4 4100 ..... .......... ......
5 5120 ...... ......... ........
6 6140 ...... ....... ........
Which shows that GA evaluated the fitness function for 1040 times to make the 2nd generation, and that confuses me a lot ! The user help does say that GA solves a sequence of subproblems that combining the fitness and nonlinear constraint function. Something like changing the penalty parameter to find the Lagrangian estimates so that the linear and bound constraints are fulfilled. But I still want to know the mathematics, how, how can it be 1040, with 20 populations each generation, one nonlinear constraint?
Thanks!!

답변 (1개)

Alan Weiss
Alan Weiss 2012년 6월 6일
Nonlinear constraints are difficult for the solver to handle. It is not a surprise that it takes so many iterations with nonlinear constraints.
For better performance, and more robust answers, I suggest you try the patternsearch solver. It usually works much more reliably and quickly. The only issue is you have to come up with your own initial points. Since you have upper and lower bounds, why not take
x0 = lb + rand(size(lb)).*(ub - lb);
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by