{
  "id": "np-completeness",
  "title": "NP-completeness",
  "lang": "en",
  "source_lang": "en",
  "summary": "NP-completeness identifies decision problems that have efficiently verifiable solutions and are at least as hard as every problem in NP.",
  "category": "computer-science",
  "subcategory": "algorithms-theory",
  "type": "concept",
  "aliases": [
    "NP completeness",
    "nondeterministic polynomial-time completeness"
  ],
  "generated_at": "2026-11-03",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/np-completeness/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/np-completeness/",
      "json": "https://aiwiki.page/zh/np-completeness.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "NP-completeness is a classification in computational complexity that identifies the hardest decision problems within NP, the class of problems whose yes-instances have certificates verifiable in polynomial time. A problem is NP-complete if it belongs to NP and every problem in NP can be transformed into it by a polynomial-time reduction. Consequently, a polynomial-time algorithm for any one NP-complete problem would provide polynomial-time algorithms for all problems in NP.\n\nThe concept connects problems that appear unrelated: satisfying logical formulas, coloring graphs, selecting compatible tasks, designing routes, and solving certain scheduling and allocation problems. Its importance is not that it proves these problems impossible to solve, but that it establishes a precise relationship among their worst-case computational difficulties. Whether any NP-complete problem has a polynomial-time algorithm is equivalent to the unresolved P versus NP problem.\n\nThe theory originated in the early 1970s through work by Stephen Cook, Leonid Levin, and Richard Karp. It now provides both a mathematical foundation for complexity theory and a practical framework for understanding why some computational tasks resist general efficient solutions, while still admitting useful exact algorithms, approximation methods, and algorithms for restricted instances."
    },
    {
      "heading": "Formal definition and computational foundations",
      "text": "Complexity theory usually represents a decision problem as a language \\(L\\subseteq\\Sigma^*\\), where \\(\\Sigma\\) is a finite alphabet and membership in \\(L\\) means that the answer to the encoded instance is yes. The input size is the length of this encoding, not necessarily the magnitude of the numbers or the number of real-world objects mentioned in the problem. A graph, for example, may be encoded by an adjacency matrix or an edge list; an integer may be written in binary or unary. Such choices matter whenever their lengths are not polynomially related.\n\nThe class P consists of languages decidable by a deterministic Turing machine in polynomial time. Thus, for some constant \\(c\\), the running time is bounded by a quantity such as \\(O(n^c)\\), where \\(n\\) is the input length. The class NP can be defined through polynomial-time verification. A language \\(L\\) is in NP if there are a deterministic polynomial-time verifier \\(V\\) and a polynomial \\(p\\) such that\n\n\\[x\\in L \\quad\\Longleftrightarrow\\quad \\exists y,\\ |y|\\leq p(|x|)\\text{ and }V(x,y)=1.\\]\n\nThe string \\(y\\) is a certificate, also called a witness. For the Boolean satisfiability problem, a satisfying assignment is a certificate: evaluating the formula on that assignment takes time polynomial in the formula’s length. The verifier need not find the assignment. It only checks one supplied to it. For a no-instance, no certificate within the permitted length can cause the verifier to accept.\n\nEquivalently, NP is the class of languages accepted by a nondeterministic polynomial-time Turing machine. Nondeterminism is a mathematical model in which a machine may have several possible next steps, and acceptance requires at least one accepting computation. It is not ordinary randomness, and the letters NP do not stand for “non-polynomial.” Every problem in P is in NP because a polynomial-time decision procedure can act as a verifier that ignores its certificate.\n\nUnder the standard definition, a language \\(B\\) is NP-complete when two conditions hold: \\(B\\in\\mathrm{NP}\\), and every language \\(A\\in\\mathrm{NP}\\) has a polynomial-time many-one reduction to \\(B\\). The second condition alone is called NP-hardness. An NP-hard problem need not belong to NP, need not be a decision problem, and can even be undecidable. NP-completeness, by contrast, always includes the requirement of polynomially verifiable yes-certificates. Standard NP-complete problems are therefore decidable: exhaustive enumeration of polynomial-length certificates already gives a finite, generally exponential-time decision method."
    },
    {
      "heading": "Polynomial-time reductions and the meaning of completeness",
      "text": "A polynomial-time many-one reduction from a language \\(A\\) to a language \\(B\\) is a polynomial-time computable function \\(f\\) satisfying\n\n\\[x\\in A \\quad\\Longleftrightarrow\\quad f(x)\\in B.\\]\n\nThis relationship is written \\(A\\leq_m^p B\\). The function converts each instance of \\(A\\) into one instance of \\(B\\), preserving both yes-answers and no-answers. If \\(B\\) has an efficient decision algorithm, an algorithm for \\(A\\) can first compute \\(f(x)\\) and then run that decision algorithm.\n\nPolynomial time is essential in two places. First, the transformation itself must not consume the computational resources whose absence the reduction is intended to demonstrate. Second, its output has polynomial length, since a polynomial-time machine cannot explicitly write an exponentially long output. These conditions ensure that composing the reduction with a polynomial-time algorithm for \\(B\\) still yields a polynomial-time algorithm for \\(A\\).\n\nReductions are transitive. If \\(A\\leq_m^p B\\) and \\(B\\leq_m^p C\\), then \\(A\\leq_m^p C\\). This gives the standard method for proving a new problem NP-complete. Membership in NP is established by describing an appropriate certificate and verifier. NP-hardness is established by reducing a previously known NP-complete problem to the new problem. The two parts are logically separate: a convincing hardness construction does not automatically establish membership in NP.\n\nThe direction of the reduction is crucial. To show that a problem \\(B\\) is hard, an already hard problem must be transformed into \\(B\\), not the reverse. A reduction from \\(B\\) to satisfiability may show that satisfiability can serve as a solver for \\(B\\), but it does not by itself show that \\(B\\) is NP-hard. Many easy problems also reduce to satisfiability.\n\nOther reduction notions exist. A polynomial-time Turing reduction allows an algorithm to make multiple queries to a solver for another problem, possibly choosing later queries based on earlier answers. Logarithmic-space reductions impose a more restrictive resource bound on the transformation. Unless otherwise specified, NP-completeness normally refers to polynomial-time many-one reductions.\n\nCompleteness identifies equivalence at the level of polynomial-time solvability, not identical running times. A reduction that enlarges an input from size \\(n\\) to size \\(n^4\\) preserves polynomial-time solvability but may substantially change the usefulness of an exponential-time algorithm. Consequently, the standard theory does not imply that every NP-complete problem has the same best exponential running time, practical difficulty, or approximation behavior."
    },
    {
      "heading": "Historical development and the Cook–Levin theorem",
      "text": "The conceptual background of NP-completeness arose from the development of formal models of computation and resource-bounded complexity. Alan Turing and other researchers established the foundations of computability in the 1930s. Later work distinguished computable problems according to the time and memory required to solve them. During the 1960s, polynomial time became a central formal criterion for feasible computation, notably in work by Alan Cobham and Jack Edmonds.\n\nIn 1971, Stephen Cook published “The Complexity of Theorem-Proving Procedures,” establishing the result now central to the Cook–Levin theorem. Leonid Levin independently developed closely related completeness results, published in 1973, in a framework emphasizing search problems. In its standard modern formulation, the theorem states that Boolean satisfiability is NP-complete.\n\nThe central construction represents a bounded computation by a Boolean formula. Suppose a nondeterministic machine runs for at most \\(T(n)\\) steps, where \\(T\\) is polynomial. Its computation can be described by a tableau: one axis represents time, and the other represents tape positions. Boolean variables encode tape symbols, machine states, and the location of the read-write head. Because at most polynomially many tape cells can be visited during polynomially many steps, the tableau has polynomial size.\n\nConstraints enforce four requirements: each position has a legal description, the first row encodes the input and initial configuration, successive rows obey the machine’s transition rules, and an accepting configuration occurs. Transition rules are local: whether a cell’s description can change depends only on a bounded neighborhood in the previous configuration. This locality permits the constraints to be expressed by a Boolean formula of polynomial size. The formula is satisfiable exactly when the machine has an accepting computation.\n\nThe significance is universal. The formula is not designed for one particular combinatorial task; it encodes the verifier or nondeterministic machine for any problem in NP. Satisfiability therefore acts as a common computational representation for the whole class.\n\nRichard Karp’s 1972 paper “Reducibility Among Combinatorial Problems” extended the approach by proving a collection of 21 problems complete through reductions. These included graph and set problems as well as integer programming and scheduling-related formulations. The resulting network of reductions demonstrated that completeness was widespread rather than a peculiarity of logical formulas. Michael Garey and David Johnson’s 1979 book Computers and Intractability subsequently organized a large body of NP-completeness results and helped establish the theory as a standard tool in algorithm analysis."
    },
    {
      "heading": "A worked reduction: from satisfiability to clique",
      "text": "A standard example illustrates how a logical problem becomes a graph problem. In 3-satisfiability, or 3-SAT, the input is a Boolean formula in conjunctive normal form with three literals in each clause. A literal is a variable or its negation. The question is whether some truth assignment makes every clause true. General satisfiability reduces to this form using auxiliary variables; the resulting formula preserves satisfiability without requiring an exponential expansion.\n\nFor a formula with clauses \\(C_1,\\ldots,C_m\\), construct an undirected graph with one vertex for every literal occurrence. Vertices associated with the same clause receive no edges between them. Vertices from different clauses are joined precisely when their literals are not contradictory: a vertex labeled \\(x\\) is not joined to one labeled \\(\\neg x\\). Set the target clique size to \\(m\\). A clique is a collection of vertices in which every pair is connected by an edge.\n\nFor example, consider\n\n\\[(x\\lor y\\lor\\neg z) \\land (\\neg x\\lor y\\lor z) \\land (x\\lor\\neg y\\lor z).\\]\n\nThe graph has nine vertices, including separate vertices for repeated occurrences of the same literal. The truth assignment \\(x=y=z=\\mathrm{true}\\) satisfies the formula. Selecting an occurrence of \\(x\\) from the first clause, \\(y\\) from the second, and \\(z\\) from the third produces three pairwise compatible vertices, hence a clique of size three.\n\nThe correctness proof has two directions. If the formula is satisfiable, choose one true literal from every clause. Two selected literals cannot contradict one another because both are true under the same assignment. Their corresponding vertices are therefore pairwise adjacent. Conversely, a clique of size \\(m\\) must contain exactly one vertex from each clause, since it cannot contain two vertices from the same clause. Its selected literals are pairwise noncontradictory, so they can be made simultaneously true and extended to a full assignment. Every clause then contains a selected true literal.\n\nFor a 3-SAT formula, the construction creates \\(3m\\) vertices and at most a quadratic number of edges. It is therefore computable in polynomial time. Since 3-SAT is NP-complete, the reduction establishes the NP-hardness of CLIQUE. Membership in NP follows by checking that the proposed vertices are distinct, meet the target size, and have every required edge.\n\nRelated reductions connect this construction to independent set and vertex cover. A clique in a graph is an independent set in its complement. In any graph, a set is independent exactly when its complementary vertex set is a vertex cover. These relationships transfer decision hardness, although they do not automatically preserve approximation guarantees in the same way."
    },
    {
      "heading": "Representative problems and the importance of exact formulation",
      "text": "NP-complete problems occur across graph theory, logic, scheduling, and discrete optimization. Their classification depends on the precise input, constraints, and question. In graph coloring, deciding whether an arbitrary graph admits a proper coloring with three colors is NP-complete, whereas deciding whether two colors suffice can be done in linear time. When the number of colors is part of the input, the general coloring decision problem is also NP-complete.\n\nThe Hamiltonian cycle problem asks whether a graph contains a cycle visiting every vertex exactly once. A proposed ordering of the vertices provides a polynomially checkable certificate. The traveling salesperson problem has a related decision form: given edge costs and a bound \\(B\\), does a tour exist whose total cost is at most \\(B\\)? With suitably encoded integer or rational costs, this decision problem is NP-complete. Finding a minimum-cost tour is an optimization problem and is ordinarily described as NP-hard, rather than as an NP-complete language.\n\nThe distinction is visible in the relationship with the shortest-path problem. Finding a shortest path between two vertices is polynomial-time solvable under familiar assumptions, including nonnegative edge weights. Requiring a simple path to visit every vertex, however, changes the problem fundamentally. The difference is not that one concerns routes and the other does not; it lies in the global visitation constraint. Longest simple path formulations are likewise hard on general graphs, even though longest paths in directed acyclic graphs can be computed efficiently.\n\nIn integer programming, variables must take integer values. Feasibility for general systems with binary variables is NP-complete, while linear programming over rational-valued variables is polynomial-time solvable. Yet fixing the number of integer variables yields a polynomial-time algorithm in the input length, with a dependence on dimension that is not polynomial in general. Structural restrictions can therefore move a problem out of the general hard setting.\n\nThe constraint satisfaction problem framework makes these distinctions systematic. Variables take values from specified domains, and constraints restrict allowed combinations. Different permitted constraint languages produce different computational problems. Boolean 2-SAT is polynomial-time solvable, whereas 3-SAT is NP-complete. For finite domains with a fixed finite constraint language, the constraint satisfaction dichotomy theorem, proved independently by Andrei Bulatov and Dmitriy Zhuk in 2017, classifies every such problem as either polynomial-time solvable or NP-complete.\n\nThese examples explain why a hardness claim must identify a formal problem rather than a broad application area. “Scheduling is NP-complete” omits essential information about machines, job lengths, precedence constraints, preemption, and the objective. Specific scheduling formulations can be polynomial-time solvable, weakly NP-complete, or strongly NP-complete."
    },
    {
      "heading": "Numerical encoding, pseudopolynomial time, and strong NP-completeness",
      "text": "Numerical problems expose the importance of measuring input length correctly. In the subset sum problem, the input consists of nonnegative integers \\(a_1,\\ldots,a_n\\) and a target \\(T\\), and the question is whether some subset sums exactly to \\(T\\). A standard dynamic programming algorithm records which totals up to \\(T\\) are reachable. Its running time is \\(O(nT)\\), with straightforward implementations using \\(O(T)\\) storage.\n\nThis does not prove polynomial-time solvability for binary-encoded inputs. Writing \\(T\\) in binary requires only \\(O(\\log T)\\) bits, so \\(T\\) can be exponentially larger than its representation. An algorithm polynomial in numerical magnitudes but not necessarily polynomial in their bit lengths is called pseudopolynomial. For instance, iterating a billion times may be linear in the value of a number whose binary representation requires only about 30 bits.\n\nSubset sum and the related partition problem are standard examples of weakly NP-complete numerical problems. Their pseudopolynomial algorithms become polynomial when the relevant numbers are sufficiently bounded or are represented in unary. In unary, a number is encoded by a string whose length is proportional to its magnitude. Binary-to-unary conversion is not a polynomial-time transformation in general, so the two encodings cannot be freely substituted in a complexity argument.\n\nStrong NP-completeness captures hardness that persists even when numerical values are restricted to be polynomially bounded in the combinatorial size of the instance. For standard numerical formulations, the corresponding unary-encoded problem remains NP-complete. This rules out the explanation that hardness arises solely because binary notation compactly represents very large numbers.\n\nA central example is 3-PARTITION. Its input consists of \\(3m\\) positive integers with total sum \\(mB\\), each satisfying\n\n\\[\\frac{B}{4}<a_i<\\frac{B}{2}.\\]\n\nThe question is whether they can be divided into \\(m\\) disjoint groups, each summing to \\(B\\). The bounds force every group to contain exactly three integers. The problem remains NP-complete under polynomial bounds on the numerical values, making it especially useful for proving strong hardness in packing and scheduling.\n\nThe distinction has algorithmic consequences. Assuming \\(P\\ne NP\\), a strongly NP-complete numerical problem cannot have a pseudopolynomial algorithm of the relevant kind, because that algorithm would become polynomial on the bounded-number instances that already establish NP-hardness. By contrast, pseudopolynomial algorithms often provide useful exact methods for weakly NP-complete problems and can sometimes be converted into approximation schemes. The encoding analysis is therefore not merely formal bookkeeping; it identifies which numerical parameters can make an algorithm practical."
    },
    {
      "heading": "Exact algorithms and practical computation",
      "text": "NP-completeness is a worst-case classification, not a claim that every instance requires extensive computation. Assuming \\(P\\ne NP\\), no polynomial-time algorithm solves all instances of an NP-complete problem. It does not follow that every instance is hard, that every input distribution is hard on average, or that exponential-time methods are useless at realistic sizes. Instance structure, constants, preprocessing, and the desired output can dominate practical performance.\n\nExact algorithms frequently improve substantially on naive enumeration. A straightforward algorithm for a Boolean formula with \\(n\\) variables examines all \\(2^n\\) assignments. More sophisticated methods prune large portions of this search space. In satisfiability solving, the Davis–Putnam–Logemann–Loveland procedure, introduced in 1962, combines branching with simplification rules such as unit propagation. Modern conflict-driven clause-learning solvers analyze failed search paths, derive clauses that exclude related failures, and use variable-selection policies and restarts.\n\nFor optimization problems, branch-and-bound maintains the best feasible solution found and bounds the quality achievable in unexplored subproblems. If a subproblem cannot improve the incumbent solution, it is discarded. Integer programming solvers combine such search with linear programming relaxations, cutting planes, presolve transformations, and specialized heuristics. These methods do not remove worst-case hardness, but they can solve instances far larger than an unstructured exhaustive search would permit.\n\nRunning-time bounds also reveal differences hidden by the common NP-complete label. The Held–Karp dynamic programming algorithm solves the traveling salesperson problem in \\(O(n^2 2^n)\\) time, substantially better than enumerating all vertex permutations. Meet-in-the-middle algorithms for subset sum split the input into two groups and combine their subset sums, giving running times around \\(2^{n/2}\\), apart from polynomial factors and implementation-dependent trade-offs. Such improvements can materially change the input sizes that are manageable.\n\nApplications in formal verification, electronic design automation, and planning often generate satisfiability instances with substantial internal structure. Repeated subcircuits, restricted interactions, and strong propagation can make these instances unlike worst-case constructions. Conversely, small but carefully structured instances can defeat otherwise effective solvers. No single instance-size threshold separates easy from hard cases across all formulations.\n\nA further distinction concerns certification of failure. A satisfying assignment is a short certificate of satisfiability, but an unsatisfiable formula has no satisfying assignment to display. Solvers may instead generate independently checkable proofs of unsatisfiability. The size of such proofs depends on the proof system and the instance; polynomial-size proofs for every unsatisfiable formula are not guaranteed by membership of satisfiability in NP."
    },
    {
      "heading": "Approximation and the limits of ordinary NP-completeness",
      "text": "Many applications seek a good feasible solution rather than an exact optimum. An approximation algorithm provides a mathematical guarantee relating its output to the optimum. For a minimization problem, a factor-\\(\\alpha\\) approximation returns a solution of cost at most \\(\\alpha\\) times the optimum, typically with \\(\\alpha\\geq1\\). Maximization guarantees are often expressed as a returned value of at least the optimum divided by \\(\\alpha\\).\n\nOrdinary NP-completeness does not determine approximability. Two NP-hard optimization problems can have very different approximation behavior. Minimum vertex cover has a simple factor-2 approximation: find a maximal matching and select both endpoints of every matched edge. The selected endpoints cover every edge, because an uncovered edge could otherwise extend the matching. Every vertex cover must contain at least one endpoint of each matching edge, so the returned cover has at most twice the optimum size.\n\nThe metric traveling salesperson problem, in which costs are symmetric, nonnegative, and satisfy the triangle inequality, admits Christofides’ factor-\\(3/2\\) approximation, introduced in 1976. Its structure combines a minimum spanning tree, a minimum-weight matching on the odd-degree vertices, and shortcutting of an Eulerian traversal. By contrast, without a metric assumption, a polynomial-time approximation with any fixed constant factor would imply \\(P=NP\\). The decision versions remain NP-complete, but the additional geometric or metric structure changes what efficient approximate computation can achieve.\n\nThe probabilistically checkable proofs theorem supplied a major foundation for proving limits on approximation in the 1990s. One standard formulation characterizes NP using proof verifiers that employ logarithmically many random bits and inspect only a constant number of proof bits. Completeness and soundness conditions distinguish true statements from false ones despite the verifier’s extremely limited inspection.\n\nThrough suitable reductions, this proof-checking viewpoint yields gap problems: yes-instances permit solutions above one quality threshold, while no-instances permit no solution above a lower threshold. An approximation algorithm strong enough to cross the gap would decide an NP-complete problem. Such gap-preserving reductions are more demanding than reductions that merely preserve exact feasibility.\n\nApproximation schemes provide another distinction. A polynomial-time approximation scheme has polynomial running time for every fixed accuracy parameter \\(\\varepsilon>0\\), while a fully polynomial-time approximation scheme is polynomial in both the input length and \\(1/\\varepsilon\\). The standard 0–1 knapsack optimization problem admits the latter. General strong NP-hardness often rules out such schemes under additional standard conditions, including suitably bounded integer objective values, unless \\(P=NP\\). Thus exact hardness, approximation ratios, and dependence on accuracy require separate analysis."
    },
    {
      "heading": "Parameterized complexity and finer running-time hypotheses",
      "text": "Parameterized complexity studies running time in terms of both the total input length \\(n\\) and a selected structural parameter \\(k\\). A problem is fixed-parameter tractable if it can be solved in time\n\n\\[f(k)n^{O(1)},\\]\n\nwhere the polynomial exponent is independent of \\(k\\). The function \\(f\\) may grow rapidly. This framework separates a difficult but small feature of an instance from its potentially large overall size.\n\nVertex cover is a basic example. Given an uncovered edge \\(\\{u,v\\}\\), every vertex cover must contain \\(u\\) or \\(v\\). Branching on those two choices and decreasing the remaining budget produces an algorithm with running time \\(O(2^k\\operatorname{poly}(n))\\). Thus a graph with many vertices can still be tractable when it is known to require only a small cover. This does not contradict NP-completeness because \\(k\\) can grow with the input.\n\nPreprocessing can also be analyzed formally through kernelization: transforming an instance \\((x,k)\\) in polynomial time into an equivalent instance whose total size is bounded by a function of \\(k\\). Vertex cover admits a kernel with at most \\(2k\\) vertices through a linear-programming-based construction. Other problems have no known comparable compression, and conditional lower bounds can rule out polynomial-size kernels under assumptions stronger than merely \\(P\\ne NP\\).\n\nAnother important parameter is treewidth, which measures how closely a graph can be decomposed into overlapping tree-arranged pieces. Many NP-complete graph problems become solvable by dynamic programming on a supplied tree decomposition, with exponential dependence on its width but polynomial dependence on graph size. This explains why sparse, locally organized instances may be easier than arbitrary ones. Sparsity alone, however, does not guarantee small treewidth or tractability.\n\nParameterized hardness distinguishes cases in which such algorithms are unlikely. The clique problem, parameterized by the desired clique size, is complete for the class W[1]. An algorithm of the form \\(n^{O(k)}\\), obtained by checking vertex subsets, is not fixed-parameter tractable because its polynomial exponent depends on \\(k\\). Whether fixed-parameter tractability equals W[1] is unresolved.\n\nFine-grained hypotheses impose stronger proposed limits than \\(P\\ne NP\\). The Exponential Time Hypothesis asserts, in a standard formulation, that 3-SAT has no \\(2^{o(n)}\\)-time algorithm in the number of variables. The Strong Exponential Time Hypothesis states that, as clause width increases, satisfiability cannot uniformly achieve a fixed improvement below the base \\(2\\) of exhaustive search. Reductions that carefully control instance size use these hypotheses to support specific running-time lower bounds that ordinary NP-completeness cannot provide."
    },
    {
      "heading": "Relations to other complexity classes and unresolved questions",
      "text": "The central unresolved question remains whether \\(P=NP\\). If any NP-complete language belongs to P, transitivity of reductions implies \\(P=NP\\). Conversely, if \\(P\\ne NP\\), no NP-complete language is in P. NP-completeness itself establishes neither alternative. A failed sequence of algorithmic approaches, even over decades, is not a proof of a lower bound.\n\nThe complementary class coNP consists of complements of languages in NP. Unsatisfiability is coNP-complete: its yes-instances are formulas for which no satisfying assignment exists. Whether \\(NP=coNP\\) is unknown. If an NP-complete problem belonged to coNP, then NP and coNP would coincide. Equality of P and NP would imply this coincidence, but equality of NP and coNP is not known to imply \\(P=NP\\).\n\nCompleteness does not mean that every problem in NP must be either easy or NP-complete. Ladner’s theorem, proved in 1975, states that if \\(P\\ne NP\\), there are languages in NP that are neither in P nor NP-complete under polynomial-time many-one reductions. Such languages are called NP-intermediate. Integer factorization and graph isomorphism are frequently discussed as natural problems without established NP-completeness, but neither has been proved to lie outside P. Integer factorization is usually formulated as a function problem, so decision-language comparisons require care.\n\nCounting introduces a different task. Finding whether a Boolean formula has any satisfying assignment is a decision problem; determining how many satisfying assignments it has is complete for the counting class #P under standard counting reductions. The theory of #P-completeness therefore concerns more information than a yes-or-no answer. Although an exact count immediately determines whether a solution exists, the reverse direction is not supplied by the ordinary NP-completeness definition.\n\nConnections with cryptography require equal care. Public-key cryptography relies on specific assumptions about efficiently generating instances that remain hard for adversaries, not simply on the existence of worst-case NP-complete problems. The assumption \\(P\\ne NP\\) alone is not known to imply the existence of one-way functions. Conversely, \\(P=NP\\) would undermine standard computational cryptography by making many efficiently verifiable search tasks polynomial-time solvable.\n\nA quantum computer is not known to solve NP-complete problems in polynomial time. Shor’s polynomial-time algorithms for factoring and discrete logarithms do not establish such a result, because those problems are not known to be NP-complete. Generic quantum search can provide a quadratic improvement over unstructured classical search, but this still leaves exponential running time when the search space grows exponentially.\n\nMajor barriers also constrain attempts to settle these questions. Relativization results show that some proof methods cannot resolve P versus NP because suitable oracle worlds support opposite answers. The natural-proofs framework of Alexander Razborov and Steven Rudich identifies obstacles to a broad family of circuit lower-bound arguments under cryptographic assumptions. These results restrict particular approaches; they do not prove that the underlying questions are unresolvable."
    }
  ],
  "links": [
    "computational-complexity",
    "p-versus-np-problem",
    "turing-machine",
    "boolean-satisfiability-problem",
    "np-hardness",
    "alan-turing",
    "shortest-path-problem",
    "integer-programming",
    "dynamic-programming",
    "heuristic",
    "formal-verification",
    "electronic-design-automation",
    "approximation-algorithm",
    "exponential-time-hypothesis",
    "cryptography",
    "quantum-computer"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}