Skip to content

DarshanaUOP/Genetic-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Genetic Algorithm

WHAT IS GENETIC ALGORITHM

"A genetic algorithm (GA) is a method for solving both constrained and unconstrained optimization problems based on a natural selection process that mimics biological evolution."

DESCRIPTION

Genetic Algorithm (GA) with Matlab

To run the code on your computer, clone the repository and run index.m on MatLab environment.

LIST OF FILES

  • Jx.m -> The function to find the optimum point.
  • binNumbInv.m -> This function helps you to convert binary strings into double variables (inverse function of the numbConv) for crossover and other operations.
  • costF.m -> This is the cost function calculator used to assign weights for each value of the function.
  • index.m -> The main method of the program. Run this file when you are ready with cloane of the repository.
  • numbConv.m -> Convert double variables into binary values corresponding to the number of bits will consider in the process.

SPECIFICATIONS AND VARIABLES

  • pop -> The variable which holds the current population.
  • x -> The range which independent variable is consider.
  • J -> The cost function (Jx) values
  • numOfPop -> Number of population consider for the algorithem. you can change and see whats happpen in the operation (but it will consume your resources)
  • min_variance -> Minimum variance of the population which is the iteration terminates. by reducing this you can get accurate optimum point and it may take more itterations to converge.