Genetic Algorithm (Evolving Strings)

  scripts
  sprites
See inside
Instructions

A simple algorithm to evolve strings that will hopefully converge to match the user's intended one.

1. You enter the word to match
2. Program generates 100 random strings
3. Scores how well the random strings match your word (fitness)
4. Uses the best matching strings (the genetic part) and the level of mutation to evolve 100 new strings
5. Repeat 3-4 until the word is matched by a random string.

Run in Turbo.

At the moment it's very crappy because it introduces to many duplicate letters in a row (natural language does not follow such a pattern). It usually fails to match a 5-6+ letter string.

Also it does not keep letters that match the same position in the prime (a letter that matches may be swapped out for a non-matching one).

Mutation rate and seed length can be changed easily within the program.

Runs even faster at http://phosphorus.github.io/

Notes and Credits

Shared: 13 Sep 2016 Modified: 21 Oct 2016
Favorite this project 0
Love this project 0
Total views 12
View the remix tree  1
  
More projects by micycle2