Software and Algorithms inspired by nature

Diego Cardona
5 min readOct 3, 2022

What does have in common, software and classic art?

I’m not a great art advocate or something like that but still enjoy visiting museums and particularly love the history behind each of the pieces that I see as interesting, and as a software engineer who loves what I do, that question has come to my mind a couple of times, What does have in common, software and classic art? And the answer was “naturally nature”.

Some of the greatest accomplishments in either field of software and art are inspired by nature, in art mainly as a muse to create new works and in software as functional design inspiration, and we have to admit it, nature is not just beauty, it is functional and everything in it works in quite optimal and sustainable ways that every engineer in the world must be either jealous or in love with those designs and just make total sense trying to replicate those wonderful behaviors in our software implementations.

About Biomimicry

There is a term called Biomimicry by Janine Benyus, it is about nature-inspired design but as far as I understand mainly focused on physical/hardware innovations, and it is clearer to replicate the nature in a tangible form since is something that we can try to replicate from the observation, e.g. the bullet train issue of sonic booms when getting out of a tunnel was solved by adding 50-foot steel ‘beak’ to the train and this solution was inspired in the kingfisher, the engineer Eiji Nakatsu come up with the solution based on his hobbit of bird watching.

The bullet train solution is a gorgeous example of how biomimicry can be applied to problems of the “physical” real world, but in software is a bit different we need to abstract the concept said in another way we need to abstract the functionality of the beauty and adequate it to a software solution that solved some problem, and here is where things start to be complicated but elegant.

Nature as Software Inspiration

In software are too many areas that required different ways of thinking for abstraction, it is not the same abstract concept for a Data Store motor, a data structure model, or a communication layer interaction, there are specific but quite important differences, luckily for us, there had been great accomplishments of software engineers generating solutions based on nature.

Probably the most popular nature-inspired solution in algorithms or at least the more used I would say are Trees as a data structure, and you know if you have been in a coding interview I’m almost certain that you have used trees to solve some problems, and I’m quite sure that if you are reading this is highly likely that you had been in a couple (or hundreds) of code interviews in the past, but basically, a tree is a data structure that is very optimal for searching and its nature-inspiration is based in the leaves and the relations between them.

There is another nature-inspired solution that I find quite interesting and is the design pattern Strangler Fit this one is intended to solve the monolith migration to microservices, yes I know almost no one has to deal with monolith migration(Bazinga), and its nature inspiration is based in the tree strangler fig, they seed in the upper branches of a tree and gradually work their way down the tree until they root in the soil. Over many years, they grow into fantastic and beautiful shapes, meanwhile strangling and killing the tree that was their host.

As the last example of a nature-inspired solution, we have a terminology based on rivers that described how the data flows from one service to another in microservices, and we call the services upstream or downstream depending on the way that the data flows.

You can see in the three examples before we saw a data structure a design pattern for microservices migration and terminology for data flowing, all nature-inspired solutions in software but all quite different from their abstraction from the nature to their functionality and goal, those examples show how hard could be to have a general working theorem to implement nature-inspired designs more often to solve a problem, but still shows that is possible despite not using a general solution to make those abstractions, but definitively we could figure out ways to make it easier per specific areas of the software, e.g. to define principles or guides that help to abstract behaviors from nature to design patterns.

Conclusions

IMHO, the software design field has the potential to improve and promote the observation of nature to abstract potential solutions that may be of general use like the three previous examples.

A general question, what would be the best way to generate a fluid “ecosystem” that naturally integrates multiple elements from “nature” and work as a whole “being”? Are our (General state-of-the-art) current efforts the best towards that, or are there some additional lessons from nature that we might adapt to be more efficient in a fully integrated context?

In general, in the technology context, there are currently multiple efforts to mimic, and protect nature around the world, with awesome people doing awesome things, but from my point of view the great majority of those efforts are focused on hardware, therefore my questioning from a software perspective how can we also take advantage of a nature-inspired design point of view, and even if there is something else that I may be overlooking.

--

--

Diego Cardona

Software Developer, Engineering Manager and Video Gaming Enthusiast