I'm implementing with JGAP a genetic algorithm to solve a problem where the chromosome is a list of Integers (i would like to keep N good-fitting solutions in the result, not just the fittest one).
Each integer must appear just once in the chromosome (I did it by setting fitness=0 to chromosomes with duplicate alleles and it's ok... )
My problem:
In my problem, the order in which the numbers appears in the chromosomes doesn't count ( 1 2 3 is the same as 2 1 3).
So at the end of the execution, i've a list of possible solutions
I used the solution reported here (using JGAp (genetic algorithm library) and the duplicated chromosomes) to remove duplicates chromosomes in this way:
conf.getNaturalSelectors(false).clear();
BestChromosomesSelector bcs = new BestChromosomesSelector(conf, 0.8d);
bcs.setDoubletteChromosomesAllowed(false);
conf.addNaturalSelector(bcs, false);
But it removes just identical chromosomes, it doesn't remove for example:
A B C D
A C B D
B A C D
Those chromosomes in my problem represents the same solution
So I end up with a list of chromosomes with the same fitness and the same meaning but with genes in different order.
How can i remove the chromosomes that represent the same solution , despite of the order in which it is represented?
Thank you, have a good day.