# Assigning Membership Values to Elements using Genetic Algorithm

### Genetic Algorithm

This uses Darwin’s theory of evolution – ‘existence of living things based on the fact survival of the fittest. New breeds come into existence through the process of

1. Reproduction.
2. Crossover.
3. Mutation.

For example let us consider the data set through which a linefit is required.

 Data Number xi yi 1 1.0 1.0 2 2.0 2.0 3 3.0 3.0 4 4.0 4.0

• for performing a linefit y = c1 x + c2, we first encode the parameters set c1, c2 in the form of bit strings.
• Bit strings are created with the random assignment of 1’s and zeros at different bit locations.
• We start with an initial population of 4 strings each of 12 bits in length.
• The first 6 bits encode the parameters c1 and next 6 bits encode the parameters c2.
• The min value of c1, c2 should be -2. The max value of c1, c2 should be +5. The above values are given in problem and change accordingly.
• By genetic algorithm generate the strings until we get a convergence to the solution for a relative fitness value of 0.8

Each bit string is mapped to the value of a parameter Ci, by the mapping

where,
b is binary equivalent of bit strings &
l is the length of the bit strings.

1. #### Reproduction :-

Among the three genetic operators reproduction is the process by which strings with better fitness vaules will send correspondingly better copies to next generations.

2. #### Crossover :-

The second operator Crossover is the process in which the strings are able to mix and match their desirable quantities in a random fashion.

3. #### Mutation :-

The third genetic operator mutation helps us in increasing the searching power. To understand the concept of mutation, let us consider the case where reproduction and crossover may not be able to find the optimum solution to a problem. During the creation of a generation it happens sometimes that all strings are missing a vital bit of information (for example bit d’o’ in all new string in zero). So mutation becomes important where future generations created using reproduction and crossover will not be able to give a convegent solution.

Mutation takes place very rarely with and its mutation rate is of the order of 0.005 / bit / generation

Scroll to Top