News for hackers. Stuff that matters.
Re:Intro to Genetic Algorithms in Javascript Part 2 by Swizec on Saturday September 15, 2012 @05:12PM (#4527323)
I thought the knapsack problem had a pretty good deterministic solution via the magic of dynamic programming?

That said, isn't it usually best to use GA algorithms only where a simpler algorithm does not exist? Or does the GA version actually produce better results than dynamic programming?

Re:Intro to Genetic Algorithms in Javascript Part 2 by bkanber on Saturday September 15, 2012 @05:16PM (#4527338)
Correct and correct.

The knapsack problem does have an excellent dynamic programming solution. And of course, where there's a simpler algorithm, you should use it.

This article isn't about the knapsack problem; it's about learning GAs. The knapsack problem is just an easy-to-visualize and easy-to-implement problem to solve in order to demonstrate features of genetic algorithms.

Re:Intro to Genetic Algorithms in Javascript Part 2 by Swizec on Saturday September 15, 2012 @05:38PM (#4527384)
Fair point.

I once used genetic algorithms for path planning where A* would do. While it was fun to implement, the scoring was based on "goodness of path found in time X" ... I didn't get a very high score on that homework.

On the other hand, I got a surprisingly high score for what was essentially "random guessing until you run out of time".