Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an undecidable problem which is not NP-hard?

share|cite|improve this question

migrated from Jan 1 '13 at 14:28

This question came from our site for theoretical computer scientists and researchers in related fields.

The title implies a very different kind of question from the actual post. – Vijay D Jan 1 '13 at 9:32
How so? I think they are identical. Perhaps you are referring to a previous title? – Yuval Filmus Jan 2 '13 at 1:27
@Yuval, I think Vijay refers to the title before it was edited. – Kaveh Jan 3 '13 at 7:46

If P=NP then any non-trivial set is NP-hard (other than the empty set and the complete set), so assume P$\neq$NP. If $A$ is a set and $f_i$ reduces SAT to $A$ in polytime, then $f_i$ must have infinite range. Otherwise, we can hardcode the relevant values of $f_i$ to get a polytime algorithm for SAT.

We can construct an undecidable problem which is not NP-hard using diagonalization. Let $f_i$ be an enumeration of all polytime reductions whose range is infinite. We construct an undecidable problem $A$ such that no $f_i$ reduces SAT to $A$. We will use $K$ to denote the undecidable set corresponding to the halting problem.

The set $A$ will be defined in stages, starting with a completely undefined set. In stage $i$, we find a string $s$ such that $f_i(s)$ is longer than any string on which $A$ is defined (here we use the fact that the range of $f_i$ is infinite). We define $A$ on $f_i(s)$ so that $s \in SAT$ iff $f_i(s) \notin A$. After all finite stages, we complete the definition of $A$ for each undefined string $s$ by letting $s \in A$ iff $|s| \in K$.

By construction, no polytime $f_i$ reduces SAT to $A$, and so $A$ is not NP-hard. On the other hand, $A$ is not decidable since $K$ reduces to $A$: we can decide whether $n \in K$ (for $n \geq 2$) by taking a majority of three strings of length $n$.

share|cite|improve this answer
Hmm. I don't get the first statement. Why is any problem NP-hard? – cineel Jan 1 '13 at 10:57
If P=NP then a polytime reduction can solve any NP problem. – Yuval Filmus Jan 1 '13 at 13:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.