Interactive Research Project

Game Algorithms Engine

Exploring Decision-Making in Artificial Intelligence

How do machines make decisions in adversarial environments? This project explores the algorithms behind game-playing AI — from minimax trees to constraint satisfaction — through interactive visualizations, empirical benchmarks, and comparative analysis.

6 Algorithms
4 Interactive Demos
4 Problem Classes
2,300+ Lines of Code
Connect 4

Minimax + Alpha-Beta Pruning

Exhaustive game-tree search with intelligent branch elimination. Explores optimal play in two-player zero-sum games.

Adversarial Tree Search Pruning
Try Demo →
N-Queens

Constraint Satisfaction (Backtracking)

Systematic variable assignment with constraint checking. Guaranteed to find a solution through exhaustive search.

CSP Backtracking O(n!)
Try Demo →
N-Queens

Forward Checking

Backtracking enhanced with domain propagation. Eliminates 58% more nodes but at 3× the overhead cost.

CSP Propagation Domain Reduction
Try Demo →
N-Queens

Minimum Conflicts (Local Search)

Heuristic local search with random restarts. Achieves O(n) average-case on N-Queens — the fastest solver.

Local Search Heuristic Stochastic
Try Demo →
Mastermind

Constraint Elimination

Information-theoretic approach: each guess eliminates ~82% of candidates. Solves any code in ≤6 guesses.

Information Theory Filtering
Try Demo →
21-Card Trick

Deterministic Rearrangement

A mathematical algorithm that always identifies a chosen card in exactly 3 rounds through ternary subdivision — determinism replacing what looks like random guessing.

Deterministic O(1) Mathematical
Try Demo →

Algorithm efficiency depends on the pruning cost-to-benefit ratio, not just branch reduction.

Alpha-Beta Pruning

Near-zero overhead → 94.2% node reduction at depth 10. The pruning cost is negligible relative to the exponential search savings.

Forward Checking Paradox

58% fewer nodes explored, but 3× slower than basic backtracking. Domain copying overhead exceeds the search savings.

Constraint Elimination

82% candidate elimination per guess. Expensive per-step computation is justified by the small, finite search space (360 codes).

Every game encodes a decision problem. N-Queens asks: can you eliminate contradictions early enough? Connect 4 asks: can you prune the irrelevant? Mastermind asks: can you extract maximum information from minimum data?

This project doesn't just implement algorithms — it asks when each approach breaks down, and why. The central finding: an algorithm's real-world efficiency depends not on theoretical complexity alone, but on the ratio between the cost of its optimization strategy and the savings that strategy produces.

Alpha-beta pruning costs almost nothing and saves exponentially. Forward checking costs a lot per step and saves only linearly. The math looks different. The truth is in the benchmarks.

Java

Algorithm implementations with empirical benchmarks

Vanilla JavaScript

Interactive visualizations, no frameworks

HTML5 Canvas / DOM

Real-time algorithm animation

Empirical Analysis

Stochastic averaging, controlled experiments

View Source on GitHub →