SEARCH AGENTS

Nineteen games, each played or solved by a different classic algorithm: search, exact solvers, and agents sharpened by what they learned. The grid behind this text is A* finding its way to your cursor. Click a block to raise or flatten a building.

0 nodes expanded 0 on the frontier 0 steps in the path
15-puzzle nodes expanded: 598,989 by optimal IDA* vs 5,009 with the learned heuristic 2048 tile reached in 88% of games with no search Sudoku: 7 guesses with propagation vs 119,468 by plain backtracking Pattern database IDA*: 31x fewer nodes than Manhattan distance Checkers alpha-beta: same move as minimax, 26x fewer positions at depth 6 Every search runs live in Python and streams to your browser

Pick a machine

N-Puzzle 120x fewer nodes than optimal search Nine search algorithms, a pattern database, and a neural heuristic trained by value iteration. Watch every expansion stream in. Play Connect Four 0 human games in its training data An AlphaZero-style agent that learned only by playing itself. See its instinct and its search side by side, then try to beat it. Play Checkers 26x fewer positions with alpha-beta An agent that assumes you always find your best reply, and prunes every line it can rule out. See how much it skipped. Play Lights Out 1 in 4 random 5x5 boards can be cleared at all Each press is a vector over GF(2). Gaussian elimination mod 2 finds the fewest presses, or proves that none exist. Play Blackjack 0.57% house edge with perfect basic strategy Solved exactly by dynamic programming over every hand, then a Monte Carlo learner that starts from nothing and converges on the same table. Play Battleship 46 shots to sink a fleet, against 95 for random firing An agent that counts every fleet layout that still fits its hits and misses, and fires where a ship is most likely. Watch its odds glow over your fleet. Play Pac-Man Q-learning from self-play, 13 features Ghosts plan shortest routes with A*. The agent scores every move with weights it learned by playing itself. Play Warehouse 3.8 collisions per plan with no coordination Robots that must not bump or swap. Conflict-Based Search branches on each collision until the plan is clean and cheapest. Play Route Planner 2 metaheuristics race a greedy baseline Simulated annealing and a genetic algorithm untangle a delivery route. Draw your own and see if you can beat them. Play 2048 88% of games reach the 2048 tile An n-tuple network learned from 40,000 self-played games. Let it play, or take the keys yourself. Play Sudoku 7 guesses per puzzle on average Three solvers race on generated puzzles with unique solutions. Replay every guess and every backtrack. Play Wordle 3.63 mean guesses for the entropy solver, with no failures over 3,568 answers Each guess is the one whose five-colour feedback is most surprising on average, which splits the remaining words most evenly. Play Minesweeper 90% of beginner boards cleared without a single guess Each number is a constraint on the mines around it. The agent counts every layout that fits, proves what it can, and guesses the lowest exact odds only when nothing is certain. Play Hex No draws a full board always has exactly one winner Monte Carlo tree search with RAVE: random playouts whose stone statistics are shared between moves. Watch the agent's visit heat map. Play N-Queens About 50 repairs solve a million queens by min-conflicts Backtracking blows up past 32 queens. Local search repairs one queen at a time, and the number of repairs barely grows with the board. Play Snake 90.1 apples per game, against 20.1 for greedy and 56.1 for the BFS planner Eight weights score each move, tuned by the cross-entropy method. The score wins on apples, but every game ends with the snake stalled, not dead. Play Tetris 0.4 lines per piece is the most a stack can clear in steady state Every rotation and column is scored by nine board features. Weights found by a cross-entropy search do the playing and clear 6,702 lines on held-out games; the hand-picked set is one button away. Play Nonogram Unique random pictures are kept only when exactly one solution fits Each clue is a regular language. Line solving proves cells row by row, and the whole grid goes to DPLL when the lines stall. Play Tic-Tac-Toe 18,297 positions searched to prove a draw, not 549,946 Minimax with alpha-beta at three depths. The shallow levels walk into forks past their horizon; the full search never loses. Play

Labs

Playgrounds where you poke at the algorithms: change the inputs, then watch the method respond.

Cluster Lab k-means alternates two steps: assign each point to its nearest centroid, then move each centroid to the mean of its points Paint points, then watch k-means, DBSCAN and a Gaussian mixture fitted by EM find the groups. Inertia, silhouette and an elbow chart run live. Play Neural Net curves that no straight line can separate Drop pink and cyan points and watch a small multilayer perceptron learn to separate them. Backprop, the loss, and each neuron's own heat map update live in the browser. Play Pathfind 7 searches race one map, from breadth-first to bidirectional Draw walls and swamps, generate a maze, and watch each frontier spread. Every path is checked against the optimal cost. Play MDP Lab 3 ways to solve one slippery grid: two planners and a learner Paint walls, rewards and pits, then watch value iteration spread heat from the goal, policy iteration settle and flip, and a Q-learning agent walk the grid to the same policy. Play Optimizer Race 3 optimizers, one curved valley, one start point Gradient descent, momentum and Adam race from one point down Rosenbrock's banana-shaped valley, with their trails drawn over the loss heat map. The page races six optimizers and lets you paint your own landscape. Play Tree Lab Gini impurity picks each cut; a forest of bootstrap trees averages the votes Paint the plane and watch a CART decision tree carve it split by split, one laser per cut. Then a random forest of bootstrap trees averages into a smooth boundary, scored on its out-of-bag rows. Play Markov text Four public-domain texts, counted once, then sampled one token at a time A chain that only remembers the last few words. Watch the next-token odds, the context window, and how much of the output is copied verbatim. Play Regression min Σ r² the squares' total area is the loss Drag points and watch the best-fit curve snap to them. Squared errors are squares; gradient descent creeps toward the same answer, and too high a degree overfits. Logistic regression draws the boundary too. Play Walkers 15.3 m in 10 seconds for the best flat walker, bred from random soft bodies Point masses, springs and pulsing muscles. Nobody codes a gait: a genetic algorithm keeps the creatures that travel farthest. Crawlers and inchworms appear; no hopper has yet. Play

Source code

kb@search-agents: ~

$ git clone https://github.com/dpologdvinity/search-agents

$ open the repository, the results, or how it works

Python, PyTorch, NumPy, FastAPI. Trained models run in NumPy, so this server needs no PyTorch.

$