Dilan Dlshad
Dilan Dlshad
Charmo of University
Computer science
CODE:150106039
(Genetic Algorithms)
Prepared by
(Dailan Dlshad saaed)
Supervised
(Zrar Khald Abdul)
2019-2020
Content
FUNCTION MAXIMIZATIONOne 4
Reslut 9
BIBLIOGRAPHY 13
1
Introduction to Genetic Algorithms
ABSTRACTA
2
the laws of motion. In understanding the environment, we often have to
discern the optimization problem to fully understand its solution.
3
AN OVERVIEW OF GENETIC ALGORITHMSA genetic:
algorithm is a type of searching algorithm. It searches a solution spacefor an
optimal solution to a problem. The key characteristic of the genetic
algorithm ishow the searching is done. The algorithm creates a “population”
of possible solutions tothe problem and lets them “evolve” over multiple
generations to find better and bettersolutions. The generic form of the
genetic algorithm is found in Figure 1. The items inbold in the algorithm are
defined here.The population is the collection of candidate solutions that we
are consideringduring the course of the algorithm. Over the generations of
the algorithm, new membersare “born” into the population, while others
“die” out of the population. A single solutionin the population is referred to
as an individual. The fitness of an individual is a measureof how “good” the
solution represented by the individual is. The better the solution, thehigher
the fitness – obviously, this is dependent on the problem to be solved.
FUNCTION MAXIMIZATIONOne
4
could probably be solved using multi-variable calculus (although this
author’s skillsin that area are pretty rusty!), but it is a good simple example
of the use of geneticalgorithms. To use the genetic algorithm, we need to
answer the questions listed in theprevious section.
5
all the individuals. In the example above, that would give the first
individuala 40% chance of being selected, the second a 20%
chance, the third a 30% chance, andthe fourth a 10% chance.
Clearly this is giving the better individuals more chances to
beselected.A similar approach could be used with the average
fitness calculations. This wouldgive the first individual a 72%
chance, the second a 5% chance, the third a 22% chance,and the
fourth a 1% chance. This method makes the probability more
dependent on therelative evaluation functions of each individual.
6
the first and third individuals are chosen for cross-over
(makingsense, as these are the two top individuals). Keep in mind
that the selection process israndom, however. The fourth and
fourteenth bits are randomly selected to define thesubstring to be
swapped, so the cross-over looks like this:1010111010000011
1010111010000011 1011011011101011 6
60111011011101011 0111011011101011
0110111010000011Thus, two new individuals are created. We
should keep creating new individualsuntil we have created enough
to replace the entire population – in our example, we needone more
cross-over. Assume that the first and fourth individuals are
selected this time.Note that an individual may be selected multiple
times for breeding, while otherindividuals might never be selected.
Further assume that the eleventh and sixteenth bitsare randomly
selected for the cross-over point. We would see a second cross-
over likethis:
1201010111010000011 1010111010000011
1010111010000000 6 60001011010000000
0001011010000000 0001011010000011So, our second
generation population is: 1011 0110 1110 1011 0110 1110 1000
0011 1010 1110 1000 0000 0001 0110 1000 00112.5. How are
individuals mutated?Finally, we need to allow individuals to
mutate. When using bit strings, the easiestway to implement the
7
mutation is to allow every single bit in every individual a chanceto
mutate. This chance should be very small, since we don’t want to
have individualschanging dramatically due to mutation. Setting
the percentage so that roughly one bit perindividual will change on
average is probably a reasonably good number.The mutation will
consist of having the bit “flip” – a 1 changes to a 0 and a 0changes
to a 1. In our example, assume that the bold and italicized bits
have been chosenfor mutation: 1011011011101011 6
1011011011101011 0110111010000011 6 0110101010000011
1010111010000000 6 1010111010010000 0001011010000011 6
0101011010000001
8
Reslut
9
Algorithms are evaluated based on some criteria, and the best
algorithms are combined to form a next generation of algorithms,
some of which at least should perform better.
10
Genetic algorithms, on the other hand, search a domain based on
the biological principles of genetics. They apply successive efforts
with sets of algorithms based on the previous set in order to
optimize the fitness score. Also, typically a genetic algorithm
attempts to optimize; that is, find a relative fitness in the search
space. Searches parallel across the space, so that it doesn’t focus
on a local optimization. It’s possible, even likely, that the fitness
function may go down during successive generations before rising
again.
11
function, your algorithm might take the two results with the
desired letters, and combine them into new sets of letters. Based
on the information contained in the preceding generation, this has
the potential to result in a better fitness score. Eventually, the
algorithm series may converge on the right answer, or at least a
“good enough” answer.
You can also introduce mutation into the process; that is, injecting
random values into the next generation. That has the effect of
possibly accelerating the process of reaching an optimal result.
12
BIBLIOGRAPHY
13
6. Goldberg, D. E. (1989).Genetic algorithms in search,
optimization, and machine learning. New York: Addison-Wes l
ey
14