GreedyCrossover does not use all my set

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

GreedyCrossover does not use all my set

Pierre G
This post was updated on .
Hi all,

I am complete newbie with jgap and I want to solve a problem, I guess very similair to Saleman Problem.

I have N persons and M places. 2 persons should visit a place.
As there is some constraints to be fullfilled, N should be > 2*M .

I want to be sure that one person is only at one place so I use the GreedyCrossover to insure all genes in the chromosome are different.

But the problem come from the 2nd feature of GreedyCrossover :
# 2. The set of genes for both chromosomes is identical and only their order in the chromosome can vary.

How I can force it to use all my N persons to find the best solution ?

I set the upper bound  for my 2*M SampleGene array:
        sampleGenes[i] = new IntegerGene(conf, 0, N -1);

but it is not using the [2*M,N-1] range.

Thanks in advance for any help