-2

Let me explain my trouble by another example.

The wiki page says that

Lattice problems are an example of NP-hard problems

However, by clicking NP-hard, i find this definition

A decision problem H is NP-hard when for every problem L in NP, there is a polynomial-time many-one reduction from L to H.

What the fact? Lattice problems are not decision problems.

Edit after two answers: I think the two answers below have contradicting definitions:

1-)An optimization problem is NP-hard if it is as hard as NP-hard decision problems.

2-) An optimization problem is NP-hard if its decision version is NP-hard.

Which one is the real definition.

user
  • 9
  • 1

2 Answers2

3

In complexity theory, we often concentrate on decision problems. "Officially," NP-hardness is a category of decision problems — only a decision problem can be (or not be) NP-hard.

However, it is also common to use NP-hardness when referring to optimization problems. An optimization problem is NP-hard if its decision version is NP-hard.

In more advanced complexity theory, NP-hardness is used in a less precise way. For example, this paper "give[s] a new proof showing that it is NP-hard to color a 3-colorable graph using just four colors". They also prove that it is NP-hard to distinguish graphs of type A from graphs of type B (see their Theorem 3). What they really mean, in the former case, is that for any problem $L$ in NP there exists a polynomial time reduction $f$, outputting a graph, such that if $x \in L$ then $f(x)$ is 3-colorable, and if $x \notin L$ then $f(x)$ is not 4-colorable.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
  • I think these two definitions contradicts:

    1-)An optimization problem is NP-hard if it is more difficult than any problem in NP 2-) An optimization problem is NP-hard if its decision version is NP-hard.

    Which one is the real definition.

    – user Mar 29 '21 at 06:50
  • The first one isn’t really a definition. What does it mean to be more difficult than any problem in NP? – Yuval Filmus Mar 29 '21 at 07:07
  • Could you please give any reference? – user Mar 29 '21 at 07:11
  • You’ll have to trust me. – Yuval Filmus Mar 29 '21 at 07:11
  • Yes, I trust you but all the people have to trust you. Since people use different definitions, I cant understand what they mean by NP-hard – user Mar 29 '21 at 07:16
  • There’s no “book of definitions” which, by fiat, contains all the correct definitions, if that’s what you’re looking for. The definition of NP-hardness for decision problems is not problematic, I assume (though sometimes one uses different notions of reduction; that will always be made explicit). NP-hardness of other types of problems is a more informal notion, though it can be formalized. Perhaps Arora and Barak’s textbook contains such a definition (probably not overly formal). – Yuval Filmus Mar 29 '21 at 07:21
1

Now that you have edited your post, your question is more clear ('cause let's be honest, it was very confusing before the modifications…)

By definition, problems in $NP$ are decision problems. However, $NP$-hard problems are not necessarily in $NP$ and even not necessarily decision problems.

Let's make an example of this. Consider the following decision problem:

Clique – Input: a graph $G$ and an integer $k$; Question: is there a subgraph of $G$ that is a clique of size $k$?

It is well known that Clique is a decision problem in $NP$ (and even $NP$-complete). Consider now the following optimization problem:

max-Clique – Input: a graphe $G$; Maximize: the size a subgraph $H$ of $G$; Conditions: $H$ is a clique.

Now we will prove that max-Clique is $NP$-hard, despite not being a decision problem. Indeed, if you know how to solve max-Clique, then given a graph $G$ and an integer $k$, you can solve Clique$(G, k)$ by running max-Clique$(G)$ and verifying if the result is greater than $k$ or not. This is done in an additionnal polynomial time. That proves that Clique $\leq_m^p$ max-Clique. Since Clique is $NP$-complete, we conclude that max-Clique is $NP$-hard.

Nathaniel
  • 15,071
  • 2
  • 27
  • 52
  • Then, what the wiki page mean here: "Lattice problems are an example of NP-hard problems – user Mar 26 '21 at 21:53
  • It roughly means "more difficult than any problem in $NP$". – Nathaniel Mar 26 '21 at 21:56
  • Thanks. You really answered my question. Then the all definitions starting "the decision problem is NP-hard if ..." are wrong. – user Mar 26 '21 at 22:45
  • Another question: Can you verify your answer by references. Is there a standart reference for this topic. – user Mar 26 '21 at 22:47
  • Not necessarily: you can chose to talk about $NP$-hardness only for decision problems. What would be wrong would be "we define a $NP$-hard problem as a decision problem verifying…" – Nathaniel Mar 26 '21 at 22:48
  • You can find references on wikipedia: https://en.wikipedia.org/wiki/NP-hardness#Consequences https://en.wikipedia.org/wiki/Longest_path_problem https://en.wikipedia.org/wiki/Set_packing#Special_cases – Nathaniel Mar 26 '21 at 23:10