\documentclass[12pt]{article}

\usepackage{multirow}
\usepackage{fullpage}
\usepackage{graphicx}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref}


\begin{document}

\title{
Assignment 2
}
\author{CS 776: Genetic Algorithms \\
  Fall 2023 \\
  Max Score: 100 \\
}

\date{}
%\input{psfig}

\maketitle

\section*{Genetic algorithms and function optimization}

Design and implement a simple genetic algorithm in any language of
your choice. Do not download and use existing code although you may
certainly use existing code for inspiration. Rather, understand and
implement simple genetic algorithm code from the textbook. It is in
pascal, but you can easily translate it to your favorite language as I
have done, to C/C++ and python. A simple genetic algorithm uses
fitness proportional selection, one-point crossover, and bit flip
mutation.

\subsection*{DeJong Functions}
First, use this simple genetic algorithm that you write to solve the DeJong functions from
page 108 of your textbook and \href{http://www2.denizyuret.com/pub/aitr1569/node19.html}{available at this
  link}. He chose
these functions because the represent common characteristics of easy
and difficult function optimization problems. You will have to
\begin{enumerate}
   \item Implement our binary encoding for scalar variables as discussed in class.
   \item Implement evaluation functions for each DeJong function
   \item Experiment with different population sizes, number of
     generations to run, and probabilities of crossover and
     mutation. Start with $50, 100, 0.7, 0.001$ for these genetic
     algorithm parameters.
\end{enumerate}

\subsection*{Analysis of GA performance}
Second, once you have discovered the best genetic algorithm parameters
for each of the five DeJong functions, plot {\bf on one graph}, the population minimum, maximum, and average fitness (y-axis)
versus number of generations (x-axis). In addition, plot {\bf on one graph}, the population minimum, average, and maximum {\em objective function value} (y-axis) versus number of
generations (x-axis). Note the following.
\begin{enumerate}
  \item Since the Genetic Algorithm (GA) is randomized, you will need
    to run the GA 30 different times with 30 different random seeds in
    order to get useful data for your plots.
  \item Each point on this graph will be the average of 30 different values for that generation over all 30 random seeds
\end{enumerate}  

\subsection*{CHC GA performance, 20 points}
Third, implement CHC selection (as discussed in class and in
\href{https://www.cse.unr.edu/~sushil/class/gas/papers/CHC.pdf}{Eshelman's
  CHC paper}). Change GA parameters to be suitable for CHC and run the
CHC-GA on the same problems. Use $50, 75, 0.95, 0.05$ for population
size, number of generations, probability of crossover, and probability
of mutation with CHC.

\section*{Turning in your assignment}

Write a report that contains the following sections

\begin{enumerate}

\item A link to you your simple genetic algorithm and CHC GA  source code
\item A link to your source code for the evaluation function for each of the five DeJong functions
\item 70 points. The plots of your genetic algorithm running as described above on each DeJong function. I will expect two plots for each DeJong Function.
\item 20 points. A table that lists the genetic algorithm parameters and the 
  average number of function evaluations needed by the simple genetic
  algorithm (SGA) and CHC-GA for finding the optimum (or getting
  within $1\%$ of optimum) for each DeJong function (row).
\item 10 points. A table with reliability, quality, and speed metrics for each GA based on your gathered performance data
  
\item 
  Use canvas to turnin in this assignment report. 
\item 
  Your FULL name and email address on the cover page of your report
  
\end{enumerate}

Email me with questions.
\end{document}
