0% found this document useful (0 votes)
31 views22 pages

Genetic Algorithm

Uploaded by

dilipy20022
Copyright
© © All Rights Reserved
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)
31 views22 pages

Genetic Algorithm

Uploaded by

dilipy20022
Copyright
© © All Rights Reserved
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/ 22

Genetic algorithm

The genetic algorithm (GA) is a search heuristic that mimics the process of natural evolution.

This heuristic is routinely used to generate useful solutions to optimization and search problems.

Genetic algorithms belong to the larger class of evolutionary algorithms (EA), which generate

solutions to optimization problems using techniques inspired by natural evolution, such as

inheritance, mutation, selection, and crossover.

Methodology
In a genetic algorithm, a population of strings (called chromosomes or the genotype of the

genome), which encode candidate solutions (called individuals, creatures, or phenotypes) to an

optimization problem, evolves toward better solutions. Traditionally, solutions are represented in

binary as strings of 0s and 1s, but other encodings are also possible. The evolution usually starts

from a population of randomly generated individuals and happens in generations. In each

generation, the fitness of every individual in the population is evaluated, multiple individuals are

stochastically selected from the current population (based on their fitness), and modified

(recombined and possibly randomly mutated) to form a new population. The new population is

then used in the next iteration of the algorithm. Commonly, the algorithm terminates when either

a maximum number of generations has been produced, or a satisfactory fitness level has been

reached for the population. If the algorithm has terminated due to a maximum number of

generations, a satisfactory solution may or may not have been reached.

Genetic algorithms find application in bioinformatics, phylogenetics, computational science,

engineering, economics, chemistry, manufacturing, mathematics, physics and other fields.

A typical genetic algorithm requires:

1. a genetic representation of the solution domain,

2. a fitness function to evaluate the solution domain.


A standard representation of the solution is as an array of bits. Arrays of other types and

structures can be used in essentially the same way. The main property that makes these genetic

representations convenient is that their parts are easily aligned due to their fixed size, which

facilitates simple crossover operations. Variable length representations may also be used, but

crossover implementation is more complex in this case. Tree-like representations are explored in

genetic programming and graph-form representations are explored in evolutionary programming.

The fitness function is defined over the genetic representation and measures the quality of the

represented solution. The fitness function is always problem dependent. For instance, in the

knapsack problem one wants to maximize the total value of objects that can be put in a knapsack

of some fixed capacity. A representation of a solution might be an array of bits, where each bit

represents a different object, and the value of the bit (0 or 1) represents whether or not the object

is in the knapsack. Not every such representation is valid, as the size of objects may exceed the

capacity of the knapsack. The fitness of the solution is the sum of values of all objects in the

knapsack if the representation is valid, or 0 otherwise. In some problems, it is hard or even

impossible to define the fitness expression; in these cases, interactive genetic algorithms are

used.

Once we have the genetic representation and the fitness function defined, GA proceeds to

initialize a population of solutions randomly, then improve it through repetitive application of

mutation, crossover, inversion and selection operators.

Initialization
Initially many individual solutions are randomly generated to form an initial population. The

population size depends on the nature of the problem, but typically contains several hundreds or

thousands of possible solutions. Traditionally, the population is generated randomly, covering

the entire range of possible solutions (the search space). Occasionally, the solutions may be

"seeded" in areas where optimal solutions are likely to be found.


Selection
During each successive generation, a proportion of the existing population is selected to breed a

new generation. Individual solutions are selected through a fitness-based process, where fitter

solutions (as measured by a fitness function) are typically more likely to be selected. Certain

selection methods rate the fitness of each solution and preferentially select the best solutions.

Other methods rate only a random sample of the population, as this process may be very time-
consuming.

Most functions are stochastic and designed so that a small proportion of less fit solutions are

selected. This helps keep the diversity of the population large, preventing premature convergence

on poor solutions. Popular and well-studied selection methods include roulette wheel selection

and tournament selection.

Reproduction
The next step is to generate a second generation population of solutions from those selected

through genetic operators: crossover (also called recombination), and/or mutation.

For each new solution to be produced, a pair of "parent" solutions is selected for breeding from

the pool selected previously. By producing a "child" solution using the above methods of

crossover and mutation, a new solution is created which typically shares many of the

characteristics of its "parents". New parents are selected for each new child, and the process

continues until a new population of solutions of appropriate size is generated. Although

reproduction methods that are based on the use of two parents are more "biology inspired", some

research suggests more than two "parents" are better to be used to reproduce a good quality

chromosome.

These processes ultimately result in the next generation population of chromosomes that is

different from the initial generation. Generally the average fitness will have increased by this

procedure for the population, since only the best organisms from the first generation are selected

for breeding, along with a small proportion of less fit solutions, for reasons already mentioned above.

Although Crossover and Mutation are known as the main genetic operators, it is possible to use

other operators such as regrouping, colonization-extinction, or migration in genetic algorithms.


Termination
This generational process is repeated until a termination condition has been reached. Common

terminating conditions are:

• A solution is found that satisfies minimum criteria

• Fixed number of generations reached

• Allocated budget (computation time/money) reached

• The highest ranking solution's fitness is reaching or has reached a plateau such that successive

iterations no longer produce better results

• Manual inspection

• Combinations of the above

Simple generational genetic algorithm pseudocode

1. Choose the initial population of individuals

2. Evaluate the fitness of each individual in that population

3. Repeat on this generation until termination: (time limit, sufficient fitness achieved, etc.)

1. Select the best-fit individuals for reproduction

2. Breed new individuals through crossover and mutation operations to give birth to

offspring

3. Evaluate the individual fitness of new individuals

4. Replace least-fit population with new individuals

Simple Genetic Algorithm


produce an initial population of individuals

evaluate the fitness of all individuals

while termination condition not met do

select fitter individuals for reproduction

recombine between individuals

mutate individuals

evaluate the fitness of the modified individuals

generate a new population End while.

End while

The building block hypothesis


The building block hypothesis
Genetic algorithms are simple to implement, but their behaviour is difficult to understand. In

particular it is difficult to understand why these algorithms frequently succeed at generating

solutions of high fitness when applied to practical problems. The building block hypothesis

(BBH) consists of:

1. A description of a heuristic that performs adaptation by identifying and recombining

"building blocks", i.e. low order, low defining-length schemata with above average

fitness.

2. A hypothesis that a genetic algorithm performs adaptation by implicitly and efficiently

implementing this heuristic.

Goldberg describes the heuristic as follows:

"Short, low order, and highly fit schemata are sampled, recombined [crossed over], and

resampled to form strings of potentially higher fitness. In a way, by working with these

particular schemata [the building blocks], we have reduced the complexity of our

problem; instead of building high-performance strings by trying every conceivable

combination, we construct better and better strings from the best partial solutions of past

samplings.

"Because highly fit schemata of low defining length and low order play such an

important role in the action of genetic algorithms, we have already given them a special

name: building blocks. Just as a child creates magnificent fortresses through the

arrangement of simple blocks of wood, so does a genetic algorithm seek near optimal

performance through the juxtaposition of short, low-order, high-performance schemata,

or building blocks.
Criticism of the building block hypothesis

The building block hypothesis has been sharply criticized on the grounds that it lacks theoretical

Justification, and experimental results have been published that draw the veracity of this

Hypothesis into question. On the theoretical side, for example, Wright et al. State that

“The various claims about Gas that are traditionally made under the name of the building

Block hypothesis have, to date, no basis in theory and, in some cases, are simply

Incoherent.”

On the experimental side uniform crossover was seen to outperform one-point and two-point

Crossover on many of the fitness functions studied by Syswerda. Summarizing these results,

Fogel remarks that

“Generally, uniform crossover yielded better performance than two-point crossover,

Which in turn yielded better performance than one-point crossover.”

Syswerda’s results contradict the building block hypothesis because uniform crossover is highly

Disruptive of short schemata, whereas one and two-point crossover are much less disruptive.

Given these problems with the building block hypothesis, the adaptive capacity of genetic

Algorithms is currently something of a mystery.

Variants

The simplest algorithm represents each chromosome as a bit string. Typically, numeric

Parameters can be represented by integers, though it is possible to use floating point

Representations. The floating point representation is natural to evolution strategies and

Evolutionary programming. The notion of real-valued genetic algorithms has been offered but is

Really a misnomer because it does not really represent the building block theory that was

Proposed by Holland in the 1970s. This theory is not without support though, based on

Theoretical and experimental results . The basic algorithm performs crossover and mutation at the
Bit level. Other variants treat the chromosome as a list of numbers which are indexes into an

Instruction table, nodes in a linked list, hashes, objects, or any other imaginable data structure.

Crossover and mutation are performed so as to respect data element boundaries. For most data

Types, specific variation operators can be designed. Different chromosomal data types seem to

Work better or worse for different specific problem domains.

When bit-string representations of integers are used, Gray coding is often employed. In this way,

Small changes in the integer can be readily effected through mutations or crossovers. This has

Been found to help prevent premature convergence at so called Hamming walls, in which too

Many simultaneous mutations (or crossover events) must occur in order to change the

Chromosome to a better solution.

Other approaches involve using arrays of real-valued numbers instead of bit strings to represent

Chromosomes. Theoretically, the smaller the alphabet, the better the performance, but

Paradoxically, good results have been obtained from using real-valued chromosomes.

A very successful (slight) variant of the general process of constructing a new population is to

Allow some of the better organisms from the current generation to carry over to the next,

Unaltered. This strategy is known as elitist selection.

Parallel implementations of genetic algorithms come in two flavours. Coarse-grained parallel

Genetic algorithms assume a population on each of the computer nodes and migration of

Individuals among the nodes. Fine-grained parallel genetic algorithms assume an individual on

Each processor node which acts with neighbouring individuals for selection and reproduction.

Other variants, like genetic algorithms for online optimization problems, introduce time dependence
or noise in the fitness function.

Genetic algorithms with adaptive parameters (adaptive genetic algorithms, AGAs) is another

Significant and promising variant of genetic algorithms. The probabilities of crossover (pc) and

Mutation (pm) greatly determine the degree of solution accuracy and the convergence speed that

Genetic algorithms can obtain. Instead of using fixed values of pc and pm, AGAs utilize the

Population information in each generation and adaptively adjust the pc and pm in order to

Maintain the population diversity as well as to sustain the convergence capacity. In AGA
(adaptive genetic algorithm), the adjustment of pc and pm depends on the fitness values of the

solutions. In CAGA (clustering-based adaptive genetic algorithm), through the use of clustering

analysis to judge the optimization states of the population, the adjustment of pc and pm depends

on these optimization states. The GEGA program is an ab initio gradient embedded GA, a

program for finding the global minima of clusters developed by Anastasia Alexandrova at Utah

State University. GEGA employs geometry-cuts for the GA, ab initio level of computation for

geometry optimization and vibrational frequency analysis, with local minima only, and a specific

mutational procedure based on the so called "kick technique".

It can be quite effective to combine GA with other optimization methods. GA tends to be quite

good at finding generally good global solutions, but quite inefficient at finding the last few

mutations to find the absolute optimum. Other techniques (such as simple hill climbing) are quite

efficient at finding absolute optimum in a limited region. Alternating GA and hill climbing can

improve the efficiency of GA while overcoming the lack of robustness of hill climbing.

This means that the rules of genetic variation may have a different meaning in the natural case.

For instance – provided that steps are stored in consecutive order – crossing over may sum a

number of steps from maternal DNA adding a number of steps from paternal DNA and so on.

This is like adding vectors that more probably may follow a ridge in the phenotypic landscape.

Thus, the efficiency of the process may be increased by many orders of magnitude. Moreover,

the inversion operator has the opportunity to place steps in consecutive order or any other

suitable order in favour of survival or efficiency. (See for instance or example in travelling

salesman problem.)

A variation, where the population as a whole is evolved rather than its individual members, is

known as gene pool recombination.

Problem domains
Problems which appear to be particularly appropriate for solution by genetic algorithms include

timetabling and scheduling problems, and many scheduling software packages are based on GAs.

GAs have also been applied to engineering. Genetic algorithms are often applied as an approach

to solve global optimization problems.


As a general rule of thumb genetic algorithms might be useful in problem domains that have a

complex fitness landscape as crossover is designed to move the population away from local

optima that a traditional hill climbing algorithm might get stuck in.

Examples of problems solved by genetic algorithms include: mirrors designed to funnel sunlight

to a solar collector, antennae designed to pick up radio signals in space, and walking methods
for

computer figures. Many of their solutions have been highly effective, unlike anything a human

engineer would have produced, and inscrutable as to how they arrived at that solution.

Functioning of a Genetic Algorithm


As an example, we're going to enter a world of simplified genetic. The "chromosomes" encode a

group of linked features. "Genes" encode the activation or deactivation of a feature. Let us

examine the global genetic pool of four basilosaurus belonging to this world. We will consider

the "chromosomes" which encode the length of anterior members. The length of the "paw" and

the length of the "fingers" are encoded by four genes : the first two encode the "paw" and the

other two encode the fingers.

In our representation of the genome, the circle on blue background depict the activation of a

feature, the cross on green background depict its deactivation. The ideal genome (short paws
and

long fingers) is : .

The genetic pool of our population is the following one :

Subject Genome

D
We can notice that A and B are the closest to their ancestors ; they've got quite long paws and

short fingers. On the contrary, D is close to the optimum, he just needs a small lengthening of his

fingers.

This is such a peculiar world that the ability to move is the main criteria of survival and

reproduction. No female would easily accept to marry basilosaurus whose paws would look like

A's. But they all dream to meet D one day.

The fitness is easy to compute : we just have to give one point to each gene corresponding to the

ideal. The perfect genome will then get four points. The probability of reproduction of a given

subject will directly depend on this value. In our case, we'll get the following results :

We’ll consider a cycle of reproduction with for descendants, i.e. four mating concerning height

Subjects. D will be selected four times and will then get four descendants. C will be selected

Twice and will get two descendants. Finally A and B will only be selected once.
The reproduction pattern is the following :
During reproduction crossovers occur at a random place (centre of the genome for A’, B’ and
C’,

Just after the first gene for D’). The link existing between the degree of adaptation and the

Probability of reproduction leads to a trend to the rise of the average fitness of the population.
In Our case, it jumps from 7 to 10.

During the following cycle of reproduction, C’ and D’ will have a common descendant :

D’ : + C’ : =

The new subject has inherited the intended genome : his paws have become flippers.

We can then see that the principle of genetic algorithms is simple :

1. Encoding of the problem in a binary string.


2. Random generation of a population. This one includes a genetic pool representing a

Group of possible solutions.

3. Reckoning of a fitness value for each subject. It will directly depend on the distance to

The optimum.

4. Selection of the subjects that will mate according to their share in the population
global Fitness.

5. Genomes crossover and mutations.

6. And then start again from point 3.


The functioning of a genetic algorithm can also be described in reference to genotype (GTYPE)

And phenotype (PTYPE) notions

1. Select pairs of GTYPE according to their PTYPE fitness.

2. Apply the genetic operators (crossover, mutation...) to create new GTYPE.

3. Develop GTYPE to get the PTYPE of a new generation and start again from 1.

Crossover is the basis of genetic algorithms, there is nevertheless other operators like mutation.

In fact, the desired solution may happen not to be present inside a given genetic pool, even a

Large one. Mutations allow the emergence of new genetic configurations which, by widening the

Pool improve the chances to find the optimal solution. Other operators like inversion are also

Possible, but we won’t deal with them here.

List of genetic algorithm applications

• Ant colony optimization (ACO) uses many ants (or agents) to traverse the solution space

And find locally productive areas. While usually inferior to genetic algorithms and other

Forms of local search, it is able to produce results in problems where no global or up-to-date
perspective can be obtained, and thus the other methods cannot be applied.

Bacteriologic algorithms (BA) inspired by evolutionary ecology and, more particularly,


• Bacteriologic algorithms (BA) inspired by evolutionary ecology and, more particularly,

Bacteriologic adaptation. Evolutionary ecology is the study of living organisms in the

Context of their environment, with the aim of discovering how they adapt. Its basic

Concept is that in a heterogeneous environment, you can’t find one individual that fits the

Whole environment. So, you need to reason at the population level. It is also believed

Bas could be successfully applied to complex positioning problems (antennas for cell

Phones, urban planning, and so on) or data mining.

• Cross-entropy method The cross-entropy (CE) method generates candidates solutions via

A parameterized probability distribution. The parameters are updated via cross-entrop

Minimization ,so as to generate better samples in the next generation

Cultural algorithm (CA) consists of the population component almost identical to that of

the genetic algorithm and, in addition, a knowledge component called the belief space.

• Evolutionary programming (EP) involves populations of solutions with primarily

mutation and selection and arbitrary representations. They use self-adaptation to adjust

parameters, and can include other variation operations such as combining information

from multiple parents.

• Extremal optimization (EO) Unlike GAs, which work with a population of candidate

solutions, EO evolves a single solution and makes local modifications to the worst

components. This requires that a suitable representation be selected which permits

individual solution components to be assigned a quality measure ("fitness"). The

governing principle behind this algorithm is that of emergent improvement through

selectively removing low-quality components and replacing them with a randomly

selected component. This is decidedly at odds with a GA that selects good solutions in an

attempt to make better solutions.


Conclusion
Genetic algorithms are original systems based on the supposed functioning of the Living. The

method is very different from classical optimization algorithms.

1. Use of the encoding of the parameters, not the parameters themselves.

2. Work on a population of points, not a unique one.

3. Use the only values of the function to optimize, not their derived function or other

auxiliary knowledge.

4. Use probabilistic transition function not determinist ones.

It's important to understand that the functioning of such an algorithm does not guarantee success.

We are in a stochastic system and a genetic pool may be too far from the solution, or for

example, a too fast convergence may halt the process of evolution. These algorithms are

nevertheless extremely efficient, and are used in fields as diverse as stock exchange, production

scheduling or programming of assembly robots in the automotive industry


References
Goldberg D., Genetic Algorithms, Addison Wesley, 1988.

J. H. Holland. Adaptation in Natural and Artificial Systems. The

University of Michigan Press, Ann Arbor, Michigan, 1975.

Z. Michalewicz. Genetic Algorithms + Data Structures = Evolution

Programs. Springer-Verlag, Berlin, third edition, 1996.

M. Sipper. Machine Nature: The Coming Age of Bio-Inspired Computing.

McGraw-Hill, New-York, first edition, 2002.

M. Tomassini. Evolutionary algorithms. In E. Sanchez and M. Tomassini,

editors, Towards Evolvable Hardware, volume 1062 of Lecture Notes in

Computer Science, pages 19-47. Springer-Verlag, Berlin, 1996.

C. Darwin. On the Origin of Species by Means of Natural Selection; or,

the Preservation of flavored Races in the Struggle for Life. John Murray,

London, 1859.

W. D. Hillis. Co-Evolving Parasites Improve Simulated Evolution as an

Optimization Procedure. Artificial Life 2, vol 10, Addison-Wesley, 1991.

You might also like