AI Search Algorithm Visualizers: BFS, DFS, UCS, A*, Greedy, Hill Climbing and More
AI search algorithms decide how a program finds a path through a graph or a state space. In these visualizers you build the graph yourself: add nodes and edges, set edge costs and heuristic values, choose the start and goal, and watch the frontier, the explored nodes and the final path appear step by step. Ten algorithms are covered — breadth-first, depth-first, uniform-cost, best-first, greedy best-first, A*, hill climbing, iterative deepening, bidirectional and beam search — and a comparison table shows which are complete and optimal and how many nodes each one expanded on your graph.
11 interactive simulations
Breadth-First Search (BFS)
Explore level by level, shallowest nodes first.
Open simulation →Depth-First Search (DFS)
Dive deep first, back up only at dead ends.
Open simulation →Uniform-Cost Search (UCS)
Always expand the cheapest path so far — guarantees the lowest cost.
Open simulation →Best-First Search
Expand the node with the best evaluation f(n) — you choose f.
Open simulation →Greedy Best-First Search
Chase the node that looks closest to the goal — fast, but not always best.
Open simulation →A* Search
Cost so far plus estimated cost to go — optimal with a good heuristic.
Open simulation →Hill Climbing
Always step to the best neighbour — and sometimes get stuck.
Open simulation →Iterative Deepening DFS (IDDFS)
Repeat DFS with growing depth limits: BFS's answer with DFS's memory.
Open simulation →Bidirectional Search
Search from both ends and meet in the middle.
Open simulation →Beam Search
Breadth-first, but keep only the k best nodes at each level.
Open simulation →Search Algorithm Comparison
Run all ten algorithms on your graph and compare them side by side.
Open simulation →Frequently asked questions
What is the difference between informed and uninformed search?
Uninformed algorithms (BFS, DFS, UCS, IDDFS, bidirectional search) use only the graph. Informed algorithms (greedy, A*, hill climbing, beam search) also use a heuristic estimate of the distance to the goal.
Which AI search algorithm finds the cheapest path?
Uniform-cost search always finds the cheapest path with positive costs, and A* does too when its heuristic is admissible — usually with far fewer expanded nodes.
Can I use my own graph?
Yes. Every page has an editor: add and move nodes, connect them, set the edge costs and heuristics, or start from a sample such as the Romania road map.