Genetic algorithms and their large number of applications
Genetic algorithms are a tool based on the natural selection process to obtain solutions to search and optimization problems.
The main idea in these algorithms is to mimic the process of
natural selection, such as inheritance, mutation, crossing, selection, etc. In
this way, individuals will be the possible solutions to the problem at hand.
Furthermore, these algorithms do not require a large amount of data for their
development.
How does this algorithm proceed?
We start from an initial set of solutions, which will be the
initial population. Those that we consider to be the best solutions, evaluated
according to the so-called fitness function, will be selected to transmit the
information to the next generation in different ways, so that this new generation
will inherit the information from the previous generation. The generations
follow one another in such a way that each time they will obtain better
individuals, that is, better solutions to the problem.
1. Generation
of the initial population of solutions.
2. Evaluation
of the population generated
3. Selection
of the best individuals
4. Building
a new generation
5. Repeat
steps 2, 3, and 4 until completion condition is reached
The solutions that we will find will be fast and efficient.
The initial population of the algorithm cannot be too large or too small. As a
general rule, we initialize it randomly, thus allowing all kinds of diversity
in our population and guaranteeing optimal solutions. In general, all
generations will have the same number of individuals.
Fitness function: what is it and what does it measure?
The fitness function will help us evaluate all individuals.
With it, we will be able to assign a value to each individual in the generation
in such a way that, if one solution obtains a higher value than another, it
will represent that it is a better solution, or a solution closer to the
optimal solution that is sought. Thus, we will be able to know which
individuals are better within a generation. We need a suitable fitness function
for each problem.
How do we generate the successors of the next generation?
Before generating the successors of the next generation, we
must select the individuals that we will use as parents and, sometimes, we will
select which children will pass to the next generation. Sometimes we will
simply clone from parent to child, to ensure that we preserve the original
genetics.
It is important that the selection favors the best according
to their assessment of fitness function, and that it allows diversity. It
usually also has a random component.
Each individual will have a probability of being selected,
proportional to their assessment, with respect to the assessments of the total
population. The best individuals will have a higher probability and, therefore,
will be selected more frequently.
What applications do genetic algorithms have?
There are a large number of problems that can be solved by
genetic algorithms. Some of these problems are:
Case 1: Route optimization. Applied in route optimization,
it allows you to find the shortest or fastest route between cities or areas in
a very short time. It is also very useful in Smart cities, to try to reduce CO2
emissions.
Case 2: Task optimization. When it comes to getting tasks
done in the shortest time possible, optimizing them is essential. With genetic
algorithms, the calculation is also fast and efficient.
Case 3: Automated management of industrial equipment. It is
possible to make a calculation in real time to optimize an automated process of
industrial equipment.
Case 4: Learning robot behavior. Robot learning is possible
with respect to a cost function. With these algorithms, learning is done faster
and more efficiently.
Case 5: Financial sector systems. An interesting application
in finance is that these algorithms allow discovering investment rules that
indicate when to enter and exit a market to obtain the maximum benefits. On the
other hand, in Splitwise methods, the method of sharing expenses between
different users can be optimized.
Case 6: Finding errors in programs . It allows you to detect
errors in the programs of the developers, which helps to save time and money in
their implementation.