Search Algorithms
Search algorithms explore possible states or candidates to find a goal, path or high-quality solution. The skill is defining a search space, choosing an exploration strategy and managing the cost of expansion. It applies to planning and combinatorial problems as well as efficient lookup, with different guarantees and data structures in each setting.
What it is
A state-space search describes an initial state, available actions, transition costs and a goal test. Breadth-first and depth-first strategies explore in different orders; uniform-cost search prioritizes accumulated cost, while heuristic search uses an estimate of the cost remaining. A* combines both quantities and its guarantees depend on the heuristic and search conditions. Search can also operate over ordered arrays or trees for lookup, where the problem is finding an item rather than planning a sequence of actions. The common competence is understanding what is explored, what can be discarded and what the stopping rule permits one to conclude.
What the work involves
Define state identity carefully so repeated states can be recognized. Choose frontier and visited-set structures, document edge costs and evaluate whether a heuristic is admissible or consistent where those properties matter. Estimate memory use and consider pruning, caching or approximate strategies when exhaustive search is impractical. Test small cases with known answers and measure both expansion count and solution quality. The result should be a search procedure with explicit completeness or optimality conditions and a clear behavior when the budget is exhausted.
Illustrative example
Suppose, illustratively, a planning tool must move a robot between rooms while avoiding locked doors. The engineer represents locations and permitted transitions as a graph, assigns movement costs and supplies a distance-based heuristic. A* proposes a route, which is checked against the actual door constraints. If the heuristic assumes a shortcut unavailable to the robot, it must remain an estimate that does not invalidate the required guarantee; otherwise the planner should present its answer as an approximate candidate.
Limits and common mistakes
A heuristic can reduce exploration without being informative in every instance. Unbounded search can consume excessive memory, and poorly defined state equality can repeat work or discard valid paths. Negative costs, cycles and changing transitions require particular care. A result found early is not automatically the best result, and failure under a runtime limit does not prove impossibility. Search algorithms differ from learned prediction: a model may guide exploration, but the correctness of the resulting path still depends on the state and transition model.
Prerequisites
Sources and further reading
- Artificial Intelligence: A Modern Approach
State-space problem solving, informed search and search properties.
Last updated: 2026-10-10