We’re creatures of habit. We form little routines to solve our ‘problems’ and we tweek the routines until we get something that works for us. Take the ‘problem’ of commuting to work. I used to live in the suburbs, and the most convenient way to work was to drive. So I tried different driving routes until I found the right combination of factors… shortest route with the least traffic, but somewhat scenic, a less expensive place to park and I would walk by a great coffee stand on the way to the office. So, I’d found the optimal routine, given my limited approach to commuting to work, for my preferences. But, is this the absolute best way for me to commute to work? I may never know, because I’ve arrived at a comfortable solution. In statistics they say I’ve reached a ‘local maxima’.

If you have a limited number of solutions to a problem, you can plot them in a graph which may appear like the graph below. A series of bell shaped curves, or what I think looks more like little turtle shells. The highest point in each shell is called the local maxima, meaning the best solution in that vicinity. If we are able to plot all of the possible solutions, then it is easy enough to look for the highest point in the highest shell (curve), and that is the ‘best’ solution. This approach is called a ‘brute force’ search for a solution. However, there are many problems that have billions of possible solutions. Some, in fact, have an un-computable number of possible solutions, so you can’t possibly consider all of the solutions. So, you won’t know if the good solution you have come up with is the best of all possible solutions, or just a local maxima.

In computers, they have an entire field of study called ‘search algorithms’. This doesn’t mean searching the internet with something like Google. A search algorithm is a computer program or technique that employs various equations to search through the ‘problem space’, the possible solutions, looking for ways to arrive at better and better solutions (now, Google likely does employ search algorithms in its internet search function). But many of these algorithms get hung up when they reach a local maxima.

There is one search algorithm I’m particularly fond of, which is known as a ‘genetic algorithm’. This computer program simulates the way genetics works with DNA to arrive at the optimal characteristics for survival, only it substitutes the characteristics for the solution of your problem instead.

One of the features of genetics is mutation, where a gene pairing is changed randomly, causing an unpredictable result. Usually, this mutation is counter productive… say it produces two heads! But sometimes, the mutation gives the species a new trait that makes them much more successful than before, say a fish with a lung capable of breathing air on land. Mutation, either in physical genetics, or applied to other ‘problems’ through computer algorithms allows the search to break out of local maxima and possibly find higher maxima; coming out of your shell, so to speak.

So, applied to our world of routines, it means that occasionally, we should break our routines, try something completely different (as Monty Python says). In commuting, perhaps I should try taking the train instead of driving. Though the commute may be longer, I would be able to do a couple of hours of work on the train, and be able to leave the office that much earlier, giving me more free time at home. Or, better yet, maybe I can tele-commute, which would save much more time, save on expenses, reduce my carbon emmissions and help the planet. But, I’ll never encounter these better solutions, if I stick to my routines. I’ve got to come out of my little shell once in a while and try something completely different!

on December 8, 2009 at 8:17 am |amitHello: Interesting way you bring Genetic Algorithms into the picture and nice context too!

on December 8, 2009 at 9:45 am |urbansannyasinThanks! I enjoyed reading up on GAs at your blog too!

on December 8, 2009 at 10:18 am |amitThanks 🙂