7

In the Wikipedia page on P vs. NP problem there is an algorithm that "solves" SUBSET-SUM in case P=NP in polynomial time. (It's idea is to find a TM that gives a certificate). But it gives "yes" in polynomial time and runs forever if the answer is "no". It can be obviously fixed to give "no" in exponential time (just to run exponential algorithm if the first one is running for too long).

But can we explicitly describe an "honest" algorithm, which solves (and I mean, really solves) SUBSET-SUM (or any other NP-complete problem) in polynomial time assuming P=NP?

By "honest" and "really solves" I mean that the algorithm meets the classical definitions for a polynomial-time algorithm, i.e., here should exist constants $C_1, C_2$ such that at any input $x$ algorithm would terminate in no more than $C_1 \cdot |x|^{C_2}$ steps and output "yes" if $x \in $ SUBSET-SUM and "no" otherwise. The Wikipedia algorithm does not satisfy the first condition, so it doesn't "really solve" the problem.

D.W.
  • 167,959
  • 22
  • 232
  • 500

2 Answers2

3

I can half-answer this, but I believe the deeper question you are getting at is something I am in the process of learning better :)

The algorithm on wikipedia, call it W, is based on the idea: rather than guess at certificates why not just guess at the deterministic P algorithm D itself? This is expensive, but since it is independent of the input it is O(1) (if such an algorithm exists). The algorithm actually always decides even if P != NP, because there is of course a series of "brute force" programs that print out just one possible certificate then halt, so W can fall back to a very slow brute force.

The problem is that you actually have no way to verify the program it returns to you. You may imagine running W and find it seems to prefer a certain program, but you may find that on larger input it eventually finds a flaw in that program and moves on. It may seem to settle on an algorithm that seems to be $n^7$ but later on find a mistake in it and switch to an $n^{2000}$ algorithm. You will never know when it has found the "right" one.

This is actually the same idea used in the proof of the Karp-Lipton theorem: given enough computation power you can use it to just start guessing entire classes of programs and verify that they work (the proof is exactly, "guess a program, and verify that it works, then use it", which takes a bit of computational power - more than NP - to pull off.)

I am not aware of theory regarding how complicated a solution can be, but perhaps someone more knowledgeable can answer.

The more concrete scenario in the P=NP reality is that someone actually constructs an algorithm to any NP-complete problem, such as SAT.

I think you asked a good question and I'm curious how to fill in the gaps in my answer, regarding how W may be analyzed and made more useful in semi-practice.

djechlin
  • 497
  • 4
  • 15
0

I. previously posted another answer (a long time ago), but it had flaws, so I've deleted it.

I gave some extra thought to your question (and Wikipedia's polynomial-time semi-algorithm).

I'll argue here in a similar way to the argument in the 2nd paragraph of @djechlin.

The semi-algorithm there (let's call it W) is an honest semi-algorithm because it shows that actual Cw1 and Cw2 exist (even though it can't show its actual values):

due to the assumption of P==NP, there exists some semi-algorithm (let's call it X), a poly-time semi-algorithm, solving any NP-complete algo (such as SSP)

Even though you don't know X, you can:

  • try each and every number of steps K; and
  • run each and every program, with an index M lower than K on S for K steps (program are enumerable).

(this is the W presented in Wikipedia)

Since X exists and is a semi-algorithm it has a finite length, so its index is a finite number (b bits long).

If there's a solution for S, X will find it in a polynomial number of X-steps.

As @djechlin states, the number of W-steps, finally, depends on:

  • number of X-steps (polynomial on the size of S), and
  • index of X (independent of S)

As such, the index-of-X is O(1) with respect to the size of S.

So, W is a poly-time semi-algorithm.

That time complexity being: (2ˆb - 1) * (Cx1 + Cx2 * size(S))ˆ2

You might try, at most:

  • (2ˆb - 1) programs,

and run each, at most, for:

  • K-steps, from 1 up to the complexity of X (second term)

Using 1 + 2 + ... + n == 1/2 * n * (n + 1) ~ O(nˆ2)

Of course, you don't know Cx1, Cx2, b, but they are proven to exist.

With this, you can see that W is an honest semi-algorithm.

You don't have to look further.

The only caveat is that X and W are semi-algorithms, they answer yes in poly-time when there's a solution and might not halt for S without a solution. But that's already part of the definition of P==NP. The X in the demonstration of P==NP is required to be a semi-algorithm (only has to "accept" a given language in poly-time).

This was quite long, so it should be improved (presented in a more elegant way).

I hope this is correct and clear enough.