Skip to content

andrei828/GeneticAlgorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Genetic algorithm

This python script uses a genetic algorithm to find the maximum value of a quadratic equation.

20 chromosomes are used through 50 generations. The value for each chromosome is encoded in a 22 bit number. The higher values have a better chance for crossover. Also, in this approach, mutation is flipping a random bit from a chromosome.

Note: The quadratic equation, number of chromosomes/generations and crossover/mutation probabilities can be updated from the input file.

The script displays a plot with the evolution of the maximum value through the generations

Example

About

This python script uses a genetic algorithm to find the maximum value of a quadratic equation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages