Algorithms
The ideas behind the games and searches on this site, one page each: what it does, how it works step by step, what it costs, and where it runs.
Searches for two-player games: look at the moves, the replies and the replies to those, and decide how much of that tree is worth the time.
Minimax
Looks ahead through every reply to a fixed depth, assuming both sides play their best, and backs the scores up the tree to pick a move.
Read the algorithm→Alpha-beta pruning
Minimax that stops exploring a branch as soon as it is proven no better than one already found. The same move, after far fewer positions.
Read the algorithm→Monte Carlo tree search
Plays thousands of random games from each candidate move and favours the moves that won most, growing a tree where the results look promising.
Read the algorithm→Greedy and random baselines
Two trivial players: one plays any legal move, the other the move that looks best right now. Every real algorithm has to beat them.
Read the algorithm→Searches on a map or a graph: from here to there, by the fewest steps or the lowest cost, looking at as few cells as possible.
Breadth-first search
Explores the grid in rings around the start, nearest first. It finds the path with the fewest steps.
Read the algorithm→Depth-first search
Follows one route as deep as it can before backing up. It finds a path quickly, but not necessarily a short one.
Read the algorithm→Dijkstra’s algorithm
Always expands the cell that is cheapest to reach so far, so it finds the cheapest path even when steps cost different amounts.
Read the algorithm→Greedy best-first search
Always expands the cell that looks closest to the goal. Fast when the way is open, but it can return a long path.
Read the algorithm→A*
Orders the frontier by cost so far plus an estimate of what remains, so it heads for the goal like greedy search and still finds the cheapest path.
Read the algorithm→0-1 breadth-first search
A shortest-path search for graphs whose steps cost either 0 or 1, using cost buckets instead of a heap. HEX uses it to count the stones a player still needs.
Read the algorithm→