Tuesday, January 10, 2006

improving an algorithm a bit

Today I decided to optimize a naive implementation of a solver algorithm a bit that took about 22 minutes to solve the problem. After only reordering some clauses an implementation resulted that did solve the problem in about 30 milliseconds which is about 50,000 times as fast. This is what I like with programming languages like Prolog. If you understand how they work you often can drastically improve your algorithms without much effort.

No comments: