I have a sample genetic algorithm in Javascript here .
One of the problems with your approach is that you are killing diversity in a population by communicating between two people. This will never work very well, because it is too greedy , and you will actually defeat the goal of having a genetic algorithm in the first place.
( , ),
for(var e = 0; e < ELITE; e++) {
tempGenerationHolder.push(fitnessScores[e].chromosome);
}
for(var s = 0; s < INITIAL_POP_SIZE - ELITE; s++) {
var randInd = Math.floor(Math.random()*(INITIAL_POP_SIZE - ELITE));
var child = mate(fitnessScores[s].chromosome, fitnessScores[randInd].chromosome);
tempGenerationHolder.push(child);
}
, , ( github repo, URL- ). () , .
, .