All Topics  
NP-hard

 

   Email Print
   Bookmark   Link






 

NP-hard



 
 
NP-hard (nondeterministic polynomial-time hard), in computational complexity theory
Computational complexity theory

Computational complexity theory, as a branch of the theory of computation in computer science, investigates the problems related to the Computational resource required for the execution of algorithms , and the inherent difficulty in providing efficient algorithms for specific computational problems....
, is a class of problems informally "at least as hard as the hardest problems in NP
NP (complexity)

In computational complexity theory, NP is one of the most fundamental complexity classes.The abbreviation NP refers to "Nondeterministic algorithm Polynomial time"....
." A problem H is NP-hard if and only if
If and only if

If and only if, in logic and fields that rely on it such as mathematics and philosophy, is a biconditional logical connective between statements....
 there is an NP-complete
NP-complete

In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
 problem L that is polynomial time Turing-reducible to H, i.e. . In other words, L can be solved in polynomial time
Polynomial time

In computational complexity theory, polynomial time refers to the computation time of a problem where the run time, , is no greater than a polynomial function of the problem size, n....
 by an oracle machine
Oracle machine

In computational complexity theory and Computability theory , an oracle machine is an abstract machine used to study decision problems. It can be visualized as a Turing machine with a black box, called an oracle, which is able to decide certain decision problems in a single operation....
 with an oracle for H. Informally we can think of an algorithm that can call such an oracle machine as subroutine for solving H, and solves L in polynomial time if the subroutine call takes only one step to compute.






Discussion
Ask a question about 'NP-hard'
Start a new discussion about 'NP-hard'
Answer questions from other users
Full Discussion Forum



Encyclopedia


NP-hard (nondeterministic polynomial-time hard), in computational complexity theory
Computational complexity theory

Computational complexity theory, as a branch of the theory of computation in computer science, investigates the problems related to the Computational resource required for the execution of algorithms , and the inherent difficulty in providing efficient algorithms for specific computational problems....
, is a class of problems informally "at least as hard as the hardest problems in NP
NP (complexity)

In computational complexity theory, NP is one of the most fundamental complexity classes.The abbreviation NP refers to "Nondeterministic algorithm Polynomial time"....
." A problem H is NP-hard if and only if
If and only if

If and only if, in logic and fields that rely on it such as mathematics and philosophy, is a biconditional logical connective between statements....
 there is an NP-complete
NP-complete

In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
 problem L that is polynomial time Turing-reducible to H, i.e. . In other words, L can be solved in polynomial time
Polynomial time

In computational complexity theory, polynomial time refers to the computation time of a problem where the run time, , is no greater than a polynomial function of the problem size, n....
 by an oracle machine
Oracle machine

In computational complexity theory and Computability theory , an oracle machine is an abstract machine used to study decision problems. It can be visualized as a Turing machine with a black box, called an oracle, which is able to decide certain decision problems in a single operation....
 with an oracle for H. Informally we can think of an algorithm that can call such an oracle machine as subroutine for solving H, and solves L in polynomial time if the subroutine call takes only one step to compute. NP-hard problems may be of any type: decision problems
Decision problem

In computability theory and computational complexity theory, a decision problem is a question in some formal system with a yes-or-no answer, depending on the values of some input parameters....
, search problems
Search problem

In computability theory, a search problem is a type of computational problem represented by a binary relation. If R is a binary relation such that field ⊆ Γ+ and T is a Turing machine, then T calculates f if:...
, optimization problems
Optimization problem

In mathematics and computer science, an optimization problem is the problem of finding the best solution from all feasible solutions. More formally, an optimization problem is a quadruple , where...
.

As consequences of such definition, we have (note that these are claims, not definitions):

  • problem H is at least as hard as L, because H can be used to solve L;


  • since L is NP-complete
    NP-complete

    In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
    , and hence the hardest in class NP
    NP (complexity)

    In computational complexity theory, NP is one of the most fundamental complexity classes.The abbreviation NP refers to "Nondeterministic algorithm Polynomial time"....
    , also problem H is at least as hard as NP
    NP (complexity)

    In computational complexity theory, NP is one of the most fundamental complexity classes.The abbreviation NP refers to "Nondeterministic algorithm Polynomial time"....
    , but H does not have to be in NP
    NP (complexity)

    In computational complexity theory, NP is one of the most fundamental complexity classes.The abbreviation NP refers to "Nondeterministic algorithm Polynomial time"....
     and hence does not have to be a decision problem
    Decision problem

    In computability theory and computational complexity theory, a decision problem is a question in some formal system with a yes-or-no answer, depending on the values of some input parameters....
     (even if it is a decision problem, it need not be in NP);


  • since NP-complete
    NP-complete

    In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
     problems transform to each other by polynomial-time many-one reduction (also called polynomial transformation), therefore all NP-complete
    NP-complete

    In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
     problems can be solved in polynomial time by a reduction to H, thus all problems in NP
    NP (complexity)

    In computational complexity theory, NP is one of the most fundamental complexity classes.The abbreviation NP refers to "Nondeterministic algorithm Polynomial time"....
     reduce to H; note however, that this involves combining two different transformations: from NP-complete
    NP-complete

    In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
     decision problems to NP-complete
    NP-complete

    In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
     problem L by polynomial transformation, and from L to H by polynomial Turing reduction;


  • if there is a polynomial algorithm for any NP-hard problem, then there are polynomial algorithms for all problems in NP
    NP (complexity)

    In computational complexity theory, NP is one of the most fundamental complexity classes.The abbreviation NP refers to "Nondeterministic algorithm Polynomial time"....
    , and hence P = NP;


  • if , then NP-hard problems have no solutions in polynomial time, while does not resolve whether the NP-hard problems can be solved in polynomial time;


  • if an optimization problem H has an NP-complete
    NP-complete

    In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
     decision version L, then H is NP-hard;


A common mistake is to think that the "NP" in "NP-hard" stands for "non-polynomial". Although it is widely suspected that there are no polynomial-time algorithms for these problems, this has never been proven.

Examples


An example of an NP-hard problem is the decision problem SUBSET-SUM
Subset sum problem

In computer science, the subset sum problem is an important problem in computational complexity theory and cryptography. The problem is this: given a set of integers, does the sum of some non-empty subset equal exactly zero? For example, given the set , the answer is YES because the subset sums to zero....
 which is this: given a set of integers, does any non empty subset of them add up to zero? That is a yes/no question, and happens to be NP-complete
NP-complete

In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
. Another example of an NP-hard problem is the optimization problem of finding the least-cost route through all nodes of a weighted graph. This is commonly known as the Traveling Salesman Problem.

There are also decision problems that are NP-hard but not NP-complete, for example the halting problem
Halting problem

In computability theory , the halting problem is a decision problem which can be stated as follows: given a description of a computer program and a finite input, decide whether the program finishes running or will run forever, given that input....
. This is the problem "given a program and its input, will it run forever?" That's a yes/no question
Yes-no question

A yes-no question, formally known as a polar question, is a question whose expected answer is either yes and no. Formally, they present an exclusive disjunction, a pair of alternatives of which only one is acceptable....
, so this is a decision problem. It is easy to prove that the halting problem is NP-hard but not NP-complete. For example the Boolean satisfiability problem
Boolean satisfiability problem

Satisfiability is the problem of determining if the variables of a givenBoolean logic formula can be assigned in such a way as to make the formula...
 can be reduced to the halting problem by transforming it to the description of a Turing machine
Turing machine

Turing machines are basic abstract symbol-manipulating devices which, despite their simplicity, can be adapted to simulate the logic of any computer algorithm....
 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 in a finite number of operations, while the halting problem, in general, is not. But not all NP-Hard problems that aren't NP-Complete are undecidable
Recursive language

A recursive language in mathematics, logic and computer science is a type of formal language which is also called decidable or Turing-decidable....
. For instance, the language of True quantified Boolean formula
True quantified Boolean formula

The language TQBF is a formal language in computer science that contains True Quantified Boolean Formulas. A fully quantified boolean formula is a formula in first-order logic where every variable is quantified , using either existential quantification or universal quantification quantifiers, at the beginning of the sentence....
s is decidable in polynomial space
PSPACE

PSPACE is all the problems which can be solved by programs which only need a polynomial amount of memory to run. In the term "PSPACE", the P stands for polynomial, and SPACE refers to the amount of space, i.e....
, but probably not nondeterministic polynomial time.

Alternative definitions

An alternative definition of NP-hard that is often used restricts NP-Hard to decision problem
Decision problem

In computability theory and computational complexity theory, a decision problem is a question in some formal system with a yes-or-no answer, depending on the values of some input parameters....
s and then uses polynomial-time many-one reduction instead of Turing reduction. So, formally, a language L is NP-hard if . If it is also the case that L is in NP, then L is called NP-complete
NP-complete

In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
.

NP-naming convention


The NP-family naming system is confusing: NP-hard
NP-hard

NP-hard , in computational complexity theory, is a class of problems informally "at least as hard as the hardest problems in NP ." A problem H is NP-hard if and only if there is an NP-complete problem L that is polynomial-time Turing reduction to H, i.e....
 problems are not all NP, despite having 'NP' as the prefix of their class name. However, the names are now entrenched and unlikely to change. On the other hand, the NP-naming system has some deeper sense, because the NP family is defined in relation to the class NP
NP (complexity)

In computational complexity theory, NP is one of the most fundamental complexity classes.The abbreviation NP refers to "Nondeterministic algorithm Polynomial time"....
: NP-complete — means problems that are 'complete' in NP, i.e. the most difficult to solve in NP; NP-hard — stands for 'at least' as hard as NP (but not necessarily in NP); NP-easy — stands for 'at most' as hard as NP (but not necessarily in NP); NP-equivalent — means equally difficult as NP, (but not necessarily in NP).

See also

Main: NP-equivalent
NP-equivalent

In computational complexity theory, the complexity class NP-equivalent is the set of function problems that are both NP-easy and NP-hard. NP-equivalent is the analogue of NP-complete for function problems....
, NP-easy
NP-easy

In computational complexity theory, the complexity class NP-easy is the set of function problems that are solvable in polynomial time by a deterministic Turing machine with an oracle machine for some decision problem in NP ....
Examples:Complexity Zoo Other:Emergence
Emergence

In philosophy, systems theory and science, emergence is the way complex systems and patterns arise out of a Multiplicity of relatively simple interactions....