Search Search is a key component of intelligent problem solving Search can be used to Find a desired goal if time allows Get closer to the goal if time is not enough section 11 page 1
The size of the search space Main Factors Affecting Search Knowledge about the search space section 11 page 2
Different Search Techniques Weak Techniques Exhaustive Search Heuristic Search Strong Techniques Expert Systems section 11 page 3
Some Drawbacks of Search Techniques Weak Techniques Exhaustive Search is not efficient in large search spaces Heuristic Search may get stuck in local minima Strong Techniques Expert Systems need a source of knowledge section 11 page 4
Genetic Algorithms as Search Techniques A very general search technique that can be applied to a broad class of problems specially When there is no heuristic or expert knowledge and When the search space is too large for random search section 11 page 5
Genetic Algorithms as Search Techniques Genetic algorithms can be used to Find a desired goal - if time allows Get closer to the goal - if time is not enough section 11 page 6
Genetic Algorithms as Search Techniques Genetic algorithms require A way to represent candidate solutions 1 1 1 1 0 0 0 0 0 A way to measure the fitness of each candidate solution fitness = x 2 = 480 2 = 230400 section 11 page 7
Genetic Algorithms What Are They? They are search algorithms that use some of the same mechanisms found in natural genetics Survival of the fittest Random information exchange Developed by J. Holland about 1975 at U of Michigan section 11 page 8
The Basic Mechanisms starting measure fitness higher fitness lower fitness measure fitness select based on fitness new recombine selected CREATION OF A NEW GROUP FROM THE MORE HIGHLY FIT INDIVIDUALS section 11 page 9
Survival Based on Fitness higher fitness lower fitness selection based on probability selected The probability of being selected is directly proportional to the fitness of each individual. Example fitness (1) = 20% of total fitness (2) = 15% of total fitness (3) = 15% of total fitness (4) = 13% of total fitness (5) = 10% of total fitness (6) = 10% of total fitness (7) = 5% of total fitness (8) = 4% of total fitness (9) = 3% of total fitness (10) = 2% of total fitness (11) = 2% of total fitness (12) = 1% of total Possible outcome of selection: 1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 8 Another possible outcome of selection: 1, 1, 3, 3, 4, 5, 6, 7, 8, 9, 10, 12 section 11 page 10
The Next Generation selected recombination new New individuals are created from different pieces of the selected Example A pair selected from among the selected 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 New individuals created from the above pair 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 section 11 page 11
The Next Generation selected new recombination mutation new A very small percentage of recombined individuals are changed randomly Example A pair selected from among the selected 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 New individuals created from the above pair 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 New individuals created after mutation 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 0 0 1 0 0
Characteristics of Genetic Algorithms Search is done not from a single individual point but from numerous points Fitness drives the search process New search points are derived probabilistically from previous higher fit points Randomness is also included in the search process section 11 page 13
A Simple GA Example Representation of the Solution Space - Binary coding Genetic Operations - Reproduction - Crossover - Mutation section 11 page 14
A Simple GA Example Optimizing Problem: Find the value of x that maximizes the function f(x) = x 2. x is permitted to vary between 0 and 31. output Step 1. Find a string to code the parameter "x" Use a 5 bit unsigned The fitness function is just x 2 Step 2. Select an initial population In this case a population of 4 strings is selected at random. Tossing a coin 20 times and assigning 1s or 0s depending on the outcome may yield the following 0 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 0 1 1 section 11 page 15
GA Example Continues Step 3. Calculate the optimizing function value (fitness) and the percentage of total fitness for each string String # Initial Population X value f(x) value % fitness 1 2 3 4 0 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 0 1 1 13 24 8 19 169 576 64 361 169/1170 = 14.4 % 576/1170 = 49.2 % 64/1170 = 5.5 % 361/1170 = 30.9 % 1170 Step 4. Select the strings to be used for reproduction 30.9% 5.5% 14.4% 49.2% String # 1 2 3 4 Actual Simulation in 4 spins Actual Count 1 2 0 1 section 11 page 16
GA Example Continues Step 5. Actual reproduction and mutation Mutation is the occasional random alteration of the value of a string position. It can prevent premature loss of important parts of the solution Empirically, a mutation rate of 1 per 1000 bit has led to good results In our example with a total of 5 * 4 = 20 bits, only 0.001 * 20 = 0.02 bits would be expected to mutate. Continuing with our original example Mating Pool Population Mate Crossover Site Mates New Population 1 1 0 0 0 1 1 0 0 0 1 0 0 1 1 0 1 1 0 1 4 3 2 1 4 2 2 4 0 1 1 0 1 1 1 0 0 0 1 0 0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 0 1 0 0 0 0 1 1 0 1 1 mutated section 11 page 17
GA Example Continues Step 6. Calculate the optimizing function value (fitness) and the percentage of total fitness for each string String # New Population X value f(x) value % fitness 1 2 3 4 0 1 1 0 0 1 1 0 0 0 1 0 0 0 0 1 1 0 1 1 12 24 16 27 144 576 256 729 144/1705 = 8.5 % 576/1705 = 33.8 % 256/1705 = 15 % 729/1705 = 42.8 % 1705 Maximum fitness has increased from 576 to 729 section 11 page 18
Survival of the fittest Why Genetic Algorithms work Strings with high fitness values have a higher probability of contributing one or more offsprings in the next generation The best string, 1 1 0 1 1, is the result of combining two substrings 1 1 * * * and * * * 1 1. These substrings come from two above-average strings 1 1 0 0 0 and 1 0 0 1 1 section 11 page 19
Similarity Templates How do we find similarities among highly fit strings? 0 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 Strings with 3 ones in the middle? All of these match * 1 1 1 * A schema or similarity template is a string over the extended alphabet { 0 1 * } Schema is the mechanism that allows us to consider similarities among the members of a string population A large amount of information is contained within the substrings. But how do reproduction, crossover, and mutation exploit this wealth of information contained in schemata? section 11 page 20
Building Blocks Building blocks are highly fit, short-defining-length schemata 1 1 * * * * 1 1 * * * * 1 1 * Reproduction aids in the search by including in the mating pool a higher proportion of building blocks than other less fit substrings. Crossover does not disturb short-defining-length schemata. 1 * * * 1 is more likely to be disrupted by crossover. 1 1 * * * is less likely to be disrupted by crossover. Instead, crossover helps bring together short -defining-length schemata. Mutation at normal low rates does not disrupt a particular schema very frequently. In conclusion: "highly fit, short-defining-length schemata (or building blocks) are propagated generation to generation by giving exponentially increasing samples to the observed best. This happens automatically in the GA search process." section 11 page 21
Review Questions Which two mechanisms found in biological systems are also found in Genetic Algorithms Name two reasons why calculus-based search techniques may fail. Explain how Genetic Algorithms are not affected by these limitations section 11 page 22