For the metric travelling salesman problem, a tour is a polynomial-size complexity certificate: list the vertices in cyclic visiting order. In polynomial time verify that every vertex occurs exactly once, add the encoded integer edge costs and compare the sum with the threshold. The certificate has bits, and addition uses a number of bits polynomial in the input length. If validity of the metric input is not treated as a promise, nonnegativity, symmetry and all triangle inequalities can also be checked in polynomial time. Therefore the decision problem belongs to NP.
An evaluation algorithm immediately decides a threshold instance by computing the optimum and comparing it with . Conversely, suppose there is a polynomial-time decision algorithm. The optimum is an integer in , where is the largest edge cost; any fixed cyclic ordering gives the upper bound. Binary search on this interval using threshold queries finds the exact minimum. It makes queries, and every queried threshold has polynomial encoding length. Thus the time is polynomial in the bit length, even when is numerically large. Zero-cost and trivial small instances can be handled directly. Consequently
This concerns the optimum value; constructing an optimal tour is the separate optimization task.
For the hardness reduction, start with an undirected graph on vertices and form the complete graph with costs
These costs satisfy the triangle inequality, since every direct cost is at most two and every two-edge path costs at least two. Set the threshold to . Every tour has exactly edges, each costing at least one. Hence it has cost at most precisely when all its edges came from , which is precisely the existence of a Hamiltonian cycle in . The construction and threshold encoding are polynomial-time. Thus the assumed NP-completeness of the Hamiltonian circuit problem gives NP-hardness of metric TSP; together with its NP membership this proves NP-completeness of metric TSP decision.
For the approximation, compute a minimum spanning tree . Deleting any one edge of an optimal tour leaves a spanning tree, so nonnegative costs imply
Double every tree edge. The resulting connected multigraph has even degrees and hence an Euler circuit, of cost . Traverse it and skip previously visited vertices, except for the final return to the start. Each skip replaces a path by its direct edge; repeated use of the triangle inequality shows that no replacement increases cost. The result is a tour visiting every vertex exactly once and satisfying
The Euler traversal and shortcutting take polynomial time, so the assumed polynomial-time MST routine supplies the requested polynomial-time algorithm. This is the double-tree approximation for metric TSP. In the relative-error convention, when the optimum is positive, explaining the printed term “1-approximation”; in the multiplicative convention it is a factor-two approximation. If the optimum is zero, the same bound forces the returned tour to have zero cost as well.
Introduce slack variables . The initial simplex dictionary is
All six variables are nonnegative. The given rule is the Dantzig pivot rule: select the nonbasic variable with the largest positive reduced cost. It applies to slack variables too once they become nonbasic. At each step the simplex ratio test limits how far that entering variable can increase before a basic variable reaches zero.
The successive objective rows of the simplex dictionary, expressed in the current nonbasic variables, are
These rows identify each entering variable unambiguously. Performing the corresponding simplex ratio tests gives the complete pivot sequence:
For example, after pivot two the dictionary has , and . Although increasing improves the objective at rate four, reaches zero first at , giving pivot three. After pivot four, and ; the upper bound gives pivot five.
In the final objective row every reduced cost is nonpositive. Since , it also directly certifies the upper bound , attained only when all three vanish. Thus
A greatest improvement pivot rule uses the total feasible increase in the objective, rather than its increase per unit of the entering variable. At the origin, the three candidate edge moves have improvements , and . It therefore brings into the simplex basis first, with leaving, and immediately reaches the optimum. This rule solves this instance in one pivot.
This is a three-dimensional Klee-Minty cube example: the specified Dantzig pivot rule visits every vertex before reaching the optimum. Higher-dimensional versions require pivots, so that rule has exponential worst-case running time despite its strong practical performance. Each pivot requires only polynomially many arithmetic operations. An anti-cycling rule such as the Bland pivoting rule ensures finite termination; without one, degenerate pivots can cycle. A crude terminating bound is the number of possible bases, for constraints and original variables, which can be exponential. This does not show that every conceivable pivot rule must take exponential time. Linear programming itself has polynomial-time algorithms, including the ellipsoid method and suitable interior-point methods.
For decision problems, the usual meaning of “no harder” is a polynomial-time reduction: if there is a polynomial-time computable map taking each instance of to an instance of such that is a yes-instance exactly when is. A polynomial-time algorithm for would then solve in polynomial time. A problem is NP-hard if every problem in NP admits such a reduction to it.
For a zero-sum game with rational payoff matrix , the row player can calculate its value by linear programming:
The minimax theorem identifies this optimum with the game value. Rational linear programming has polynomial-time algorithms, and an optimal rational value can be compared exactly with rational in polynomial time in the binary input length. Thus the decision problem belongs to P. If it were NP-hard, composing the reductions with this algorithm would put every problem in NP in P, contradicting the assumed separation. Therefore
The finite rational encoding is part of the computational model; arbitrary real inputs without an encoding would not define the same complexity question.
For the set cover reduction to equilibrium support, first take and assume every element belongs to some subset. Suppose rows cover . Let player 1 use the uniform mixed strategy on these rows and let player 2 play column . The row player's payoff is one for every row, so any row mixture is a best response to column . If denotes the probability that a random supported row covers element , then , and player 2's payoff from column is
Column also pays one. It is therefore a best response, giving a Nash equilibrium whose row-player support of a mixed strategy contains exactly rows.
Conversely, suppose an equilibrium has row support of size , and some element is not covered by . For that column , so player 2 can earn . This is the largest possible column payoff, and it is attained exactly at columns corresponding to elements uncovered by . The column player's mixed strategy must consequently put all its probability on these columns, with none on column . Every currently supported row gives player 1 payoff zero. Choose any positive-probability column ; because , there is some row containing . Deviating to gives strictly positive expected payoff, contradicting the best response condition. Thus must be a cover, proving
under the stated union and conditions.
The printed formulation omits both conditions. For , its payoffs contain division by zero. Without the union condition its claimed implication is false: take , , and . No selection covers , but any row mixture supported on two rows, paired with pure column , is a Nash equilibrium. The row player always gets zero, and column is the column player's strictly optimal choice with payoff two. This gives an explicit counterexample to the unrestricted wording.
These restrictions do not weaken the complexity conclusion. The set cover problem remains NP-complete when every element occurs in some subset and : globally uncovered elements and the easy cases can be recognized and replaced by fixed promised yes- or no-instances. A cover by at most subsets can be padded to exactly . The constructed game has polynomial size, so deciding whether a Nash equilibrium of the specified support size exists is NP-hard. Computing a complete description of all equilibria would resolve this question and hence is at least this difficult. In addition, the equilibrium set may be infinite; a complete output must then describe families rather than list individual points. There is a finite representation by feasible pairs of supports and their associated strategy polytopes, but there are exponentially many support pairs to consider. This reduction concerns locating specified supports or describing all equilibria, rather than finding one unrestricted equilibrium.
A decision problem belongs to NP if every yes-instance has a polynomial-length certificate verifiable by a deterministic polynomial-time algorithm. It is NP-hard if every problem in NP has a polynomial-time many-one reduction to it. It is NP-complete if it is both NP-hard and in NP.
A polynomial-time algorithm for any NP-complete problem would therefore give one for every problem in NP, implying . Conversely, if , all NP-complete decision problems have polynomial-time algorithms. NP-completeness does not unconditionally prove that polynomial-time solution is impossible. Optimization problems such as minimum tour cost are described as NP-hard, while their threshold decision versions can be NP-complete.
For a minimization problem with nonnegative costs, an approximation algorithm of ratio is a polynomial-time algorithm returning a feasible solution of cost at most times the optimum on every instance. For maximization, one often uses with value at least ; an equivalent convention uses ratios at most one. The metric-tour question uses the minimization convention.
Let the bipartite graph have parts . Add a source , a sink , capacity-one edges for and for , and capacity on each original edge directed . Use the max-flow min-cut theorem: maximum flow value equals minimum cut capacity. Also use Integrality of the Ford-Fulkerson algorithm: integral capacities admit an integral maximum flow, found by integral augmenting paths.
An integral flow selects a matching in a graph, because each left and right vertex carries at most one unit. Conversely every matching gives a unit flow along its selected paths. Hence maximum flow value equals maximum matching cardinality.
A minimum cut has capacity at most , whereas crossing even one original edge would cost . For its source side , no edge of the original graph runs from to . Therefore
is a vertex cover, and its cardinality is exactly the cut capacity. Conversely, given any cover , use . No original edge crosses this cut, because both its endpoints would otherwise be outside the cover; its capacity is . Thus minimum cut capacity equals minimum cover size, proving Kőnig's theorem for bipartite matching:
For the algorithm, repeatedly find augmenting paths in the residual network, then take to be the vertices reachable from . Each integral augmentation increases flow by at least one; the total value is at most . Each reachability search takes time, so this procedure takes time. The network uses only polynomially many edges and integer capacities, yielding the requested polynomial-time algorithm and an explicit cover.
Polynomial-time reduction Created 2026-10-03 Updated 2026-11-05
A polynomial-time reduction uses a solver for one computational problem to solve another with polynomial overhead, while preserving the required answer. Efficiently transforming data alone is insufficient: the transformation must come with a correctness argument connecting the two tasks.
For a polynomial-time many-one reduction between decision problems , one function satisfies
A polynomial-time Turing reduction instead permits adaptively chosen queries to a solver for . Writing the queries and processing their answers count toward the reduction's resource bound. These are different reduction conventions and should be named explicitly.
If has a polynomial-time algorithm, either such reduction supplies one for : query lengths and the total number of queries are polynomially bounded, so replacing each solver call preserves a polynomial total running time. Conversely, a reduction from a hard helps establish a lower bound on .
A polynomial-time Turing reduction from a decision problem to a decision problem is a deterministic algorithm deciding membership in in polynomial time when allowed to query whether strings belong to . An oracle Turing machine models each query answer as a single oracle operation, while writing the query and using the answer still costs time. Queries may depend on earlier answers.
For example, the complement of reduces to by asking one membership question and reversing its answer. This is a Turing reduction, regardless of whether there is a simple many-one reduction with the same effect. A polynomial-time many-one reduction instead computes one transformed instance whose answer is used unchanged.
If reduces to this way and has a polynomial-time algorithm, then does too: substitute that algorithm at each oracle call. Polynomially many queries of polynomial length keep the total cost polynomial. Completeness claims must specify which reduction is intended because adaptive access is more permissive.
Automated planning with ground actions that are always applicable because their precondition sets are empty. Delete effects are still permitted, so taking the union of all add effects does not decide reachability. With a positive conjunctive goal, the last-achiever algorithm for precondition-free planning gives a polynomial-time algorithm.
Let be a nonzero multivariate polynomial over a field , with total degree at most . Choose a nonempty finite set . For independent random variables , each with a uniform distribution on a finite set on , the Schwartz-Zippel lemma gives
Nonzeroness is essential; the zero polynomial always evaluates to zero. The total degree sums exponents within each monomial, rather than taking their maximum: has total degree five. The field need not be finite, but must be finite. The estimate reduces error only when .[ref]
The proof begins with the root bound for a polynomial. For several variables, write , with . The total degree of is at most . By induction, vanishes with probability at most . Otherwise the remaining univariate polynomial has at most polynomial roots. Adding the two contributions gives .[ref]
The algorithm samples a point, performs exact polynomial evaluation, rejects the identity if the value is nonzero, and otherwise accepts. The lemma bounds false acceptance for every fixed nonzero input. For the polynomial identity testing over a finite field example, has and , so its exact error attains the bound. Numerical near-zero values from floating-point arithmetic do not satisfy this exact algebraic contract. A polynomial-time algorithm claim additionally needs efficient sampling and evaluation, including the bit cost of representing and operating on field elements. Counting field operations alone does not establish that cost.
Razborov–Rudich natural-proofs barrier Created 2026-09-28 Updated 2026-11-05
The Razborov–Rudich natural-proofs barrier connects lower bounds in circuit complexity with the security of pseudorandom function families. Suppose a property of Boolean functions is constructive, large and useful against a class containing the relevant pseudorandom function family.
Query all inputs of a candidate Boolean function, then run the property's membership test on its truth table. Constructivity makes this take time. Largeness gives acceptance probability at least for a uniformly random Boolean function. Usefulness gives rejection for all functions in the chosen small-circuit family at sufficiently large lengths. The property therefore supplies a statistical distinguisher.
A security assumption must cover that running time and distinguishing advantage, at the chosen relation between input length and key length. Security only against polynomial-time algorithms in does not cover a full truth table test. Razborov and Rudich use a stronger quantitative hardness assumption to obtain the barrier against P/poly. The conclusion restricts a form of lower-bound proof under the assumption; it does not settle whether P equals NP.[ref]
Search-to-decision reduction Created 2026-09-24 Updated 2026-11-05
A search-to-decision reduction reconstructs a valid witness by querying a procedure that answers only whether an appropriate witness exists. The reduction must specify how it restricts the original task after each answer and how many queries it uses.
For Boolean satisfiability, first ask whether the propositional formula is satisfiable. If it is, consider its Boolean variables in order. Tentatively fix the next variable to zero and ask whether a satisfying extension remains. Keep zero after a positive answer; after a negative answer, fix it to one. The previously satisfiable partial assignment must have an extension using one of those values, so this step preserves existence of an extension.
After all variables are fixed, the resulting assignment is a witness. There are at most decision queries, and each restricted propositional formula has size bounded by the original size. Thus a polynomial-time algorithm for deciding Boolean satisfiability would also give a polynomial-time algorithm for finding a satisfying assignment. The procedure proves this relation for the specified task rather than assuming arbitrary search specifications have the same reduction.