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?!

 Respuesta aceptada

Alan Weiss
Alan Weiss el 6 de Sept. de 2012

1 voto

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 comentarios

Itachi
Itachi el 6 de Sept. de 2012
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?
Alan Weiss
Alan Weiss el 7 de Sept. de 2012
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 el 7 de Sept. de 2012
Editada: Itachi el 13 de Sept. de 2012
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.
Alan Weiss
Alan Weiss el 13 de Sept. de 2012
There is documentation on dealing with equality constraints. That's all I can tell you.
Alan Weiss
MATLAB mathematical toolbox documentation
Itachi
Itachi el 13 de Sept. de 2012
Editada: Itachi el 13 de Sept. de 2012
I'm very sorry, I meant linear inequality constraints, please help me out.
Alan Weiss
Alan Weiss el 14 de Sept. de 2012
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
Itachi
Itachi el 18 de Sept. de 2012
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?
Alan Weiss
Alan Weiss el 19 de Sept. de 2012
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 el 20 de Sept. de 2012
Editada: Itachi el 22 de Sept. de 2012
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,

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Preguntada:

el 6 de Sept. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by