Can a problem be simultaneously polynomial time and undecidable? - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-26T01:34:10Z http://mathoverflow.net/feeds/question/48014 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/48014/can-a-problem-be-simultaneously-polynomial-time-and-undecidable Can a problem be simultaneously polynomial time and undecidable? gordon-royle 2010-12-02T08:59:35Z 2011-02-10T06:41:24Z <p>The Robertson-Seymour theorem on graph minors leads to some interesting conundrums.</p> <p>The theorem states that any minor-closed class of graphs can be described by a finite number of excluded minors. As testing for the presence of any given minor can be done in cubic time (albeit with astronomical constants) this implies that there <em>exists</em> a polynomial time algorithm for testing membership in any minor-closed class of graphs. Hence it seems reasonable that problem should be deemed to be in P.</p> <p>However the RS theory does not give us even the faintest clue as to how to <em>determine</em> the guaranteed-finite set of excluded minors, and until we have these at hand, we may not have any algorithm of any sort. Worse still, there is no known algorithm to actually find the excluded minors and even if you have a big list of them, there is no way that I know to verify that the list is actually complete. In fact, could it perhaps actually be <em>undecidable</em> to find the list of excluded minors?</p> <p>So, does it make sense to view a problem as being simultaneously polynomial-time and undecidable? It seems a bit odd to me (who is not a particular expert in complexity) but maybe it's quite routine?</p> http://mathoverflow.net/questions/48014/can-a-problem-be-simultaneously-polynomial-time-and-undecidable/48015#48015 Answer by Lamine for Can a problem be simultaneously polynomial time and undecidable? Lamine 2010-12-02T09:08:57Z 2010-12-02T09:36:33Z <p>A problem is in P if it is <strong>decidable in polynomial time</strong>. So if it is undecidable, it is neither in P nor in NP. It is not even recursive. See <a href="http://en.wikipedia.org/wiki/Complexity_class" rel="nofollow">http://en.wikipedia.org/wiki/Complexity_class</a>.</p> http://mathoverflow.net/questions/48014/can-a-problem-be-simultaneously-polynomial-time-and-undecidable/48018#48018 Answer by ndkrempel for Can a problem be simultaneously polynomial time and undecidable? ndkrempel 2010-12-02T09:21:26Z 2010-12-02T09:21:26Z <p>It seems to me there are two levels operating here.</p> <p>For any given minor-closed class of graphs, there <strong>is</strong> some finite set of excluded minors, and hence there is a polynomial time algorithm for testing membership of <strong>that</strong> class (we don't need to explicity know what the algorithm is, we simply know it exists.)</p> <p>However, on the level above, writing out that algorithm explicitly involves finding a finite set of excluded minors explicitly, and that might be hard/undecidable.</p> http://mathoverflow.net/questions/48014/can-a-problem-be-simultaneously-polynomial-time-and-undecidable/48021#48021 Answer by Stefan Geschke for Can a problem be simultaneously polynomial time and undecidable? Stefan Geschke 2010-12-02T09:32:23Z 2010-12-02T09:40:19Z <p>Of course, every problem in P is decidable by definition of P. This was mentioned in the previous answers. </p> <p>But there is another problem here that hasn't been addressed yet:<br> you apparently are looking for an algorithm that takes as input a class closed under minors and a finite graph and decides whether or not the finite graph is in the class.<br> Or you are looking for an algorithm that takes a class closed under minors and produces an polynomial time algorithm that decides membership to the class.</p> <p>Here is the problem: How do you present a class of graphs closed under minors? A priori, it is not clear that every class of graphs that is closed under minors (usually a class containing graphs of infinitely many isomorphism classes) has a reasonable representation as a finite object (that can be treated algorithmically) at all. By finite representation I mean a formula that defines the class in one way or other or something similar. </p> <p>Now, the graph minor theorem gives us a nice representation of every such class: Just list the finite set of forbidden minors. If this is your representation of the class, then you get your polynomial time algorithm that decides membership for the class. </p> <p>If you settle on another representation (and you have to come up with some uniform way to describe your class by finite objects to be able to say anything algorithmically at all, I would think), it might not be possible to come up with an algorithm that computes the finitely many forbidden minors from the representation of the class. </p> http://mathoverflow.net/questions/48014/can-a-problem-be-simultaneously-polynomial-time-and-undecidable/48025#48025 Answer by Tony Huynh for Can a problem be simultaneously polynomial time and undecidable? Tony Huynh 2010-12-02T10:14:06Z 2010-12-02T15:20:06Z <p>As others have mentioned, the answer to your title question is strictly speaking <strong>no</strong>. With regards to your other questions, it has been proven that it is undecidable to <em>compute</em> the excluded minors for a minor-closed class $\mathcal{C}$, unless $\mathcal{C}$ is presented to you in a silly way. Of course, there is no paradox, because this does not imply that the related problem of determining if an input graph $G$ is in $\mathcal{C}$ is undecidable. Indeed, as you mention by the Robertson-Seymour theory, this second problem is not only decidable, but is in P. </p> <p>I guess I should quantify what I mean by non-silly representations of minor-closed families. Fellows and Langston proved that if your minor-closed class $\mathcal{C}$ is given by a Turing machine $M$, then it is undecidable to compute an excluded minor characterization of $\mathcal{C}$. Courcelle, Downey, and Fellows proved that if $\mathcal{C}$ is instead given by a monadic second-order logic formula $\phi$, then it is also undecidable to compute an excluded minor characterization of $\mathcal{C}$. </p> <p>There are positive results for certain minor-closed families. For example, this <a href="http://www.comlab.ox.ac.uk/stephan.kreutzer/Publications/08-soda.pdf" rel="nofollow">paper</a> by Adler, Grohe, and Kreutzer shows that for any fixed $k$, they can compute the excluded minors for the class of graphs of tree-width at most $k$. For the undecidability results that I mentioned above, the references are:</p> <p>M.R. Fellows and M.A. Langston. On search, decision and the efficiency of polynomial-time algorithms (extended abstract). In <em>Proceedings of the 21st ACM Symposium on Theory of Computing</em>, pages 501–512, 1989.</p> <p>B. Courcelle, R.G. Downey, and M.R. Fellows. A note on the computability of graph minor obstruction sets for monadic second order ideals. <em>Journal of Universal Computer Science</em>, 3:1194–1198, 1997.</p> http://mathoverflow.net/questions/48014/can-a-problem-be-simultaneously-polynomial-time-and-undecidable/48031#48031 Answer by Joel David Hamkins for Can a problem be simultaneously polynomial time and undecidable? Joel David Hamkins 2010-12-02T11:00:42Z 2010-12-03T01:48:36Z <p>Consider the following simplified example of the same phenomenon, which many students find clarifying.</p> <p>Let $f(n)=1$, if there are $n$ consecutive $7$s in the decimal expansion of $\pi$, and otherwise $f(n)=0$. Is this function computable? </p> <p>A naive attempt to compute $f(n)$ would simply proceed to search $\pi$ for $n$ consecutive $7$s. If found, the algorithm outputs $1$, but otherwise....and then the naive algorithm doesn't seem to know when to output $0$, and so students sometimes expect that $f$ is not computable.</p> <p>But actually, $f$ is a computable function. If it happens that there are arbitrarily long sequences of $7$s in the decimal expansion of $\pi$, an open question, then $f$ is the constant $1$ function, which is certainly computable. Otherwise, there is some longest sequence of $7$s in $\pi$, having length $N$, and so $f$ is the function that is $1$ up to $N$ and then $0$ above $N$. And this function also is computable, for any particular $N$.</p> <p>So the situation is that we have proved that $f$ is computable by exhibiting several algorithms, and proving that $f$ is definitely computed by one of them, but we don't know which one. (In fact, $f$ is linear time computable.) So we have proved that $f$ is a computable function, but by a pure existence proof that merely shows there is an algorithm computing $f$, without explicitly exhibiting it. </p> <p>It seems to be the same phenomenon in your case, where you have a computable function, but you don't know which algorithm computes it.</p> <hr> <p><b>Addition.</b> Let me try to address Thierry Zell's concern about the third question. To my way of thinking, the phenomenon of the question is an instance of the problem of <em>uniformity</em> of algorithms, a pervasively considered issue in computability theory.</p> <p>To illustrate, consider the question of whether a given program $p$ halts on input $0$ before another program $q$. Let $f_p(q)=1$ if it does and otherwise $f_p(q)=0$. Every such function $f_p$ is computable, for similar reasons to my $\pi$ function $f$ above, since either $p$ doesn't halt at all on input $0$, in which case $f_p$ is identically $0$, or $p$ does halt in $N$ steps, in which case we need only run $q$ for $N$ steps to see if it halts, and give our output for $f_p(q)$ by that time. So each $f_p$ is a computable function. But the joint function $f(p,q)=f_p(q)$, a binary function, is <em>not</em> computable (if it were, then we could solve the halting problem: to decide if $p$ halts on input $0$, design a program $q$ that would take one step extra after a halt, and ask if $p$ halts before $q$).</p> <p>In other words, the function $f(p,q)$ is computable for any fixed $p$, but not uniformly in $p$. And such uniformity issues are ubiquitous in computability theory.</p> <p>In the example of the question, each class of graphs is decidable, but not uniformly so, since by Tony's answer there is no uniform algorithm, given a description of the class, to find the collection of excluded minors. But for any such fixed class, the membership question is decidable.</p> <p>The issue of whether a given algorithm is uniform in a given parameter is a very common concern in computability theory, and occurs throughout the subject.</p> http://mathoverflow.net/questions/48014/can-a-problem-be-simultaneously-polynomial-time-and-undecidable/54996#54996 Answer by none for Can a problem be simultaneously polynomial time and undecidable? none 2011-02-10T06:41:24Z 2011-02-10T06:41:24Z <p>Donald Knuth made such a prediction in a poll ( <a href="http://www.cs.umd.edu/~gasarch/papers/poll.pdf" rel="nofollow">http://www.cs.umd.edu/~gasarch/papers/poll.pdf</a> ) about when P vs NP would be settled:</p> <blockquote> <p>It will be solved by either 2048 or 4096. I am currently somewhat pessimistic. The outcome will be the truly worst case scenario: namely that someone will prove “P=NP because there are only finitely many obstructions to the opposite hypothesis”; hence there will exists a polynomial time solution to SAT but we will never know its complexity!</p> </blockquote>