This project implements a parallelized genetic algorithm to solve decyphering problems. The algorithm includes selection, crossover, and mutation operations to evolve a population of individuals towards an optimal solution.
-
Clone the repository:
git clone https://github.com/yourusername/genetic-algorithm-project.git
-
Navigate to the project directory:
cd genetic-algorithm-project -
Compile the project using a C++ compiler:
g++ -o genetic_algorithm main.cpp NonParallel.cpp -std=c++11
-
option: you can use openml to compile the project
g++ -o genetic_algorithm Parallel.cpp -std=c++11 -fopenmp
NonParallel.cpp: Contains the implementation of the genetic algorithm, including selection, crossover, and mutation functions in a non parallelised manner (vanilla version) Parallel.cpp: Contains the code for parallelized implementation of the genetic algorithm, including selection, crossover, and mutation functions using OPENMP
Parallelizing aspects like Fitness calculation,Initialization of individuals, Selection of parents, Crossover and Mutation operations can improve efficiency, performance, lead to faster convergence and speed up the optimization process
Each processor or core can independently evaluate the fitness of a subset of individuals. Different processors can independently perform selection operations • Crossover- Different pairs of parents can undergo crossover concurrently. • Mutation- Multiple processors can perform mutation operations on different individuals simultaneously. • Population replacement can be parallelized
Dividing overall computation into independent tasks. Assigning different processors to different tasks require proper coordination and synchronization
