How to avoid permutation condition in Genetic Algorithm?

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.

답변 (1개)

Walter Roberson
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.

댓글 수: 1

Thank you so much for your suggession.
The constrain which you have suggested will avoid the repetation and arrange the out output in accending/decending order.
Suppose my range is 1 to 100(ie. want to pick 8 variable from 1 - 100), the whole result will depents on x(8). That means, if the algorithm pick x(8) as 50 then it will ignore all the values from 50-100 because of the constrain suggested by you.
Kindly give me a suggestion to over come this iisue.
Thanks.

댓글을 달려면 로그인하십시오.

카테고리

제품

릴리스

R2018a

질문:

2019년 10월 19일

댓글:

2019년 10월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by