Genetic Algorithms and Evolutionary Programming A Brief Overview

Genetic Algorithms and Evolutionary Programming A Brief Overview

What is Evolution?

Evolutionary Process

Encode Problem Determine Appropriate Fitness Function Pick Crossover and Mutation Techniques DURING DEVELOPMENT OF THE CODE REPEAT UNTIL RESULTS ARE SATISFACTORY Initialize an Initial Population Evaluate Fitness Selection based on Fitness Mutation Reproduction through Crossover Applying Evolution as a Programming Technique

� Great for coming up with a “suitable” solution to optimization problems that are too complicated for mathematical or conventional simulation methods. Genetic Algorithm Applications

My Experiment in Cryptanalysis: Decoding the Substitution Cipher

An “Individual” in a Population of Solutions has one “chromosome” which represents a potential cipher “key” (i. e. the 26 -letter string That tells the plain text what letters get replaced by what). An example “chromosome”: XAFGLBCVEIJHOUZNDKSWYQTRMP The code below generates a random individual for the initial population. Encoding the Problem

Cipher text message decrypted using the Individual’s “chromosome” as a key. Process that decrypted message using Frequency Analysis: Multiply the “counters” by weights and return the value. For each would-be-word in message. Add up the frequencies of each 2 letter combo found. Add up the frequencies of each 3 letter combo found. Update a bunch of “counter” variables. Check to see if that cluster is a word. Environmental Pressure: The Fitness Calculation

“Tournament Selection” 1. Pick a certain number of Individuals from the Population. 2. Find the one with the highest fitness. 3. Allow that Individual (tournament winner) to “breed”. “I’m a potential cipher key” Selection Process

Parent 1’s Chromosome: XAFGLBCVEIJHOUZNDKSWYQTRMP Parent 2’s Chromosome: DCBJKLFGVPOZQHIERMWSXTNUAY Parent 1’s Chromosome: XAFGLBCVEIJHOUZNDKSWYQTRMP Parent 2’s Chromosome: DBJLFGVPZQIERWSXTNUY Child’s Chromosome: -A----C----HO----K------MParent 1’s Chromosome: XAFGLBCVEIJHOUZNDKSWYQTRMP Parent 2’s Chromosome: Child’s Chromosome: DABJLFCGVPZHOQIERKWSXTNUMY This process repeats for 2 nd Child, except this time we start with Parent 2 and fill from Parent 1. Crossover/Reproduction

SNP’s or INDELS won’t work in this example, because we need the entire alphabet represented in the chromosome. Therefore, we utilize “Swap Mutation”. Individual’s Chromosome: XAFGLBCVEIJHOUZNDKSWYQTRMP XAFGLDCVEIJHOUZNBKSWYQTRMP Mutation

Overall Algorithm

Parameters and Results
- Slides: 13