Introduction to the GAlib

5 points.

The purpose of this project is to gain familiarity with the GA library.

  1. Look at the code in intro.C and get a feel for how it works. Notice that the fitness function gives higher scores to bitstrings which have more 1 bits.

    Compile and run the program. Play with a few of the GAlib's command line parameters.

  2. Modify intro.C so that at each generation, it prints out the best individual and his score. (hint: replace the call to ga.evolve with a loop calling ga.step. See the GAlib documentation for a full description.)

  3. Modify intro.C so that it uses the uniform crossover operator, instead of the default 1-point. Does either operator have an advantage here?

  4. Modify the fitness function of intro.C so that it favors strings of alternating bits. Is this problem harder to solve than the original?

  5. Again compare the effectiveness of 1-point crossover versus uniform crossover for the alternating bit problem.

    Files for the project are available here.