How I create a non-equal restriction for GA problem?
조회 수: 4 (최근 30일)
이전 댓글 표시
How to say for matlab that all elements in a vector must be different? I need to make a restriction for a GA problem, like V = [x1 x2 x3 x4], and x1~=x2,x3,x4, x2~=x3,x4, x3~=x4;
댓글 수: 0
답변 (1개)
John D'Errico
2017년 12월 3일
Essentially, you cannot. Or constraints are not an option for any optimizer, including GA, thus x1>x2 OR x1<x2. And you cannot have strict inequalities anyway.
Are these integers?
Could you require that the x_i are sorted, thus something like:
x1 + tol <= x2
x2 + tol <= x3
x3 + tol <= x4?
Yes, somebody will probably tell you to use a constraint like
abs(x1 - x2) >= tol
etc.
It might even work, SOME of the time, IF you used good starting values. But it will certainly create a problem with multiple local minima, ABSOLUTELY necessitating good starting values.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!