Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit 4.2: Genetic Algorithms (GA)

Lesson 18 of 22 in the free Engineering Optimization notes on Siksha Sarovar, written by Rohit Jangra.

Unit 4.2: Genetic Algorithms(GA)

Definition: Genetic Algorithms are search heuristics that mimic the process of natural selection(Charles Darwin’s theory of evolution).

Key Terminology

  • Chromosome: A single solution(usually a binary string, e.g., 10110).
  • Population: A set of chromosomes (solutions).
  • Gene: A specific bit or variable within a chromosome.
  • Fitness Function: A function that evaluates how "good" a solution is.

The GA Operators ("Survival of the Fittest")

1. Selection (Reproduction)

Decides which individuals get to reproduce based on their fitness. Better solutions have a higher chance (e.g., Roulette Wheel Selection).

2. Crossover (Recombination)

Combines parts of two parent chromosomes to create offspring.

  • Parent A: 11111 | 11
  • Parent B: 00000 | 00
  • Offspring: 11111 00 (Mix of features).

3. Mutation

Randomly flips a bit in a chromosome (e.g., 0 to 1). This introduces new genetic diversity and prevents getting stuck in local optima.

Algorithm Steps

  1. Initialize random population.
  2. Evaluate fitness.
  3. Loop: Select -> Crossover -> Mutate -> Replace.
  4. Repeat until satisfied.