views:

89

answers:

3

I am developing a GA for a school project and I've noticed that upon evaluating my functions for fitness, an individual is equivalent to its inverse.

For example, the set (1, 1, -1, 1) is equivalent to (-1, -1, 1, -1). To shrink my search space and reach a solution more efficiently, how can I avoid my crossovers from searching in this second half of the search space?

+1  A: 

Try to re-write your fitness function to assign weights appropriately to individuals - not sure on the problem you're trying to solve or how weight can be re-assigned. Remember, fittest individuals should be in the pool and more likely to be selected for crossover - you don't want a pool full of dummys that have the same fitness as good solutions that defeats the purpose of the genetic algorithm

Stellios
Maybe I've misunderstood your answer, but I'm looking to avoid this full half of the search space altogether. I don't believe the fitness function to be the problem. Basically, one half of the search space is entirely equivalent to the other, based on the problem. As per my example, (1, -1) is equally fit as (-1, 1). This is the nature of the problem, not my fitness function.
Dave
What he is saying is to add something to your fitness function that makes one-half of the solution space less fit, but otherwise doesn't change the problem.
Justin Peel
@Dave I think the fitness function is to blame. You say that those answers are just as fit, but that you don't want them. Those two statement are contradictory. You should design your fitness function so that it promotes the solutions you actually want.
Ross
+1  A: 

Cut the space in half. Require the first element to be non-negative, then if you have (x_1, .. , x_n) and its inverse (-x_1, .. , -x_n) only one will be in the search space. (if x_1 = 0 they are the same) BTW, what is the problem you are solving?

Daniel Velkov
+1  A: 

Its computationally expensive, but something like this should do the job. Ignoring the 1st generation, for every generation >=2:

If the children produced via crossover/mutation is an inverse, ignore it and generate another child till it is a "good" child.

Amit