Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Genetic algorithm in Python, Summaries of Computer Science

An overview of Genetic Algorithms (GAs), which are heuristic optimization algorithms inspired by the natural selection process. It covers the historical development of GAs, their basic mechanics, applications in various fields such as optimization problems, machine learning, financial modeling, game development, bioinformatics, engineering, and art, as well as their advantages and limitations. The document also includes a brief summary and mathematical formulation of GAs, and explains the working of GAs through six steps.

Typology: Summaries

2022/2023

Available from 10/07/2023

sajadjnu
sajadjnu 🇮🇳

4 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
A Brief Tutorial on Genetic Algorithms
Sajad A. Sheikh
1 Introduction
Genetic algorithms (GAs) are heuristic optimization algorithms inspired by the natural selection process. They
belong to a broader class of evolutionary algorithms, which generate solutions to optimization problems by
emulating biological evolution. Since their inception, GAs have been applied to a vast array of fields, from
optimization tasks to machine learning, highlighting their versatility and robustness.
2 Historical Development
The concept of applying principles of evolutionary biology to computer science can be traced back to the 1950s
and 1960s. John Holland at the University of Michigan is often credited with pioneering this idea. His work in
the 1960s laid the groundwork for the development of the genetic algorithm, culminating in his seminal book,
”Adaptation in Natural and Artificial Systems” in 1975. This book outlined the foundational concepts and
operations of GAs, such as selection, crossover (recombination), and mutation.
Throughout the 1980s and 1990s, GAs gained popularity as researchers began to understand their potential
and apply them to a wider range of problems. The development of more advanced and tailored crossover and
mutation techniques, as well as selection mechanisms, allowed GAs to be more efficient and effective.
3 Basic Mechanics
Genetic algorithms start with a population of candidate solutions, typically represented as binary strings (though
other encodings are possible). This population undergoes iterative transformations through the GA operators:
Selection: Solutions (or chromosomes) are chosen from the population based on their fitness, usually
probabilistically.
Crossover: Pairs of solutions are combined, sharing parts of their structure to produce new solutions.
Mutation: Random changes are introduced to maintain genetic diversity.
Replacement: New solutions replace old ones, and the algorithm returns to the selection phase.
The iterative process continues until a stopping criterion, such as a maximum number of generations or a
satisfactory fitness level, is met.
4 Applications of Genetic Algorithms
Optimization Problems: GAs excel in optimization tasks, especially in complex landscapes where
traditional methods falter. This includes tasks like traveling salesman problems, scheduling, and resource
allocation.
Machine Learning: GAs can be used for feature selection in large datasets, optimizing neural network
weights, and even evolving rule sets for classification.
Financial Modeling: In the world of finance, GAs can optimize trading strategies, portfolio selection,
or forecast financial market trends based on historical data.
Game Development: Video game developers use GAs to evolve intelligent behaviors for non-player
characters, optimize game levels, or even procedurally generate content.
Bioinformatics: GAs are employed to predict protein structures, analyze DNA sequences, and model
evolutionary processes.
Engineering: In engineering design, GAs can optimize parameters for systems, be it in aerodynamic
wing design or electrical circuit configurations.
Art: Artists and musicians have employed GAs to create new forms of art and compositions, leveraging
the algorithm’s ability to explore vast solution spaces creatively.
1
pf3

Partial preview of the text

Download Genetic algorithm in Python and more Summaries Computer Science in PDF only on Docsity!

A Brief Tutorial on Genetic Algorithms

Sajad A. Sheikh

1 Introduction

Genetic algorithms (GAs) are heuristic optimization algorithms inspired by the natural selection process. They

belong to a broader class of evolutionary algorithms, which generate solutions to optimization problems by

emulating biological evolution. Since their inception, GAs have been applied to a vast array of fields, from

optimization tasks to machine learning, highlighting their versatility and robustness.

2 Historical Development

The concept of applying principles of evolutionary biology to computer science can be traced back to the 1950s

and 1960s. John Holland at the University of Michigan is often credited with pioneering this idea. His work in

the 1960s laid the groundwork for the development of the genetic algorithm, culminating in his seminal book,

”Adaptation in Natural and Artificial Systems” in 1975. This book outlined the foundational concepts and

operations of GAs, such as selection, crossover (recombination), and mutation.

Throughout the 1980s and 1990s, GAs gained popularity as researchers began to understand their potential

and apply them to a wider range of problems. The development of more advanced and tailored crossover and

mutation techniques, as well as selection mechanisms, allowed GAs to be more efficient and effective.

3 Basic Mechanics

Genetic algorithms start with a population of candidate solutions, typically represented as binary strings (though

other encodings are possible). This population undergoes iterative transformations through the GA operators:

  • Selection: Solutions (or chromosomes) are chosen from the population based on their fitness, usually

probabilistically.

  • Crossover: Pairs of solutions are combined, sharing parts of their structure to produce new solutions.
  • Mutation: Random changes are introduced to maintain genetic diversity.
  • Replacement: New solutions replace old ones, and the algorithm returns to the selection phase.

The iterative process continues until a stopping criterion, such as a maximum number of generations or a

satisfactory fitness level, is met.

4 Applications of Genetic Algorithms

  • Optimization Problems: GAs excel in optimization tasks, especially in complex landscapes where

traditional methods falter. This includes tasks like traveling salesman problems, scheduling, and resource

allocation.

  • Machine Learning: GAs can be used for feature selection in large datasets, optimizing neural network

weights, and even evolving rule sets for classification.

  • Financial Modeling: In the world of finance, GAs can optimize trading strategies, portfolio selection,

or forecast financial market trends based on historical data.

  • Game Development: Video game developers use GAs to evolve intelligent behaviors for non-player

characters, optimize game levels, or even procedurally generate content.

5 Advantages and Limitations

The strength of GAs lies in their ability to search large, complex solution spaces efficiently. They are particularly

useful when the problem landscape has many local optima, as GAs are less likely to get stuck compared to

gradient-based methods. Furthermore, they are highly parallelizable and can be adapted to a wide range of

problems.

However, GAs are not without limitations. Their stochastic nature means they might not always find the

global optimum. They can also require significant computational resources, especially for problems with large

populations or many generations. The choice of parameters (mutation rate, crossover rate, population size) can

significantly impact performance, and there’s no one-size-fits-all; often, these parameters need to be fine-tuned

for specific problems.

6 Conclusion

Genetic algorithms, inspired by the process of natural evolution, have proven to be versatile and robust opti-

mization tools. Their development from theoretical concepts in the 1960s to wide-ranging applications today

underscores their potential. As computational power continues to increase and as researchers develop more

refined and efficient variants of GAs, their applications are bound to expand further, solidifying their place in

the toolkit of every computational scientist and engineer.

7 Brief Summary

Genetic Algorithms (GAs) are optimization and search algorithms inspired by the process of natural selection.

They are used to find approximate solutions to optimization and search problems.

8 Mathematical Formulation

Let’s assume a function f : S → R that we want to maximize, where S is the solution space.

8.1 Components

  • Chromosome Representation: A solution in S is represented as a chromosome, typically a binary

string.

  • Fitness Function: f itself serves as the fitness function.
  • Selection: Based on fitness, some chromosomes are selected to form the next generation.
  • Crossover: Combines two chromosomes to produce one or more offspring.
  • Mutation: Introduces small random changes in a chromosome. 9 Working of Genetic Algorithms

1. Initialization: Create an initial population of chromosomes.

2. Selection: Evaluate the fitness of each chromosome. Select chromosomes based on their fitness.

3. Crossover: Perform crossover on selected chromosomes.

4. Mutation: Apply mutation on offspring.

5. Replacement: Replace the old population with the new one.

6. Termination: If the stopping criterion is met, stop. Otherwise, go to the selection step.