Means–ends analysis

On this page 7

Means–ends analysis is a problem-solving strategy that repeatedly compares the current state with the goal state, identifies the most important difference between them, and selects an operator whose effect reduces that difference. In the field of Symbolic AI & reasoning, it is best known as the core control method of the General Problem Solver (GPS), developed by Allen Newell, J. C. Shaw and Herbert Simon in the late 1950s.

The method matters because it introduced goal-directed search with subgoaling: when an operator cannot be applied yet, its unmet preconditions become a new subgoal. This idea shaped later classical planning systems such as STRIPS, the cognitive architecture Soar and many models of human problem solving in cognitive psychology.

How means–ends analysis reduces differences

Means–ends analysis works as a recursive difference-reduction loop. The solver describes states symbolically, measures how the current state differs from the goal, and looks up which operators are relevant to that difference. Relevance is stored in a table of connections (also called a difference-operator table) that maps each type of difference to the operators that can remove it.

If a relevant operator has unsatisfied preconditions, the solver does not discard it. Instead, it sets up a subgoal: transform the current state into one where the operator applies. The same procedure then runs on the subgoal, which produces a goal stack that unwinds as operators succeed. The following table summarizes the three goal types used in the original GPS formulation.

Goal typeWhat the solver tries to doTypical result
Transform goalTurn state A into state BFinds a difference, then a reduce goal
Reduce goalRemove difference D from state ASelects a relevant operator
Apply goalApply operator Q to state ANew state, or a new transform subgoal
Goal types in the General Problem Solver

Differences are usually ordered by importance, so the solver tackles the hardest or most structural difference first and leaves minor details for later. This ordering is a form of domain knowledge, and its quality largely determines whether the search converges quickly or wanders.

Key components and parameters

A working implementation needs several explicit pieces of knowledge. Each one must be engineered for the domain, which is why means–ends analysis is described as a weak method: general in its control logic, but dependent on a hand-built problem representation. The table lists the components and what each one affects.

ComponentRoleEffect of poor design
State representationSymbolic description of the worldDifferences cannot be detected precisely
Difference functionLists how a state differs from the goalIrrelevant or missing differences
Difference orderingRanks differences by difficultySolver fixes details before structure
Operator tableLinks differences to operatorsRelevant operators are never tried
Preconditions and effectsDefine when and how operators applyInvalid plans or endless subgoaling
Depth limitBounds the goal stackInfinite regress on cyclic subgoals
Components of a means–ends analysis solver

Practical solvers also keep a record of attempted goals to detect loops, because a subgoal can recreate a goal already on the stack. Without this check, the procedure may oscillate between two states indefinitely.

Means–ends analysis sits between blind state-space search and modern planning algorithms. It is neither purely forward nor purely backward: it reasons backward from goals to choose operators, then works forward to satisfy preconditions. The comparison below places it among neighboring techniques in symbolic AI.

MethodSearch directionGuidanceTypical use
Means–ends analysisMixed, goal-drivenDifferences and operator tablePuzzles, early planners, cognitive models
Forward chainingForward from factsRule matchingExpert systems, monitoring
Backward chainingBackward from goalRule conclusionsDiagnosis, logic programming
Best-first searchForwardNumeric heuristicPathfinding, optimization
STRIPS planningBackward or forwardAdd and delete listsClassical planning
Hierarchical task networkTop-down decompositionTask methodsLarge structured domains
Means–ends analysis and neighboring techniques

The closest descendant is STRIPS, whose original planner used a means–ends style of goal regression with explicit add and delete lists. Hierarchical task network planning generalizes the idea of decomposing a goal into ordered subtasks, while Soar keeps subgoaling as a universal mechanism triggered by impasses.

Where the method is used today

Pure means–ends analysis is rarely deployed as a standalone engine, yet its principles remain common. Cognitive scientists use it to model how people solve the Tower of Hanoi, river-crossing puzzles and algebra problems, because think-aloud protocols show the same pattern of difference detection and subgoaling.

  • Planning education: it is the standard introduction to goal regression before STRIPS and PDDL.
  • Cognitive architectures: Soar and ACT-R models reproduce subgoal stacks observed in human solvers.
  • Intelligent tutoring systems: tutors diagnose which difference a student is trying to reduce.
  • Agent design: LLM-based agents that decompose a task into subgoals echo the same control idea.

The method is most appropriate when differences are easy to describe, operators have clear preconditions and the domain is small enough to encode by hand.

Limitations and common pitfalls

The main weakness is interacting subgoals. Solving one difference can undo another that was already removed, a problem made famous by the Sussman anomaly in the blocks world. Linear goal stacks cannot handle such interactions well, which motivated partial-order planning. The table lists typical failure modes.

SymptomCauseRemedy
Solver undoes earlier progressInteracting subgoalsPartial-order or interleaved planning
Search never terminatesCyclic subgoalsLoop detection and a depth limit
Detour is never foundGreedy difference reductionAllow moves that temporarily increase difference
Poor results in a new domainHand-built tablesLearn operators or use domain-independent heuristics
Typical failure modes and remedies

Another pitfall is the assumption that every step should reduce the difference. Many problems require a move that temporarily makes the state look worse, such as backing a car out of a space before driving forward. A strictly greedy solver misses such detour solutions, so it offers no completeness or optimality guarantee on its own.

In plain words

Means–ends analysis is a way to solve a problem by asking one question again and again. What is the biggest gap between now and the goal? Then you pick an action that closes that gap.

Sometimes the action is not possible yet. In that case, making it possible becomes a smaller goal. You solve that smaller goal first and then return. Big goals turn into a chain of smaller goals. People do this naturally when they plan a trip or fix a broken device.

A real-world example

A university course on artificial intelligence asks students to build a means–ends planner for a warehouse robot. The goal state is a package on shelf C, and the robot starts at the charging dock with an empty gripper. The difference function reports three differences: package location, robot location and gripper status, ranked in that order.

The solver selects the operator “place package on shelf”, which requires the robot to hold the package at shelf C. These unmet preconditions become subgoals: pick up the package, which in turn needs the robot at the loading bay. The goal stack unwinds into a five-step plan: move to the bay, pick up, move to shelf C, place, return to the dock.

When students add a second package, the planner sometimes blocks the first one with the second. This reproduces the interacting-subgoal problem in miniature and shows why later planners moved beyond simple difference reduction.