Lecture Notes (2)
Lecture Notes (2)
Biological behaviour:
•Genetics & Evolution → Genetic Algorithm (GA)
•Human Nervous System → Artificial Neural Network (ANN)
•Behaviour of ant colony → Ant Colony Optimization (ACO)
Physical behaviour:
•Learning → Fuzzy Logic (FL)
•Swarming of particles → Particle Swarming Optimization (PSO)
Genetic Algorithm
Genetics
•Cells (Basic building blocks in living bodies)
•Each cell has the same set of chromosomes
• Humans: 46 (Female: 23, Male: 23)
• Mice: 40
•Chromosomes are the string of DNA (0’s and 1’s)
•Genes → Alleles
•Chromosomes consist of several genes
•Genes encode a specific trait (e.g., hair color, eye color)
Evolution
1.Heredity:
1. Offspring inherits many of its characteristics from parents.
2.Diversity:
1. Variation in characteristics in the next generation.
3.Selection:
Selection determines which individuals(chromosomes) will pass
their genes to next generation.The goal is to choose the fittest
scores, ensuring better solutions evolve over generation.
4.Ranking:
in this method individuals are sorted based on their
fitness scores.
Intuition Behind Genetic Algorithm
•Optimization technique
•Finds the best set of inputs to get the best output values
•Used for highly complex problems by simulating biological
processes (Genetics and Evolution)
Key Differences: Genetic Algorithm vs Traditional
Algorithm
Basic Structure (Flow Chart) of Genetic Algorithm
Basic Terms
Population
•It is a subset of all the possible solutions to the given problem.
Chromosome
•A chromosome is one such solution to the given problem.
Gene
•A gene is one element position of a chromosome.
Population = Set of Chromosomes
Flow Chart of Genetic Algorithm or
Phases in Genetic Algorithm or
Basic Structure of Genetic Algorithm
1) Population Initialization
•Population is initialized as a set of random solutions (random
chromosomes).
•Each individual solution is represented using a chromosome
(solution).
2) Fitness Function Calculation
•Fitness function determines how good a solution is.
•Each chromosome is assigned a fitness score.
•Best-scoring chromosomes are selected for reproduction to
create a new generation.
3) Selection
•The best or fittest individuals (based on fitness score) are
selected as parents.
•These parents pass their genes to the next generation.
4) Crossover
•Pairs of parents are selected.
•Their genes are combined using a crossover process.
•This produces offspring with characteristics from both
parents.
5) Mutation
•Some random changes occur in some genes.
•This helps maintain diversity and prevents premature
convergence.
Termination Check
•If the stopping criteria (e.g., optimal solution found) is met,
• Yes → Output the solution.
• No → Repeat the process.
Flowchart included showing the steps:
Genetic Operators
1)Selection
•The primary objective of the selection operator is to
emphasize good solutions and eliminate bad solutions in a
population while keeping the population size constant.
•Different solutions for choosing the best solution exist (e.g.,
Fitness-based Selection, Tournament Selection).
Crossover
• Manual inspection.
• Combination of the above .