How to avoid permutation condition in Genetic Algorithm?
조회 수: 7 (최근 30일)
이전 댓글 표시
I want to minimize my objective fuction with with 8 variables using genetic algorithm. Considering my problem, all my 8 variables are integer and the arrangenment of my variable wont affect my objective function.
Example: output like 1 2 3 4 5 6 7 8 or 8 7 6 5 4 3 2 1 wont affect my objective function. But the GA considering both this set of variable as a separate gene. Kindly someone let me know how to avoid this condition in GA.
Thanks.
댓글 수: 0
답변 (1개)
Walter Roberson
2019년 10월 19일
Use A and b constraints to enforce that the values are in sorted order. x(1) < x(2) if [1 -1]*x(1:2).' < 0 so
A = [1 -1 0 0 0 0 0 0
0 1 -1 0 0 0 0 0
0 0 1 -1 0 0 0 0
0 0 0 1 -1 0 0 0
0 0 0 0 1 -1 0 0
0 0 0 0 0 1 -1 0
0 0 0 0 0 0 1 -1]
b = [0; 0; 0; 0; 0; 0; 0; 0]
However, that particular matrix does not enforce that the values are different: it would be satisfied with x(1) = x(2) for example. Fortunately when you work with integer variables you can rewrite x(1) < x(2) as x(1) + 1 < x(2) which is x(1)-x(2) < -1 so instead of all 0'is in b, make it all -1's and duplicates would be ruled out.
참고 항목
카테고리
Help Center 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!