---
title: '10 Most Interesting Algorithms Ever Engineered'
source: 'https://youtube.com/watch?v=SmyPTnlqhlk'
video_id: 'SmyPTnlqhlk'
date: 2026-07-12
duration_sec: 545
---

# 10 Most Interesting Algorithms Ever Engineered

> Source: [10 Most Interesting Algorithms Ever Engineered](https://youtube.com/watch?v=SmyPTnlqhlk)

## Summary

This video explores 10 fascinating algorithms, from the double slit experiment's wave function collapse to Boyer-Moore string search, explaining how they solve real-world problems in graphics, cryptography, AI, and distributed systems.

### Key Points

- **Marching Cubes** [00:14] — Patented in 1987 by GE programmers, extracts polygonal mesh from 3D scalar fields (e.g., CT/MRI data). Uses 256 possible configurations per cube.
- **Wave Function Collapse** [00:57] — Inspired by quantum mechanics, used for procedural generation in games. Starts with superposition of possibilities, collapses to a tile following rules (e.g., connected roads).
- **Diffusion Models** [01:38] — Reverse thermodynamic diffusion: adds noise to images (forward phase), then reconstructs (reverse phase). Powers DALL-E, Stable Diffusion. Also works on audio and video.
- **Simulated Annealing** [02:32] — Optimization algorithm inspired by metallurgy. Starts with high 'temperature' for exploration, gradually lowers to exploit best solution. Used in warehouse inventory optimization.
- **Sleep Sort** [03:28] — Novelty sorting algorithm: for each element, spawns a thread that sleeps for that element's value, then prints it. Delegates sorting to CPU scheduler; impractical but clever.
- **Quantum Bogo Sort** [04:19] — Hypothetical: uses quantum mechanics to check if array is sorted in parallel universes. If sorted, travel to that universe. Not yet feasible.
- **RSA Encryption** [04:52] — Public-key cryptosystem based on difficulty of factoring large primes. Used for digital signatures and secure communication. Vulnerable to Shor's algorithm on quantum computers.
- **Shor's Algorithm** [05:22] — Quantum algorithm that factors integers exponentially faster than classical. Biggest factored number so far is 21; IBM's Q system one fails at 35. Threatens RSA.
- **Practical Byzantine Fault Tolerance (PBFT)** [06:49] — Consensus algorithm for distributed systems. Tolerates up to 1/3 faulty nodes. Uses pre-prepare, prepare, commit phases. Used in cloud databases and blockchain.
- **Boyd's Artificial Life (Boids)** [07:47] — Simulates flocking with three rules: separation, alignment, cohesion. Emergent complexity from simple rules. Used in computer graphics and swarm robotics.
- **Boyer-Moore String Search** [08:14] — Efficient string matching scanning right-to-left. Uses two precomputed tables to skip characters. Powers fast grep. Guarantees no false negatives.

### Conclusion

Algorithms like Boyer-Moore and PBFT demonstrate how clever design can solve complex problems efficiently, while quantum algorithms like Shor's threaten current cryptography.

## Transcript

extract a polygonal mesh of an ISO surface from a three-dimensional discrete scalar field yeah I didn't think so but back in ' 87 two programmers at General Electric did they created and patented the marching cubes
doctors to visualize data from CT and MRI scans whenever you instruct a for rearranging ones and zeros that can make animals talk and vacuums walk most
algorithms belong in the dumpster but some are fast some are beautiful and look at 10 of the most interesting algorithms ever engineered and how they're used to solve very interesting problems in the real world first on the
is the double slit experiment where particles behave like a wave when you're seems counterintuitive but it makes total sense when you realize we're
living in a simulation and the universe wrote this algorithm to cut down on its general idea behind wave function collapse can also be implemented programmatically imagine we have a map for a video game but what if this is a
sidescrolling game that can go on for eternity we can't just make a bigger map we need an algorithm to procedurally generate it on the Fly what's so weird super position of all possibilities it's the wave function then upon observation
it collapses into a particle or in other words it selects a Rand a map tile but follows a consistent set of rules like in this case making sure that the roads are always connected providing a random yet cohesive result and doesn't rely on
any sort of modern generative AI speaking of which AI is weird as hell Ai and is the magic behind image generators like Dolly and stable diffusion but the concept of diffusion actually comes from thermodynamics where
particles spread from areas of higher concentration to lower concentration in artificial intelligence the process is r reversed the algorithm starts by generating random noise which would be like high entropy in thermodynamics and
gradually refines it to a structured image which would be lower entropy but Works in two phases in the forward phase it gradually adds noise to an image step
by step until it becomes completely random in the second phase the algorithm reverses this process reconstructing it back into a coherent image when the that can be used to generate new images out of thin air allowing us to build an
infinite Army of only fans models it's highly compute intensive but also works well on audio and the next Frontier is diffusion for video generation but now let's talk about simulated analing one frustrating thing about programming is
that for many problems there's not just one solution but many solutions like an Amazon warehouse has many different ways to organize its inventory but some ways metals are heated up and cooled down over and over again to to remove defects
the same idea is used in optimization algorithms to find the best answer in a CA of good answers imagine trying to find the highest point in a mountain range full of Peaks and valleys a simple Hill Climb algorithm won't work because
algorithm to explore freely as time goes on though the temperature is lowered here is exploration versus exploitation but the reason I included this algorithm
you start out exploring all kinds of different Technologies and Frameworks then eventually you find one specific area to exploit and specialize in but we ingenious sorting algorithm of all time is without a doubt sleep sort the
conquer to break up an array into subarrays where it can be sorted more efficiently however some random genius on forchan found a better way but it's a simple it Loops over the array and then for each element it opens up a new
element then finally after waking up it prints that element it's genius because it delegates the Sorting to the CPU scheduler it's also incredibly dumb and useless because it delegates sorting to the CPU scheduler speaking of which you
might be familiar with another useless sorting algorithm BOGO sort which tries the lottery but what if we apply the same algorithm with Quant mechanics to possible outcomes exist in separate parallel universes that means as a
developer if you find yourself with an unsorted array there's some other parallel universe where it is sorted the technology isn't quite there yet but if could then use a portal gun to travel to that Universe which would make our lives
that universe but if it's a really large array Quantum BOGO sort might be worth it that's purely hypothetical but one of the most practical and goed algorithms of all time is RSA a public key crypto system it's essential for digital
letters with a unique signature but it's based on one simple mathematical reality extremely difficult and timec consuming like it take your laptop 300 trillion
start leveraging Shores algorithm which can solve the integer factorization problem exponentially faster than any classical algorithm Prime factoring is relies on Concepts like cubits superposition and entanglement to
perform massive amounts of calculations in parallel the algorithm is legit but so far the biggest number ever factored is [Music] 21 even IBM state-of-the-art Q system
one fails when trying to factor the number 35 however just recently the different algorithm that doesn't scale very well for large numbers unlike make quantum computers work expect all hell to break loose in the cyber
algorithm but it deserves a closer look so first we start with a 3D scalar field which might represent data from an MRI machine each point in the 3D space is
represented by a single number or scaler the algorithm starts with a single point treats the values as a bit in an 8bit integer this results in 256 different
algorithm marches through each point to create a 3D mesh that can be used in 3D of data that can now be rendered in 3D in modern times though we're often
dealing with distributed systems in the cloud and that brings us to the you're camped around a city with a few other generals with plans to attack up to hung over to attack the entire system could collapse computers have the
same problem sometimes they might fail or be infiltrated by hackers and you never know when or where that's going to happen luckily algorithms like pbft are designed to solve this they can keep a distributed Network working properly
even if up to onethird of its nodes go Haywire it works by having a node broadcast a pre-prepare message to other nodes indicating its Readiness to an agreement then after a certain threshold a consensus is formed once
other nodes which can then all execute the changes making the entire state of technology and things like distributed Cloud databases what's really cool about
algorithms though is that they can also reflect nature like Boyd's artificial Life program it was created back in ' 86 and simulates the flocking behavior of birds what's so cool about it is that it demonstrates the emerging complexity or
beauty that we get out of just a few simple rules in this case the birds have of the flock and they steer towards the center of mass of their local flock
directly but just emerge naturally but finally that brings us to an old algorithm that blew my mind just the other day and inspired this video boy or string it's searching becomes bigger that seems impossible but it makes sense
when you understand the algorithm it scans text from right to left then has pattern it jumps past it based on an estimation made in a pre-processed table likewise if it finds a partial match then a mismatch occurs it has a separate
pre-calculated table that maximizes the number of characters it can safely skip guaranteed to be perfect but are far more practical than looping over every because it's able to to skip a higher proportion of characters and if you've
ever wondered why grep is so fast you have this algorithm to thank
