Inferensys

Glossary

Proof-Number Search

Proof-Number Search is a best-first search algorithm designed to solve two-player games by proving a position is a win or a loss, focusing on expanding the most proving or disproving nodes.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
ALGORITHM

What is Proof-Number Search?

Proof-Number Search is a best-first search algorithm designed for solving two-player games, focusing on proving a position is a win or a loss by expanding the most proving or disproving nodes.

Proof-Number Search (PNS) is a best-first, adversarial search algorithm specifically engineered for solving two-player, deterministic, perfect-information games. Unlike minimax, which seeks an optimal move, PNS aims to prove a game state is a forced win (a proof) or a forced loss (a disproof) for the player to move. It does this by dynamically constructing an AND/OR tree where OR nodes represent positions where the current player chooses a move, and AND nodes represent positions where the opponent responds. The algorithm assigns each node a proof number (minimum leaves to prove a win) and a disproof number (minimum leaves to disprove a win), always expanding the node with the smallest proof or disproof number—the most promising candidate to resolve the game's status.

The algorithm's power lies in its goal-directed nature, focusing computational resources exclusively on the sub-tree most likely to determine the game's outcome. This makes it exceptionally efficient for solving endgame positions in games like checkers, chess, and Go, where the branching factor is high but the outcome is often determined by a narrow line of play. PNS is a cornerstone of combinatorial game theory and is closely related to other heuristic search methods like Monte Carlo Tree Search (MCTS), but where MCTS estimates win probabilities, PNS seeks absolute, logical proof. Its variants, like Depth-First Proof-Number Search (DFPN), further optimize memory usage for deep searches.

ALGORITHMIC FOUNDATIONS

Key Characteristics of Proof-Number Search

Proof-Number Search (PNS) is a best-first search algorithm designed for solving two-player, deterministic, perfect-information games by focusing on proving a position is a forced win or loss. It operates by assigning proof and disproof numbers to nodes, guiding the search toward the most uncertain or critical parts of the game tree.

01

Proof and Disproof Numbers

The core mechanism of PNS is assigning two values to each node:

  • Proof Number (pn): The minimum number of leaf nodes in the subtree that must be proven to be a win for the player to move.
  • Disproof Number (dn): The minimum number of leaf nodes that must be disproven (shown to be a loss).

For a terminal winning node, pn=0 and dn=∞. For a terminal losing node, pn=∞ and dn=0. An AND node (where the player must find a winning move among all children) has its pn as the sum of its children's pns and its dn as the minimum of its children's dns. An OR node (where the opponent must find a refutation) uses the opposite logic. The algorithm always expands the node with the smallest proof or disproof number, depending on the current proving goal.

02

Best-First AND/OR Tree Search

PNS is a best-first search algorithm that does not use depth or heuristic evaluation. Instead, it directly targets proving or disproving the root node's status. It models the game as an AND/OR tree:

  • OR nodes represent positions where the player to move can choose a move (only one child needs to be proven a win).
  • AND nodes represent positions where the opponent will respond (all children must be proven wins for the original player).

The search is guided solely by the proof and disproof numbers, making it exceptionally efficient for problems where the goal is a binary proof (win/loss) rather than finding a marginally better score. It is particularly effective for endgame databases and solving chess puzzles like checkmate-in-N.

03

No Heuristic Evaluation Required

Unlike Minimax with Alpha-Beta Pruning, which relies on a heuristic evaluation function to score non-terminal positions, PNS requires no such function. It operates purely on the logical structure of proof. This makes it immune to errors from inaccurate positional assessments, a significant advantage for proof-solving. However, it also means PNS cannot differentiate between a swift win and a slow one; it only seeks to prove the existence of a forced win. This characteristic makes it a deductive reasoning tool rather than an optimizing one, ideal for domains where certainty is paramount.

04

Application in Game Solving

PNS is the foundational algorithm for complete game solvers. Its most famous application is in solving Connect Four, proving the first player can force a win with perfect play. It is also extensively used for:

  • Constructing endgame tablebases for chess (e.g., King and Queen vs. King).
  • Solving Shogi and Go endgame puzzles.
  • Analyzing Awari and other combinatorial games.

The algorithm's efficiency stems from its ability to ignore vast sections of the tree that are irrelevant to the proof. It is often combined with transposition tables to recognize identical positions reached via different move orders, and with iterative deepening frameworks to manage memory.

05

Relation to Other Search Paradigms

PNS occupies a unique niche within the search landscape:

  • Vs. Monte Carlo Tree Search (MCTS): MCTS uses stochastic rollouts for value estimation and balances the exploration-exploitation tradeoff (e.g., via UCT). PNS is deterministic and seeks proof, not statistical confidence.
  • Vs. Alpha-Beta Search: Alpha-Beta is optimized for finding the best move using evaluations, often employing aggressive pruning. PNS is optimized for exhaustively proving a game-theoretic value, expanding nodes that appear most critical to the proof.
  • Vs. Breadth/Depth-First Search: Uninformed searches explore the state space systematically. PNS is an informed, goal-directed search where the proof numbers act as a dynamic, internal heuristic guiding expansion toward the most proving node.
06

PN² and DF-PN Variants

The basic PNS algorithm can suffer from memory explosion. Two critical variants address this:

  • Proof-Number Search 2 (PN²): Employs a two-level search. The outer search uses PNS, but when a child node is selected for expansion, an inner depth-first search is initiated from that child to update its proof numbers more efficiently before returning to the outer loop.
  • Depth-First Proof-Number Search (DF-PN): A more sophisticated variant that performs a depth-first traversal while maintaining proof number thresholds. It uses iterative deepening on the proof numbers themselves, allowing it to operate within strict memory limits. DF-PN is the modern standard for high-performance game-solving programs, as it dramatically reduces the memory footprint compared to naive best-first PNS.
PROOF-NUMBER SEARCH

Frequently Asked Questions

Proof-Number Search (PNS) is a specialized best-first search algorithm for solving two-player, zero-sum games. These FAQs address its core mechanics, applications, and distinctions from other search methods.

Proof-Number Search (PNS) is a best-first search algorithm designed to solve two-player, perfect-information games by proving whether the current position is a forced win (proved) or a forced loss (disproved). It operates on an AND/OR tree where OR nodes represent positions where it is the player-to-move's turn (trying to prove a win), and AND nodes represent positions where it is the opponent's turn (trying to disprove a win, i.e., prove a loss for the player). The algorithm assigns two numbers to each node: a proof number (pn) representing the minimum number of leaf nodes that must be proven to prove the node, and a disproof number (dn) representing the minimum number of leaf nodes that must be disproven to disprove the node. The search always expands the most-proving node—the leaf node with the smallest proof number (for OR nodes) or disproof number (for AND nodes)—iteratively updating ancestor numbers until the root node is either proven (pn=0) or disproven (dn=0).

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.