12
Applications of Genetic Algorithms TJHSST Computer Systems Lab 2008-2009 By Mary Linnell

Applications of Genetic Algorithms TJHSST Computer Systems Lab 2008-2009 By Mary Linnell

Embed Size (px)

Citation preview

Applications of Genetic Algorithms

TJHSST Computer Systems Lab2008-2009

By Mary Linnell

What is a Genetic Algorithm?

Evolutionary algorithm Population consisting of

individuals Needs a function to evaluate

each individual Least fit individuals killed off Best fit individuals breed with

rest of population

http://www.lifeinthefastlane.ca/wp-content/uploads/ 2007/10/king_penguin_breeding_1sfw.jpg

A population of penguins

Genetic Algorithm Applications

N Queens Problem Optimizing of Traveling

Salesman Problem Othello Any problem with a population

able to be characterized by a function

http://en.wikipedia.org/wiki/N_queens_problem

http://images.boardgamegeek.com/images/pic158681_md.jpg

Purpose and Goals

Find minimum point of a three-dimensional graph

Testing every point would involve too many computations

Use genetic algorithms to simplify this problem

Purpose and Goals

Vary the population size to see what is “best” If too small

Population not representative of search space Population will converge to a local minimum Too many random mutations to find true

solution If too large

Long run times Large amount of computer space and memory

Scope of Study and Project

C Genetic algorithm Analytical display of results

OpenGL 3D graphics Visual display of results

Approximate answer should closely match exact answer

Procedure and Methods

Wire-mesh display of graph with mouse controls

Lots of local minimums N randomly-generated

yellow points, where N is the number in the population

z=−cos x∗8.0 cos y∗8.0∗1−x ∗1− y

5.0

Controls

Reset: re-initializes all values, increments seed Step: steps through the genetic algorithm One iteration: runs 5 steps (a full cycle) Single Trial: runs a fixed number of iterations Multiple Trials: runs a fixed number of single trials

Procedure and Methods

Cycle of the genetic algorithm steps: 25% of the population population selected based on

the fitness function Delete selected points New points are bred based on best point Random mutation New points become part of the population

Results of a Single Trial

Should approximate exact answer Shown visually

Shown numerically

Results of Multiple Trials

True z-value for graph used: -0.84411 Population size of 8

Average result: -0.52009 Difference from true minimum: 0.32403

Future Testing

Change other parameters of genetic algorithm Change the equation of the graph See changes in performance and number of

iterations