// Exploring Intelligence · One Algorithm at a Time
↓ Click any card to expand pseudocode
Explores all nodes at current depth before moving deeper. Guarantees shortest path in unweighted graphs using a FIFO queue.
Dives as deep as possible along each branch before backtracking. Memory-efficient using recursion or an explicit stack.
Expands the lowest cumulative-cost node first. Dijkstra's algorithm generalised for any step cost — always finds the optimal path.
Always expands the node that appears closest to the goal using a heuristic h(n). Fast but not guaranteed to be optimal.
Combines UCS and Greedy: f(n) = g(n) + h(n). Optimal with an admissible heuristic — the gold standard of pathfinding.
Optimal strategy for two-player zero-sum games. MAX player maximises score; MIN player minimises it across the game tree.
Enhancement of Minimax that prunes irrelevant branches. Cuts average branching factor from b to √b, doubling search depth.
Classic state-space search puzzle using BFS. Generates all valid jug operations and searches for the target water volume.
Recursively partitions data using Information Gain to select the best attribute, building an interpretable classification tree.
Solve SEND + MORE = MONEY via constraint satisfaction. Each letter maps to a unique digit; leading letters cannot be zero.
Basic perceptron training model. Computes weighted sums, applies activation functions, and updates weights via error correction.
Every algorithm accepts user-defined inputs at runtime — flexible graphs, custom heuristics, and adjustable parameters.
Step-by-step node visit sequence printed in real time, revealing how each strategy explores the search space.
Time and space complexity documented for every implementation with practical observations from actual runs.
Programs structured with clean, reusable functions — separation of concerns for easy understanding and extension.
Conceptual side-by-side comparison of informed vs uninformed and optimal vs heuristic approaches.
Screenshots of actual program runs included for every algorithm — see theory meet practice.