David Mercer

David contributes to SME Pals, a blog aimed at helping startups and online businesses.

Why I Built Virtual Grass That Evolves

It’s not every day you realize that software you have been designing and building for the last few years appears to have developed “common sense”. 
To be clear this is heuristic software I’m talking about. 
An heuristic is a comparative process used to generate solutions not guaranteed to be perfect.
Heuristic algorithms that think like humans. Does that say more about the algorithms, or about humans?
I wanted to know. So I found out.
Turns out we’re heuristic. The human mind relies on heuristics to achieve some of the fantabulous mental acrobatics we take for granted on a daily basis. 
Creativity. Common sense. Stuff we can’t yet replicate with AI.
There’s a kind of smugness about most futurists who confidently tell us that creative pursuits will become the focus of human endeavor in the future, as manual, technical and scientific fields are ceded to machines.
I’m here to tell you it’s simply not true.
Machines will be able to ‘out-creative’ humans in exactly the same way they can out-calculate us.
Advanced heuristic systems are already solving mind-blowingly complex NP-Hard problems that humans, despite our common sense advantage, can’t hope to match. 
Route optimizations can play a significant role in any economy by lowering transport costs up and down the supply chain — in particular for the so called last mile
Consider an everyday logistics problem in which a fleet of five vehicles need to stop at 100 locations within a time-limit. The complexity of this problem can be denoted using the number of permutations (possibilities).
5¹⁰⁰ x 100! = 7.36 x 10²²⁷
To put it in perspective there are only about 10⁸⁰ Hydrogen atoms in the entire Universe. 
Heuristics can find incredibly accurate solutions out of all these possibilities in a matter of seconds. Akin to finding a needle in a trillion trillion trillion trillion … trillion haystacks.
Here’s what one solution for a bunch of museums around London looks like.
Route optimization for five vehicles and 100 locations courtesy of Optergon.
They can also help us be more creative in everyday life. Coming up with creative ideas can be really difficult. Entrepreneurs, for example, can employ an heuristic approach to generating new business ideas that radically increase the number of concepts your brain can use to generate creative associations.
That said, 
Heuristics right now are more of a help than a threat to human creative supremacy. To explain why they soon might overtake us I need to take you back to the start of the Solar system.
Our solar system, like countless others, began life as a swirling cloud of dust and gas. Over time Gravity aggregated larger and larger volumes of dust and gas into what would eventually ignite into a star.
The nuclear ignition of Sol blasted off lighter elements into the outer system leaving small rocky planets to form as they swept clear their orbits. 
A few billion years ago our solar system had a star, planets, moons and something more peculiar.
None of these existed at the start of the story. These things, including life emerged.
Emergence occurs when a system exhibits properties that did not exist in its constituent parts.
Once life began, emergence took on a different guise.
The process of Evolution is both heuristic and emergent.
Heuristic emergence is arguably the most powerful natural phenomenon you’ve never heard of.
Genes mutate, combine, recombine and do all sorts of strange things designed to alter themselves during reproduction in order to produce offspring with diverse genetic traits.
There is no guarantee that these mutations or changes will be beneficial. There is no guiding hand.
None is needed. 
On aggregate, if a mutation is not beneficial the organism will not survive to reproduce. That mutation will be lost to the gene pool.
Evolution regulates itself via a single ‘fitness’ test — reproductive survival.
In this way evolution took life here on Earth from simple, single celled organisms to complex, sentient multi-cellular beasties.
Heuristic emergence still wasn’t done. It imbued us with new heuristics.
A natural heuristic (evolution) emerged a new, organic heuristic (i.e. common sense).
Our intelligence is emerged from heuristics. If Nature emerged intelligence using heuristics, can we?
I built virtual grass to see if an environment would emerge new individuals able to adapt and survive conditions not survivable by their progenitors.
The screenshot below shows a map (bottom left) with the faint outline of a river that drains into an inland swamp, fed by high rainfall in the North West. 
Initial conditions showing 2 seed grasses of gene size expression 20.
There are two seed grasses each with gene size expression of 20
Larger gene expression means larger grass. Smaller gene expression, smaller grass. Small grass needs less water to survive. Large grass needs more water.
Most of the map has too little water to sustain grass of size 20. 
Random mutations of up to 1% in size may occur during reproduction. Reproduction can only occur if the individual has survived to reproductive age — approx 15% of its total lifespan.
After simulating 240 years the map looks like this (more often than not — it changes every time since the entire process is heuristic).
Evolution leads to adapted individuals able to survive in their respective environments.
Larger grass (displayed as dark green) dominates the areas of high rainfall or abundant water, following the line of the river to the inland wetlands. Smaller grass (displayed as light green) evolves and adapts to colonize other areas that have significantly less water.
The largest grass has a gene size expression of 116 while the smallest grass gene is 6.
There is no code that instructs grass to adapt one way or another. No guiding hand. It simply adapts to environmental pressures in exactly the same way natural evolution occurs.
Admittedly my virtual grass’ DNA was radically simplified, possessing a single gene for size. 
However, it is a basic proof of concept that artificial heuristic processes can produce evolution. 
This leaves us here:
  • Premise 1: Evolution can emerge intelligence. 
  • Premise 2: Artificial evolution is possible.
  • Conclusion: Artificial evolution can emerge artificial intelligence.
Oddly enough this would add a 4th step in the heuristic stepladder. 1. Physical heuristics emerged a planet on which emerged life. 2. Evolution emerged organisms with organic heuristics. 3. Those organic heuristics gave rise to artificial heuristics, which in turn could 4. emerge artificial virtual heuristics as part of the mental machinery of an heuristic AI.
An evolved heuristic AI would be different from anything we know. It would not necessarily be what we predict… or even desire.
It would be intelligent. But on its own terms.
It would be a true AI. Complete with heuristics that give it creativity and common sense (and any other mental machinery we have, or can evolve) not found in today’s machine learning neural networks.
Here’s the question to ask yourself.
With the right starting conditions, how long would it take for an artificial intelligence to evolve?
The simulated 240 years in my Grasslands example took less than a few seconds. 
Once an intelligence emerges how long would it take to supersede us? 
I’ll let you know…



More by David Mercer

Topics of interest