~/playground [h]

tom@pce:~$ ls ~/playground
1 tspFour 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. genetic algorithmant colony optimizationrustpythonwasm 2 firefliesA 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. rustwasmboidsswarm intelligence 3 kruskalKruskal'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. binary heapdisjoint setrustpythonwasm 4 sudokuA 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. constraint propagationsearchrustpythonwasm 5 wayoflifeConway'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. numbapygamerustpythonwasm

~/playground/sudoku [l]

tom@pce:~/playground$ ./sudoku

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.