I live in Barcelona, a city marked with GaudÃ’s spirit. GaudÃ was a wise architect who studied shapes from nature, as a form of inspiration, and he used them to create new buildings. These shapes, like spiral, helix or hyperboloid, are not only beautiful but also interesting ways to sustain a building’s weight. Both beauty and engineering, a really good research.
This morning I was thinking about it: how can nature help us to discover new solutions? It spent millions of years fixing and optimizing common and uncommon problems, so it’s obvious that we should look at it to try to get some inspiration, some tips or clues, while trying to solve a problem. Also with Computer Science problems!
What does nature do to sort things? Maybe a new sorting algorithm is waiting to be discovered. How can DNA replicate itself with an incredible error-tolerance method, and making mutations a way to evolve? It has lots of examples to study. And you needn’t be a biologist to understand its behaviour. For example: look at the way you walk, moving your arms and legs in a curious synchronization, i.e. 4 elements moving “at the same time”. It’s probably an excellent method to save energy. Now imagine you have 4 arrays in your program, and you need to make a complex operation with them. Maybe the easiest way is to implement 4 nested loops to do this process (with a complexity of O(n^4)). But it might be a way to implement this process operating with these 4 arrays at the same time, with only a loop (O(n)!). It might be hard to find, although the result is worth the effort.
Now we are using some behaviours from nature, like neural networks and genetic algorithms, but I think we need to go further.
“Computer science is no more about computers than astronomy is about telescopes.” – Edsger Dijkstra