Reasoning, Knowledge Representation, and Uninformed Search Algorithms in Artificial Intelligence

Foundations of Knowledge and Reasoning

Knowledge encompasses the collection of facts, relationships, and operational rules governing a domain or the world at large. Unlike raw data, knowledge represents structured, contextual, and meaningful information that allows an entity to understand situations and project future occurrences. A fact represents an isolated reality, such as the statement that it is raining, whereas knowledge links facts to principles, such as the conditional rule asserting that if it rains, the ground becomes wet.

Reasoning is the rigorous computational or cognitive process of applying knowledge to infer new facts, draw valid conclusions, or select courses of action. When an intelligent system couples the knowledge that rain causes a wet ground with the observed fact that it is currently raining, reasoning yields the derived conclusion that the ground is wet. In artificial intelligence, this separation between knowledge (data representing the state and dynamics of the environment) and reasoning (domain-independent inferential mechanisms) forms the architectural bedrock of intelligent agents. By decoupling declarative content from inference algorithms, an intelligent agent can update its domain understanding without requiring modifications to its underlying procedural logic.

Formal relationship between knowledge representation in sentences and aspects of the real world

At the formal level, knowledge representation relies on facts, models, and entailment. Facts are formal declarative sentences held to be true within a representation language. A model, often referred to as a possible world, is a mathematical construct that fixes a complete assignment of truth values to all elementary facts. The set of possible worlds represents every combinatorial configuration of truth values that remains consistent with what an agent currently knows. When an agent learns a new factual sentence, it eliminates incompatible models, thereby reducing the number of possible worlds. For example, considering the facts regarding rain and ground wetness, one potential model assigns true to both propositions, while another assigns false to both. If the agent receives confirmation that it is raining, any model assigning false to rain is eliminated from the space of possible worlds.

Entailment, formally denoted by the symbol ⊨\models, defines the necessary logical consequence between sentences. A knowledge base KBKB entails a sentence α\alpha, written as KB⊨αKB \models \alpha, if and only if α\alpha is true in every possible model in which KBKB is true. Entailment ensures that derived conclusions are strictly bounded by truth preservation: whenever the premises in the knowledge base are satisfied by reality, the entailed conclusion cannot be false. Thus, if KBKB contains the implication that rain implies wet ground alongside the assertion of rain, KBKB strictly entails that the ground is wet.

Knowledge-Based Agents

A knowledge-based agent is an autonomous system whose actions and decisions are driven by internal reasoning over a formal knowledge base. The architecture cleanly separates the knowledge base (KBKB) from the domain-independent inference engine. The knowledge base stores declarative sentences, including background rules, axioms, and current environmental facts. The inference engine executes formal algorithms over the KBKB to deduce new conclusions and determine optimal behaviors. This structural decoupling endows knowledge-based agents with immense flexibility, enabling them to adapt their behavior to newly acquired knowledge, learn incrementally, and serve as the foundation for expert systems.

Architecture of a knowledge-based agent showing environment, inference engine, knowledge base, and learning

The operational architecture consists of three core components: the knowledge base containing explicit facts and rules; the inference engine utilizing domain-independent logic algorithms; and the decision-making agent program that selects actions aligning with internal goals and current beliefs. For instance, when the knowledge base contains the fact that the ground is wet, the decision maker references operational goals and triggers the action to carry an umbrella.

Pseudocode implementation of the generic KB-AGENT function

The interaction cycle of a generic knowledge-based agent is formalized in the KB-AGENT procedural loop. The agent maintains persistent internal state consisting of the knowledge base KBKB and an integer counter tt, initialized to 00, tracking discrete time steps. Upon receiving a percept at time tt, the agent invokes TELL(KB, MAKE-PERCEPT-SENTENCE(percept, t)) to construct and store an internal sentence representing the current observation. Next, the agent queries the knowledge base by executing action = ASK(KB, MAKE-ACTION-QUERY(t)) to infer the logically entailed action for the current objective. Once an action is selected, the agent executes TELL(KB, MAKE-ACTION-SENTENCE(action, t)) to record the action executed at time tt, increments the counter t←t+1t \leftarrow t + 1, and returns the chosen action to its actuators.

Symbolic and Structured Knowledge Representation Techniques

Logic serves as a declarative, symbolic representation that encodes knowledge in unambiguous, mathematically structured statements. In a declarative system, the designer declares what is true, allowing automated reasoning procedures to compute all downstream logical consequences without manual intervention. Formal logic within artificial intelligence primarily branches into propositional logic and first-order logic.

Propositional logic deals with declarative propositions—atomic assertions that evaluate strictly to either true or false. Its syntax is constructed from atomic proposition symbols (such as PP, QQ, and RR) joined by standard logical connectives: negation (¬\neg), conjunction (∧\land), disjunction (∨\lor), implication (→\rightarrow), and biconditional equivalence (↔\leftrightarrow). Semantics are defined through truth assignments, where the truth of complex sentences is computed deterministically via truth tables. For instance, if PP represents "It is raining" and QQ represents "The ground is wet", the rule P→QP \rightarrow Q enforces that whenever PP is true, QQ must evaluate to true under entailment. Despite its precision, propositional logic cannot represent generalized relationships over domains of entities, failing to express statements such as "All humans are mortal" without enumerating each entity individually.

First-order logic extends propositional logic by introducing an explicit ontology of objects, relations, and quantifiers. Its vocabulary includes constants that refer to specific objects (such as Socrates\text{Socrates}), predicates that assert relations or properties over objects (such as Human(x)\text{Human}(x) or Mortal(x)\text{Mortal}(x)), and quantifiers. The universal quantifier (∀\forall) specifies that a statement holds for all entities in the domain, while the existential quantifier (∃\exists) asserts the existence of at least one entity satisfying the condition. Expressing "All humans are mortal" is formalized as ∀x (Human(x)→Mortal(x))\forall x\,(\text{Human}(x) \rightarrow \text{Mortal}(x)). When paired with the assertion Human(Socrates)\text{Human}(\text{Socrates}), first-order reasoning derives Mortal(Socrates)\text{Mortal}(\text{Socrates}) through deductive instantiation.

Logical reasoning operates via exact formal inference rules. Modus Ponens dictates that from the premises P→QP \rightarrow Q and PP, one necessarily derives QQ. Resolution provides an algorithm for combining clauses to deduce contradictions or new assertions, matching complementary literals such as ¬P∨Q\neg P \lor Q and P∨RP \lor R. Unification identifies substitution mappings that bind variables to constants or terms, making general first-order clauses syntactically identical (e.g., binding x=Socratesx = \text{Socrates}). While logic offers exactness, sound deductive power, and widespread use in automated theorem proving, SAT solvers, planning systems, and expert systems like MYCIN, it exhibits significant limitations. It is inherently brittle when handling real-world domains characterized by uncertainty, cannot natively express probabilistic likelihoods, requires manual knowledge authoring by experts, and scales with high computational complexity.

Semantic network representing relationships between Bob, builder, Fido, dog, Fang, cat, mice, and cheese

Semantic networks represent knowledge as directed graphs. In this paradigm, nodes correspond to concepts, entities, or classes, while labeled directed edges define relational dependencies between nodes. Knowledge is encoded through interconnected topological meaning rather than linear textual sentences. The structural backbone of a semantic network relies on inheritance hierarchies, where lower-level child nodes inherit properties from higher-level ancestral nodes. In an illustrative network, nodes representing entities such as Bob, Fido, Fang, and Cheese connect via labeled links like "owns", "chases", "is-a", and "eats". Reasoning is executed via taxonomic inheritance—where Fido, being an instance of Dog, inherits general animal traits like the requirement for sustenance—and spreading activation, where querying the Bob node propagates activation signals to adjacent concepts such as his profession (Builder) or pet (Fido).

Semantic networks are categorized into definitional networks (which map strict "is-a" taxonomies such as Dog→Mammal→Animal\text{Dog} \rightarrow \text{Mammal} \rightarrow \text{Animal}), assertional networks (which assert specific instance propositions such as Fido→instance-of→Dog\text{Fido} \rightarrow \text{instance-of} \rightarrow \text{Dog}), inheritance networks (which manage property inheritance alongside non-monotonic exception overrides, such as specifying that penguins are birds that cannot fly), and conceptual dependency networks (which map linguistic and behavioral actions through actor-action-object roles for natural language processing). Semantic networks provide intuitive visual structures and rapid associative lookups, finding extensive application in WordNet, the Google Knowledge Graph, and ConceptNet. However, they lack standard formal semantics, struggle to enforce complex logical constraints, fail to manage probabilistic uncertainty, and face scalability bottlenecks as graphs become dense.

Frames provide a structured, object-like schema that encapsulates contextual knowledge about concepts, physical objects, or recurring scenarios. A frame consists of named attributes termed slots, paired with corresponding values. These values may be specific data instances, inherited values, procedural routines, or defaults. Frames organize domain understanding hierarchically, mirroring class structures in object-oriented programming.

A canonical hierarchy demonstrates frame specialization and default overriding:

Vehicle (Frame)
  Wheels: 4
  Engine: Generic
  HasDoors: Yes

Car (Frame)
  Inherits from: Vehicle
  Engine: Petrol
  Type: Sedan
  Color: White

Electric Car (Frame)
  Inherits from: Car
  Engine: Electric (Overrides)
  Battery: Lithium-Ion
  Range: 350 km

When a property query is executed, the frame system first evaluates whether an instance-specific value exists; if absent, it checks for a local default, and if still undefined, it traverses inheritance links up the hierarchy. Reasoning in frame systems relies on default reasoning (assuming unspecified traits adhere to common defaults) and procedural attachments, which are attached methods ("if-needed" or "if-added" daemons) that trigger computations when a slot is queried or modified, such as calculating battery discharge when querying range. Frames structure complex domain knowledge effectively for computer vision, robotics, and natural language processing, but they scale poorly over non-hierarchical, relational, or time-varying data.

Production rules represent procedural, condition-action knowledge through formal IF-THEN statements. The condition (IF) evaluates operational predicates against the working memory, while the action (THEN) executes behavioral steps, modifies internal facts, or asserts conclusions when the condition is satisfied. In a medical rule-based system, Rule 1 may state: IF fever AND cough THEN possible flu, while Rule 2 specifies: IF temperature > 38°C THEN fever = True. Given initial assertions that temperature = 39°C and cough = True, the system evaluates Rule 2, fires its action to assert fever = True, and subsequently fires Rule 1 to infer possible flu.

Production systems employ two primary chaining strategies. Forward chaining is a data-driven process that begins with known facts and iteratively fires satisfied rules to derive new conclusions until no further rules can activate. Backward chaining is a goal-driven process that begins with a hypothesized goal (e.g., "Does the patient have flu?") and works in reverse, inspecting which rules conclude that goal and checking whether current facts support their requisite conditions. Rule-based architectures formed the core of foundational expert systems including MYCIN (medical diagnosis) and DENDRAL (chemical spectral analysis), as well as modern business rules engines and game artificial intelligence. Nevertheless, production systems face management hurdles when rule bases grow into thousands of interdependent statements, suffer from conflict resolution challenges when competing rules fire simultaneously, and cannot natively represent continuous or probabilistic uncertainty.

Ontology hierarchy showing animals, mammals, birds, and inherited properties

An ontology provides an explicit, formal, and hierarchical specification of conceptualization within a domain. Ontologies formalize abstract categories and concrete reality through five core components: classes (abstract groupings of entities), subclasses (specialized child classes within a parent category), relations (explicit semantic connections linking classes), properties (attributes and constraints characterizing concepts), and instances (concrete individual ground entities). In an ontology covering biological classifications, the root class Animal subsumes Mammal and Bird; Mammal subsumes Dog (possessing attributes hasHair=True\text{hasHair} = \text{True} and givesBirth=True\text{givesBirth} = \text{True}) and Whale (possessing livesIn=Water\text{livesIn} = \text{Water} and givesBirth=True\text{givesBirth} = \text{True}), while Bird features hasFeathers=True\text{hasFeathers} = \text{True} and canFly=True\text{canFly} = \text{True}.

Ontological reasoning incorporates property inheritance down subclass hierarchies, automated classification (determining that an arbitrary entity exhibiting feathers and flight belongs to the Bird class), consistency checking (verifying that an entity is not simultaneously asserted as a Bird and a Fish when defined as disjoint classes), and semantic inference (discovering implicit relations across cross-linked domains). Standardized in Semantic Web frameworks via Resource Description Framework (RDF), Web Ontology Language (OWL), and SPARQL query mechanisms, ontologies enable automated interoperability across distributed databases, biomedical systems (such as SNOMED CT and Gene Ontology), and open knowledge graphs like DBpedia. However, developing domain ontologies demands extensive expert labor, and maintaining them across evolving schemas introduces substantial computational overhead.

Logical Reasoning Approaches and Inference Procedures

Reasoning paradigms in artificial intelligence define how systems infer conclusions from evidence and domain models, varying in directional flow, deductive certainty, and reliance on empirical data.

Deductive reasoning is a top-down inferential paradigm that derives logically certain conclusions from general premises. It adheres to the canonical form: if A→BA \rightarrow B is true, and AA is confirmed true, then BB must be true. Given the rule that all birds can fly and the fact that a parrot is a bird, deductive reasoning necessarily derives that the parrot can fly. Deduction is monotonic and guarantees that truth is strictly preserved, provided the initial premises are sound.

Inductive reasoning operates bottom-up, synthesizing generalized rules and predictive models from sets of specific observations. For example, repeatedly observing that Swan1\text{Swan}_1, Swan2\text{Swan}_2, and Swan3\text{Swan}_3 are white leads to the generalized hypothesis that all swans are white. Inductive inference underpins machine learning, pattern recognition, and statistical modeling. Because it relies on finite samples, inductive conclusions are probabilistic and subject to revision upon encountering contradictory evidence.

Abductive reasoning infers the most plausible explanation or underlying cause for an observed phenomenon. Given an observation—such as finding that the ground is wet—abductive reasoning weighs competing explanations, such as rainfall, active lawn sprinklers, or a local liquid spill, selecting rainfall as the most likely hypothesis. Abduction is non-monotonic and forms the inferential core of diagnostic medical expert systems, fault detection, and scientific hypothesis generation.

Formal inference procedures operationalize these reasoning strategies across computational architectures. Forward chaining executes in a data-driven loop, matching working memory facts against production rule antecedents to deduce successive facts. Backward chaining executes in a goal-driven loop, decomposing a top-level hypothesis into prerequisite sub-goals, matching rule consequents to verify if working facts ground the query. Resolution provides a sound refutation theorem-proving method for propositional and first-order logics in Conjunctive Normal Form (CNF), conjoining the negated goal to the knowledge base and iteratively applying resolution rules to derive an empty clause (contradiction), thereby proving the validity of the un-negated goal.

Inference systems are formally evaluated through soundness and completeness. An inference procedure is sound if it derives only conclusions that are logically entailed by the knowledge base, ensuring that every computed output is valid (KB⊢α  ⟹  KB⊨αKB \vdash \alpha \implies KB \models \alpha). An inference procedure is complete if it can derive every sentence that is logically entailed by the knowledge base (KB⊨α  ⟹  KB⊢αKB \models \alpha \implies KB \vdash \alpha). The central objective in automated reasoning is the design of algorithms that guarantee both soundness (generating no false derivations) and completeness (leaving no entailed truths unproven).

Modern Perspectives on Knowledge Representation

Traditional knowledge representation relies on handcrafted symbolic rules, deterministic logic, and static ontologies. Modern knowledge representation integrates deep neural networks, large language models, and probabilistic graphical models, enabling systems to extract implicit representations directly from unstructured data and reason under conditions of uncertainty.

Large language models (LLMs), such as GPT, BERT, and PaLM, represent knowledge implicitly across high-dimensional vector spaces optimized over trillions of training tokens. Instead of relying on hand-coded predicates or production rules, semantic relationships, syntactic rules, and factual associations are embedded within dense vector representations. These models perform reasoning via in-context learning and contextual pattern association. For example, when prompted with "If Paris is in France, where is Berlin?", an LLM infers "Germany" by traversing latent geometric relationships learned during pre-training. LLMs process natural language variations robustly, tolerate ambiguity, and scale across diverse domains. However, their implicit representations lack formal transparency, cannot be directly edited, and frequently produce plausible but factually incorrect outputs, a phenomenon known as hallucination.

Probabilistic reasoning addresses the brittleness of classical bivalent logic by modeling uncertainty directly through probability theory. Rather than asserting a deterministic fact such as "The patient has flu", a probabilistic system models conditional beliefs, formalizing statements such as:

P(Flu∣Fever,Cough)=0.85P(\text{Flu} \mid \text{Fever}, \text{Cough}) = 0.85

Bayesian Networks represent these uncertainties via directed acyclic graphs whose nodes correspond to random variables and whose edges encode conditional dependencies quantified by Conditional Probability Tables (CPTs). For sequential reasoning under uncertainty, Hidden Markov Models (HMMs) model temporal states across domains like speech recognition, while Markov Decision Processes (MDPs) provide the mathematical framework for decision-making in stochastic environments within reinforcement learning. Under Bayesian inference, observing a symptom like fever updates the posterior probability of flu based on prior prevalence and conditional likelihoods, providing robust handling of noisy sensor inputs. However, probabilistic reasoning requires precise prior and conditional probability distributions, which can become computationally intractable during exact inference over large, densely connected networks.

Neuro-Symbolic artificial intelligence bridges structured symbolic reasoning with statistical neural representations. Pure neural approaches excel at pattern perception, statistical association, and handling continuous real-world data, but struggle with rigorous reasoning, verifiability, and interpretability. Conversely, symbolic systems execute sound deductive inference, enforce strict logical constraints, and yield explainable traces, but fail when faced with unstructured inputs or noisy domains. Neuro-symbolic architectures combine both paradigms: a neural network or large language model processes unstructured text or sensory data, while a symbolic layer enforces ontological consistency, applies logical constraints, and guarantees soundness.

Problem Solving by Search and Goal-Based Agents

Goal-based agents operate by formulating objectives and determining sequences of actions that transition the environment from an initial state to a goal state. Problem solving by search constitutes an offline planning phase executed prior to real-world action execution. The agent conducts an internal search within a simulated state space model, discovers a viable sequence of actions, and subsequently executes the resulting plan within the real environment.

Goal-based agent architecture operating within an environment

Classical search formulations assume that the operational environment is known (a transition model is accessible), fully observable (the agent's sensors detect the complete environmental state), deterministic (each action yields an exact, predictable outcome), and static. Because the environment is deterministic and known, the problem-solving cycle splits into two distinct operational phases: the planning phase, where the agent searches for a path to the goal, followed by the execution phase. During execution, the agent operates in an open-loop regime, carrying out the precomputed action sequence without needing to query sensors, confident that each action will produce its planned outcome.

A search problem is formally defined by five core components:

  1. Initial State: A formal description of the starting configuration of the agent, represented as s0s_0.

  2. Actions: The set of allowable actions executable in a given state, denoted as ACTIONS(s)\text{ACTIONS}(s).

  3. Transition Model: A formal function mapping a state and an action to the resulting state, specified as RESULT(s,a)\text{RESULT}(s, a), or alternatively written as s′=f(s,a)s' = f(s, a).

  4. Goal State / Goal Test: A predicate evaluating whether a given state satisfies the terminal objective, or an explicit set of target states.

  5. Path Cost: A numeric function, denoted by g(n)g(n), that computes the cumulative sum of step costs along a trajectory, where the step cost of transitioning from state ss to state s′s' via action aa is denoted as c(s,a,s′)c(s, a, s').

Discretized grid and state transitions across a maze environment

In continuous environments such as a physical maze, an agent discretizes its surroundings using a coordinate grid. Each cell is assigned an atomic state identifier (such as 1,2,3,…1, 2, 3, \dots), and the action set is restricted to cardinal directions: ACTIONS={N,E,S,W}\text{ACTIONS} = \{N, E, S, W\}. A tabular transition model dictates legal transitions based on whether physical barriers obstruct adjacent cells. The optimal solution is the sequence of actions that minimizes the total path cost while connecting the initial state to the goal state.

Map of Romania indicating route finding connections between cities

The Romania route-finding problem represents a classic discrete search domain. An agent vacationing in Romania begins at an initial state in the city of Arad, with the objective of reaching Bucharest to catch a scheduled flight. The actions consist of driving along inter-city highway segments. The transition model dictates that executing a drive from city AA to city BB places the agent in city BB. The path cost corresponds to the cumulative road distance measured in miles or kilometers across traveled segments.

Vacuum world domain showing agent and dirt configurations across two locations

The vacuum cleaner world models a discrete environment consisting of two locations, AA and BB, each of which may be clean or dirty. An atomic state configuration is defined by the agent's spatial location alongside the dirt status of every cell. For an environment with nn distinct locations, the state space contains n×2nn \times 2^n possible configurations. For n=2n = 2, the state space consists of exactly 2×22=82 \times 2^2 = 8 atomic states. The agent's action space contains three operations: Left\text{Left}, Right\text{Right}, and Suck\text{Suck}. The goal state requires all locations to be clean, and the path cost is typically defined as the total number of actions taken.

Start state configuration of the 8-puzzle sliding-tile problemGoal state configuration of the 8-puzzle sliding-tile problem

The sliding-tile puzzle consists of a grid containing numbered tiles and a single blank space. An agent shifts tiles adjacent to the blank space into the empty slot, formalizing actions as moving the blank Left, Right, Up, or Down. The goal state arranges the tiles in sequential numeric order with the blank occupying the upper-left or lower-right position. Because sliding-tile configurations are constrained by permutation parity, exactly half of all theoretical tile permutations are reachable from any given configuration. The size of the reachable state space grows factorially:

  • 8-puzzle (3×33 \times 3 grid): 9!2=181,440\frac{9!}{2} = 181{,}440 reachable states.

  • 15-puzzle (4×44 \times 4 grid): 16!2≈1013\frac{16!}{2} \approx 10^{13} reachable states.

  • 24-puzzle (5×55 \times 5 grid): 25!2≈1025\frac{25!}{2} \approx 10^{25} reachable states.

Robot manipulator arm with prismatic and revolute joint configurations

In robot motion planning, an agent manipulates physical kinematic arms using prismatic (linear sliding, PP) and revolute (rotational, RR) joints. The state space is continuous, defined by real-valued joint angles and spatial coordinates. Actions correspond to continuous motor actuations applied across kinematic degrees of freedom. The goal state specifies an end-effector pose that successfully grasps a target object, while path costs measure execution duration, cumulative energy expenditure, or joint trajectory smoothness.

State Space Graphs and Search Trees

A state space is an abstract mathematical graph whose vertices represent environmental states and whose directed edges denote valid actions. Because real-world state spaces are typically too large to enumerate explicitly in memory, search algorithms superimpose an explicit search tree over the underlying graph, instantiating nodes dynamically as exploration unfolds. The root node represents the problem's initial state. Child nodes are generated by applying allowable actions via the transition model, producing edges that connect parent states to child states.

Search tree generation showing initial root, child expansion, cycles, and redundant paths

A critical challenge arises because state space graphs frequently contain cycles and redundant paths, whereas search trees cannot tolerate infinite loops. A cycle occurs when an action sequence returns the agent to an already visited state; if left unchecked, tree generation can loop infinitely down an identical branch. A non-cycle redundant path occurs when distinct sequences of actions reach the exact same state via different routes. In standard computer science tree algorithms, trees are provided as static, acyclic structures that fit entirely within memory. In contrast, artificial intelligence search trees are generated on the fly from an implicit graph model. Because search trees can grow exponentially, managing cycles and pruning redundant paths is essential to ensure termination and computational efficiency.

To build and manage search trees, search algorithms encapsulate individual nodes within a specialized data structure comprising four core fields:

  1. STATE: The environmental state configuration corresponding to this node.

  2. PARENT: A pointer reference to the parent node that generated this node.

  3. ACTION: The specific action applied to the parent's state to produce this node.

  4. PATH-COST: The cumulative path cost (g(n)g(n)) incurred from the initial state to this node.

The search frontier—the collection of generated, unexpanded candidate nodes—is managed using a queue. Queue operations include IS-EMPTY(frontier), which returns true if no candidate nodes remain; POP(frontier), which removes and returns the top node according to the search strategy; TOP(frontier), which inspects the leading node without removal; and ADD(node, frontier), which inserts a newly instantiated node into the queue according to the chosen ordering strategy.

Search strategies are evaluated across four foundational criteria:

  • Completeness: Guarantees that the algorithm will always find a solution if at least one exists.

  • Optimality: Guarantees that the algorithm will return the lowest-cost solution among all possible paths.

  • Time Complexity: The computational duration or number of node expansions required to terminate.

  • Space Complexity: The maximum memory capacity required to store the frontier and visited state sets.

Complexity metrics are expressed using three parameters:

  • bb: The branching factor, representing the maximum number of successor nodes generated by expanding any given state.

  • dd: The depth of the shallowest goal node in the search tree.

  • mm: The maximum depth of any branch in the state space (which may be infinite if cycles exist).

Uninformed Search Algorithms

Uninformed search algorithms—also known as blind search methods—explore state spaces relying solely on the problem definition (the initial state, available actions, transition model, goal test, and path cost). These algorithms have no domain-specific heuristics indicating whether a particular non-goal state is closer to the objective than another. They explore the search space systematically, differing only in the order in which nodes are selected from the frontier for expansion.

Breadth-first search node exploration sequence on a binary tree

Breadth-first search (BFS) expands the shallowest unexpanded node in the frontier first. The frontier is implemented as a First-In, First-Out (FIFO) queue, ensuring that nodes at depth kk are expanded entirely before any nodes at depth k+1k+1 are considered. To prevent infinite loops caused by cycles and avoid redundant paths, BFS maintains a lookup data structure known as the reached set, which tracks every state that has been visited or added to the frontier.

Pseudocode for breadth-first search using a FIFO queue and reached set

BFS applies an early goal test: it evaluates whether a node represents a goal state the moment it is generated, rather than waiting until it is popped from the frontier. The algorithm initializes the root node from problem.INITIAL, checks whether this starting node satisfies the goal condition, and initializes the frontier as a FIFO queue containing the root. The reached set is initialized containing problem.INITIAL. While the frontier is not empty, the algorithm pops the leading node and generates its successors using the EXPAND function. For each generated child node, if its state satisfies problem.IS-GOAL, the child node is immediately returned as the solution. Otherwise, if the child's state does not already exist in the reached set, the state is added to reached, and the child node is appended to the frontier. If the frontier empties without identifying a goal, the procedure returns failure.

Pseudocode for expanding nodes in a search tree

The helper function EXPAND(problem, node) extracts the state s←node.STATEs \leftarrow node.\text{STATE}. For every valid action in problem.ACTIONS(s), it computes the successor state s′←problem.RESULT(s,action)s' \leftarrow \text{problem.RESULT}(s, action), calculates the cumulative path cost as cost←node.PATH-COST+problem.ACTION-COST(s,action,s′)cost \leftarrow node.\text{PATH-COST} + \text{problem.ACTION-COST}(s, action, s'), and instantiates a new child node with fields STATE = s′s', PARENT = nodenode, ACTION = actionaction, and PATH-COST = costcost.

Breadth-first search is complete, guaranteeing a solution if the branching factor bb is finite. It is optimal if all step costs are equal (or monotonically non-decreasing with depth). However, BFS expands all nodes level by level up to depth dd, yielding an exponential worst-case time complexity of O(bd)O(b^d). Because the frontier and reached set must retain all generated nodes in memory, its space complexity is also O(bd)O(b^d). This exponential memory footprint makes BFS impractical for deep search problems.

Uniform-cost search (UCS) expands the node in the frontier that has the lowest cumulative path cost g(n)g(n) from the initial state. While BFS finds the path with the fewest steps, UCS finds the path with the lowest overall cost in graphs with varying step costs. UCS is implemented via a best-first search framework, where the frontier is organized as a priority queue ordered by ascending g(n)g(n). UCS represents the generalized artificial intelligence equivalent of Dijkstra's single-source shortest-path algorithm.

Pseudocode implementation of best-first search algorithm

Unlike BFS, UCS applies a late goal test: it evaluates whether a node satisfies the goal condition only when that node is popped from the frontier for expansion. This delay ensures that the algorithm does not terminate prematurely on a suboptimal path that happens to reach the goal early with a higher total cost. Furthermore, if a newly generated child node leads to a state that is already present in the reached lookup table, UCS replaces that entry if the newly discovered path offers a strictly lower path cost: child.PATH-COST < reached[s].PATH-COST. By updating the reached table and re-inserting the cheaper path into the priority queue, UCS guarantees that states are reached via optimal routes.

Uniform-cost search is complete provided that every step cost is strictly positive and bounded away from zero by a small constant ϵ>0\epsilon > 0 (formally, c(s,a,s′)≥ϵ>0c(s, a, s') \ge \epsilon > 0). This condition prevents infinite loops over zero-cost cycles. UCS is optimal because nodes are expanded in strictly non-decreasing order of path cost. Let C∗C^* denote the cost of the optimal solution. The effective depth of the search is governed by ⌊C∗/ϵ⌋\lfloor C^* / \epsilon \rfloor. Consequently, both the time and space complexity of uniform-cost search scale as:

O(b1+⌊C∗/ϵ⌋)O(b^{1 + \lfloor C^* / \epsilon \rfloor})

When all step costs are identical, this bound reduces to the standard O(bd)O(b^d) complexity of breadth-first search.

Twelve sequential steps of depth-first search on a binary tree

Depth-first search (DFS) expands the deepest unexpanded node in the frontier first. The frontier is managed using a Last-In, First-Out (LIFO) stack. DFS pursues each path forward through the search tree until it encounters a dead end (a node with no legal actions), at which point it backtracks to explore alternative branches at shallower depths. While graph-search DFS can maintain a complete reached set, doing so incurs an exponential memory footprint of O(bm)O(b^m). To achieve linear space efficiency, practical DFS implementations omit the full reached set, instead tracking only the active trajectory from the root to the current node. This restricts cycle checking to the current path, which prevents loops along the active branch but leaves the algorithm susceptible to exploring non-cycle redundant paths multiple times.

Depth-first search is not complete: if the state space contains cycles or infinite paths, DFS can traverse an unbounded branch indefinitely, failing to terminate even if a shallow goal exists elsewhere in the tree. DFS is also not optimal; it returns the first path that reaches a goal, which is often deeper and more expensive than the optimal solution. In the worst case, DFS explores all branches up to the maximum tree depth mm, resulting in a time complexity of O(bm)O(b^m). However, its primary advantage lies in its space efficiency: because it stores only the active path along with the unexpanded siblings at each depth, its space complexity is strictly linear:

O(b×m)O(b \times m)

This minimal memory requirement allows depth-first search to operate within constrained memory environments where breadth-first search would quickly fail.

Depth-limited search stages during iterative deepening search from limit 0 to 3

Iterative deepening search (IDS) combines the completeness and shallow-path optimality of breadth-first search with the linear space efficiency of depth-first search. IDS operates by executing successive rounds of depth-limited search (DLS), an augmented depth-first search that enforces a maximum depth boundary ℓ\ell. Nodes situated at depth ℓ\ell are treated as terminal leaves; if an active path exceeds ℓ\ell, the algorithm records a cutoff signal and backtracks.

Iterative deepening search wraps depth-limited search in an outer loop that increments the depth limit from ℓ=0,1,2,3,…\ell = 0, 1, 2, 3, \dots until a solution is identified or the search space is exhausted. Because it increases the depth limit incrementally by one at each stage, the first goal node it encounters is guaranteed to be at the shallowest possible depth (dd).

Although it appears that re-expanding upper tree levels across successive iterations introduces excessive overhead, the vast majority of nodes in an exponentially expanding tree reside at the bottom level. In a tree with branching factor bb and shallowest goal depth dd, the root node is generated d+1d + 1 times, nodes at depth 11 are generated dd times, and nodes at the goal depth dd are generated exactly once. The total number of node generations across the entire run of iterative deepening search evaluates to:

N(IDS)=(d+1)(1)+d(b)+(d−1)(b2)+⋯+1(bd)=O(bd)N(\text{IDS}) = (d+1)(1) + d(b) + (d-1)(b^2) + \dots + 1(b^d) = O(b^d)

Iterative deepening search is complete whenever the branching factor bb is finite. It is optimal when all step costs are equal (unit cost). Its overall time complexity remains O(bd)O(b^d), matching the asymptotic class of breadth-first search, while its space complexity is bounded by the current depth limit, requiring only:

O(b×d)O(b \times d)

This combination of completeness, shallow-path optimality, and linear space complexity makes iterative deepening search the preferred uninformed search strategy for large, discrete search spaces where the goal depth is not known in advance.

Comparative evaluation of uninformed search algorithms across completeness, optimality, and complexity

The trade-offs among uninformed search algorithms are characterized by their formal operational properties:

Algorithm

Completeness

Optimality

Time Complexity

Space Complexity

Breadth-First Search (BFS)

Yes (if bb is finite)

Yes (for equal step costs)

O(bd)O(b^d)

O(bd)O(b^d)

Uniform Cost Search (UCS)

Yes (if step cost ≥ϵ>0\ge \epsilon > 0)

Yes

O(b1+⌊C∗/ϵ⌋)O(b^{1 + \lfloor C^* / \epsilon \rfloor})

O(b1+⌊C∗/ϵ⌋)O(b^{1 + \lfloor C^* / \epsilon \rfloor})

Depth-First Search (DFS)

No (fails in infinite spaces/loops)

No

O(bm)O(b^m)

O(b×m)O(b \times m)

Iterative Deepening Search (IDS)

Yes (if bb is finite)

Yes (for equal step costs)

O(bd)O(b^d)

O(b×d)O(b \times d)

Breadth-first search guarantees completeness and finds shallow solutions under uniform step costs, but its exponential space complexity (O(bd)O(b^d)) leads to severe memory exhaustion on non-trivial problems. Uniform-cost search provides cost optimality across graphs with non-uniform edge weights, but its memory footprint (O(b1+⌊C∗/ϵ⌋)O(b^{1 + \lfloor C^* / \epsilon \rfloor})) scales comparably to BFS. Depth-first search drastically reduces memory consumption to linear space (O(b×m)O(b \times m)), but sacrifices both completeness and optimality, risking infinite loops down unbounded paths. Iterative deepening search reconciles these trade-offs by pairing the systematic level-by-level exploration of BFS with the linear memory efficiency of DFS. These algorithms form the foundation of problem solving by search, establishing the baseline upon which informed heuristic methods, such as A∗A^* search, are constructed.