A polynomial-time reduction transforms instances of one computational problem into instances of another using a polynomial-time algorithm.
A polynomial-time many-one reduction from a decision problem to a decision problem is a polynomial-time computable function satisfying exactly when .
A total mapping with exactly when , computed by a deterministic logarithmic-work-space transducer with read-only input and write-only output. Such reductions compose, and are used for NL-completeness and P-completeness. The output can be polynomially larger than the work storage.
Given subsets of a finite universe, the decision problem asks whether at most of them cover the universe. It is NP-complete. If , existence of a cover by at most subsets is equivalent to existence of a cover by exactly , by adding unused subsets. The promise that every element occurs in some subset loses no hardness: an uncovered element can be detected in polynomial time and mapped to a fixed negative instance.
// Target: mathematical-optimization.bigb
Assume and . Construct a two-player game with row for and columns . Column pays both players one; column pays when , and otherwise. There is a Nash equilibrium whose row player's support of a mixed strategy has size exactly when rows cover the universe. A uniform mixture on a cover makes column a best response. Conversely, if some element is uncovered by the support, the column player's best responses are uncovered elements and the row player's current payoff is zero. The union promise provides a profitable row deviation. Without the union promise the equivalence is false: a globally uncovered element is a best response against every row mixture.
// Target: mathematical-optimization.bigb
Every NP verifier can be compiled into a polynomial-size Boolean circuit whose inputs encode its certificate, and then into an equisatisfiable conjunctive normal form by a Tseitin transformation. This gives a polynomial-time many-one reduction from every NP language to SAT. Checking a guessed assignment proves membership, so SAT is NP-complete.
Given finitely encoded nonnegative integers and target , the subset sum problem asks whether some subset sums to . Taking equal item weights and profits reduces it to testing whether a 0-1 knapsack problem with capacity attains value .
For indexed occurrences with positive integer weights, let record whether a subset of the first entries has sum . The recurrence chooses whether the last occurrence is absent or present: , with an out-of-range term false. Initialize only sum zero true. Descending one-dimensional updates prevent reusing the current occurrence. Time is for target and space ; positivity permits immediate rejection above the total. With weights bounded by , the total is at most , making the bound polynomial in .
A finite set of positive integers such that nonempty disjoint sets contained in have different sums, and the larger subset has the larger sum when their sizes differ. For , the size condition is equivalent to for : the left side is the smallest possible sum of elements and the right side the largest sum of elements.
The Boolean satisfiability problem asks whether a Boolean formula has an assignment making it true. A complete assignment is a Boolean valuation: it gives every Boolean variable a truth value, consistently at all occurrences. A satisfying assignment, also called a model of a Boolean formula, makes the entire Boolean formula true. A solver's answer
SAT asserts that at least one satisfying assignment exists; UNSAT asserts that the input is an unsatisfiable Boolean formula. These are statements about existence, rather than the truth value under one particular Boolean valuation.For conjunctive normal form, or CNF, writeEach Boolean literal is a Boolean variable or its logical negation. Each Boolean clause uses inclusive logical disjunction: one true Boolean literal suffices. The outer logical conjunction requires every Boolean clause to succeed under the same Boolean valuation. Choosing a different Boolean valuation for each Boolean clause would answer a different question.
Consider the original three-Boolean variable exampleAt the Boolean valuation , the Boolean literals in have values , those in have values , and those in have values . Every Boolean clause therefore has truth value one, so has truth value one: this is a satisfying assignment.
An original satisfying assignment evaluated through Boolean literals, three Boolean clauses, and their logical conjunction
. Details. The complete truth table has Boolean valuations. Exactly two are satisfying assignments: and . In particular, satisfies the first two Boolean clauses but falsifies the third, so satisfying most Boolean clauses does not suffice for SAT. That different objective belongs to maximum satisfiability.
All eight Boolean valuations of the original CNF example, with its two satisfying assignments highlighted
. Details. A short proof of completeness avoids listing all eight rows. If , the Boolean clause forces , after which forces ; is already true. If , forces , after which forces ; is already true. These two cases exhaust the truth values of and produce precisely the two satisfying assignments above.
Verifying a satisfying assignment and finding a satisfying assignment are different tasks. Given a candidate, evaluate the Boolean formula once; finding a candidate requires choosing compatible truth values across all its Boolean clauses. The Cook-Levin theorem says that general SAT is NP-complete, even though a proposed satisfying assignment is efficiently checkable. Its proof encodes a bounded nondeterministic computation as a Boolean formula whose satisfying assignments describe accepting computations. Stephen A. Cook's 1971 paper established this connection between computational complexity theory and propositional logic.[ref]
The Complexity of Theorem-Proving Procedures by Stephen A. Cook. The Complexity of Theorem-Proving Procedures by Stephen A. Cook, 1971, §1, Theorem 1 and proof, pp. 2–3 of the revision-3 transcription: CNF encodes accepting computations
A concrete use is checking finite configuration rules. Let mean that an optional feature is enabled, that a fallback is selected, and that the feature's required component is installed. Require a feature or fallback, require the component whenever the feature is enabled, and forbid using the fallback with that component. Logical implication rewrites the second rule as ; De Morgan's laws rewrite the third rule as . Their logical conjunction is exactly , so its two satisfying assignments give the two allowed configurations. The usefulness of SAT lies in expressing local rules uniformly while demanding one globally consistent Boolean valuation. The conclusion concerns exactly these encoded rules.
An algorithm or software system that decides whether a Boolean formula has a satisfying assignment, usually returning one when it exists. Unit propagation and clause learning are important mechanisms in modern SAT solvers. A reduction must be correct and its representation costs counted before the performance of the downstream SAT solver is relevant.
Deriving additional Boolean clauses implied by the original Boolean formula, usually after analyzing a conflict in search. A learned Boolean clause excludes a failed combination of choices on subsequent branches without removing any satisfying assignment.
If all but one literal of a Boolean clause are false under a partial Boolean valuation, the remaining literal must be true in any extension satisfying the clause. Repeatedly make such forced assignments, remove satisfied Boolean clauses and remove false literals from the others. An empty Boolean clause proves that the current partial Boolean valuation has no satisfying extension. This is sound because every step is forced by an original or already implied Boolean clause; it is not by itself a complete SAT decision procedure.
A restriction requiring exactly one member of a set of Boolean variables to be true. A direct conjunctive normal form encoding combines one at-least-one Boolean clause, , with at-most-one Boolean clauses, for . The first supplies existence and the second supplies uniqueness. For , the empty at-least-one Boolean clause correctly makes the condition unsatisfiable.
A satisfying assignment is a complete Boolean valuation for which a Boolean formula has truth value one, written . The notation describes a relation between the Boolean valuation and the Boolean formula. For the example in Boolean satisfiability problem, is a model of a Boolean formula , whereas is not. SAT asks for existence of at least one satisfying assignment, rather than for every Boolean valuation to work; the latter condition makes a tautology.
For each , a propositional formula over specified variables can have exactly satisfying assignments and length . For , interpret a Boolean valuation as the binary number and test whether it is less than .
For every position with , use a conjunction asserting that all earlier bits equal and , leaving later bits unrestricted. Take the disjunction of these terms. Each satisfying assignment has a unique first differing position, so the terms are disjoint, and their counts sum to . Their combined length is . Use logical falsity and logical truth at the two endpoints. The count is over all variables, including those absent from an individual term or from the whole formula.
For a CNF input with Boolean variables, Boolean clauses, and Boolean literal occurrences, first check that the supplied Boolean valuation gives each input Boolean variable exactly one truth value. Evaluate each Boolean literal by lookup or logical negation, each Boolean clause by logical disjunction, and the Boolean formula by logical conjunction. Indexed Boolean variables and constant-cost lookups give an operation count; with a finite binary string encoding the check still takes polynomial time. Thus a satisfying assignment is a certificate in computational complexity for SAT, proving that SAT belongs to NP. Finding it by exhaustive checking can require candidate Boolean valuations; this enumeration cost is not a lower bound on every possible SAT algorithm.[ref]
CS 252, Lecture 8: Constraint Satisfaction Problems (Carnegie Mellon University). CS 252, Lecture 8: Constraint Satisfaction Problems, p. 3, §3 opening paragraph: assignments as certificates and membership in NP
An unsatisfiable Boolean formula has no satisfying assignment. Forthe Boolean valuation falsifies the first Boolean clause, and falsifies the second. Both possible truth values fail, proving
UNSAT. Each Boolean clause alone has a satisfying assignment, but their logical conjunction does not: compatibility is the central issue. By contrast, finding just one failed Boolean valuation for a general Boolean formula only rejects that candidate. Finding one successful Boolean valuation proves SAT; proving UNSAT requires excluding every candidate, possibly with a compact argument rather than a full truth table.A partial Boolean assignment gives truth values to some of a Boolean formula's Boolean variables. An extension is a complete Boolean valuation agreeing on the assigned Boolean variables. In CNF, a Boolean clause containing a true assigned Boolean literal is already satisfied; a Boolean clause whose every Boolean literal is assigned false rules out all extensions. A Boolean clause with no true assigned Boolean literal and at least one unassigned Boolean variable is unresolved. An unresolved Boolean clause need not have a compatible extension with the other Boolean clauses.
For in Boolean satisfiability problem, setting already falsifies , so both choices of can be discarded. Setting only leaves unresolved and forces if a satisfying assignment is to survive; then forces . Branching on an unassigned Boolean variable into its two truth values and discarding branches with a false Boolean clause is sound: every satisfying assignment follows one branch and cannot extend a false Boolean clause. If all branches are eliminated, the original Boolean formula is an unsatisfiable Boolean formula.
2-satisfiability restricts SAT to CNF in which each Boolean clause has at most two Boolean literals. The example in Boolean satisfiability problem is therefore a 2-SAT instance. Unlike general SAT and 3-SAT, 2-SAT has a polynomial-time algorithm; its tractability concerns finding a satisfying assignment or deciding that none exists, not merely checking a candidate. 3-SAT allows up to three Boolean literals per Boolean clause and is NP-complete, even though it includes many individually easy instances such as this one.[ref]
The key logical equivalence iswhere are Boolean literals. It expresses a two-Boolean literal Boolean clause as two logical implications. Representing these logical implications as edges in a directed graph gives a route to the polynomial-time algorithm. In the example, says both and : enabling the feature requires its component, and an absent component excludes the feature.
Encode each truth value by . A positive Boolean literal has value and its negation has value . The sum of literal values in a clause is at least one exactly when that clause is true. Thus the displayed inequalities, with objective zero, express Boolean satisfiability as a binary integer programming feasibility problem. For maximum satisfiability, introduce with and maximize . False clauses force zero indicators; true clauses permit indicators one, and maximization selects all of them. Hence the optimal objective equals the maximum number of true clauses.
Maximum satisfiability asks for a truth assignment maximizing the number of true clauses of a conjunctive normal form formula. The Boolean satisfiability problem asks whether all its clauses can be made true. Binary clause indicators give an integer programming formulation, and the literal-frequency greedy approximation for MAX-SAT guarantees at least half the optimum. Counts of clauses, rather than multiplicities of repeated literals within one clause, are relevant to this objective.
In the residual unsatisfied formula, choose a Boolean literal contained in the largest number of clauses and make it true. Its opposite occurs in at most clauses, since it too was an eligible literal. The step permanently satisfies clauses; only clauses containing the opposite can become empty, so it loses at most clauses. Delete satisfied clauses and false literals and repeat. No satisfied clause or newly empty clause is counted twice. Summing gives total lost nonempty clauses at most total satisfied clauses . All initially nonempty clauses are eventually in one of these classes, so . Initial empty clauses can never be satisfied and are excluded from . This proves the approximation algorithm guarantee even with tautological clauses or repeated literals.
Satisfiability of conjunctive normal form formulas whose clauses have at most two unnegated variables. It is NP-complete: binary AND/OR and unary NOT gate equivalences in a Tseitin transformation already satisfy that restriction. Clauses may contain arbitrarily many negative literals; the total clause width is not restricted to two.
Maximum 2-satisfiability asks for an assignment satisfying as many clause occurrences as possible when every nonempty clause has at most two literals. Occurrences are counted even when a clause is repeated. Its decision problem is NP-complete by the seven-clause gadget for MAX-2SAT, while the method of conditional probabilities gives a polynomial-time half approximation.
When each variable appears in at most one normalized singleton clause, satisfy that favored literal with probability and choose independent variables. Every proper binary clause is then satisfied with probability at least , and every singleton with probability . Maximize the common lower bound by , giving the reciprocal of the golden ratio. The method of conditional probabilities derandomizes the construction, obtaining approximation ratio . Tautologies are harmless; the singleton restriction must be applied after removing repeated literals within clauses.
A three-literal disjunction can be represented by ten unit or two-literal clause occurrences with one fresh auxiliary variable. If the number of true input literals is zero, the best auxiliary choice satisfies six; for , the best count is seven. Applying separate gadgets to all clauses of a 3-SAT instance gives target seven times the original clause count, proving NP-completeness of the decision form of MAX-2SAT. The local counting argument is essential: no gadget may exceed seven and compensate for an unsatisfied input clause.
A Boolean formula is a finite expression built from Boolean variables and Boolean operations, equivalently a propositional formula with two-valued semantics. A Boolean valuation determines its truth value. In , logical negation acts only on , and the outer logical conjunction combines with . Occurrences of the same Boolean variable share one truth value. The Boolean satisfiability problem asks whether some Boolean valuation makes the Boolean formula true.
A Boolean formula is in disjunctive normal form when it is a disjunction of conjunctions of Boolean literals. Width bounds the number of literals in each conjunction, not the number of conjunctions. A depth- decision tree gives such a formula of width at most by taking the disjunction of its accepting leaf conditions; rejecting leaves give the dual conjunctive normal form.
A Boolean formula is in conjunctive normal form when it is a logical conjunction of Boolean clauses. It is true precisely when every Boolean clause is true under the same Boolean valuation; an empty logical conjunction is true. For example, has two Boolean clauses with widths two and one. Width counts Boolean literal occurrences within a Boolean clause, whereas the Boolean clause count counts the conjuncts. 2-SAT bounds width by two, and 3-SAT bounds width by three. A Boolean formula with an empty Boolean clause is an unsatisfiable Boolean formula.
Introduce a Boolean variable for each gate output and impose its equivalence to the gate's input function with a constant number of clauses. A final unit clause forces acceptance. For a bounded-fan-in Boolean circuit, the formula size is linear in the gate count and it is satisfiable exactly when some input makes the Boolean circuit output one. Auxiliary variables extend the satisfying assignments; this is equisatisfiability, not equality as functions of the enlarged variable set.
A Boolean clause is an expression formed from Boolean literals, true when at least one Boolean literal is true. The empty Boolean clause is false. Repeating a Boolean literal does not change the truth value. A CNF Boolean formula is a logical conjunction of these Boolean clauses.
For , the only failing pair is : its two Boolean literals then both have truth value zero. The one-Boolean literal Boolean clause requires . A Boolean clause containing both and is a tautology, since one of those Boolean literals is true under every Boolean valuation. These observations separate Boolean clause satisfaction from the simultaneous satisfaction required by SAT.
A Boolean literal is a Boolean variable or its logical negation . The two Boolean literals have opposite truth values: a Boolean valuation gives when false and true are encoded as zero and one. Thus makes the positive Boolean literal false and the negative Boolean literal true. A Boolean clause combines Boolean literals, and a Boolean-pair colouring gadget represents a Boolean variable and its logical negation by two vertices with opposite Boolean colours.
A Boolean variable takes one of two truth values, false or true, encoded as zero or one. It is an input to a Boolean formula; a Boolean literal uses the Boolean variable either positively or with logical negation. A Boolean valuation assigns one truth value to each distinct Boolean variable, so three distinct Boolean variables give eight possible complete assignments regardless of how often each appears.
3-SAT is the Boolean satisfiability problem restricted to Boolean formulas in conjunctive normal form with at most three Boolean literals per Boolean clause. It is NP-complete. A nonempty short Boolean clause can be padded to three positions by repeating a Boolean literal, without changing satisfiability.
A Horn clause is a disjunction of literals containing at most one positive literal. It can be read as an implication whose antecedent is a conjunction of variables.
Horn-SAT asks whether a conjunction of Horn clauses is satisfiable.
The Horn-SAT forward-chaining algorithm starts with every variable false and repeatedly makes the conclusion of any enabled implication true. It reports failure if it enables a clause with no positive conclusion; otherwise the fixed point is the least satisfying assignment.
Quadratic-equation satisfiability over asks whether a finite system of polynomial equations of degree at most two over the finite field has a common solution.
Articles by others on the same topic
Polynomial-time reduction is a concept in computational complexity theory that describes a way to show that one problem can be transformed into another problem in polynomial time. It serves as a fundamental technique for classifying the difficulty of computational problems and understanding their relationships. ### Key Concepts: 1. **Problem Mapping**: In polynomial-time reduction, we have two problems, let's say Problem A and Problem B. We want to show that Problem A is at most as hard as Problem B.

