Simple Genetic Algorithm

A simple code that illustrates a basic Genetic Algorithm
42 Downloads
Updated 11 May 2023

View License

Problem: Maximize f(x) = x(8-x) where 0<=x<=8
Author: Shouvik Chakraborty (B.Tech, 2nd Year),
shouvikchakraborty51@gmail.com
Please Cite:
Chakraborty, S., Seal, A., & Roy, M. (2015, February). An elitist model for obtaining alignment of multiple sequences using genetic algorithm. In 2nd national conference NCETAS (Vol. 4, No. 9, pp. 61-67).
Input parameters
P = Number of population
G = Number of generations
cp = Crossover probability
mp = Mutation probability
nb = Number of bits in each chromosome. Suppose we have 0<=x<=8. So there are 9 values. So we need at least 4 bits to encode them (because 2^3<9).
Output parameters
fitness = Best fitness value of the function used
param_val = Value of the variable (suppose x) for which best fitness occur

Cite As

Chakraborty, S., Seal, A., & Roy, M. (2015, February). An elitist model for obtaining alignment of multiple sequences using genetic algorithm. In 2nd national conference NCETAS (Vol. 4, No. 9, pp. 61-67).

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0