Tuesday, March 8, 2011

10 Great Ideas for using Clever Algorithms

The Clever Algorithms book provides working, although minimal, implementations of 45 algorithms from the fields of Computational Intelligence, Biologically Inspired Computational, and Metaheuristics.

The intent of providing minimal implementations is to allow people to play with the systems, to make them come alive, and most importantly, provide the basis for extension.

I'm really keen to see what people can do with the algorithms. To see the creative side in how these methods can be applied, not just in science and engineering.

In this post I'll suggest 10 projects uses the algorithm implementations, and maybe provoke something interesting. The majority of these ideas are proposed as exercises for learning more about one or more algorithms described in the book or about the genetic research or application of such methods.

The following 5 ideas relate to a single given algorithm.

  1. Change the demonstration problem. The problems presented in the book were idealized and simplistic. They were selected for the simplicity and ability to demonstrate a given method. A great place to start would be to simply change the problem being solved by a give algorithm. This may be as simple as changing the number of dimensions on a continuous function optimization problem, to changing a method to work with a new representation all together. Remember, most methods are generic, therefore careful attention must be paid to the both the representation and the chosen cost function.
  2. Extend an algorithm implementation. Many of the implementations provide a minimal working version of the algorithm. This leaves a lot of room to add in all the fancy bells and whistles (extensions discovered to improve performance over intervening studies). Most of the time I mention these extensions. In some cases, such as many Evolutionary Algorithms, one can extend an algorithm implementation by switching out a high-level operator. These algorithms are described in such a way that the principle operators and sub-processes are modular and can be exchanged. Perhaps for starters, consider switching out the selection, crossover, and/or mutation genetic operators in the Genetic Algorithm or related evolutionary algorithm.
  3. Study an algorithm. Something I really get a kick out of is going deep on a given method. Vary one parameter at a time and control all others, including the problem domain. Run each variation multiple times (control for the random starting position) and evaluate the algorithm configuration on each configuration. You will quickly build up matrices of configuration-performance behaviours that you can slice, dice, and graph. Sample parameters randomly or test them in a tightly stratified manner (such as each 0.01 increment between 0 and 1 for the crossover rate in the genetic algorithm). By performing such studies across multiple test problems or across multiple algorithms you can start to define equations that describe the behaviour of a method under specific conditions. You might even learn something new about a method (and publish)! These are complex systems, there is much to learn.
  4. Implement another algorithm. I only managed to describe 45 algorithms in the book. There are many many other algorithms and variations I didn't have time to describe. Pick one and implement it. If you're super keen, try describing it using the same algorithm description template.  
  5. Apply to something fun. One can run off and attempt to solve difficult science and technology problems where there is limited domain knowledge, complex constraints, and where such a method would be appropriate. There are also those problems that are slightly less serious, but whose outputs can be very provocative. For example, start framing problems that require innovation or creativity as optimization or function approximation problems and apply a technique. For example music composition, art, and types of design problems. For inspiration, see these 5 fun genetic algorithm examples.
The next following 5 ideas relate to a collection of algorithms, maybe all the algorithms in the book.
  1. Race algorithms. The natural thought when one has a bunch of competing methods at ones disposal is to race them. Although I discourage this behaviour in the book (from a scientific merit perspective), it can be enticing. Construct a bake-off between a number of closely related methods, fairly tune each in turn on one or a small suite of test problems and test-away. You can produce some thought provoking graphs and perhaps begin speculating about the relative merit of this method or that. Remember to think deeply on the actual transferability of your findings to other algorithms or problems.
  2. Port algorithms to a favorite programming language. Ruby is pretty awesome in my humble opinion. It is concise, productive, and fun to program in, which is why I chosen it for the implementations in the book. That being said, it is not everyone's favorite programming language. Consider porting one or more algorithms to YOUR favorite programming language. For example Python is a natural fit given the close similarities to Ruby, but I'd be keen to see ports to Javascript, ANSI C, Go, Java, even LISP languages like Clojure. You would be sharing these interesting AI methods with people from your language tribe while learning the innards of each algorithm as you ported them. Win-Win.
  3. Implement a plug-in for existing software. There are many great software packages out there that might benefit by having some of the optimization and function approximation methods described in the book provided as plug-in's. For example, one might write plug-in's for WEKA, Matlab, Mathematica, or Octave.
  4. Implement a software library. Rather than simply port the algorithms to a new language or provide implementations as plugin-in's for existing software workbenches, one could build a new library of optimization algorithms. One could start building a library of genetic Artificial Intelligence methods, data representations and visualization, or could focus on a specific problem domain and build up a suite of methods specifically for solving it (such as continuous function multiple objective problems)
  5. Translate the book. Not really an algorithm thing, but if you can speak (write in) another language and want to really absorb this content, I can't think of a better way than translating algorithm descriptions to another language. Chinese? Russian? Spanish? I'm sure you would have a gaggle of devoted fans for doing so.
All of the content (including the algorithm implementations themselves) have been released under a permissive Creative Commons license. Go nuts! If you do end up exploring one or more of these ideas, shoot me an comment or email. I'd be very keen to see what you come up with!

If there is any general interest, I'd really like to add a "projects" section to the Clever Algorithms website. A place where one can suggest a project idea, read over tutorials on applying the algorithms in the book, and download interesting code examples. Let me know what you think?

0 comments: