AI Glossary / Graphs and symbolic AI / Intermediate
Pruning
Definition
Pruning means removing or skipping parts of a search space or learned structure according to a rule. In search, it avoids exploring branches judged unnecessary or unpromising. In model learning, it can simplify a structure such as a decision tree. The justification matters: some pruning preserves an exact answer, while other forms deliberately trade potential accuracy or completeness for efficiency.
What it means
A search procedure can spend considerable effort on alternatives that cannot improve its current result. A pruning rule identifies some of those alternatives before fully exploring them. For example, a valid lower bound can show that a partial route cannot beat an already known complete route.
The word also appears in decision-tree learning, where branches may be removed to control complexity and generalization. These uses share the idea of reducing work or structure, but their guarantees differ. This entry emphasizes search pruning, consistent with symbolic AI and graph search, while distinguishing it from learned-model pruning rather than treating every use as one algorithm.
How it works
Choose what property must be preserved: finding any solution, retaining an optimal cost, maintaining a minimax value, or obtaining a useful simplified predictor. Establish a criterion appropriate to that goal. Apply it when considering a branch or structure, and retain enough information to explain the decision.
For minimum-cost branch and bound, compare a lower bound on a branch's possible completion cost with the cost of a known feasible solution. If the branch cannot improve that solution, it can be excluded when seeking one optimum. Cycle pruning and repeated-state pruning use different reasoning. Their safety depends on the state representation, cost assumptions, and how alternative paths are handled.
Three practical examples
- A route search can skip a partial route whose best possible completion is already more expensive than an available complete route.
- A game-tree search can use alpha - beta bounds to avoid evaluating branches that cannot change the relevant minimax result.
- A decision-tree learning workflow can remove branches under a complexity criterion and evaluate the resulting predictor on suitable held-out data.
Think of it this way
Think of comparing quotations when one supplier's unavoidable minimum charge already exceeds a complete acceptable offer. Further detail cannot make that supplier cheaper under those assumptions. The analogy is limited because a computational bound must really apply to every completion of the branch; an optimistic-looking guess or an omitted rebate can invalidate the exclusion.
Worked example
Consider an invented minimum-cost planning search with a known feasible plan costing 12. For a partial branch X, the cost already incurred is 5 and a valid lower bound on the remaining cost is 8. Every completion of X costs at least 13, so X cannot improve the incumbent plan and may be pruned.
For branch Y, the incurred cost is 4 and the remaining-cost lower bound is 6. Its total bound is 10, so it must remain eligible: it might beat 12. Suppose exploring Y finds a complete plan costing 11. The incumbent becomes 11.
Now branch Z has incurred cost 7 and a valid remaining bound of 4, giving 11. If the objective is to return one minimum-cost plan, Z can be pruned because it cannot improve the existing 11-cost plan. If the objective is to enumerate every optimal plan, pruning the equality case could lose another optimum. The required output therefore changes the pruning criterion.
If X's supposed remaining bound of 8 were merely a guess and its true remaining cost were 3, pruning would incorrectly discard an 8-cost plan. The correctness claim depends on a genuine bound.
Illustrative case study
Fictional case: Ash Scheduler speeds up a small task-assignment prototype by rejecting branches whose estimated cost exceeds the best schedule found. A review discovers that the estimate sometimes overstates unavoidable remaining work because two tasks can share setup.
The team replaces that estimate with a justified lower bound before describing the search as optimal. It keeps the stronger estimate only where its heuristic role is explicitly understood. This fictional example illustrates how a useful ranking estimate can still be unsafe as an exact pruning certificate. No measured speedup or real scheduling outcome is claimed.
Common misconceptions and mistakes
Do not equate “unlikely to help” with “proved unable to help.” Heuristic pruning may be valuable, but its loss of guarantees should be explicit. Do not assume every repeated state can be discarded without considering path costs and future-relevant information.
An equality cutoff that preserves one optimal answer may not preserve all optimal answers. Removing cycles can also require cost and state assumptions; a representation that omits collected resources may wrongly identify two situations as identical. In decision-tree learning, fewer branches do not automatically mean better unseen performance. Simplification must be assessed in the learning context rather than borrowed from a search proof.
Business use
Pruning can make a solver practical by reducing the alternatives it explores, and it can make a learned tree easier to maintain. A business team should ask which result is preserved and what evidence supports that claim.
For a search pilot, record the reason each sampled branch was excluded and compare small instances against exhaustive solutions. Measure both computation and answer quality when a heuristic cutoff is used. For a predictive tree, assess generalization with an appropriate evaluation design. The important distinction is between a performance optimization with a correctness argument and a deliberate approximation whose consequences must be measured.
People also ask
Does pruning always preserve the best answer?
No. Exact pruning can preserve it under stated conditions; heuristic pruning may discard it.
Is pruning the same as stopping early?
Not necessarily. Pruning excludes particular branches or structures, while stopping may end the whole computation.
Can a better bound improve pruning?
Yes. A tighter valid lower bound can rule out more branches in minimization, but its computational cost also matters.
Check your understanding
A feasible solution costs 20. A branch has incurred cost 9 and a valid remaining-cost lower bound of 12. Can it be pruned when seeking a cheaper solution?
Answer: Yes. Every completion costs at least 21, so none can beat 20. The conclusion would not be justified if 12 were an estimate that might exceed the actual remaining cost.
Related terms
- Admissible heuristic
- Decision tree pruning
- Branch and bound
- alpha–beta pruning
- cycle pruning
- multiple-path pruning
- lower bound
- incumbent
- model complexity
Learn next
Learn branch and bound and admissible heuristics next. Change the worked example's goal from finding one optimum to listing all optima. Mark which equality cutoffs must change, and explain why branches with strictly worse valid bounds can still be removed.
More in Graphs and symbolic AI
- Proof-number search - Proof-number search is a best-first search method for proving or disproving a proposition represented by an AND - OR tree.
- Proposition symbol - A proposition symbol is an atomic symbol used to represent a statement in propositional logic.
- Propositional logic - Propositional logic is a formal system for reasoning with statements that are treated as true or false and combined using logical connectives.
- Psychological reasoning - Psychological reasoning, in symbolic AI, is reasoning about agents in terms of what they know, believe, want, intend, and are likely to do.
- Pure Monte Carlo search - Pure Monte Carlo search evaluates candidate moves by running simulated continuations, or playouts, and comparing their average outcomes.
- Pure strategy - A pure strategy is a complete, deterministic plan specifying which action a player will choose at each of that player's decision situations in a game.
Sources
David Poole and Alan Mackworth, Artificial Intelligence: Foundations of Computational Agents, informed search and branch and bound: https://artint.info/3e/html/ArtInt3e.Ch3.S6.html Poole and Mackworth, pruning search spaces: https://artint.info/2e/html2e/ArtInt2e.Ch3.S7.html Scikit-learn, decision trees and minimal cost-complexity pruning: https://scikit-learn.org/stable/modules/tree.html#minimal-cost-complexity-pruning
Previous: Proxy (sensitive attributes) Next: Pseudo-anonymization (pseudonymization)