The aim of this competition is to produce the tiniest possible implementation of a genetic algorithm.


The implementation must have the following features:

  1. The system can be either generational or steady state. In the latter case a "generation" is to be interpreted as POPSIZE (see below) crossover/reproduction events.
  2. Fitness proportionate selection should be implemented.
  3. The representation is binary strings of fixed length.
  4. Uniform crossover must be implemented.
  5. Reproduction (a.k.a. cloning) must be implemented.
  6. Point mutation must be implemented. This must be applied to all strings generated either by crossover or reproduction.
  7. The fitness function must be One-max (a.k.a. counting ones), but should not be hard coded (i.e., it should easily be possible to modify the code to change fitness function).
  8. Initialization should be based on generation of random strings uniformly distributed in the search space.
  9. The following parameters must be implemented (but can be fixed at compile time if necessary) and printed when each run starts:
    • LEN // the length bit strings
    • POPSIZE // the size of the population
    • GENERATIONS // the maximum number of generations allowed for a run
    • CROSSOVER_PROB // the probability of crossing over
      (the reproduction probability is 1 - CROSSOVER_PROB)
    • PMUT // the mutation probability per bit
  10.  At each generation the following statistics/data should be calculated and printed:
    • Generation number
    • Average fitness of the individuals in the population.
    • The fitness of the best individual in the population.
    • The string representing the best individual in the population.
  11. The random number generator will need to be seeded. It must be possible to do this from command line. If the command line parameter is absent, the system must use the current time to seed the random number generator.
  12. If the fitness of the best individual in the population reaches the maximum fitness (LEN, in the case of the one-max fitness function) the program should stop printing a message indicating success.
  13. If the problem has not been solved after the maximum number of generations, the program should stop printing a message indicating failure.
Submission of Entries:

Submit the source code and a short document (in PDF format, ACM style, max 3 pages) explaining how the code works, how to execute it, how to change the parameters, etc.

Winning criteria:

Winning criteria include

Entries submitted for this competition will be judged by a panel of international experts (to be announced).