Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ch.12 Machine Learning Genetic Algorithm Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2011.

Similar presentations


Presentation on theme: "Ch.12 Machine Learning Genetic Algorithm Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2011."— Presentation transcript:

1 Ch.12 Machine Learning Genetic Algorithm Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2011

2 Genetic Algorithm (GA) GA view learning as a competition among a population of evolving candidate problem solutions. A “fitness” function evaluates each solution to decide whether it will contribute to the next generation of solutions

3 Genetic Algorithm

4 Basic functions of Genetic Algorithm (GA) Crossover Mutation: takes a single candidate and randomly changes some aspect of it Inversion

5 Genetic Algorithm Example: Traveling Salesperson problem The Traveling salesperson problem Suppose a salesperson has five cities to visit and then must return home The goal of the problem is to find the shortest path for the salesperson to travel

6 Genetic Algorithm Traveling Salesperson Problem (TSP) is classic to AI and computer science It has been shown to be NP-hard problem TSP has some very nice applications, including Circuit board drilling X-ray crystallography Routing in VLSI fabrications Some of these applications required to travel tens of thousands points (cities)

7 Genetic Algorithm How might we use genetic algorithm (GA) to solve traveling salesperson problem (TSP)? First of all, the choice of a representation for the path of cities visited in not trivial Give each city an numeric name The design of fitness function is much easier

8 Genetic Algorithm Now, the problem is how to crossover? P1= (192465783) P2= (459187623)

9 Genetic Algorithm First of all, select two cut point, indicate by a “|”, which are randomly inserted into the same location of each parent P1= (192 | 4657 | 83) P2= (459 | 1876 | 23)

10 Genetic Algorithm Two children C1 and C2 are produced in the following way. First, the segments between cut points are copied into the offspring: C1= (XXX | 4657 | XX) C2= (XXX | 1876 | XX)

11 Genetic Algorithm Next, starting from the second cut point of one parent, the cities from the other parent are copied in the same order, omitting cities already present When the end of the string is reached, continue on from the beginning Thus, the sequence of cities from P2 (459 | 1876 | 23) is 23 459 1876

12 Genetic Algorithm For C1= (XXX | 4657 | XX), once 4657 are removed from the sequence generated by P2, we get the sequence 23918. Then we just use these numbers to fill in the XXX XX portion in order Thus, C1=(239 | 4657 | 18)

13 Genetic Algorithm So, what is C2?

14 Genetic Algorithm Mutation: A mutation operation could be defined that randomly selected a city and placed it in a new randomly selected location in the path Randomly selected two cities and swap their location

15 Genetic Algorithm Inversion: Just reverse the order


Download ppt "Ch.12 Machine Learning Genetic Algorithm Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2011."

Similar presentations


Ads by Google