Presentation is loading. Please wait.

Presentation is loading. Please wait.

GENETIC ALGORITHM By Siti Rohajawati. Definition Genetic algorithms are sets of computational procedures that conceptually follow steps inspired by the.

Similar presentations


Presentation on theme: "GENETIC ALGORITHM By Siti Rohajawati. Definition Genetic algorithms are sets of computational procedures that conceptually follow steps inspired by the."— Presentation transcript:

1 GENETIC ALGORITHM By Siti Rohajawati

2 Definition Genetic algorithms are sets of computational procedures that conceptually follow steps inspired by the biological processes of evolution. Better and better solutions evolve from previous generations until an optimal or near optimal solution is obtained.

3 Genetic algorithms (also known as evolutionary algorithms) demonstrate self- organization and adaptation in much the same way that the fittest biological organisms survive and reproduce.

4 The method learns by producing offspring that are better and better as measured by a fitness (to survive) function. Algorithms of this type have been applied to problems like vehicle routing (Baker and Syechew, 2003), bangkruptcy prediction (Shin and Lee, 2000), and Web Search (Nick and Themis, 2001).

5 Process GA

6 Selection Process Fitness proportionate selection Rank Selection Tournament Selection Steady-State Selection Elitism

7 The Vector Games – To illustrate how genetic algorithms work, we describe the Vector Game (Walbridge, 1989). This games is similar to MasterMind. As your opponent give you clues about how good your guess is (a fitness function), you create a new solution using knowledge of the current solutions and their quality.

8 Description – Vector is played against an opponent who secretly writes down a string of six digits (in a genetic algorithm, this string consists of chromosomes), Each digit can be either 0 or 1. – For this example, the secret number is 001010. You must try to guess this number as quickly as possible. You present a number (a guess) to your opponent, and he or she tells you how many of the digits (but not which ones) you guessed are correct (the fitness function or quality of your guess). – For example, the guess 110101 has no correct digits (score = 0). The guess 111101 has only one correct digit (the third one). Thus, the score (the fitness, or value, of the solution) = 1

9 RANDOM TRIAL AND ERROR There are 64 possible six-digit strings of number. If you pick numbers at random, it will take, on average, 32 guesses to obtain the right answer. Can you do it faster? Yes, if you can interpret the feedback provided to you by your opponent (a measured of the goodness or fitness of your guess). This is how a genetic algorithm works.

10 GA Solution Step 1: Present to your opponent four strings selected at random. (Select four arbitrarily, through experimentation, you may find that five or six would be better). Assume that you have selected these four: – (A)110100: for a score = 1 (one digit correctly guessed) – (B)111101: score = 1 – (C)011011: score = 4 – (D)101100: score = 3 Because none of these strings is entirely correct, continue

11 Step 2: Delete (A) and (B) because of their low scores. Call (C) and (D) parents. Step 3: “Mate” the parents by splitting each number as shown between the second and third digits (the position of the split is randomly selected): – (C) 01:1011 – (D)10:1100

12 Now combine the first two digits of (C) with the last four of (D) (this is called CROSSOVER). The result is (E), the first offspring: – (E)011100: score = 3 Similarity, combine the first two digits of (D) with the last four of (C). The result is (F), the second offspring: – (F)101011: score = 4 It looks as though the offspring are not doing much better than the parents.

13 Step 4: Now copy the original (C) and (D). Step 5: Mate and crossover the new parents, but use a different split. Now you have two new offspring, (G) and (H): – (C)0110:11 – (D)1011:00 – (G)011000: score = 4 – (H)101111: score = 3

14 Next, repeat step 2: Select the best “couple” from all the previous solutions to reproduce. You have several options, such as (G) and (C). Select (G) and (F). Now duplicate and crossover. Here are the results: – (F)1:01011 – (G)0:11000 – (I)111000: score = 3 – (J)001011: score = 5

15 You can also generate more offspring: – (F)101:011 – (G)011:000 – (K)101000: score = 4 – (L)011011: score = 4 Now repeat the process with (J) and (K) as parents, and duplicate the crossover: – (J)00101:1 – (K)10100:0 – (M)001010: score = 6 This is it! You have reached the solution after 13 guessed. Not bad when compared to the average of 32 for a random guess out of 64 possibilities.


Download ppt "GENETIC ALGORITHM By Siti Rohajawati. Definition Genetic algorithms are sets of computational procedures that conceptually follow steps inspired by the."

Similar presentations


Ads by Google