Search Algorithms
From BFS to A*, every algorithm explores a problem differently. Read the beginner-friendly theory, then watch it run step by step — the frontier, the visited nodes, the path it finds.
Three ways to actually understand a search algorithm — not just memorise it.
Plain-English idea, a real-world analogy, step-by-step how it works, pseudocode, and when to use it.
Open the example and see the OPEN (frontier) and CLOSED (visited) lists animate as the search unfolds.
Drag nodes, set edge costs and heuristics, then run any algorithm on your own problem and compare them.
Pick one to read the theory and see it in action. = live animated demo
No heuristic — explore the graph blindly but systematically.
Explore a maze one ripple at a time, nearest first.
Learn it →Always expand the cheapest-so-far path first — guaranteed lowest total cost.
Learn it →Always expand the closest unvisited node — that's the shortest path.
Learn it →Go as deep as you can, then back up and try the next path.
Learn it →DFS with a leash — explore deep, but never past the fence.
Learn it →Repeatedly dive deeper until you find the goal — DFS memory, BFS answers.
Learn it →Dig from both ends of the tunnel and meet in the middle.
Learn it →Use a heuristic h(n) to head toward the goal faster.
Always chase the node that looks closest to the goal.
Learn it →A* finds the shortest path by being smart about which way to look.
Learn it →Turn a speed dial: trade a little optimality for a lot of speed.
Learn it →DFS on a leash: raise the cost limit until the goal appears.
Learn it →Keep only the best k options at each level and race ahead.
Learn it →Two A* searches race from both ends and meet in the middle.
Learn it →A* smarts on a shoestring memory budget.
Learn it →Optimise a single state by moving to better neighbours.
Always step toward the best-looking neighbour until nothing looks better.
Learn it →Wander boldly at first, then settle down to find the best spot.
Learn it →Search with a team of k explorers who share their best leads.
Learn it →Evolve a crowd of guesses until the fittest survives.
Learn it →Plan moves in two-player games against an opponent.
Assume the worst opponent, then play your best move.
Learn it →Minimax's clever twin that skips moves it already knows won't matter.
Learn it →Minimax for games with dice: average over luck instead of fearing the worst.
Learn it →Play thousands of random games, then trust what actually wins.
Learn it →Assign variables so all constraints hold.
Specialised shortest-path search on grids/maps.
Jump into the visualizer — build a graph, pick algorithms, and watch them race.
Open the visualizer →