Algorithmic Thinking

Borealis
The Zerone
Published in
5 min readDec 17, 2023

Nature is often super secretive in her approaches. Yet sometimes she unveils her way of making things work cleverly. She works around complicated problems with as minimal computing power as possible still maintaining the artistic touch and elegance. Humans capture some of the glimpses and devise algorithms out of it.

Nature inspired algorithms

Slime mould foraging for resilient networks

Brainless, single-celled slime mould foraging shows a striking resemblance to the design of Japan’s rail system known to be one of the world’s most efficient.

In an experiment, researchers arranged oat flakes in the pattern of Japanese cities around Tokyo and exposed them to slime moulds. Being home to the world’s busiest intersection, engineers had spent countless hours coming up with the design of Japan’s rail system known to be one of the world’s most efficient. It is amazing how they found a remarkable degree of overlap between networks of nutrient-channeling tubes and the layout of the Japanese rail system.

Even though slime moulds are brainless and single-celled, they embody the experience of hundreds of millions of years of evolution in coming up with a design at the cost of survival.

By modeling its behavior we can find the optimal design for transportation networks, and energy networks. Like the slime mold, the model first creates a fine mesh network that goes everywhere, and then continuously refines the network so that the tubes carrying the most cargo grow more robust and redundant tubes are pruned.

Decentralization

Intelligence is amplified by thinking together in systems also known as swarm intelligence.

Many natural systems, such as ant colonies, bee hives, and ecosystems, exhibit decentralized organization without a leader. Ranging from colonies of tiny ants and insects to a school of fish or a flock of birds they achieve complex tasks through local interactions. Their intelligence is amplified by thinking together in systems also known as swarm intelligence. They can profit from the experience of all other members like all birds in the flock can share their discovery and help the entire flock get the best hunt.

Just simulating the movement of a flock of birds, leveraging each bird’s local solution to help us find the optimal solution in a high-dimensional solution space, and eventually the best solution found by the flock gives the best solution in the space. Algorithms like Particle Swarm Optimization (PSO) and Ant Colony Optimization (ACO) are all based on this principle.

Genetic algorithm and evolutionary algorithm

Individuals with better fitness have a higher chance of passing their “genes” to the next generation through crossover, and occasional mutations introduce genetic diversity. Over multiple generations, the population tends to evolve towards better solutions, reflecting the principles of natural selection and genetics. Genetic optimization can solve cases like Traveling Salesman problem.

Humans are no less in coming up with great algorithms. Like the proverb, necessity is the mother of invention, the most beautiful algorithms were designed at the time of the biggest crises. Fast Fourier Transform (FFT) is one of them.

FFT: The most important numerical algorithm of our lifetime

It is amazing how the underlying idea behind this ingenious algorithm that potentially prevented a nuclear arms race is a simple divide-and-conquer principle.

Mankind witnessed the human-invented curse when nuclear weapons were detonated at Hiroshima and Nagasaki. After the end of the Second World War, when the Nuclear Test Ban Treaty was signed by the United Kingdom, the United States, and the Soviet Union they agreed never to test nuclear arms again but there was a loophole. Nuclear tests on the atmosphere could be detected from traces of residual atoms and hydrophones could detect them under the sea but for underground tests there was no proper method of detecting and differentiating it from seismic shock waves.

The FFT algorithm became glasses for signals and data that take a closer look and uncover hidden frequencies. It enabled scientists to identify underground nuclear tests reducing calculation time from over three years to 35 minutes so the treaty remained intact.

It is amazing how the underlying idea behind this ingenious algorithm that potentially prevented a nuclear arms race is a simple divide-and-conquer principle. It expresses the DFT (Discrete Fourier Transform, time to frequency domain transformation for a digital signal) of a sequence of N points as the sum of smaller DFTs of even and odd-indexed elements. By doing this recursively, you break down the problem into smaller and smaller sub-problems until you reach sequences of just two points. (Recursion has always been beautiful!)

Variation of FFT pops up almost everywhere data compression(JPEG), audio, image processing, radar analysis, and so on.

Stories worth knowing

Reinforcement learning algorithms have their beauty as it takes inspiration from animals and humans on how to learn i.e., based on a reward feedback mechanism. OpenAI has leveraged these algorithms to play games and developed cool models like Alpha Go, Alpha Zero, and muZero (muZero can beat chess engines like stockfish and does not even need to know about any rules of chess). There is also a rumour of how Q* is going to be the next big thing; an RL algorithm to solve physics problems or your interesting math problems.

Can there ever be an algorithm to solve it in an accurate enough manner?

What were your steps in learning to solve the algebra for the first time?Or procedures to solve integration and differentiation problems?

Can everything every task be listed in a series of steps?

Pause and Ponder

A few years back an interesting experiment (Brainport) was done by researchers in which they were studying how humans learn to receive and decode signals from sensory parts. The finding was even mind-boggling. They observed cortical regions known to decode signals from your tongue can also learn to see if provided with visual input. This enabled your tongue to see if some form of visual stimulus was provided to your tongue (tasting the light). This implies brain has some single form of algorithm to learn the decoding regardless of the nature of inputs.

The question is will humans ever catch a glimpse of this one algorithm that makes us homo sapiens!

--

--