# Can the decision version of an optimization problem in NP, be in P?

It is well known that a optimization problem can be turned into a decision problem with an extra parameter: e.g. in TSP we are looking for the lowest cost for a tour, the decision version therefore could check whether a a tour exists which costs at most $K$.

Lets assume we are talking about an optimization problem which is either NP or NP-hard. Can the corresponding decision problem ever be in P?

NB: What I am trying to ask is: if a optimization problem cannot be solved in polynomial time, can the corresponding decision problem be solve in polynomial time?

## 1 Answer

Optimization problems cannot belong to NP or be NP-hard any more than apples. NP is a class of decision problems, and NP-hardness is a property of decision problems. When we say that an optimization problem is in NP or is NP-hard, what we really mean is that the corresponding decision problem is in NP or is NP-hard.

• You're right about optimization problems not being in NP, but NP-hard does not only contain decision problems but also optimization problems. Anyway what I want to ask is: if a optimization problem cannot be solved in polynomial time, can the corresponding decision problem be solve in polynomial time? – Héctor van den Boorn Apr 26 '16 at 12:00
• No, actually I'm right about NP-hardness as well. – Yuval Filmus Apr 26 '16 at 12:03
• The more interesting direction is the other one: if the decision version is in P, can we solve the original version in polynomial time? This is the case if, for example, the optimal value is a polynomial-size integer, and the idea is to use binary search (details left to you). – Yuval Filmus Apr 26 '16 at 12:05
• @YuvalFilmus To be fair, NP-hardness is sometimes used in the context of optimization problems, e.g. wikipedia: "It does not restrict the class NP-hard to decision problems, for instance it also includes search problems, or optimization problems." – Tom van der Zanden Apr 26 '16 at 12:07
• @Tom The same is true for NP. For example, when we say that Max Clique is an NP-complete problem, we are implying that the optimization problem Max Clique is in NP. What we really mean is that the decision version of Max Clique is in NP. Therefore, by definition, if an optimization problem is in NP (or NP-hard) then its decision version is in NP (or NP-hard). – Yuval Filmus Apr 26 '16 at 12:11