Announcing the Algorithms Category

Pathfinding, sorting, mazes, genetic algorithms and neural networks — the new Algorithms & AI category brings the most visually satisfying computer science simulations together in one place.

The Algorithms & AI category has been live for a while, but it now has its own dedicated landing page with category-specific accent colours, featured simulations and article links. Here's what's in it.

What's in the Category

Why Algorithms?

Algorithms are often taught with static diagrams or pseudocode. But they're processes — they have dynamics, they make decisions, they explore spaces. Animating them in real time reveals things that a flowchart never could: why A* finds the shortest path without exploring the whole grid, why genetic algorithms converge to local optima, why quicksort degrades on already-sorted input.

Every simulation in this category lets you interact with the algorithm while it runs. Change the maze walls, disturb the swarm, adjust mutation rates — see the effect immediately.

A Closer Look at the Pathfinder

The A* pathfinder is probably the best entry point if you have never watched a search algorithm work. Drop walls anywhere on the grid, drag the start and goal markers, and press play. You will see the frontier expand as a fan of visited cells radiating outward from the start, biased toward the goal by the heuristic — usually straight-line or Manhattan distance. Compare it against plain Dijkstra's algorithm (which explores uniformly in every direction with no sense of where the goal is) and the difference in explored-cell count is dramatic, especially in open grids with few obstacles.

Sorting and Mazes, Side by Side

The sorting visualiser runs several classic algorithms — quicksort, mergesort, heapsort, and a couple of quadratic ones for comparison — on the exact same shuffled array, so you can watch them race. Quicksort is usually fastest on random data but has an ugly worst case on already-sorted or reverse-sorted input, which the visualiser makes obvious the moment you feed it a sorted array and watch it degrade to quadratic behaviour. Mergesort, by contrast, plods along at a steady, predictable pace no matter what the input looks like — the trade-off for its guaranteed O(n log n) bound is that it needs extra memory for the merge step.

The maze generators sit right next to the pathfinder for a reason: generation and search are two sides of the same graph-theory coin. Depth-first search carves long, winding corridors with few branches because it always commits to the newest unvisited neighbour. Prim's algorithm, run as a maze generator instead of a minimum-spanning-tree builder, produces shorter, more uniform passages with more dead ends. Wilson's algorithm uses loop-erased random walks and, unlike the other two, generates a perfectly unbiased maze — every possible spanning tree of the grid is equally likely.

Coming Up

In the pipeline: a full graph algorithm explorer (BFS, DFS, Dijkstra, Bellman-Ford) so you can compare all four traversal strategies on the same graph, an ant-colony-optimisation (ACO) driven TSP solver that lays down and evaporates pheromone trails the way real ants do, and a reinforcement learning demo where an agent learns to navigate a grid world purely from trial-and-error reward signals, with a visible Q-table updating in real time. Watch this space.