genetic algorithms nehaya tayseer 1.introduction what is a genetic algorithm? a search technique...

23

Post on 21-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions
Page 2: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Genetic Algorithms

Nehaya Tayseer

Page 3: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

1.Introduction

What is a Genetic algorithm? A search technique used in computer

science to find approximate solutions for optimization and search problems

A class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, natural selection, and recombination (or crossover).

Page 4: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- What is a Genetic algorithm?

Typically implemented as a computer simulation in which a population of abstract representations (called chromosomes) of candidate solutions (called individuals) to an optimization problem evolves toward better solutions.

Page 5: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Introduction

Some History! Genetic algorithms originated from the studies of cellular

automata, conducted by John Holland and his colleagues at the University of Michigan in the mid 70’s.

The first commercial genetic algorithm, called the evolver, was produced in 1985.

now used by a majority of 500 companies to solve difficult scheduling, data fitting, trend spotting and budgeting problems

Page 6: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

2. Optimization Problems

In mathematics, the term optimization, or mathematical programming, refers to the study of problems in which one seeks to minimize or maximize a real function by systematically choosing the values of real or integer variables from within an allowed set.

Page 7: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Optimization Problems

- A Simple Case

8

22

6

5

3

12

5

City A

City B

City E

City D

City C

Figure 1: an example of a small sized optimization problem, here we have exactly 5 paths between city A and B. the number above the path is the cost of exploring the path. The optimal path is A,E,D,B with a total cost of 6.

Page 8: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Optimization Problems:Why do we need non trivial Techniques?

City A City

B

Figure 2: an Example of a huge solution space, assume we have n cities between A and B. the n cities are fully connected then the solution space is n! size. Computationally, this problem is defined as NP-Hard.

Page 9: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Optimization Problems:Why do we need non trivial Techniques?

Possible Solutions:

- Choose any path.

- Local Search algorithms

- Genetic Algorithms

- Neural Networks

Page 10: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

The Canonical Genetic Algorithm

Typical Operations in any Genetic Algorithm include: Initialization Selection Crossover Mutation Termination

Page 11: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

Initialization Many individual solutions are randomly generated to

form an initial population The population size depends on the nature of the

problem (typically several hundreds) Each member of this population will be a binary

string of length L which corresponds to the problem encoding

Strings (individuals) are usually called Chromosomes.

Page 12: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

Selection each string is then evaluated and assigned a fitness function.

A fitness function is a particular type of objective function that quantifies the optimality of a solution (that is, a chromosome) in a genetic algorithm so that that particular chromosome may be ranked against all the other chromosomes

Page 13: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

Selection In the canonical genetic algorithm, fitness is defined by:

Where fi is the evaluation associated with string i and fº is the average evaluation of all the strings in the population.

Fitness can also be assigned based on a string's rank in the population or by sampling methods

f

f i

Page 14: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

Selection (Duplication)

Recombination (Crossover)

String 1

String 2

String 3

String 4

String 1

String 1

Sring 2

String 3

String 3

String 3

OffSpring A

OffSpringB

OffSpringC

OffSpringD

OffSpringE

OffSpringF

Current Generation

Intermediate Generation

Next Generation

Figure 3: One generation is broken down into a selection phase and recombination phase.

Page 15: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

Selection Methods

- Stochastic sampling with replacement: We might view the population as mapping onto a roulette wheel, where each individual is represented by a space that proportionally corresponds to its fitness. By repeatedly spinning the roulette wheel, individuals are chosen.

Page 16: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

Selection Methods- Remainder stochastic sampling : if fitness is greater

than 1.0, the integer portion of this number indicates how many copies of that string are directly placed in the intermediate population. All strings (including those with less than 1.0) then place additional copies In the intermediate population with a probability corresponding to the fractional portion of the fitness.

Page 17: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

Remainder stochastic sampling Example, a string with fitness 1.36 places 1

copy in the intermediate population, and then receives a 0.36 chance of placing a second copy. A string with a fitness of 0.54 has a 0.54 chance of placing one string in the intermediate population

Page 18: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

Crossover Creating the next population from the

intermediate population One point crossover

Page 19: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

One point crossover Example

- Father: 1101001100101101

- Mother: yxyyxyxxyyyxyxxy

- Crossover: 11010 \ / 01100101101

yxyyx / \ yxxyyyxyxxy

- Children: 11010yxxyyyxyxxy and

yxyyx01100101101

Page 20: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

Mutation Maintains genetic diversity from one generation of

chromosomes to the next. It is analogous to biological mutation.

Usually performed by either flipping one bit in the chosen chromosome or setting the bit to 0 or 1.

Typically the mutation rate is applied with less than 1% probability.

Page 21: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Cont’d- Canonical GA

Termination The process of evaluation, selection, recombination

and mutation forms one generation in the execution of a genetic algorithm.

Common terminating conditions are A solution is found that satisfies minimum criteria Fixed number of generations reached Allocated budget (computation time/money) reached Manual inspection Combinations of the above.

Page 22: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Some Applications

Artificial Creativity Code Breaking Design of water distribution systems Traveling Salesman Problem Scheduling applications Electronic circuit design

Page 23: Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions

Thank You