Search code examples
matlabgenetic-algorithmgenetic-programming

in genetic algorithm, how to initialize population and how to determine the length of chromosomes if there is no constraints?


For example, how to minimize x^2 when x ranges from -inf to inf? How to pick initial length of chromosomes? How to determine initial population? Can I do in a guided way instead of initializing randomly?


Solution

  • Genetic algorithms normally have a fixed length in the chromosome representation, if the length will vary we are talking more about Genetic Programming.

    Anyway. I don't know if there is a rule on the initial length, but you should think of a size that allows the individuals to offer good initial results, but is not very large. You need to remember that GA/GP tend to present Bloat.

    Initial population should be the largest you can use and still be able to finish your executions in a reasonable amount of time given your computational power available. In my experience more is always better.

    About the initialization, there are certainly several seeding techniques, this paper enumerates some of them, you should be able to find more information about each of them: Nearest Neighbor (NN), Gene Bank (GB), Selective Initialization (SI), Sorted population (SP).

    For all the questions above, the best way is to experiment a lot and figure out what works best for your problem, your implementation. For instance: in a system I have the best solution usually sits around 70 nodes; after a lot of experimentation I found a sweet spot of initial individuals of 45 nodes, which worked better than initializing at 30 or 60.