Chapter 5: Implementing a GA
Section 5.1: When Should a GA Be Used?
- Search space is large
- Search space is not well understood
- Fitness function is noisy
- Satisficing is acceptable
Section 5.2: Encoding a Problem for a GA
- Typically fixed length
- Typically fixed ordering
Binary Encodings
- There are variants, such as Gray coding
Many-Character and Real-Valued Encodings
Tree Encodings
- Variable length
- Example: Koza's Lisp programs
Section 5.3: Adapting the Encoding
- A potential solution for the linkage problem enabling
related loci to be close together
- A variable length encoding presents a larger solution space
Inversion
- Idea: if the original string is abcdefgh, the new string after
inversion might be abfedcgh
- The position of each gene now needs to be explicitly represented,
for example {(1, a) (2, b) (3, c) (4, d) (5, e) (6, f) (7, g) (8, h)}
- What is a potential problem with single point crossover?
- One potential solution is to use a master / slave approach
Exploring Crossover "Hot Spots"
- ! represents a crossover spot
- Parent 1: 1 0 0 1 ! 1 1 1 ! 1
- Parent 2: 0 0 0 0 0 0 ! 0 0
- Child 1: 1 0 0 1 ! 0 0 ! 1 ! 0
- Child 2: 0 0 0 0 1 1 0 1
Messy GAs
- Goldberg et. al.
- Loci can be overspecified
- Loci can be underspecified
- For example a binary chromosome of length four might be
{(1, 0) (2, 0) (4, 1) (4, 0)}
- For overspecified positions, read off the leftmost value
- For underspecified positions, do one bit hill climbing and
use the fitness of the local optimum
- Phase 1: Primordial Phase. Guess(!!) the order of a solution, k.
Generate all(!!) possible solutions of size k. Reduce the size
of the population using fitness based selection.
- Phase 2: Juxtaposition Phase. Use "cut" and "splice" to
produce the next generation. No mutation.
- The approach worked well on a 30 bit "deceptive problem" where
f(000) = 28, f(001) = 26, f(010) = 22, f(011) = 0, f(100) = 14,
f(101) = 0, f(110) = 0, f(111) = 30