Opinion

The algorithm that mirrors life...

The concept of an algorithm is broader than its modern usage implies. In the digital world, an algorithm is a logical, step-by-step mathematical approach to achieving a goal

One scene has remained etched in my memory ever since my doctoral studies in the United Kingdom, during a chapter of my thesis that dealt with applying the genetic algorithm to an artificial intelligence model. I was telling my supervisor how the genetic algorithm had been running on my computer for almost 24 hours straight, still searching for the optimal solution. He laughed and said, “Life and all its intricacies, according to the law of evolution, took millions of years to shape into what we see today, don’t fret over a few dozen computational hours!” That moment captured the profound link between genetic algorithms and their natural and mathematical counterparts, a connection this article seeks to explore.

The term “algorithm” has become a buzzword in today’s digital discourse - including in my own published articles - often tightly coupled with artificial intelligence. However, the concept of an algorithm is broader than its modern usage implies. In the digital world, an algorithm is a logical, step-by-step mathematical approach to achieving a goal. It’s a general mathematical methodology whose applications vary widely depending on the context.

In artificial intelligence systems, algorithms function as the digital brain. They interlink inputs, facilitate training and generate desired outputs. Among these, one of the most powerful is the Genetic Algorithm (GA), often used directly on datasets to perform tasks such as optimisation and selection. In fact, the GA can be integrated with primary AI algorithms to enhance their efficiency and performance.

This raises a common question: what do genes have to do with mathematics? Genetic material, after all, is biological, tied to hereditary traits and DNA analysis used in diagnosing or predicting diseases. Yet, the Genetic Algorithm borrows the logic of natural genetics and evolution, applying it through pure mathematics to simulate biological processes. To understand this better, let’s explore how the GA works and how it is applied, especially in AI.

The Genetic Algorithm is one of the evolutionary algorithms inspired by Darwin’s theory of natural selection, but in this context, it’s a non-random, guided process. It shines in fields like AI and machine learning in solving optimisation problems, where multiple solutions are evaluated, compared and refined.

The process begins with initialisation, randomly generating a group of potential solutions, known as individuals or chromosomes. These serve as the starting population. Using mechanisms that mimic genetic crossover and mutation, the algorithm gradually improves the population. Each individual is evaluated through a fitness function that measures how well it solves the problem. The best-performing individuals are then selected in the selection phase, similar to survival of the fittest.

Next comes crossover, the digital equivalent of biological reproduction. Here, two “parent” solutions combine parts of their data to create “offspring”, new solutions that inherit traits from both. This increases the diversity of the population and allows for exploration of new, potentially better areas of the solution space.

To prevent stagnation or premature convergence, mutation is introduced. In biological terms, this refers to random changes in DNA; in algorithms, it's a controlled alteration of a solution’s data to maintain diversity. Although most mutations are minor, some can significantly enhance (or reduce) the fitness of an individual, a phenomenon also observed in real genetics. In fact, I’ve previously expressed the idea, detailed in my book Between Science and Faith, that so-called “random mutations” may actually conceal an intricate, undiscovered order beyond the grasp of current science.

Following mutation is the replacement stage, where the new population (or part of it) replaces the older one based on overall fitness. This iterative cycle continues until the termination condition is met, usually when a sufficient solution is found, or a maximum number of iterations is reached. In this way, the algorithm doesn’t just simulate biology, it demonstrates how complex systems, whether digital or organic, evolve towards optimal states through competition, adaptation and change.

Dr Muamar bin Ali Al Tobi

The writer is an academic and researcher