Simple Genetic Algorithm implemented in Javascript