Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

A Simple Genetic Algorithm using Levenshtein distance


[Image: fcFR29H.png]

This is merely a "try and see if it works" kinda project, it uses the basis principle of the genetic algorithm using characters and we train until we get the target result (string phrase).


You can modify the algorithm function, in this project i use the Levenshtein method, but you could swap it out for a 1 on 1 comparison block that compares each equal character that would accumulates a score by 1, this is faster but was not my goal obviously.

Parameters explained

Elitism

This parameter is used to include correct gene sequences from the parent gene sequences so you would not discard results that have already been found.

Amplify

This parameter is used to amplify the target result values by the exponent so the the process is some what quicker (2 is best anything above 3 is to big),
i picked this trick up along the way when i was reading up on this field of programming.

Probability

The crossover and mutate methods in the Genome(of T) class have probability (0~100 being the percentage) parameters to increase or decrease the influence of mutations
and crossover (parent genes inheritance). You can play with these if so wish, but it can slow down the whole process if set wrong.

Github: https://github.com/TheBarret/Simple-Genetic-Algorithm

Have fun! -B
This looks really cool, thanks for sharing man.
[Image: qSkqBCb.gif]

Already been screwing with some path finding code using the GA. ;)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by BarretFeb 6, 2018 01:47 PM 21 589 Feb 6, 2018 01:47 PM
Last Post: HFDone
[.NET] by BarretJan 8, 2018 10:25 AM 18 775 Jan 8, 2018 10:25 AM
Last Post: Barret
[Python] by lolimsoasdApr 19, 2017 12:12 PM 4 185 Apr 19, 2017 12:12 PM
Last Post: lolimsoasd