The History of the Algorithm

Matt George

Fractional CTO · Founder of Injuria.ai

The History of the Algorithm

An algorithm is a finite sequence of well-defined, implementable instructions, designed to solve a class of problems or to perform a computation. The concept is as ancient as mathematics itself, originating in step-by-step procedures for calculation performed by human scribes. The history of the algorithm is a story of increasing abstraction and automation, a journey from arithmetic recipes on clay tablets to complex neural networks that learn from vast datasets. This progression was not linear but driven by specific needs: the desire for mathematical rigor, the demands of wartime computation, the economic necessity of managing information, and the challenge of making sense of a globally connected network.

The word itself derives from the name of the 9th-century Persian mathematician Muhammad ibn Musa al-Khwarizmi[1], whose work systematized solving equations. His name, when Latinized, became Algoritmi. Yet, the modern understanding of the algorithm was only forged in the 20th century through the foundational work of logicians like Alan Turing and Alonzo Church, who sought to define the very limits of what is computable. From these theoretical underpinnings, the algorithm became the core component of the software that animated the first electronic computers.

As computers evolved from room-sized mainframes to personal devices and now to global-scale distributed systems, so too have the algorithms that run on them. The discipline of algorithm analysis, pioneered by figures like Donald Knuth, provided the tools to measure and compare their efficiency. This led to a sophisticated understanding of computational complexity, separating problems that can be solved efficiently from those that are likely intractable. Today, algorithms determine the search results people see, the financial trades that are made, and the medical diagnoses that are suggested, with machine learning models representing a new frontier where the instructions themselves are not explicitly programmed but learned from data.

Ancient and Classical Origins (c. 2000 BCE to 400 CE)

The earliest evidence of algorithmic thinking appears in the mathematics of ancient civilizations. Babylonian clay tablets dating to c. 1800 to 1600 BCE[2] contain procedures for solving problems equivalent to linear and quadratic equations. These were prescriptive recipes for calculation. While they were effective, the most influential early algorithm came from Greek geometry.

Around 300 BCE, the Greek mathematician Euclid, in his seminal work Elements[3], described a method for finding the greatest common divisor (GCD) of two integers. Now known as the Euclidean algorithm[4], it is a model of algorithmic clarity. The procedure involves replacing the larger of two numbers with the difference between the two, a process that is repeated until the numbers are equal. This final number is the GCD. The algorithm is guaranteed to terminate because the numbers decrease with each step, and it is correct and unambiguous. It is one of the oldest algorithms still in common use, often implemented in introductory programming courses and used in cryptographic protocols.

Another significant example from this period is the Sieve of Eratosthenes[5], attributed to the Greek scholar Eratosthenes of Cyrene (c. 276 to 194 BCE). It provides a simple, efficient method for finding all prime numbers up to a specified integer. The process begins with a list of consecutive integers from 2 up to the limit. The first number, 2, is prime. All multiples of 2 are then marked as composite. The next unmarked number, 3, is prime, and all of its multiples are marked. This process continues, with each new unmarked number being the next prime. These ancient algorithms were designed for human execution, laying the conceptual groundwork for automated computation that would follow centuries later.

The Etymology and Mechanical Future (c. 800 to 1900)

The term "algorithm" has its roots in the Islamic Golden Age. The Persian scholar Muhammad ibn Musa al-Khwarizmi, active around 820 CE in Baghdad's House of Wisdom, wrote a revolutionary book on arithmetic using the Hindu-Arabic numeral system. The Latin translation of this text, Algoritmi de numero Indorum (Al-Khwarizmi on the Hindu Art of Reckoning), introduced his name, Latinized as Algoritmi, into European intellectual life. The word “algorism” initially meant performing arithmetic using these new numerals, and over time it evolved into “algorithm” to mean any systematic procedure. Al-Khwarizmi's other major work, The Compendious Book on Calculation by Completion and Balancing (Al-jabr wa’l-muqabala), provided systematic methods for solving equations, giving rise to the word “algebra[6]” from al-jabr.

For nearly a millennium, algorithms remained the domain of mathematicians and were executed with pen and paper. The idea of automating them began to take shape in the 19th century with the work of the English mathematician and inventor Charles Babbage[7]. Frustrated by errors in hand-calculated mathematical tables, he designed the Difference Engine, a mechanical calculator for polynomial functions. His vision grew far more ambitious with the design of the Analytical Engine[8] in the 1830s. This was a conceptual leap: a general-purpose, programmable mechanical computer. It featured a “store” (memory) and a “mill” (central processing unit) and could be programmed using punched cards, an idea borrowed from the Jacquard loom.

While Babbage designed the hardware, it was his collaborator, Ada Lovelace[9], who articulated its true potential and, in the process, wrote what is considered the first computer algorithm. In 1843, she translated a paper about the Analytical Engine by Italian engineer Luigi Menabrea. She appended a series of extensive notes, which were longer than the original paper. In her Note G[10], Lovelace described in detail a method for using the Engine to calculate a sequence of Bernoulli numbers. This was not merely a mathematical formula; it was a concrete, step-by-step sequence of operations tailored for the machine, including loops and memory storage. It is the first published algorithm specifically intended for implementation on a computer. Lovelace also foresaw that the machine could manipulate symbols other than numbers, suggesting it could compose music or create graphics if the underlying rules could be expressed algorithmically.

The Theoretical Foundations of Computation (1900 to 1945)

The 20th century began with a profound crisis in mathematics that ultimately led to a formal definition of the algorithm. In 1900, at the International Congress of Mathematicians in Paris, David Hilbert[11] outlined 23 unsolved problems[12] to guide mathematical research. The tenth problem concerned finding an algorithm to determine if a Diophantine equation has integer solutions. More fundamentally, the Entscheidungsproblem (decision problem) asked for an algorithm that could take any logical statement and determine whether it was provable within a formal system.

The search for an answer forced mathematicians to ask a more basic question: what, precisely, is an algorithm? An intuitive understanding was no longer sufficient. The answer came in 1931 when Kurt Gödel[13] published his incompleteness theorems[14], showing that in any sufficiently complex formal system, there are true statements that cannot be proven within that system. This demonstrated inherent limitations to what could be decided mechanically and shattered Hilbert's dream of a complete and consistent system for all of mathematics.

In 1936, several mathematicians independently proposed formal models of computation that answered the Entscheidungsproblem in the negative. American logician Alonzo Church[15] created lambda calculus[16], a formal system based on function abstraction and application. In his paper, he showed that the Entscheidungsproblem was unsolvable. In the same year, the British mathematician Alan Turing[17] published his landmark paper "On Computable Numbers, with an Application to the Entscheidungsproblem[18]". Turing introduced a simple yet powerful abstract device, now known as the Turing machine[19], which could read, write, and move along an infinite tape of symbols according to a set of rules. He argued that any computation that could be carried out by a human could be carried out by one of these machines. He then proved that there exists no Turing machine that can solve the Entscheidungsproblem. Church's and Turing's models were proven to be equivalent in computational power. This gave rise to the Church-Turing thesis[20], which posits that any function that is intuitively computable can be computed by a Turing machine. This thesis provided a robust, formal definition of an algorithm: an algorithm is a procedure that can be executed by a Turing machine.

This theoretical work soon found practical application. The outbreak of World War II created an urgent need for high-speed computation for tasks like calculating artillery firing tables and, most famously, breaking enemy codes. At Bletchley Park[21] in the UK, Turing and his colleagues developed algorithmic techniques and specialized machines, such as the Bombe, to break the German Enigma cipher[22]. This work saved countless lives and demonstrated the immense power of automated algorithmic processing.

The Mainframe Era and Algorithmic Analysis (1946 to 1970)

After the war, the first generation of general-purpose electronic computers emerged, such as the ENIAC[23] and its successor, the stored-program EDVAC[24]. For the first time, algorithms could be encoded as software and stored in a computer's memory, allowing for unprecedented flexibility and speed. This new capability required better ways to express algorithms. Early machine code was cumbersome and error-prone. The development of high-level programming languages was a critical next step. FORTRAN[25] (Formula Translation), developed by a team at IBM led by John Backus in 1957, made it easier to write scientific and engineering algorithms. In 1958, a committee of American and European computer scientists created ALGOL[26] (Algorithmic Language). ALGOL was particularly influential in academic circles for its clean structure and became the standard way to describe algorithms in publications for decades.

With the ability to implement and run complex algorithms, a new field emerged: the analysis of algorithms. It was no longer enough for an algorithm to be correct; it also had to be efficient. The central figure in this movement was Donald Knuth[27]. In 1968, he published the first volume of his magnum opus, The Art of Computer Programming. Knuth's work was transformative. He provided a rigorous mathematical framework for analyzing the performance of algorithms, popularizing the use of asymptotic notation (like Big O notation[28]) to describe their running time and memory usage as a function of input size. This allowed for objective comparisons between different methods. The book series also served as a comprehensive encyclopedia of fundamental algorithms and data structures.

This period saw the development of many of the foundational algorithms that are still the bedrock of computer science. In 1956, Edsger Dijkstra[29] conceived of his now-famous algorithm for finding the shortest path between nodes in a graph, publishing it in 1959. This algorithm is essential in network routing protocols. In 1959, Tony Hoare[30] invented Quicksort[31], a highly efficient divide-and-conquer sorting algorithm that remains one of the most widely used. Another breakthrough was the Fast Fourier Transform (FFT)[32], an algorithm that computes the discrete Fourier transform much more quickly than naive methods. While its principles had roots in the work of Gauss, its modern form was popularized in a 1965 paper by James Cooley and John Tukey[33], revolutionizing the field of digital signal processing.

Complexity, Optimization, and the Personal Computer (1971 to 1990)

As computer scientists developed more algorithms, they noticed that some problems resisted all attempts at an efficient solution. Problems like the Traveling Salesperson Problem, which asks for the shortest possible route that visits a set of cities and returns to the origin, could be solved for a small number of cities by brute force, but the computation time exploded as more cities were added. This practical difficulty led to one of the most important theoretical breakthroughs in computer science.

The Theory of NP-Completeness

In his 1971 paper, "The Complexity of Theorem-Proving Procedures", Stephen Cook[34] formalized this class of hard problems. He defined the class P as the set of problems solvable in polynomial time on a deterministic Turing machine (considered "efficiently solvable"). He defined NP as the set of problems whose solutions can be verified in polynomial time. Cook then proved that a specific problem, the Boolean satisfiability problem (SAT), had the property that if it could be solved in polynomial time, then every other problem in NP could as well. Such problems were termed NP-complete[35]. A year later, in his paper "Reducibility Among Combinatorial Problems[36]", Richard Karp[37] showed that 21 other well-known and important problems, including the Traveling Salesperson Problem, were also NP-complete. The P versus NP problem[38], which asks whether P = NP, remains the most famous unsolved problem in computer science. The theory of NP-completeness provided a framework for understanding computational intractability. It told developers not to waste time seeking an exact, efficient algorithm for these problems, but to instead focus on heuristics, approximation algorithms, or solutions for special cases.

Algorithms for New Domains

The invention of the microprocessor, starting with the Intel 4004[39] in 1971, brought computing power out of large data centers and into smaller machines. This shift created new applications and new algorithmic challenges. The rise of database management systems required efficient ways to store and retrieve data on disk. In 1972, Rudolf Bayer and Edward McCreight invented the B-tree[40], a self-balancing tree data structure that minimizes disk reads and became the standard for database and filesystem indexing.

The need for secure communication in a world of interconnected computers spurred a revolution in cryptography. In 1976, Whitfield Diffie and Martin Hellman published "New Directions in Cryptography," introducing the radical idea of public-key cryptography and the Diffie-Hellman key exchange[41] protocol. This allowed two parties to establish a shared secret over an insecure channel. A year later, Ron Rivest, Adi Shamir, and Leonard Adleman at MIT developed the RSA algorithm[42], a practical implementation of a public-key system that could be used for both encryption and digital signatures. Its security relies on the presumed difficulty of factoring large integers, a problem for which no efficient classical algorithm is known. In 3D computer graphics, Edwin Catmull[43] developed the Z-buffer[44] algorithm in 1974, a simple and effective method for hidden surface determination that became a standard in graphics hardware.

The Internet and the Data Explosion (1991 to 2010)

The advent of the World Wide Web and the commercialization of the internet in the 1990s created a new set of problems centered on scale and information retrieval. The internet was a massive, chaotic, and constantly changing graph of interconnected documents. Finding relevant information in this environment required new kinds of algorithms.

Search and Ranking

Early web search engines like AltaVista used algorithms that primarily indexed the text of web pages. While fast, they were easily manipulated and often returned irrelevant results. The breakthrough came from two Stanford PhD students, Larry Page and Sergey Brin. They developed an algorithm called PageRank[45] that ranked web pages not just by their content, but by the structure of the links between them. The core idea was that a link from page A to page B is a vote by page A for page B. The importance of a page is determined by the number and importance of the pages that link to it. This is an application of eigenvector centrality on the web graph. The PageRank algorithm, combined with sophisticated text analysis, formed the basis for the Google search engine and dramatically improved the quality of web search.

Compression and Streaming

The growth of the web also created a demand for transmitting rich media like images, audio, and video over bandwidth-constrained connections. This drove intense development in data compression algorithms. The JPEG[46] standard, finalized in 1992, employed a lossy compression scheme based on the discrete cosine transform (DCT), a close relative of the FFT, to drastically reduce the file size of images with minimal perceptual loss. For audio, the MP3[47] format, part of the MPEG-1 standard from 1993, used psychoacoustic models to discard parts of the audio signal that are less audible to the human ear. These and other compression algorithms were essential for making multimedia content practical on the internet.

Machine Learning's Resurgence

This era also saw the resurgence of machine learning, an area of artificial intelligence focused on algorithms that learn from data. While many of the ideas had existed for decades, the combination of faster processors and, crucially, the vast datasets made available by the internet made them practical. Techniques like Support Vector Machines (SVMs)[48] became popular for classification tasks in the 1990s. In 2001, Leo Breiman introduced the Random Forest[49] algorithm, an ensemble method that combined many decision trees to improve accuracy and reduce overfitting. The Netflix Prize[50], a competition that ran from 2006 to 2009 to improve movie recommendations, focused the attention of thousands of researchers on collaborative filtering algorithms, significantly advancing the state of the art in recommendation systems.

The Era of Big Data and Deep Learning (2011 to Present)

The current era of algorithms is defined by three converging trends: datasets of unprecedented scale (so-called "Big Data"), the availability of massively parallel hardware like Graphics Processing Units (GPUs)[51], and algorithmic breakthroughs in machine learning, particularly deep learning.

The Deep Learning Revolution

Artificial neural networks, inspired by the structure of the brain, had been studied for decades. However, training deep networks (those with many layers) was notoriously difficult and computationally expensive. This changed dramatically in 2012. A team from the University of Toronto led by Geoffrey Hinton submitted a deep convolutional neural network (CNN)[52] named AlexNet[53] to the ImageNet Large Scale Visual Recognition Challenge (ILSVRC)[54]. AlexNet, trained on 1.2 million images using GPUs, achieved an error rate that was less than half that of the next-best entry. This stunning result, often called the "ImageNet moment," triggered a revolution. Deep learning quickly became the dominant approach for problems in computer vision, speech recognition, and natural language processing.

Subsequent years saw rapid innovation in neural network architectures. For sequential data like text, Recurrent Neural Networks (RNNs)[55] were improved upon by architectures like the Long Short-Term Memory (LSTM) network. A major shift occurred in 2017 with the publication of the paper "Attention Is All You Need[56]" by researchers at Google. It introduced the Transformer[57], a new architecture that relied entirely on attention mechanisms to process sequential data in parallel. This design proved to be highly scalable and effective, forming the foundation for modern Large Language Models (LLMs) like OpenAI's GPT series.

Algorithms at Scale and Today's Landscape

Processing the massive datasets required for deep learning and other big data applications demanded new computational paradigms. Google's MapReduce framework, described in a 2004 paper, provided a simple model for processing large datasets in parallel across a distributed cluster of commodity machines. Its open-source implementation, Apache Hadoop[58], was widely adopted. These systems shifted the focus of algorithm design towards parallelism, fault tolerance, and managing data locality.

Today, the field of algorithms is more dynamic than ever. While classical algorithms for sorting, searching, and graph traversal remain fundamental, the frontier has moved towards probabilistic and learning-based algorithms. The most advanced systems, such as those used in generative AI, are often so complex that their behavior is emergent rather than explicitly designed. The primary challenges now involve not just performance but also fairness, accountability, and transparency. Ensuring that algorithms do not perpetuate societal biases embedded in training data is a critical area of research. The immense energy and computational cost of training state-of-the-art models are also driving research into more efficient algorithms and specialized hardware.

Looking forward, the development of practical quantum computers could fundamentally alter the landscape of computation. Algorithms like Shor's algorithm[59] for integer factorization and Grover's algorithm for searching unstructured data promise exponential speedups for specific problems, with profound implications for fields like cryptography and materials science. For now, the story of the algorithm continues its trajectory: from simple, deterministic rules to complex, adaptive systems that are increasingly integral to science, commerce, and daily life.

Sources (59)
  1. Muhammad ibn Musa al-Khwarizmi - Wikipedia
  2. Plimpton 322 - Wikipedia
  3. Euclid's Elements - Wikipedia
  4. Euclidean algorithm - Wikipedia
  5. Sieve of Eratosthenes - Wikipedia
  6. Algebra - Britannica
  7. Charles Babbage - Wikipedia
  8. Analytical Engine - Wikipedia
  9. Ada Lovelace - Wikipedia
  10. Lovelace's Note G
  11. David Hilbert - Wikipedia
  12. Hilbert's problems - Wikipedia
  13. Kurt Gödel - Wikipedia
  14. Gödel's incompleteness theorems - Wikipedia
  15. Alonzo Church - Wikipedia
  16. Lambda calculus - Wikipedia
  17. Alan Turing - Wikipedia
  18. On Computable Numbers, with an Application to the Entscheidungsproblem
  19. Turing machine - Wikipedia
  20. Church-Turing Thesis - Stanford Encyclopedia of Philosophy
  21. Bletchley Park - Wikipedia
  22. Enigma machine - Wikipedia
  23. ENIAC - Wikipedia
  24. EDVAC - Wikipedia
  25. Fortran - Wikipedia
  26. ALGOL - Wikipedia
  27. Donald Knuth - Wikipedia
  28. Big O notation - Wikipedia
  29. Edsger W. Dijkstra - Wikipedia
  30. Tony Hoare - Wikipedia
  31. Quicksort - Wikipedia
  32. Fast Fourier Transform - Wikipedia
  33. Cooley-Tukey FFT Paper (1965)
  34. Stephen Cook - Wikipedia
  35. NP-completeness - Wikipedia
  36. Reducibility Among Combinatorial Problems (Karp's Paper)
  37. Richard Karp - Wikipedia
  38. P versus NP problem - Wikipedia
  39. Intel 4004 - Wikipedia
  40. B-tree - Wikipedia
  41. Diffie - Hellman key exchange - Wikipedia
  42. RSA (cryptosystem) - Wikipedia
  43. Edwin Catmull - Wikipedia
  44. Z-buffering - Wikipedia
  45. PageRank - Wikipedia
  46. JPEG - Wikipedia
  47. MP3 - Wikipedia
  48. Support vector machine - Wikipedia
  49. Random Forests (Breiman's Paper)
  50. Netflix Prize - Wikipedia
  51. Graphics processing unit - Wikipedia
  52. Convolutional neural network - Wikipedia
  53. ImageNet Classification with Deep Convolutional Neural Networks (AlexNet Paper)
  54. ImageNet Large Scale Visual Recognition Challenge (ILSVRC)
  55. Recurrent neural network - Wikipedia
  56. Attention Is All You Need (Transformer Paper)
  57. Transformer (machine learning model) - Wikipedia
  58. Apache Hadoop
  59. Shor's algorithm - Wikipedia

Recommended reading