#sponnu {padding:3px;background-color:#900;height:14px;text-align:center;color:#FFF;font-family:arial;font-size:11px;border:1px solid #FFF} #sponnu a{color:#FFF;font-weight:bold;font-size:11px;text-decoration:underline;}

 Main Menu PHP Tools PHP Help Request PHP Editors Newsletter Editor Search Reviewed PHP Editors Latest News Submit News PHP Tutorials PHP Book Reviews Online Book Chapters PHP Games

 Forums PHP Desktop Editors Other PHP Tools PHP Contests PHP Programming Help Linux Help Apache Help MySQL Help PHP Games PHP Jobs PHP Forums Home

 Programming Contest

 Documentation

 Partner Sites

Genetic Algorithms

# 8.2. Genetic Algorithms

The genetic algorithm (GA) is a heuristic optimization method which operates through determined, randomized search. The set of possible solutions for the optimization problem is considered as a population of individuals. The degree of adaptation of an individual to its environment is specified by its fitness.

The coordinates of an individual in the search space are represented by chromosomes, in essence a set of character strings. A gene is a subsection of a chromosome which encodes the value of a single parameter being optimized. Typical encodings for a gene could be binary or integer.

Through simulation of the evolutionary operations recombination, mutation, and selection new generations of search points are found that show a higher average fitness than their ancestors.

According to the comp.ai.genetic FAQ it cannot be stressed too strongly that a GA is not a pure random search for a solution to a problem. A GA uses stochastic processes, but the result is distinctly non-random (better than random).

Figure 8-1. Structured Diagram of a Genetic Algorithm

 P(t) generation of ancestors at a time t P''(t) generation of descendants at a time t

```+=========================================+
|>>>>>>>>>>>  Algorithm GA  <<<<<<<<<<<<<<|
+=========================================+
| INITIALIZE t := 0                       |
+=========================================+
| INITIALIZE P(t)                         |
+=========================================+
| evaluate FITNESS of P(t)                |
+=========================================+
| while not STOPPING CRITERION do         |
|   +-------------------------------------+
|   | P'(t)  := RECOMBINATION{P(t)}       |
|   +-------------------------------------+
|   | P''(t) := MUTATION{P'(t)}           |
|   +-------------------------------------+
|   | P(t+1) := SELECTION{P''(t) + P(t)}  |
|   +-------------------------------------+
|   | evaluate FITNESS of P''(t)          |
|   +-------------------------------------+
|   | t := t + 1                          |
+===+=====================================+```
 © Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.