CS 5970 Programming Assignment 2 — Genetic Algorithms

Due Monday, October 17, 2016

1. Motivation

Evolutionary computation is often used for optimization. Some optimization problems have a single optimum and a smooth optimization landscape that allows even the simplest local search procedure to quickly find the optimum. Others have complicating features such as multiple local optima that are inferior to the global optimum, valleys, plateaus, and ridges that cause difficulties for local search approaches. For these problems, an evolutionary computation approach can be superior.

Moreover, when we create a particular evolutionary computation implementation, we need to decide on particulars for the replicators, replication mechanisms, and selection mechanisms we will use, among others. Some of the questions we need to answer to create our implementations are:

All of these decisions need to be made in the context of the particular problem to which evolutionary computation will be applied (for example, the replicators in combination must be able to represent solutions to the problem in question). These decisions will also effect the unfolding of the evolutionary process (e.g., how quickly it converges to a solution).

2. Goals

The goals of this assignment are:

3. Assignment Overview

You will design, program, and run a simple GA to find the global maxima of two different functions, one with a single maximum and the other with one global maximum but also several local maxima separated by valleys. You will compare the performance of your GA on these functions to that of a simple local search optimization procedure known as hill climbing. The functions are as follows:

  1. f(x,y)=sin(x)+2×J1(y); 0 ≤ x, y ≤ 5
    sin(x) + the first bessel function of the first kind of y in the range 0 to 5 inclusive for both x and y
  2. f(x,y)=sin(x)+2×J1(y); -10 ≤ x ≤ 10, 0 ≤ y ≤ 10
    sin(x) + the first bessel function of the first kind of y in the range -10 to 10 inclusive for x and 0 to 10 inclusive for y
[Note that J1 is the first Bessel function of the first kind.]

You will also turn in written material regarding the design and implementation choices you made regarding the GA and an analysis of the results you will collected from your runs.

4. Assignment Details

Carry out the following steps. Underlined steps require a written response, those in code require you to write software, and those in italics require you to collect data. Written responses, code, and data will be turned in for grading

  1. Consider the choices one needs to make regarding the design and implementation of any evolutionary computation system.
  2. List the choices that need to be made when designing an evolutionary computation system that have already been made for you in this assignment.
  3. For each of these choices, list which option I chose for you in making this assignment.
  4. List the choices you need to make regarding the design of your GA. (Note, these do not include purely implementation choices such as programming language.) Between those I chose for you and those you chose yourself, you should be able to list at least nine.
  5. Choose an option that seems reasonable to you for each of these design choices and explain why it seems reasonable to you. If you do not have a good reason for your chosen option, say so.
  6. Implement your GA.
  7. Now that you have implemented your GA, you are likely to have recognized more choices that you needed to make along the way. List the choices you needed to make regarding the design of your GA. Including the choices you listed previously, your list should now contain at least ten choices.
  8. For each of these design choices, list the option you chose, and explain why it seems reasonable to you. If you do not have a good reason for your chosen option, say so.
  9. Consider the choices one needs to make regarding the design and implementation of a hill climber.
  10. List the choices that need to be made when designing an hill climber that have already been made for you in this assignment.
  11. For each of these choices, list which option I chose for you in making this assignment.
  12. List the choices you need to make regarding the design of your hill climber. (Note, these do not include purely implementation choices such as programming language.) Between those I chose for you and those you chose yourself, you should be able to list at least four.
  13. Choose an option that seems reasonable to you for each of these design choices and explain why it seems reasonable to you. If you do not have a good reason for your chosen option, say so.
  14. Implement your hill climber.
  15. Now that you have implemented your hill climber, you are likely to have recognized more choices that you needed to make along the way. List the choices you needed to make regarding the design of your hill climber. Including the choices you listed previously, your list should now contain at least five choices.
  16. For each of these design choices, list the option you chose, and explain why it seems reasonable to you. If you do not have a good reason for your chosen option, say so.
  17. Answer the following questions about data collection, reporting, and conclusions so that you are ensured of collecting the appropriate data. Attempt to justify your answers to these questions. As you do so, keep in mind that what you want is a data set that allows you to understand the workings of your GA and your hill climber as optimization tools and you want to report the minimum amount that allows your reader to thoroughly understand what you have learned. Note that you may lack a justification for your answers to some of these questions at this time. That is acceptable since this is your first evolutionary computation programming assignment in this course. However, you should keep all of these questions in your mind as the course progresses and be able to give good, justified answers to similar questions for your large project.
  18. Run your GA and your hill climber on the given functions.
  19. Report your results and conclusions regarding the application of your GA and your hill climber to the given functions.

5. What to Turn In

Write Up
You will turn in both an electronic copy of your write up. Your write-up should be a coherent document that covers all of the underlined steps from the assignment above. Note that selected data in a digested form (such as tables or graphs) should be included in your writeup; however, your raw data should not be included here.
Code
You will turn in an electronic copy of your code. You will turn in the source code you have written for both your GA and your hill climber. Your source code should be well structured and well commented. It should conform to good coding standards (e.g., no memory leaks).
Data
You will turn in an electronic copy of your data. This may be in a single file or multiple files. You will also need to include a brief writeup on how the data is organized.

6. Notes on this Assignment

You may write your program from scratch or may start from programs for which the source code is freely available (such as on the web or from friends or student organizations). If you do not start from scratch, you must give a complete and accurate accounting of where all of your code came from and indicate which parts are original or changed, and which you got from which other source. Similarly, for the written components of this assignment you may follow the format or content of other written works but you must give a complete and accurate accounting of who deserves credit for all parts of your documents. You will be graded on the contribution you make to your project; in other words, to earn the points possible for this assignment, you must make your own substantial contributions to the completion of this assignment above and beyond what you obtain from others. Failure to give credit where credit is due is academic fraud and will be dealt with accordingly. Please see the University's web pages on academic integrity.