You are on page 1of 5

AI EXPERIMENT 5

Genetic Algorithm

NAME- Darsh Jain


SAPID- 60004210200
DIV- C31

- Aim:
To Implement Genetic Algorithm.

- Theory:
Genetic Algorithms (GAs) are adaptive search algorithms based on natural selection and
genetics. They exploit random search with historical data to find better performance areas
in solution space. GA’s are commonly used for optimization and search problems. They
simulate the "survival of the fittest" among consecutive generations of individuals,
representing each individual as a point in the search space and possible solution. Each
generation consists of a population of individuals, representing a possible solution in the
search space. Each individual is represented as a string of character, integer, float, or bit,
similar to the Chromosome.

- Advantages of Genetic Algorithm:

• GAs excels in exploring large solution spaces, allowing for global optimization by
searching for optimal or near-optimal solutions across diverse problem domains.

• They can handle various types of problems, including multi-modal and high-
dimensional spaces, without requiring assumptions about the problem's continuity
or differentiability.

• GAs allow parallel exploration of multiple solutions within the population,


accelerating the search process and enabling them to handle computationally
intensive tasks.
- Disadvantages of Genetic Algorithm:

• The performance of GAs is heavily dependent on parameter settings, such as


population size, crossover rate, mutation rate, and selection mechanisms, requiring
fine-tuning for different problem domains.

• Operating on a population-based approach, GAs might demand higher


computational resources, especially in large-scale problems, due to their iterative
nature and evaluation of numerous potential solutions.

• 4.While efficient, GAs don’t ensure finding the global optimal solution. They rather
aim at finding good solutions within a reasonable timeframe.

- Algorithm:
- Code:
- Output:
- Conclusion:
Genetic Algorithms (GAs) have been found to be robust in solving complex optimization and
search problems. They can explore diverse solution spaces using concepts like crossover,
mutation, and selection, efficiently converge towards optimal solutions. GAs are adaptable
and scalable, allowing them to handle multi-modal, high-dimensional problems. However,
their performance depends on parameter settings, population size, crossover and mutation
rates, and problem space representation. Larger-scale problems may experience
computational overhead due to the iterative nature of GAs. Despite these limitations, GAs
are a powerful approach for complex optimization challenges, providing a balance between
exploration and exploitation in solution spaces.

You might also like