views:

752

answers:

16

When you step back and look at ...

  • the nature of animals, insects, plants and the problems they have organically solved
  • perhaps even the nature and balance of the universe

Have you ever been able to solve a problem by deriving an approach from nature?

I've heard of Ant Colony Algorithms being able to optimize supply chain amongst other things. Also Fractal's being the "geometry of nature" have been applied to a wide range of problems.

Now that spring is here again and the world is coming back to life I'm wondering if anybody has some experiences they can share.

Thanks

PS I would recommend watching the "Hunting the Hidden Dimension" Nova episode on fractals.

+17  A: 

I remember reading a book by a mathematician about the field of mathematics, and he mentioned an example from nature. His example from nature helped me improve a design I was working on.

His example was this: he was driving and he saw some birds on a telephone wire. The birds were spaced evenly apart. This happened not because there was some all-ruling bird that was telling each one where to sit. Rather, each bird had within itself a certain "algorithm" for deciding what to do when another bird came by. Birds prefer to maximize their free space, I guess.

This helped me at a point when I was fairly new to OO. I kept tending to make things procedural and have centralized intelligence in "god-objects". I read this and realized that individual objects could focus only on the things they needed to know and care about, and yet that the result at the big picture level could still be what you want. That the right result can "emerge" without being "controlled".

Charlie Flowers
This is no coincidence: Alan Kay, the father of object-oriented programming, is a microbiologist by training, and he modeled OO after the way simple cells can form complex organisms with complex behavior.
Jörg W Mittag
Interesting, I didn't know that. Fits with the Ant Colony reference too.
Charlie Flowers
Humans also prefer to maximize their free space: Observe yourself next time you choose a place at restaurant or at movie theater.
mouviciel
Yes, I know ... I was thinking of the "elevator rules" we all subconsciously follow. Pretty funny.
Charlie Flowers
But how might this be applied to real code??
Seun Osewa
In fact, there are some rules that are funnier to think about than "elevator rules" ... "urinal rules". The way guys choose a urinal in a crowded restroom is very much like the behavior of the birds. :)
Charlie Flowers
+1  A: 

Though mostly through academic exercise I did use some of these algorithm, I always thought it fascinating. Then I saw this book but could not afford it on my student budget. Now it's the time budget that is more of a restraint. Besides I am already plenty busy with this one.

give it a look, I think you will like it :-)

Newtopian
A: 

The threat of the daystar constantly forces me to evaluate and reevaluate my algorithms for maximal efficiency.

thedz
+6  A: 

I personally have never solved a problem by applying ideas from nature. However, I have solved problems by applying other people's solutions inspired by nature.

Many graph layout algorithms, and layout algorithms in general, are based on mechanics (springs, rubber bands, gravity) or simple insect-like behavior (follow your leader, maximize/minimize distance).

And, of course, I like object-oriented programming, which was developed by Nygaard and Dahl for simulations of physical real-world objects, and was perfected by Alan Kay, a microbiologist who modeled OO explicitly after the way simple cells can form complex organisms capable of complex behavior. So, in a sense, everybody who does OO, is indirectly deriving his program from nature.

Jörg W Mittag
+1  A: 

One of the most famous are neural networks.

mouviciel
Ironically, neural networks (as currently practiced) are based on a poor understanding of the state of knowledge of neuronal functioning as it existed decades ago. Understanding of how neurons work both individually and as parts of a network has advanced unbelievable in recent years, while at the same time "neural network" programmers have abandoned even their poorly-understood out-of-date biological modesl.
MusiGenesis
Spelling brought to you by a very out-of-date neural network that hasn't had its coffee yet.
MusiGenesis
A: 

One thing I have understood well from nature's law of conservation of energy, "Total amount of bugs in the product are constant. A Bug never gets fixed. It just gets converted to another bug" !! :-)

Jokes apart, I am really grateful to use languages like C++ in my work where the concepts ( e.g: inheritance, friend ) are derived from social system.

aJ
+2  A: 

I work in image processing, dealing with blobby objects which are too close to distinguish by simple thresholding. I implemented a watershed algorithm - the idea being that if you visualise the objects as hills on a map, and calculate the watershed line between the two hills, you can work out where one object ends and the other begins.

I wanted to improve this algorithm and as a bit of a hiker have found myself high up in the Lake District looking out over the panorama slicing up the hills and valleys with my fingers (much to the embarrassment of my other half). I have also been known to accost fellow walkers with questions like, "where does this hill end and the next one begin? Why? And why didn't you count that hillock?"

I haven't gone so far as to take my laptop out with me yet though. :)

north5
+2  A: 

Whatever concept in the nature, where we can make a mathematical model (Differential Equation) we can apply them on programming since the last are based on logic and mathematical foundation, one more than others.

I think we can think it backwards too, for example the observer pattern, there are a lot of species that implement that pattern too, chain of responsability, etc.

Its an interesting way to think...

Good one pal!

MRFerocius
I see that 'backwards' part most interesting.
Arnis L.
+1  A: 

My music software (see my profile) uses the evolutionary process to create music, in a manner somewhat analogous to Richard Dawkins' The Blind Watchmaker (which created images instead of music).

MusiGenesis
Are you familiar with Professor Al Biles?
San Jacinto
@San Jacinto: the question is, is professor Al Biles familiar with *me*? :)
MusiGenesis
Actually, I've never heard of Al biles, but I have heard of his software *GenJam*, so I guess Ihave heard of him somewhat.
MusiGenesis
+1  A: 

Extremely simple concept of "exception handling" is the most powerful and most straight forward application of nature in any software.

Any living organism does its level best to adapt to changing circumstances around him, and to go ahead in life achieving its goal of survival. Many exceptional circumstances come in between to deter it from its goal, but organisms fight hard and tries to find the most optimal way to do the job at hand. Our daily lives are full of such experiences.

Exception handling too helps any software to work towards achieving its goal bypassing any difficulties encountered.

But one thing which is missing in softwares is something I wish really must be there. It goes like this :

Human beings keep learning from their mistakes, storing everything they encounter in their heads, and next time when such problem arises, they know how to avoid/solve it. But first time when it occurs, they know to avoid it from their normal habits (handling the exception using common base class Exception), but they learn afterwards that there is a specialized way of handling it (specialized exception class like FileDoesNotExistException ). They never go to a repair shop to get updated, though they take advises from friends. I hope you people are getting the gist of what I am trying to say.

A software too should keep learning without showing their users the message "Site under upgradation" and handling unknown issues using plain Exception class. New versions are published though, but I wish we should develop an all time running and self learning software which upgrades itself, without going down ever.

pokrate
+1  A: 

The CS department at my old university has had a historic interest for algorithms inspired by nature since the seventies (I think the correct academic term is Natural computation. That's how I came into contact with some of those algorithms, especially Evolution strategies, the widely-known neural networks, and the exotic art of Membrane computing. I also did a class on data mining, where we studied some algorithms that allowed a computer system to learn from a set of data.

I would say that every kind of algorithm that makes the computer "learn" something falls into the category that is derived from nature. Therefore, even the rather basic algos like naive Bayes fall into this category, and we probably all use them in some way or another e.g. to filter out spam e-mail.

Personally, I have only implemented this kind of algorithms in university classes or my personal programming experiments. I think it is generally taught that they are powerful albeit in many cases less efficient than "classic" deterministic algorithms. Therefore a deterministic algorithm should always be preferred -- if there is one that solves the problem! It is only when the problem is too complex to be solved using deterministic algorithms that natural computation can offer a better solution. From my personal experience this is actually true. One small example: the evolution strategy I implemented to solve Sudoku puzzles took me half a day to implement and ran for several hours to find the same solution that the classic backtracking algo found in under a second (which took me less than thirty minutes to write ;-))

I just remember that a fellow student used evolution strategies to solve the problem of how to optimally distribute a set of files onto several DVDs for archival, which is I think an application of the knapsack problem or bin-packing problem, and it worked quite well. Apparently, ant colony algorithms can be used for this as well. Anyway, thanks for this interesting question.

Robert Petermeier
A: 

I did some work once with the author of Terragen to incorporate some atmospheric rendering algorithms of his into a landscape rendering program I had written. I was most impressed that the code actually emulated the atmosphere - you fed in black as your base colour (because the sky is black out in space) and the light source colour (effectively white, a slight touch of yellow maybe), various values for atmosphere height, density and red/green/blue decay then kicked the whole thing off - whereby it produced a nice blue graduated sky and a glowing yellow sun - or if you positioned the sun correctly a nice red to dark blue sky and sunset.

Actually it wasn't particularly complex - just some extremely well chosen mathematical equations emulating the behaviour of at most a dozen different parameters - but it was beautifully put together. I spent a lot of time thereafter playing with it - and eventually rewriting it completely for GLSL, but it certainly taught me a few things about how to approach a certain class of problem.

Cruachan
+1  A: 

I haven't solved the problem yet, but I think the ultimate solution to reputation, "karma" or any variation on finding a consensus among a group of people lies in Maynard Smith's work described in Evolution and the Theory of Games. Specifically, he develops the concept of an Evolutionarily Stable Strategy (ESS), which is behavior pattern that is robust against outside bad actors.

If we assume that everyone is altruistic, then things are simple. What Maynard Smith calls the "Dove" strategy of always deferring to others is an efficient strategy in the sense that no one wastes time fighting. But it isn't an ESS, because it can be invaded from outside by selfish actors. This would be analogous to a site that only has upvotes. It would fail because anyone could vote anything to the top.

More sophisticated systems like Stack Overflow and Slashdot encourage primarily upvotes, but allow for downvotes. They are more robust against people who are not "cooperating", but they are still vulnerable to "gaming". In both cases, it's easy to run up reputation quickly by being the first one to post, by posting something funny rather than useful, and similar actions.

Kevin Peterson
+1  A: 

Very often.

I have sometimes gone for a walk in the forrest while pondering a problem. And more often than not the solutions I happen upon have something to do with trees.

I have also worked on UI ideas inspired by physics. Using concepts such as gravity, magnetism or electric repulsion to organize items on the display.

I also once heard an interesting talk on SOA, believe it or not. The central idea of the talk was that different subsystems in a SOA architecture should cooperate in the manner of cells in a biological system. The subject was highly illuminating as to how a complex system can actually work, even if it is constructed out of loosely coupled components.

Guge
When all you have is trees, every problem looks like a forest? :)
Coxy
When all I have is trees, every problem IS a forest! Thanks, Coxymla.
Guge
+1  A: 

I used Genetic Algorithms which is based on evolutionary biology to detect faults in Very Large Scale Integrated Circuits

Following links will give you basic explanation of genetic algorithm and a C++ library of Genetic Algorithm.

Introduction to Genetic Algorithms

C++ Library of Genetic Algorithm Components

RP
+1  A: 

We created a "bug" programmatically ...once...

Mark Redman
sorry couldnt resist...
Mark Redman
Ha ha ha ! Good one!
RP