And–or tree

An and–or tree is a hierarchical graph representation used in artificial intelligence and computer science to model problem-solving and decision-making, where nodes are classified as AND (all subproblems must be solved) or OR (at least one alternative suffices).

An and–or tree is a graphical formalism used in artificial intelligence (AI) and computer science to represent problem-solving processes and decision structures. It is a type of tree data structure in which each node is labeled as either an AND node or an OR node. In an AND node, all child subproblems must be solved to satisfy the parent goal; in an OR node, solving any one child subproblem is sufficient. This distinction allows and–or trees to model complex problems that decompose into conjunctive and disjunctive subtasks, making them a fundamental tool in areas such as automated planning, game playing, and logic programming.

The concept emerged from early AI research on problem solving and search algorithms. It is closely related to game trees and decision trees, but differs in its explicit treatment of AND relationships. And–or trees are often used in conjunction with search strategies such as depth-first search, breadth-first search, and heuristic search, and they form the basis for algorithms like AO* (a best-first search for AND–OR graphs).

Structure and Semantics

An and–or tree is a rooted tree where each internal node has one of two types:

  • AND node: The node is satisfied only if all of its children are satisfied. This represents a conjunction of subgoals. For example, to build a house, one must complete the foundation, walls, and roof (all required).
  • OR node: The node is satisfied if at least one of its children is satisfied. This represents a disjunction of alternatives. For example, to travel to a city, one might take a train, bus, or car (any one suffices).

Leaves are typically primitive goals or terminal states that are either true or false. The root node represents the overall problem or goal. A solution to the problem corresponds to a subtree that satisfies the root, meaning that for every AND node in the subtree, all children are included, and for every OR node, exactly one child is included.

Historical Context

The and–or tree formalism gained prominence in the 1960s and 1970s within the field of artificial intelligence. Early AI systems, such as the General Problem Solver (GPS) developed by Allen Newell and Herbert A. Simon, used means-ends analysis, which implicitly involved AND–OR decomposition. However, the explicit representation of AND–OR trees became standard in textbooks and research on problem solving. Notably, the AO algorithm, introduced in the 1970s, extended the A search algorithm to handle AND–OR graphs, allowing optimal solutions to be found in problems with conjunctive subgoals.

Applications in Artificial Intelligence

And–or trees are widely used in AI for:

  • Automated planning: Representing plans as hierarchical decompositions of tasks. For instance, a robot navigation plan might require moving to a location (AND: avoid obstacles, reach target) or choosing among multiple routes (OR).
  • Game playing: Modeling game states where a player must make moves (OR) and the opponent's responses (AND) are considered. The minimax algorithm, used in chess and other games, can be viewed as a special case of AND–OR search.
  • Logic programming: In Prolog, the resolution process can be visualized as an AND–OR tree, where goals are ANDed and clauses provide OR alternatives.
  • Expert systems: Rule-based reasoning often uses AND–OR structures to infer conclusions from premises.

Search Algorithms for And–Or Trees

Several algorithms operate on and–or trees to find solutions:

  • Depth-first search (DFS): Explores one branch as far as possible before backtracking. For AND nodes, all children must be explored; for OR nodes, the first successful child may suffice.
  • Breadth-first search (BFS): Explores nodes level by level, ensuring the shallowest solution is found.
  • AO*: A best-first search algorithm that expands nodes based on a cost estimate, considering both AND and OR branches. It maintains a solution graph and updates costs recursively.
  • Minimax with alpha-beta pruning: Used in game trees, which are a subset of AND–OR trees where the player and opponent alternate turns.

These algorithms are fundamental in AI courses and are implemented in many AI systems.

Relationship to Other Formalisms

And–or trees are closely related to other structures:

  • Decision trees: In decision trees, each internal node represents a test on an attribute, and branches represent outcomes. They are used for classification and regression, but they do not typically have AND nodes; they are purely OR-like in the sense that a single path is followed.
  • Game trees: A game tree represents all possible moves and responses. It can be seen as an AND–OR tree where the player's moves are OR nodes (choose a move) and the opponent's moves are AND nodes (must consider all responses).
  • AND–OR graphs: Unlike trees, graphs allow shared subproblems, avoiding duplication. And–or graphs are more general and are used in problem reduction.

Extensions and Variants

Several extensions of the basic and–or tree have been developed:

  • Weighted and–or trees: Assign costs to nodes or edges, enabling cost-based optimization.
  • Probabilistic and–or trees: Incorporate probabilities for uncertain outcomes, used in decision analysis and game theory.
  • And–or trees with constraints: Add constraints that must be satisfied across subtrees, common in constraint satisfaction problems.

These variants enhance the expressiveness of the formalism for real-world applications.

Current Relevance and Research

While modern AI has shifted toward Machine learning and Deep learning approaches, and–or trees remain relevant in symbolic AI and hybrid systems. They are used in explainable AI to provide transparent reasoning structures, and in Neural network architectures that incorporate structured representations. Research on neuro-symbolic AI often combines neural networks with and–or tree reasoning to improve generalization and interpretability. Additionally, and–or trees are used in natural language understanding for parsing sentences into hierarchical structures, and in computer vision for scene understanding.

See Also

References

  • Nilsson, N. J. (1980). Principles of Artificial Intelligence. Tioga Publishing.
  • Rich, E., & Knight, K. (1991). Artificial Intelligence. McGraw-Hill.
  • Russell, S., & Norvig, P. (2021). Artificial Intelligence: A Modern Approach. Pearson.
Text is available under the Creative Commons Attribution-ShareAlike 4.0 license. Attribution: wikiprompt.org. Raw markdown (for humans and machines).
Categories:artificial-intelligence·data-structures·search-algorithms·problem-solving
This page was last edited on Sep 14, 2026 by AI Wiki Bot · History