Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b59b6ce90e
@ -3,7 +3,7 @@
|
||||
|
||||
\usepackage{graphicx} % Used to insert images into the paper
|
||||
\graphicspath{ {} }
|
||||
|
||||
\usepackage{float}
|
||||
\usepackage[justification=centering]{caption} % Used for captions
|
||||
\captionsetup[figure]{font=small} % Makes captions small
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
% Easier compilation
|
||||
\usepackage{bookmark}
|
||||
\usepackage{natbib}
|
||||
\usepackage{graphicx}
|
||||
% \usepackage{graphicx}
|
||||
|
||||
\begin{document}
|
||||
\title{Week 10 - Comparing Algorithms}
|
||||
@ -37,48 +37,43 @@
|
||||
simple hill climbing algorithm and the second algorithm is a genetic
|
||||
algorithm.
|
||||
|
||||
\section{Methodology}
|
||||
\section{Hill Climbing and Genetic Algorithms}
|
||||
% Describe methods
|
||||
% How did we collect data (and how we made it precise by averaging data)
|
||||
The experiment compares the capability of two algorithms to generate words from scratch. This involved taking repeated measurements of the number of time steps each algorithm required to generate words of varying fixed length. Each algorithm was tasked to generate words of length 1, 2, 4, 8, and 16 letters, and each of these measurements were performed ten times. The results were each word length were averaged, and used to construct the plot given in Figure \ref{fig:plot1}.
|
||||
\par
|
||||
The first algorithm randomly 'guesses' each digit of the required word, and fixes the letters that are correctly guessed in their respective place. The second algorithm however, uses a genetic algorithm to generate the words by 'breeding' the most correct words at each iteration. In order to assess the rate at which each method correctly finds a word, the fitness of both techniques (percentage of correct letters) is recorded at every iteration for a four letter word and compared (Figure \ref{fig:fitness1} and Figure \ref{fig:fitness2}).
|
||||
\par
|
||||
The experiment compared the capability of two algorithms to generate words from scratch. The first algorithm, the hill climbing approach, randomly 'guesses' each character of the required word, and fixes the ones that are correctly guessed in their respective place. The second approach however, uses a genetic algorithm to generate the words by 'breeding' the most correct words at each iteration.
|
||||
|
||||
The capability of each algorithm to generating words from scratch was assessed by collecting repeated measurements of the number of time steps each algorithm required to generate words of varying fixed length. Each algorithm was tasked to generate words of length 1, 2, 4, 8, and 16 letters, and each of these measurements were performed ten times. The average of the results of both methods was used to construct the plot given in Figure \ref{fig:plot1}.\\
|
||||
|
||||
In the Discussion, the merits and pitfalls of both approaches are explored, and an algorithm is selected as the most fitting for this task.
|
||||
|
||||
\section{Results}
|
||||
\par
|
||||
% what we graphed
|
||||
After taking repeated measurements of the number of steps taken to generate words of varying length, these measurements were averaged and plotted.
|
||||
|
||||
\begin{figure}[ht]
|
||||
\includegraphics[scale=0.65]{chart}
|
||||
\begin{figure}[H]
|
||||
\includegraphics[scale=0.55]{chart}
|
||||
\centering
|
||||
\captionsetup{width=0.80\textwidth}
|
||||
\caption{Plot of the plain random algorithm (red) and the genetic algorithm (blue) against the word length}
|
||||
\caption{Plot of the hill climbing (red) and genetic algorithm (blue) against the word length}
|
||||
\label{fig:plot1}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[ht]
|
||||
\includegraphics[scale=0.65]{chart-1}
|
||||
\par
|
||||
This shows...
|
||||
\\
|
||||
\par
|
||||
In order to assess the rate at which each method correctly finds a word, the fitness of both techniques (percentage of correct letters) is recorded at every iteration for a four letter word and compared (Figure \ref{fig:fitness1} and Figure \ref{fig:fitness2}). \\
|
||||
|
||||
\begin{figure}[H]
|
||||
\includegraphics[scale=0.55]{chart-1}
|
||||
\centering
|
||||
\captionsetup{width=0.80\textwidth}
|
||||
\caption{Repeated measurements of the fitness of the stochastic fixed algorithm (as a percentage of the word) against the number of iterations taken}
|
||||
\label{fig:fitness1}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[ht]
|
||||
\includegraphics[scale=0.65
|
||||
]{chart-2}
|
||||
\begin{figure}[H]
|
||||
\includegraphics[scale=0.55]{chart-2}
|
||||
\centering
|
||||
\captionsetup{width=0.80\textwidth}
|
||||
\caption{Repeated measurements of the fitness of the genetic algorithm (as a percentage of the word) against the number of iterations taken}
|
||||
\label{fig:fitness2}
|
||||
\end{figure}
|
||||
|
||||
\section{Discussion}
|
||||
% Make sure Qs are answered
|
||||
|
||||
\section{Conclusion}
|
||||
% Make sure Qs are answered
|
||||
\end{document}
|
||||
|
Reference in New Issue
Block a user