🤖

Algorithms & AI

Swarm intelligence and nature-inspired optimisation algorithms. Complex behaviour without central control — only local rules.

10+ simulations Three.js · Canvas 2D Swarm · ACO · Reynolds

Category Simulations

Open a simulation — it runs right in your browser

Emergent behaviour — system-level properties that arise from inter-agent interactions that are not programmed into any single agent. The ant trail, the bird flock — no individual “knows” about the overall result.

🐦
Popular ★★☆ Moderate
Boids — Swarm Intelligence
Craig Reynolds' 1987 algorithm: three rules — separation, alignment, cohesion. 5,000+ agents in 3D, InstancedMesh, 60fps.
Three.js Reynolds InstancedMesh Swarm AI
🐜
★☆☆ Easy
Ant Colony (ACO)
Ant colony optimisation algorithm (Dorigo, 1992): pheromone trails, stigmergy, self-organised shortest-path finding.
Canvas 2D ACO Stigmergy Pheromones
🗺️
New ★★☆ Moderate
Pathfinding — A*, Dijkstra, BFS
Draw walls, generate mazes and watch A*, Dijkstra, Greedy Best-First and BFS explore the grid step by step. Compare algorithms live.
Canvas 2D A* Dijkstra BFS
📊
New ★★☆ Moderate
Sorting Algorithms — Visual & Audio
12 algorithms animated as bar charts with Web Audio tones. Compare Bubble, Quick, Merge, Heap and more — hear each comparison.
Canvas 2D Web Audio Sorting Algorithms
🏗️
New ★★☆ Moderate
Maze Generator
Four algorithms — DFS Backtracker, Prim’s, Kruskal’s and Wilson’s loop-erased random walk — animated live. Then solve with BFS.
Canvas 2D DFS Kruskal Wilson
🤝
New ★★★ Advanced
Travelling Salesman — TSP
Three algorithms compete on the same cities: Nearest Neighbour greedy, 2-opt local search and Simulated Annealing. Drag cities live.
Canvas 2D 2-opt Simulated Annealing Optimisation
🧬
New ★★☆ Moderate
Genetic Algorithm
Watch a population evolve via selection, crossover and mutation. Two modes: classic Weasel string evolution and 2D Rastrigin optimisation.
Canvas 2D Genetic Evolution Optimisation
🐜
★☆☆ Easy
Langton's Ant
A two-dimensional Turing machine that creates complex emergent highways from just two simple rules. Multiple ants, custom LLRR rulesets and colour modes reveal deep structure in chaos.
Cellular Automaton Emergence Canvas 2D
🌲
New ★★☆ Moderate
Minimum Spanning Tree
Visualise Kruskal's and Prim's MST algorithms on weighted graphs. Watch edges being added in order and see the spanning tree grow.
Graph Theory Kruskal Prim Canvas 2D
🕸️
New ★★☆ Moderate
Force-Directed Graph
Network graph layout using spring forces and charge repulsion. Drag nodes, import JSON graphs and observe community structure emerge.
Graph Physics Layout Canvas 2D
🌳
New ★★☆ Moderate
Decision Tree
Interactive decision tree builder and classifier. See entropy, information gain and Gini impurity guide splits. Visualise classification boundaries.
Machine Learning Entropy Canvas 2D
🧠
New ★★★ Advanced
Self-Organising Map (SOM)
Kohonen SOM learns to represent high-dimensional data on a 2D grid. Watch neurons migrate to cover the input space as training progresses.
Neural Network Kohonen Unsupervised Canvas 2D
New ★★☆ Moderate
N-Queens Problem
Watch backtracking place and retract queens on an N×N board. See every conflict and every solution found in real time. Board size 4–12.
Backtracking Combinatorics Chess Puzzle
🖥️
New ★★☆ Moderate
Turing Machine
Animated scrolling tape with head pointer, transition table and five programs — binary increment, unary addition, palindrome checker, copy, and the 3-state Busy Beaver champion.
Computability Church-Turing Busy Beaver
>Boids Algorithm: flocks and swarms Reynolds' three rules. Spatial hashing implementation. Scaling to 10,000 agents. Article A* and Pathfinding Algorithms Dijkstra vs Greedy vs A*. Heuristic functions. Navigation meshes in 3D space. Article Genetic Algorithms Selection, crossover, mutation. Travelling salesman problem. Evolutionary neural network training.

About Algorithms & AI Simulations

Pathfinding, sorting, neural networks, and search — made visual

Algorithms and AI simulations visualise the step-by-step execution of computer science's most important techniques. Watch A* and Dijkstra explore a maze and compare the paths they discover; observe a genetic algorithm evolve solutions to the Travelling Salesman Problem generation by generation; see a neural network adjust its weights in real time as it learns XOR or digit classification; follow how ant colony optimisation lays pheromone trails to find shortest routes.

Visualising algorithms makes abstract complexity tangible. You can pause playback, adjust heuristic weights, change maze topology, or tweak mutation rates and immediately see how performance changes. These are not toy examples — the same A* heuristic guides characters in AAA games, the same backpropagation trains production neural networks, and the same ACO logic optimises logistics routes in industry.

Algorithm visualisations are one of the most effective learning tools in computer science education. Watching A* expand nodes on a grid, or seeing bubble sort and merge sort side by side, builds an intuition for algorithmic complexity that no amount of reading can replace. These simulations are used in university courses worldwide to teach data structures, graph theory, and machine learning fundamentals.

Key Concepts

Topics and algorithms you'll explore in this category

A* PathfindingHeuristic-based optimal graph search
Genetic AlgorithmsEvolutionary optimisation: selection, crossover, mutation
Neural NetworksFeedforward networks with backpropagation
Sorting AlgorithmsBubble, merge, quick, heap — visualised
TSP / CombinatoricsNP-hard route optimisation
Boids / SteeringEmergent behaviour from local agent rules

Frequently Asked Questions

Common questions about this simulation category

How does A* find the shortest path?
A* combines Dijkstra's cost-so-far (g) with a heuristic estimate of remaining cost (h). The priority queue always expands the node with lowest f = g + h. With an admissible heuristic (never over-estimates), A* is guaranteed to find the optimal path in O(E log V) time.
What is the Travelling Salesman simulation?
The TSP simulation visualises several meta-heuristics — nearest neighbour, 2-opt improvement, and ant colony optimisation — attacking the classic NP-hard problem of finding the shortest tour through all cities. You can compare their quality and speed interactively.
How does the neural network simulation learn?
The network is trained with stochastic gradient descent and backpropagation. You can watch weights update in real time as the network learns XOR, a spiral classification, or digit recognition. Adjusting the learning rate and hidden-layer size demonstrates the bias-variance trade-off visually.

Other Categories