3- The genitic algorithm(GA):

    1-      Basic Terminology:

Before beginning a discussion on Genetic Algorithms, it is essential to be familiar with some basic terminology.

       Population: Population – this is a subset of all possible (coded) solutions for the problem. In a genetic algorithm (GA), the population is comparable to that of human beings, except here, it is candidate solutions that represent individuals.

       Chromosomes – A chromosome is one such solution to the given problem.

       · Gene – A gene is one element position of a chromosome.

       Allele – It is the value a gene takes for a particular chromosome.

         2- Genetic algorithms (GA):

Genetic algorithms (GA) are optimization methods inspired by Darwin’s theory of evolution and the mechanisms of natural selection. They are commonly used to solve complex optimization problems, where it can be difficult to find an optimal solution by traditional methods. AGs are part of the evolutionary family of algorithms and work by iteration, using concepts such as selection, crossing and mutation.

     3-      Basic principles of genetic algorithms in binary coding:

Here is an overview of their main stages:

      1. Initialization (Initial population)
      2. Evaluation (fitness function)
      3. Selection
      4. Crossing
      5. Mutation
      6. Replacement
      7. Repetition

         1.      Initialization (Initial population):

A population of individuals, or potential solutions, is generated randomly. Each individual is represented by a set of parameters or genes, often in the form of binary chains (0 and 1), although other representations are possible.

         2.      Evaluation (fitness function):

Each individual is evaluated according to a fitness function that measures the quality of the solution he represents. The fitness function depends on the problem to be solved: it indicates how close a given solution is to the optimum sought.

        3.      Selection:

Individuals with the highest fitness scores are selected to breed. This selection favours the most "adapted" individuals, in the belief that they have a better chance of generating quality solutions.

        4.      Crossing:

Two individuals (parents) are crossed to generate one or more descendants. Crossing is the mixing of genes from both parents to produce a new solution that combines elements from each parent.

               4.1  Crossing in 1-point:

It is the simplest and most well-known cross in literature. It consists in randomly choosing a crossing point for each pair of chromosomes. The substrings after this point are then interchanged to form the threads.

             4.2  Cross in 2-points:

In this type of crossing, two cut-off points are chosen at random and the content between these points is inter-changed to form the wires.

                  4.3  Crossing in n-points:

This type of crossing is expressed by a random choice of n-cut points to dissociate each parent into n+1 fragments. To form a son, it is enough to concatenate alternately n+1 under chains from both parents.

                4.Croisement uniforme :

This method consists of creating a random mask, a string of bits of the same length as the parents' chromosomes. For each position (locus), the mask determines the origin of the gene: a "1" indicates that the first child will inherit the parent 1 gene, while a "0" means that it will inherit from parent 2. The second child is constructed in a complementary way, inheriting the opposite gene for each locus.

     4.5 Crossing with three parents:

In this technique, three parents are randomly chosen. Each bit of the first parent is compared with the second parent bit. If both are the the bit is taken for the result, otherwise the third parent bit is taken for the result.

     5.Mutation:

Randomly, some genes of the descendants are modified. The mutation allows to introduce genetic diversity in the population and to avoid that the algorithm is blocked in local solutions.

Exemple:

-       Suppose a chromosome represented by a binary chain: 101101.

-       If the third bit is selected, the string becomes: 100101

    6. Replacement (New generation):

The new individuals resulting from the crossing and mutation processes replace part or all of the previous population. This process is repeated for a number of generations, until a stop criterion (for example, a fixed number of iterations or a fitness threshold) is reached.

         7. Repetition:

Steps 2 to 6 are repeated until a stop criterion is reached, such as a satisfactory solution or a maximum number of generations.

     4.       Applications of genetic algorithms:

Genetic algorithms are used in a variety of areas, including:

       Function optimization (optimization of complex and multivariable functions),

       Planning and scheduling (as in scheduling and production chain management),

       Business traveler issues (finding the optimal route to visit multiple points),

       Machine learning and artificial intelligence (to select hyperparameters or optimize neural networks),

     4.      Advantages and disadvantages:

Advantages:

        ·       Adaptability to complex problems without any definite derivatives or curves.

        ·       Exploring the space of solutions in an extensive way, avoiding local solutions in some cases.

 

        Disadvantages :

        ·       High computational cost, especially for large problems.

        ·       Random convergence which may sometimes require adjustments to achieve good results.

Genetic algorithms are powerful, but it may be necessary to choose the parameters (population size, mutation rate, number of generations) so that they converge towards an optimal solution.

  •  Finance and economics (portfolio optimization, risk management).

Modifié le: vendredi 15 novembre 2024, 18:26