| Name | Weight | Value |
|---|
Pathfinder is an interactive grid where you can watch classic search algorithms explore space step by step, cell by cell, until they find — or fail to find — a route from a start point to a target. It also includes a separate 0/1 Knapsack module for exploring optimization algorithms outside of grid search.
Breadth-First Search (BFS) explores the grid in expanding rings, one step at a time. On an unweighted grid like this one, it always finds the shortest path, but it checks many cells it doesn't strictly need to.
Depth-First Search (DFS) commits to a direction and follows it as far as possible before backtracking. It is fast to code and easy to reason about, but the path it finds is rarely the shortest one.
Depth-Limited Search (DLS) is DFS with a hard ceiling on how deep it is allowed to go. Anything beyond the limit is treated as a dead end, even if a real path exists just past it.
Iterative Deepening Search (IDS) runs DLS repeatedly with limits 0, 1, 2, ... until a path is found. It keeps DFS's low memory footprint while still guaranteeing the shortest path on an unweighted grid, at the cost of re-exploring shallow cells many times.
Bidirectional Search grows two BFS waves at once — one from the start, one from the target — and stops the moment they meet in the middle. It typically explores far fewer cells than a single-direction BFS.
Greedy Best-First Search expands whichever cell looks closest to the target according to the heuristic alone, ignoring how far it has already traveled. It's fast but can be led astray by dead ends.
A* Search is Dijkstra plus a heuristic: it estimates the remaining distance to the target (Manhattan distance here) and prioritizes cells that look promising, usually examining far fewer cells than uninformed search while still finding the shortest path.
Dijkstra's Algorithm always expands the closest unvisited cell first. On this grid, where every step costs the same, it behaves like BFS — but the same logic scales to grids with variable movement costs.
Hill Climbing always steps to whichever unvisited neighbor looks closest to the goal, with no backtracking. It's simple and memory-light, but it can walk into a dead end (a "local optimum") and get stuck even when a path exists — a classic limitation from local search theory.
Beam Search keeps only the k most promising cells at each layer (k = 3 here) instead of exploring everything — a middle ground between greedy search and full breadth-first search.
Switching the Problem selector to 0/1 Knapsack replaces the grid with a classic optimization problem: given items with a weight and a value, choose a subset that fits inside a weight capacity while maximizing total value.
Dynamic Programming builds a table of the best achievable value for every (item, remaining capacity) pair, then backtracks through it to read off exactly which items were chosen. It always finds the optimal answer.
Genetic Algorithm instead evolves a population of random item-selections generation by generation — combining, mutating, and keeping the fittest — converging toward a good (often optimal) answer without ever building the full table.
Turning on Cartoon Mode adds a small animated explorer that physically walks across the grid as the algorithm visits each cell, then celebrates on arrival — a more playful way to watch the same search unfold.
These are the same core ideas behind route planning in maps, NPC movement in games, and the search and optimization techniques covered in most introductory AI courses. Watching them run side by side makes their trade-offs — speed, memory, and optimality — visible instead of abstract.