News for hackers. Stuff that matters.
Re:Intro to Genetic Algorithms in Javascript Part 2 by TazeTSchnitzel on Saturday September 15, 2012 @02:14PM (#4526806)
Maybe I'm not thinking enough about this, but wouldn't the best solution be to just stock up with elements that have the best value per weight, starting with the highest?
Re:Intro to Genetic Algorithms in Javascript Part 2 by bkanber on Saturday September 15, 2012 @02:18PM (#4526818)
I talk about that technique in the article. It's called the "greedy algorithm" or "greedy solution". In this example, the GA handily defeats that approach.

Edit: the greedy algorithm gives you a solution with a total value of $4,901. So far, the best observed GA solution yields $5,968. 20% or so is a big difference!

Re:Intro to Genetic Algorithms in Javascript Part 2 by TazeTSchnitzel on Saturday September 15, 2012 @02:21PM (#4526827)
Ah, whoops. My bad.