Computational complexity theory is part of the theory of computation dealing with the resources required during computation to solve a given problem. The most common resources are time (how many steps does it take to solve a problem) and space (how much memory does it take to solve a problem).
In this theory, NPhard (Nondeterministic Polynomialtime hard) refers to the class of decision problems that contains all problems H such that for all decision problems L in NP there is a polynomialtime manyone reduction to H. Informally this class can be described as containing the decision problems that are at least as hard as any problem in NP. This intuition is supported by the fact that if we can find an algorithm A that solves one of these problems H in polynomial time then we can construct a polynomial time algorithm for every problem in NP by first executing the reduction from this problem to H and then executing the algorithm A.
Assuming language L to be NPcomplete,
NPHard assumes language L satisfys property 2, but not necessarily property 1.
The notion of NPhardness plays an important role in the discusson about the relationship between the complexity classes P and NP. It is also often used to define the complexity class NPcomplete which is the intersection of NP and NPhard. Consequently the class NPhard can be understood as the class of problems that are NPcomplete or harder.
A common mistake is to think that the "NP" in "NPhard" stands for "nonpolynomial". Although it is widely suspected that there are no polynomialtime algorithms for these problems, this has never been proved.
An example of an NPhard problem is the decision problem SUBSETSUM which is this: given a set of integers, do any subset of them add up to zero? That is a yes/no question, and happens to be NPcomplete.
There are also decision problems that are NPhard but not NPcomplete, for example the halting problem. This is the problem "given a program and its input, will it run forever?" That's a yes/no question, so this is a decision problem. It is easy to prove that the halting problem is NPhard but not NPcomplete. For example the boolean satisfiability problem can be reduced to the halting problem by transforming it to the description of a Turing machine that tries all truth value assignments and when it finds one that satisfies the formula it halts and otherwise it goes into an infinite loop. It is also easy to see that the halting problem is not in NP since all problems in NP are decidable and the halting problem is not.
An alternative definition of NPhard that is often used replaces polynomialtime manyone reductions with polynomialtime Turing reductions. This notion of NPhardness can be formulated for general problems (not just decision problems).
In this sense, the problem H is NPhard if for every decision problem L in NP there is an oracle machine that has an oracle for solving H and this oracle machine can solve L in polynomial time. Informally we can think of such a machine as an algorithm that can call a subroutine for solving H and solves L in polynomial time if the subroutine call takes only one step to compute.
Also for this definition of NPhardness it holds that if we find a polynomialtime algorithm for an NPhard problem then we have a polynomialtime algorithm for all problems in NP.
Whether this definition of NPhardness is equivalent with the one at the beginning of this article is still an open problem and is discussed in more detail in the article on NPcompleteness.
Search Encyclopedia

Featured Article
