Genetic Algorithm Implementation

Table of Content

There are three main steps for genetic algorithm which is random initialization of population, evaluation of fitness function and generation of new population. In random initialization of population, the initial population is created randomly with even number of individuals. An individual is characterized by a fixed-length binary bit string, which is called a chromosome. In evaluation of fitness function all the individuals of the initially created population are evaluated by means of a fitness function . The fitness function is then used in the next step, to create a genetic pool.

After evaluating the fitness of the individuals of the initial population, a new population is created. The creation of a new generation is performed basically in three stages, reproduction, crossover and mutation. The overall goal of this step is to obtain a new population with individuals which have high fitness values. In reproduction stage, the individuals are selected among the population depending on their fitness values i. E. Individuals with lower fitness values are eliminated, whilst the others with higher fitness values are copied to the next generation one or more times.

This essay could be plagiarized. Get your custom essay
“Dirty Pretty Things” Acts of Desperation: The State of Being Desperate
128 writers

ready to help you now

Get original paper

Without paying upfront

The population after reproduction stage is called mating pool. In crossover stage, a genetic crossover operator is applied to the mating LOL to generate new individuals. Thus individuals of the mating pool are paired randomly, and genetic couples are obtained. There are many crossover operators can be used but the most basic crossover operator is the one-point crossover operator, in this case a crossover point in the string bits of the selected pair is randomly chosen, and the bits of the two parents are interchanged at this point.

In two-point crossover operation, the two crossover points are selected in the binary strings of the pair under consideration and between these points the bits are swapped. This crossover process is similar to the mating process in a biological system, where parents pass segments of chromosomes to their offspring and thus offspring can outperform their parents if they get ‘good’ genes from both parents. In a mutation process it introduces further changes to a bit string.

This is required because if the population does not contain all the encoded information required to solve a specific problem, no amount of gene mixing can provide a satisfactory solution. By applying the mutation operator, it is possible to produce new chromosomes. This can be implemented in various ways, and the most common technique is to change a randomly chosen bit in the bit string of the individual to be mutated. Thus certain bit is changed from 1 into O or from 0 into (b) List and explain any TWO (2) Genetic Algorithm operators with examples.

The 2 Generic Algorithm operators are Crossover and Mutation. Performance of Genetic Algorithm very depends on them. Type and implementation of operators depends on encoding and also on a problem. Crossover Crossover is a genetic operator that combines or mixing two chromosomes o produce a new chromosome. Main idea about crossover is that the new chromosome may be better than both of the two chromosomes. Crossover will occur during evolution according to a user definable crossover probability and crossover selects genes from parent’s chromosomes and it will create a new offspring.

There are 5 crossovers such as one point, two point, uniform, arithmetic and heuristic. Single point – one crossover point is selected, binary string from beginning of chromosome to the crossover point is copied from one parent, the rest is copied from the second parent. Two point – two crossover point are selected, binary string from beginning of chromosome to the first crossover point is copied from one parent, the part from the first to the second crossover point is copied from the second parent and the rest is copied from the first parent. Uniform – bits are randomly copied from the first or from the second parent.

Arithmetic – some arithmetic operation is performed to make a new offspring. Mutation Mutation is a genetic operator used to maintain genetic diversity from one generation of a population of chromosomes to the next and after a crossover is reform, mutation will take place. Mutation occurs during evolution according to a user definable mutation probability, the mutation rate is the probability a bit changes from O to 1 or 1 to 0. However, usually mutation rate is set to very small value. The mutation depends on the encoding as well as the crossover.

For example, when we are encoding permutations, mutation could be exchanging two genes. Mutation can be following: Original offspring 2 : 1101100100110110 Mutated offspring 2 : 1101101100110110 (c) Discuss the main roles of a fitness function in Genetic Algorithm implementation. The most difficult and most important concept of genetic algorithm is the fitness function and it is more responsible for performing evaluation and returning a positive integer number, or fitness value, that reflect how optimal the solution is, it occur when the higher the number, the better the solution.

The fitness values are then used in a process of natural selection to decide which possible solutions will continue on to the next generation. Besides that, the fitness function will maximize or minimized depending on the problems that having with. Finally, o make it simple the main roles of fitness function is to provide a meaningful, measurable and comparable value given a set of genes. QUESTION 2 (a) Summation function plays an important role in machine learning algorithms such as the perception.

Briefly explain the role of a summation function in perception. Support your answers by diagrams whenever appropriate. i) Summing function allows a neuron to add while the other causes it to subtract. Ii) Allow software engineers to create their own summing functions via routines coded in a higher level language (commonly C language). Ii) The summing function is further complicated by the addition of an activation function which enables the summing function to operate in a time sensitive way. B) Describe Backstopping algorithm in detail. Backstopping algorithm, in order to make sure neural network to execute some task, weight adjustment should be done of each unit in such a way whereby error’s between the desired output and also the actual output will be reduced. This process actually requires to that the neural network computes the error which is the derivative of the weights (EWE). It means that, must know how to calculate the error changes as each weight is increased or has it decreased slightly.

Backstopping algorithm is the easiest method to understand it all, if and only if all the units in the network are linear. The algorithm calculates or computes each EWE by first computing the EAI, the rate where the error changes when the activity level of a unit is changed. EAI is only simply the output unit difference between the actual and desired outputs. In order to compute EAI for the layer just before the output layer, it is a must to identify all the weights teens that hidden unit and also the output units which is connected.

Cite this page

Genetic Algorithm Implementation. (2018, May 09). Retrieved from

https://graduateway.com/genetic-algorithm-implementation/

Remember! This essay was written by a student

You can get a custom paper by one of our expert writers

Order custom paper Without paying upfront