Genetic algorithms in cpp | Sololearn: Learn to code for FREE!


Genetic algorithms in cpp

How can describe this to me ??I will give a present But remember that u should have understandable examples too

1/24/2020 11:25:13 AM

Night FuryπŸ”₯<adrina>

6 Answers

New Answer


A genetic algorithm eh? My favorite! I don't use cpp though. I use Python for this, but any turing complete language can do this. First you must decide on a task that's fast to run and easy to score. How about printing hello world! Then you generate a large list of other lists containing letters. We'll call these creatures. You test each creature to see how close it is to "hello world", assigning a score. Then we take the top preformers, and overwrite (aka killing the underpreforming creatures, and birthing copies of the best), with some minor random letter changes with each birth. Repeat! Assuming you coded it right, the creatures will evolve into hello world. Congrats, that is a very simple genetic algorithm. You can go a lot farther with it via more complex tasks, parent breeding, genetic programming, tournament selection, and so much more! GL!


This documentation might be helpful to you:


Vinay_GB Tnx too Listen this a the present


Ahri Fox Yeah !! Tnx for that


Hardik Pandya πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ™ŒπŸ™Œ


Hardik Pandya Ok