       Re: Convex crossover in genetic algorithm

• To: mathgroup at smc.vnet.net
• Subject: [mg112666] Re: Convex crossover in genetic algorithm
• From: Bill Rowe <readnews at sbcglobal.net>
• Date: Sat, 25 Sep 2010 02:21:08 -0400 (EDT)

On 9/24/10 at 5:39 AM, lightnation at naver.com (lightnation) wrote:

>If you are interested in the genetic algorithm, please help me make
>coding about convex crossover. The coding below is convex crossover
>in RCGA. It's working, but the convergence is not so good. Please
>correct me. (The whole algorithm is posted in this.
>http://blog.daum.net/lightnation/5846116)

Are you aware Mathematica already has this functionality built-in?

That is:

In:= obj = x^2 + 2 y^2 - 0.3 Cos[3 Pi x] - 0.4 Cos[4 Pi y] + 0.7;
constraints = {-1 <= x <= 1, -1 <= y <= 1};

In:= NMaximize[{obj, And @@ constraints}, {x, y},
Method -> {"DifferentialEvolution", "ScalingFactor" -> .1}]

Out= {3.60426,{x->1.,y->-0.805358}}

Here, I tweaked the ScalingFactor since the default value fails
to find a maximum. But note, allowing NMaximize to automatically
choose the method finds a maximum, i.e.,

In:= NMaximize[{obj, And @@ constraints}, {x, y}]

Out= {3.60426,{x->1.,y->0.805358}}

can be found in

tutorial/ConstrainedOptimizationGlobalNumerical

Included here are details of various options for the methods not
described in the basic documentation for NMaximize, i.e., the
main documentation page in the Documentation Center for NMaximize

• Prev by Date: Re: Using Mathematica remotely (installed on Mac, to be accessed
• Next by Date: Re: Creating a Grid with square cells
• Previous by thread: Convex crossover in genetic algorithm
• Next by thread: Re: Convex crossover in genetic algorithm