Mix-integer optimization problem using GA

조회 수: 2 (최근 30일)
Hoang Trinh
Hoang Trinh 2019년 7월 15일
편집: Bruno Luong 2019년 7월 17일
Is there anyway we can assign some specific values to a variable in the optimization problem? For example, x1 can only take values of 32 40 50 and 65.
I know that GA can find integer solutions. However, in my problem, some of my variables can only be assigned with specific values. For example, variable X1 only takes the value of 32 40 50 and 65. Is there anyway we can define it ?
Thank you so much,
Regards,
Kim,
  댓글 수: 1
Bruno Luong
Bruno Luong 2019년 7월 17일
편집: Bruno Luong 2019년 7월 17일
For example, variable X1 only takes the value of 32 40 50 and 65.
Reformulate your score/variable, instead of minimizing (by GA)
f(x1,x2, ...,xn) with x1 in [32,40,50,65]
minimize
g(y1,x2,...xn) := f(yourset(y1),x2,...,xn) with y1 (integer) in 1:4
and with
yourset := [32,40,50,65]

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

답변 (2개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 7월 15일
편집: KALYAN ACHARJYA 2019년 7월 15일
Define x1 as array with allowable values,
x1 =[32 40 50 65];
if sum(x1==input_value)>=1
% Allowed % Do something
else
%Not allowed with revert message
end
Is this you are looking for?

Bruno Luong
Bruno Luong 2019년 7월 15일
편집: Bruno Luong 2019년 7월 17일
Take x1 fix allowed value, e.g. 32, optimize wrt (x2,...), repeat 4 times pick the solutions (among 4) with smallest score value.
If your allowed array is large you might use integer programming GA method.
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 7월 15일
intlinprog permits discrete values but not general objective functions.
ga permits discrete values and general objective functions but uses a randomized approach in its choices.

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

Community Treasure Hunt

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

Start Hunting!

Translated by