Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Mickdep/GeneticAlgorithmCPP

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GeneticAlgorithmCPP

Genetic algorithm programmed in C++ using raw pointers. In practice smart pointers are better to use but just for some practice I decided to use raw pointers.

Note

This algorithm is not perfect and there are many vectors than can affect the outcome and/or the performance. For instance the mutation chance of 1% might be too high, or the population size might be too low/high. Besides, there are different methods of selection and crossover.

Tweaking these vectors is key to good outcome and/or performance.

In this example the goal of the algorithm was to guess a string of characters. This is just to demonstrate the function of the genetic algorithm. If you want to use this algorithm for your own use you can simply substitute the individual's gene by your own object. Do not forget to change the way fitness is calculated and how mutation is implemented.

Screenshot

Running the genetic algorithm

About

Genetic algorithm implemented in C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.