Skip to content

Solving Real-Parameter Optimization Problem using Real Coded Genetic Algorithm (RCGA)

License

Notifications You must be signed in to change notification settings

m-RezaFahlevi/GeneticAlgorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 

Repository files navigation

Genetic Algorithm


Licence

The main parts of this repository is in folder GeneticAlgorithm. SteadyStateGeneticAlgorithm.R and steady_state_genetic_algorithm.py are the main source code. Real-Parameter Optimazation Problem are supposed to be solved in this repository, at least for now.

arg min spherefun population
Solving $\arg \min_{x_1,x_2\in\mathbb{R}}\phi(x_1, x_2) = x_1^2 + x_2^2$

SteadyStateGeneticAlgorithm.R

For file SteadyStateGeneticAlgorithm.R, there are 2 library must be installed first, ggplot2 and dplyr. These library can be installed via RStudio or execute following code in your R's terminal.

install.packages(c("ggplot2", "dplyr"))

When the execution of file SteadyStateGeneticAlgorithm.R is finish, it's show that max[f(x,y)] if and only if x,y = 0.

steady_state_genetic_algorithm.py

Prelude

Install these 2 python module, numpy and pandas

pip install numpy
pip install pandas

How to Execute It

Run the file in your python IDE, or, if python had been installed in your system, open your terminal, change the current working directory to the directory where file steady_state_genetic_algorithm.py belongs to, then execute the following code

python steady_state_genetic_algorithm.py