Discrete optimization with Genetic Algorithm - help

Hi again, I have trouble carrying out this optimization procedure. I know that I should use penalty functions when I have a constrained problem. Does MATLAB implement any penalty? Is there any example on this method?!

 채택된 답변

Alan Weiss
Alan Weiss 2012년 9월 6일

1 개 추천

The documentation deals with nonlinear inequality constraints. The underlying algorithm for the nonlinear constraint solver uses penalty functions, but you don't have to do anything special, such as write your own penalty.
Alan Weiss
MATLAB mathematical toolbox documentation

댓글 수: 9

Thanks, But mixed integer optimization deals with integer values, I want want GA to find the optimum among values like [1.2 , 1.5 , ...]. Is it possible?
There are several ways to make integer ga use discrete values. If you want values that are any decimal value to one point, such as 1.2, 1.5, etc, just make your variable x take integer values, and divide it by 10.
If instead you have some discrete values a(1),...,a(n) that you want to sample, let x take integer values, and use a(x) as your variables. Be sure to bound x between 1 and n. This is an example using that technique.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Itachi
Itachi 2012년 9월 7일
편집: Itachi 2012년 9월 13일
Thanks, What should I do if I had linear equality constraints? Because I have to insert coefficients of x in "A". please help me out, thanks in advance.
There is documentation on dealing with equality constraints. That's all I can tell you.
Alan Weiss
MATLAB mathematical toolbox documentation
Itachi
Itachi 2012년 9월 13일
편집: Itachi 2012년 9월 13일
I'm very sorry, I meant linear inequality constraints, please help me out.
I'm sorry, I do not understand what you are asking. There is plenty of documentation on including linear inequality constraints. What is it that you are trying to do that you are unable to?
Alan Weiss
MATLAB mathematical toolbox documentation
Hi again, thanks for your answer. As you said earlier I have some discrete values a(1),...,a(n) that I want to sample, x taking integer values, and using a(x) as my variables. But for linear inequality constraints how should I do that?
Again, I do not understand you. Sorry.
Perhaps you have a linear constraint in the variables a(x). You can write that as a nonlinear inequality constraint.
Perhaps you have a linear constraint in x. You can use the A, b matrices to represent that constraint.
You might mean something else. In that case, feel free to ask again, but I am afraid we are not communicating well.
Alan Weiss
MATLAB mathematical toolbox documentation
Itachi
Itachi 2012년 9월 20일
편집: Itachi 2012년 9월 22일
Hi again, thank you so much. I had linear inequality constraint in the variables a(x).So by writing them in nonlinear inequality constraint I can fix this.
Best regards,

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

추가 답변 (0개)

카테고리

제품

질문:

2012년 9월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by