0% found this document useful (0 votes)
44 views

09 Ga

This document discusses genetic algorithms and their application to solving optimization problems. It begins by describing the search space as the set of all possible solutions to a problem. It then provides background on genetic algorithms' inspiration from biological evolution, including concepts like chromosomes, reproduction, crossover and mutation. The basic genetic algorithm is outlined as initializing a population of solutions and then iteratively selecting parents, crossing over genes to create offspring, mutating some offspring, and replacing the population until a solution is found.

Uploaded by

chilledkarthik
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

09 Ga

This document discusses genetic algorithms and their application to solving optimization problems. It begins by describing the search space as the set of all possible solutions to a problem. It then provides background on genetic algorithms' inspiration from biological evolution, including concepts like chromosomes, reproduction, crossover and mutation. The basic genetic algorithm is outlined as initializing a population of solutions and then iteratively selecting parents, crossing over genes to create offspring, mutating some offspring, and replacing the population until a solution is found.

Uploaded by

chilledkarthik
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

CAD Algorithms

Genetic Algorithms
Mohammad Tehranipoor
ECE Department

16 September 2008

Search Space
If we are solving a problem, we are usually looking for some solution which will be the best among others. The space of all feasible solutions (the set of solutions among which the desired solution resides) is called search space (also state space). Each point in the search space represents one possible solution. Each possible solution can be "marked" by its value (or fitness) for the problem.

16 September 2008

Search Space
With GA we look for the best solution among a number of possible solutions - represented by one point in the search space. Looking for a solution is then equal to looking for some extreme value (minimum or maximum) in the search space. In the process of using GA, the process of finding solutions generates other points (possible solutions) as evolution proceeds.

16 September 2008

Search Space
The problem is that the search can be very complicated. One may not know:
where to look for a solution where to start

Many methods can be used for finding a suitable solution, but these methods do not necessarily provide the best solution.
Hill Climbing, Simulated Annealing, and Genetic Algorithm The solutions found by these methods are often considered as good solutions, because it is not often possible to prove what the optimum is.

16 September 2008

Biological Background
Genetic algorithms are a part of evolutionary computing, which is a rapidly growing area of artificial intelligence. Chromosome: All living organisms consist of cells. In each cell there is the same set of chromosomes. A chromosome consists of genes, blocks of DNA. Each gene has its own position in the chromosome.

16 September 2008

Biological Background
Reproduction:
During reproduction, recombination (or crossover) first occurs. Genes from parents combine to form a whole new chromosome. The newly created offspring can then be mutated. Mutation means that the elements of DNA are a bit changed. These changes are mainly caused by errors in copying genes from parents. The fitness of an organism is measured by success of the organism in its life (survival).

16 September 2008

Genetic Algorithm (GA)


Genetic algorithms are inspired by Darwin's theory of evolution.
http://www.darwins-theory-of-evolution.com/

Solution to a problem solved by genetic algorithms uses an evolutionary process (it is evolved).

16 September 2008

GA
Algorithm begins with a set of solutions (represented by chromosomes) called population. Solutions from one population are taken and used to form a new population. This is motivated by a hope, that the new population will be better than the old one. Solutions which are then selected to form new solutions (offspring) are selected according to their fitness - the more suitable they are the more chances they have to reproduce. This is repeated until some condition (for example number of populations or improvement of the best solution) is satisfied.
16 September 2008 8

Example
Population 1

Fitness

x
Solutions (search space)

16 September 2008

Cont.
Population 2

Fitness

x
Solutions

16 September 2008

10

Outline of the Basic Genetic Algorithm


[Start] Generate random population of n chromosomes [Fitness] Evaluate the fitness f(x) of each chromosome x in the population [New population] Create a new population by repeating following steps until the new population is complete
[Selection] Select two parent chromosomes from a population according to their fitness (the better fitness, the bigger chance to be selected) [Crossover] With a crossover probability cross over the parents to form new offspring (children). If no crossover was performed, offspring is the exact copy of parents. [Mutation] With a mutation probability mutate new offspring at each locus (position in chromosome). [Accepting] Place new offspring in the new population

[Replace] Use new generated population for a further run of the algorithm [Test] If the end condition is satisfied, stop, and return the best solution in current population [Loop] Go to step 2

16 September 2008

11

Operators of GA
Encoding of a Chromosome
A chromosome should contain information about solution that it represents. The most used way of

encoding is a binary string.


Example: Chromosome 1: 1101100100110110 Chromosome 2: 1101111000011110 Each chromosome is represented by a binary string. Each bit in the string can represent some characteristics of the solution. Another possibility is that the whole string can represent a number.
16 September 2008 12

Encoding of a Chromosome
There are many other ways of encoding. The encoding depends mainly on the solved problem and potential solution. For example, one can encode directly integer or real numbers. Binary string is the most widely used one.

16 September 2008

13

Crossover
After we have decided what encoding we will use, we can proceed to crossover operation. Crossover operates on selected genes from parent chromosomes and creates new offspring. Choose randomly some crossover point and copy everything before this point from the first parent and then copy everything after the crossover point from the other parent.

16 September 2008

14

Crossover
Example: ( | is the crossover point): Chromosome 1: 11011 | 00100110110 Chromosome 2: 11011 | 11000011110 Offspring 1: Offspring 2: 11011 | 11000011110 11011 | 00100110110

There are other ways to make crossover


E.g., choose more crossover points

Crossover can be quite complicated and depends mainly on the encoding of chromosomes. Specific crossover made for a specific problem can improve performance of the genetic algorithm.
16 September 2008 15

Mutation
After a crossover is performed, mutation takes place. Mutation is intended to prevent falling of all solutions in the population into a local optimum of the solved problem. Mutation operation randomly changes the offspring resulted from crossover. In case of binary encoding we can switch a few randomly chosen bits from 1 to 0 or from 0 to 1.

16 September 2008

16

Mutation
Mutation can be then illustrated as follows: Original offspring 1: 1101111000011110 Original offspring 2: 1101100100110110 Mutated offspring 1: 1100111000011110 Mutated offspring 2: 1101101100110110 The technique of mutation (as well as crossover) depends mainly on the encoding of chromosomes.

16 September 2008

17

You might also like