# Easy decision problem, hard search problem

Deciding whether a Nash equilibrium exists is easy (it always does); however, actually finding one is believed to be difficult (it is PPAD-Complete).

What are some other examples of problems where the decision version is easy but the search version is relatively difficult (compared the the decision version)?

I would be particularly interested in problems where the decision version is non-trival (unlike the case with Nash equilibrium).

• Should probably be community wiki: meta.cstheory.stackexchange.com/questions/225/… – Dave Clarke Oct 1 '10 at 14:04
• @supercooldave: I wouldn't hurry with CW in this case. It may turn out that there are very few natural problems with a non-trivial but easy decision version and hard search version. This is not necessarily a "big-list". – Jukka Suomela Oct 1 '10 at 14:09
• I went with the heuristic that big list = community wiki. – Dave Clarke Oct 1 '10 at 14:16
• So this raises the question "what is the natural decision problem to be associated with a search problem?". I think existence of NE is not the natural decision problem associate with NE. – Kaveh Oct 1 '10 at 14:56
• @Kaveh: You can define that decision problem for Nash (if you specify an encoding of a solution to Nash), but the problem is whether it is the same complexity as Nash or not, or formally, whether that decision problem is reducible to Nash. I doubt it because finding a Nash equilibrium satisfying some additional constraint is often NP-hard. – Tsuyoshi Ito Oct 1 '10 at 15:56

## 13 Answers

Given an integer, does it have a non-trivial factor? -> Non-trivially in P.

Given an integer, find a non-trivial factor, if there is one -> Not known to be in FP.

• Or you could ask, does it have a prime factor? Then you don't need the PRIMES is in P paper – Bjørn Kjos-Hanssen Sep 6 '18 at 1:37

Here is another example: Given a cubic graph G and a hamiltonian cycle H in G, find a different hamiltonian cycle in G. Such a cycle exists (by Smith's theorem) but, as far as I know, it is open whether it can be computed in polynomial time.

If you give the following the same "leeway" that you do for Nash equilibria, then:

• Integer factorization, where the decision problem is "Is there a factorized representation of this integer?" (trivially, yes), and the search problem is to output it

A number of lattice problems could conceivably fit here with the same type of generous allowance for defining the decision problem:

• Shortest Vector Problem (SVP) -- decide if there's a shortest vector vs finding it
• Closest Vector Problem (CVP) -- decide if there's a closest vector vs finding it

Of course, these are all cases where the decision version I've mentioned isn't very interesting (because it's trivially the case). One problem that's not quite as trivial:

• Planar graph $k$-colorability for $k \ge 4$

The decision problem of planar graph 4-colorability is in P. But obtaining the lexicographically first such solution is NP-hard (Khuller/Vazirani).

Note that the property you're really interested in is self-reducibility (or rather, non-self-reducibility). In the planar graph coloring problem, the essential issue is that the method of self-reducing the general case of $k$-colorability will destroy planarity in a graph.

Let $G=G(n,1/2)$, the random graph on $1,\ldots,n$, in which each edge is independently present with probability $1/2$. Choose $n^{1/3}$ vertices of $G$ uniformly at random and add all edges between them; call the resulting graph $H$. Then $H$ has a clique of size $n^{1/3}$.

Search problem: find a clique of size at least $10\log n$.

• Very neat! Is there a relevant paper about this? – András Salamon Oct 2 '10 at 23:05
• @András: To give a bit more background, this is called the "hidden clique problem". If the hidden clique that's planted is on Omega(sqrt(n log n)) vertices, one can easily see that the vertices of the clique are those with the highest degree, almost surely. [Alon-Krivelevic-Sudakov] (tau.ac.il/~nogaa/PDFS/clique3.pdf) improve this to Omega(sqrt(n)) using spectral techniques. For hidden cliques of smaller size, such as O(log n), nothing non-trivial is known. – arnab Oct 2 '10 at 23:55
• Another related intriguing problem, posed by Karp, is to find a clique of size (1+c)log(n) in G(n,1/2), for any constant 0<c<1. It's known that there exists a clique of size 2log(n) almost surely in G(n,1/2). The only polynomial time algorithms known (such as the greedy one) find cliques of size (1+o(1))log(n). – arnab Oct 2 '10 at 23:59
• @arnab: Feige and Ron recently simplified the AKS result (see reference at my question cstheory.stackexchange.com/questions/1406/… ). My question to @Louigi was really about the $10\log n$ question: what motivates the particular constant, and has this question been asked in a paper one can cite? – András Salamon Oct 3 '10 at 8:00

One more example; The Subset-sums equality: Given $a_1,a_2,a_3,...,,a_n$ natural numbers with $\sum_1^n{a_i} \lt 2^n -1$. The pigeon-hole principle guarantees the existence of two subsets $I, J$ in ${1,2,..., n}$ such that $\sum_{i\in I} a_i=\sum_{j \in J} a_j$ (since the are more subsets than possible sums). The existence of polynomial time algorithm for finding sets $I$ and $J$ is a famous open problem.

Another number theory example, similar to the ones above. It's known by Bertrand's postulate that for every positive integer $n$, there's a prime between $n$ and $2n$. But we have no polynomial time algorithm currently to find such a prime, given $n$. (The desired algorithm must run in polylog($n$) time.) One can easily come up with polynomial time randomized algorithms because of the prime number theorem, and one can derandomize them by assuming some standard number theoretic conjectures (such as Cramer's conjecture), but no unconditionally polynomial time deterministic algorithm is known. Related work was recently done in the Polymath4 project; Tao's blog post on the project is a good summary of it.

• Even without Bertrand's postulate, you have a deterministic algorithm with expected polynomial runtime due to the Prime Number Theorem and the AKS primality test. – Joe Fitzsimons Oct 4 '10 at 14:52
• @JoeFitzsimons, I am not sure what you mean by "deterministic algorithm with expected polynomial runtime". – Chandra Chekuri Jun 27 '13 at 0:14
• @ChandraChekuri, "deterministic" probably is meant to say that it always gets the correct answer. – usul Jun 27 '13 at 19:36
• @ChandraChekuri: Sorry, my choice of wording was poor. I meant that you can find a prime number with absolute certainty in expected polynomial time, rather than simply with bounded error. At least, I think that's what I meant. It was 3 years ago. – Joe Fitzsimons Jun 30 '13 at 9:33

At the risk of being slightly off-topic, let me give a simple and natural example of a theory C answer: Eulerian cycles and distributed algorithms.

The decision problem is not completely trivial, in the sense that there are are both Eulerian and non-Eulerian graphs.

There is, however, a fast and simple distributed algorithm that solves the decision problem (in the sense that for yes-instances all nodes output "1" and for no-instances at least one node outputs "0"): each node just checks the parity of its own degree and outputs 0 or 1 accordingly.

But if you would like to find a Eulerian cycle (in the sense that each node outputs the structure of the cycle in its own neighbourhood), then we need essentially global information on the graph. It shouldn't be hard to come up with a pair of examples that shows that the problem requires $\Omega(n)$ communication rounds; on the other hand, $O(n)$ rounds is enough to solve any problem (assuming unique IDs).

In summary: $O(1)$-time decision problem, $\Theta(n)$-time search problem, and this is the worst possible gap.

Edit: This implicitly assumes that the graph is connected (or, equivalently, that we want to find an Eulerian cycle in each connected component).

• This might be a stupid question (because I know almost nothing about distributed computing), but is there a promise that the graph is connected, or is the connectedness easy to check efficiently in a distributed way? – Tsuyoshi Ito Oct 2 '10 at 22:19
• Thanks, not a stupid question at all. I clarified my answer, I had forgotten to add the assumption that we deal with connected graphs here. (Usually there is little point in studying disconnected graphs from the perspective of distributed algorithms, as by definition there is no way to transmit information between the connected components, but of course this should be made explicit.) – Jukka Suomela Oct 2 '10 at 22:43
• Thanks! After reading your answer, I think that it should have been obvious that the graph (= network topology) was assumed to be connected. :) – Tsuyoshi Ito Oct 4 '10 at 13:51

Finding Tverberg partitions is of unknown complexity:

Theorem: Let $x_1,x_2,\dots, x_m$ be points in $R^d$, $m \ge (r-1)(d+1)+1$. Then there is a partition $S_1,S_2,\dots, S_r$ of ${1,2,\dots,m}$ such that $\cap _{j=1}^r \text{conv} (x_i: i \in S_j) \ne \emptyset$.

Like with Nash equilibria, the partition is guaranteed by the theorem, but it's not known if a polytime algorithm exists to find one.

Gil Kalai wrote a wonderful series of posts on this topic: One, Two and Three.

• Actually, any problem that falls into TFNP would be a good candidate I think. When an answer is guaranteed to exist by a theorem -- then, define some apparently-harder-than-P search problem over the possible solutions to accompany it. – Daniel Apon Oct 1 '10 at 18:40

In all the examples above the decision problem is in P and the search problem is not known to be in P but not known to be NP-hard either. I want to point out that it is possible to have an NP-hard search problem whose decision version is easy.

Consider the generalized satisfiability problem for given relations $R_1,\ldots,R_k$ over Boolean domain $\{0,1\}$. An instance is an expression of the form $$R_{i_1}(t_{11},\ldots,t_{1r_1}) \wedge \cdots \wedge R_{i_m}(t_{m1},\ldots,t_{mr_m})$$ where the $t_{ij}$'s are either variables or constants in ${0,1}$, and $r_1,\ldots,r_m$ are the arities of $R_1,\ldots,R_k$ (this is the same framework as in Schaeffer's dichotomy theorem with constants, in case you know what it is). The search problem is: given such an expression, find a lexicographically minimal solution, if there is one.

It was shown by Reith and Vollmer here that there exists a choice of relations $R_1,\ldots,R_k$ that make this problem NP-hard (actually OptP-complete) but keep the satisfiability problem easy (quite trivial actually). An example given in the paper is $R = \{(1,0,0),(0,1,0),(1,1,1)\}$ (here $k = 1$). Once the satisfiability problem is solvable in polynomial-time, the question whether there exists a lexicographically minimal satisfying assignment is trivial.

See Corollary 13 and the example following it in the paper above (at least in this on-line version).

• Decision version is (highly) non-trival in P: $k$-colourability ($k$ fixed) on graphs without induced path with five vertices; due to this paper.
• Search version is NP-hard: Finding the chromatic number of graphs without induced path with five vertices; due to this paper.
• You perhaps meant to say that for fixed $k$, the decision version is in P. – András Salamon Jun 26 '13 at 19:50

Take a "pairing-friendly" elliptic curve. That is, a curve that has a one bilinear map $e$ associated with it - with $e (a + b, c + d) = e (a c) e (a d) e (b c) e (b d)$ such that $e$ is difficult to invert).

Such pairings are used widely in cryptography, partially since given $e$, it is trivial to solve Decisional Diffie-Hellman (given $(g, h, g^a, h^b)$, decide if $a = b$: just verify whether $e (g, h^b) = e (h, g^a)$). However, it is still conjectured that the search/computational Diffie-Hellman problem is difficult.

Such groups are also generalized to "gap groups".

I guess Planar Perfect Matching got missed out from this list.

• The decision version is in NC (even the counting version is in $\mathsf{NC}$) by a parallel version (see Mahajan-Subramanya-Vinay) of Kastelyn's algorithm
• The search version remains unparallelised to date i.e there is no known deterministic $\mathsf{NC}$ algorithm for this problem (though if we drop either of the parallel or deterministic restrictions there are well known algorithms - Edmonds and Mulmuley-Vazirani-Vazirani/Karp-Upfal-Wigderson, respectively.

Let's notch up the complexity a bit.

Many decision problems about vector addition systems (VAS) are EXPSPACE-complete, but may require much larger witnesses. For instance, deciding whether the language of a VAS is regular is EXPSPACE-complete (e.g. Blockelet & Schmitz, 2011), but the smallest equivalent finite-state automaton might be of Ackermannian size (Valk & Vidal-Naquet, 1981). The explanation behind this huge gap is that there exist much smaller witnesses of non-regularity.