~/playground [h]
~/playground/sudoku [l]
Four ways to solve the traveling salesman problem, racing each other on the same cities. Brute force and dynamic programming find the guaranteed shortest round trip, a genetic algorithm and an ant colony approximate it in a fraction of the time. Add cities and watch the exact methods hit a wall while the heuristics keep going. Read about it in Traveling salesman problem, or see the project.
A swarm of fireflies, living their lives in a colony in a true ecosystem, or taking flight in a swarm of thousands. Each one only follows three rules over the friends it sees: don't crowd them, fly their way, stay close. Together that gives streams, swirls and flocks that split around rocks and scatter away from predators. See the project.
Kruskal's algorithm for the minimum spanning tree, built on hand-made data structures: a min binary heap hands out the edges cheapest first, a disjoint set with union by rank and path compression tells whether an edge joins two trees or would close a cycle. Watch the forest grow into a single tree, one edge at a time. Read about it in Through the trees..., or see the project.
A Sudoku solver, regular or diagonal, by constraint propagation: elimination, only choice and naked twins narrow the pencil marks down. When they get stuck, a depth-first search guesses in the cell with the fewest candidates and backtracks on a contradiction. Watch every step, or switch the strategies off and see how much more it has to guess. See the project.
Conway's Game of Life with a twist: every cell is new, a survivor or dying, each in its own colour, so you can follow how the grid evolves. The Python version grew from a naive grid into one that only looks at active cells and keeps neighbour counts up to date, sped up with Numba. A Rust port runs right here in the browser. Read about it in A way of life, or see the project.