CS472 Evolutionary Computation
Assignment 1
(getting a feel for local search and landscapes)
120 points
DUE: Fri Sep 19 at 5pm PST


This assignment is a good warmup.

It is also surprisingly easy to miscode this, so read carefully, code carefully.

This assignment will get us familiar with navigating fitness spaces and the basics of local search.

The Algorithm

Write a simple local search.

The Experiments

For the experiments, you will run essentially the same program except for the different mutation operators and genotype to phenotype mappings. You will turn in your code and a report on what you find. More on the report in a moment. When you turn in your code you will need code for each of the four experiments and a single makefile (I will supply a sample makefile below).

Experiment 0

This program shall be named localRand. This is the "control" for our experiment. Create a mutation operator that takes the last chromosome (unsigned int) and the size of the chromosome in bits and ignores the chromosome input and returns a random bit string of the given size. Run this experiment 20 times and print the 5 numbers above for each experiment run. [Hint: don't forget to randomly initialize your random number generator for each experiment.]

Then in the next three experiments compare them to this one. [Hint: here is a possible declartion for a mutation function:
unsigned int mutate(unsigned int chromosome, int size);]

Experiment 1

This program shall be named localBit. (note what is capitalized and what is not) For the first experiment, create a mutation operator that randomly flips exactly one bit in the chromosome that represents the current best fitness. It is important that you are always mutating the last best chromosome and not the last chromosome that failed. Why? The geneotype/phenotype mapping is as described above. Run this 20 times with different random seeds. What do you observe? Explain it. Be clear and concise. Show your data/results.

Experiment 2

This program shall be named localInc. For this experiment use a mutation operator that either increments or decrements the field of 10 bits with x in it or with y it. That is four possible mutations. This must be done very carefully since the field must wrap within each 10 bit field and not carry over into the adjacent field. Run this 20 times with different random seeds and report what you observe. Be clear and concise. Show your data/results and compare.

Experiment 3

This program shall be named localGray. For this experiment go back to the random bit flip mutation operator of experiment 1. This time alter the fitness function to use the bitDegray function from the bit utilities provided below to degray the 10 bit x and y strings before you map them to reals. This will treat your space as if it is in gray code. Run this 20 times with different random seeds and report what you observe. Compare your observations with the previous two experiments and the control.

What to turn in

The Code

Please tar up your code as a set of files (not a directory of a set of files). You should provide all of the source code necessary to run each experiment is in the tar. There should be a makefile that will build code for all three experiments. My scripts will automatically explode your tar file into a fresh directory and then executing the make command four times as:
make localRand 
make localBit 
make localInc
make localGray
to build the four experiments. Your code should take no parameters but run simply by executing localRand, localBit, localInc or localGray to see the results of one run up to 10000 evaluations.

The Report

Your report should be in a pdf file named exactly report.pdf. It should say:

Grading this Assignment

I will grade this based first be seeing that your code compilers, runs and returns a sensible answer. I will read the report to make sure it is clear and that you understand what happened when you ran the experiments. 50% of your score on each part. Your report needs to be concise and to the point. Make your points about each experiment and what you learned from that experiment.

Helpful Stuff

Some of this is also listed on the class web page:

Submission

Homework will be submitted as an uncompressed tar file to the homework submission page. You can submit as many times as you like. The LAST file you submit BEFORE the deadline will be the one graded. For all submissions you will receive email giving you some automated feedback on the unpacking and compiling and running of code and other things that can be autotested. I will read the results of the runs and the reports you submit.


Robert Heckendorn Last updated: Sep 7, 2008 14:54