Friday, October 30, 2009

Workings of Algorithms





Genetic Algorithm is an effective method for solving a problem using a finite sequence of instructions. Algorithms are used for calculation, data processing, and many other fields.

Genetic Alogrithms are adaptive search techniques that can learn high performance knowledge structures. The genetic algorithms' strength comes from the implicitly parallel search of the solution space that it performs via a population of candidate solutions and this population is manipulated in the simulation. The candidate solutions represent every possible behaviour of the robot and based on the overall performance of the candidates, each could be assigned a fitness value. Genetic operators could then be applied to improve the performance of the population of behaviours. One cycle of testing all of the competing behaviour is defined as a generation, and is repeated until a good behaviours is evolved. The good behaviour is then applied to the real world. Also because of the nature of GA, the initial knowledge does not have to be very good.

Before you can use a genetic algorithm to solve a problem, a way must be found of encoding any potential solution to the problem. This could be as a string of real numbers or, as is more typically the case, a binary bit string.

At the beginning of a run of a genetic algorithm a large population of random chromosomes is created. Each one, when decoded will represent a different solution to the problem at hand. Let's say there are N chromosomes in the initial population.
Then, the following steps are repeated until a solution is found:

Test each chromosome to see how good it is at solving the problem at hand and assign a fitness score accordingly. The fitness score is a measure of how good that chromosome is at solving the problem to hand.

Select two members from the current population. The chance of being selected is proportional to the chromosomes fitness. Roulette Wheel selection is a commonly used method.

Dependent on the crossover rate crossover the bits from each chosen chromosome at a randomly chosen point.

Step through the chosen chromosomes bits and flip dependent on the mutation rate.

Repeat step 2, 3, 4 until a new population of N members has been created.

Basically its a simple way of finding a solution to a problem that physically doing would take hours/days/weeks etc. Like how does the GPS system know which journey is the shortest... Algorithms. Trying to work out the distance yourself would take a long time.

No comments:

Post a Comment