so a problem is in P (=poly time) if there exists a Turing machine that can solve it in polynomial time. For NP (=non-deterministic poly time) problems there exists a witness, which the Turing machine can utilize to solve the problem in polynomial time (or decide if its part of the language or not).
The question if P = NP is still unproven.
I wonder how you can prove that P is not equal to NP. My thought was that if you find a problem in NP and then prove that there is no algorithm, which can solve the problem in poly time (without witness), then P not equal NP.
So for example if you look at the Hamiltonian path problem (which is in NP) and prove that it cant be solved in poly time by a deterministic TM, then P not equal NP.
Is my thought process correct or am I missing something?
We have NP complete problems, the most known one being SAT and there are numerous others, such as hamiltonian path. If one of these problems is in P, then NP=P. If one of these isn't in P - i.e., there does not exists any poly-time TM that decides this language - then NP != P. So yes, proving P is equal or not equal to NP is equivalent to proving there does or doesn't exists an algorithm which solves one of the complete problems (such as hamiltonian path which you gave as an example).
Related
Explain why each of the following statements is correct. You may assume that nSudoku is NP-complete.
If nSudoku can be reduced in polynomial time to factorization, then factorization is NP-complete.
If nSudoku can be reduced in polynomial time to the problem of sorting an integer array, then P = NP.
Any ideas how to explain? Thank you!!!
In order to determine if a problem (A) is NP-Complete, we must take four steps:
Prove that A is in NP
Transform a known NP Complete problem (B) into A in polynomial time
Prove that an answer to A is an answer to B
Prove that an answer to B is an answer to A
In your problem, you start with the known NP-Complete problem nSudoku, with the goal to first show that factorization is also NP-Complete. To do this, we would first show that factorization is in NP. You then provide the information that nSudoku can be transformed to factorization in polynomial time. If we then show that an answer to nSudoku is an answer to factorization and vice versa, then we have proven that factorization is NP-Complete.
We will then follow this same pattern for factorization and the problem of sorting an integer array to prove that the problem of sorting an integer array is NP Complete (starting with the fact that factorization is in NP). This, however, complicates things, because the problem of sorting an integer array is actually in P, as you can sort an integer array in O(nlogn), which is polynomial time.
At the core of this question is the "P versus NP problem", which is an unsolved problem that asks whether every problem in NP is really in P (in other words if every problem that has a decision problem that can be verified in polynomial time can ALSO be solved in polynomial time). To this date, there is no answer to the problem.
However, in your problem we prove that a problem that is known to be P is also NP complete, which then results in the conclusion stated in your problem that P=NP.
From a textbook, it says:
The best deterministic method currently known for deciding languages in NP uses exponential time. In other words, we can prove that
...
Why is this true? I can't seem to find the intuition for this.
NP belongs to EXPTIME (though we're not sure whether or not it's a proper subset) because, intuitively, you can trace through all possible paths of a polynomial-time NTM in exponential time.
More concretely, consider any language L in NP. There has to be a polynomial-time NTM for it; let's call it M and say that it runs in nondeterministic time O(nk). For simplicity, we'll assume that the NTM only uses binary nondeterminism (i.e. at each step, it has at most two choices to pick from). This means that the maximum possible number of different branches of the nondeterminism is then given by 2O(nk), and each one can be simulated in polynomial time by simulating the execution of the NTM on that branch. This means that the total time is poly(n) · 2O(nk) = O(2O(nk)), so this deterministic algorithm runs in exponential time.
Now, this doesn't mean that you have to spend deterministic exponential time to solve NP problems. It just says that if you want to use a deterministic algorithm, you need at most exponential time. The whole P versus NP question is about whether you can do better.
Hope this helps!
any problem in NP can be solved in deterministically exponential time,
or we can say that
any language in NP can be decided by an algorithm running in time 2^O(n^k)
i.e., NP ⊆ EXP
informally speaking, we just try each one of the possible solutions and then decide it
However, there is a simple example that I can not figure out what's wrong with the idea i made
Here it is..
The Traveling Salesman problem : given a undirected graph G=(V,E) V=|n|
This is a well-known NP-complete problem, therefore, indeed belongs to NP
And I try to analyse the running time..like this:
I simply list out all the possible solutions, and there are (n-1)! possible tours in total
Then I check each one of them, it takes O(n) for each possible tour
The total running time will be O(n!)
It doesn't look like can be bounded above by 2^O(n^k), i.e., exponential time
where is the pitfall of this analysis?
or in the other word, how can we explain traveling salesman problem indeed can be decided by an algorithm running in time 2^O(n^k)
Note that
n! ≤ nn = (2log n)n = 2n log n ≤ 2n2
So n! = 2O(n2), so n! ∈ EXP.
Hope this helps!
If someone were able to prove an exponential lower bound for a NP-complete problem, would that prove that P ≠ NP?
Yes, that would prove that P is not equal to NP. All polynomials are bounded from above by any exponential function, so an exponential lower bound on any NP problem would prove that the problem is not in P, and thus would prove that P cannot equal NP.
Hope this helps!
You are absolutely right.
If you prove an exponential lower bound for A, you have shown that A cannot lie in P. If A did lie in P, it would be decidable in polynomial time which is asymptotically faster than your just proven lower bound - we have a contradiction!
However, you don't have to pick an NP-complete problem. You can pick any language A in NP. By proving that A does not lie in P, you have also proven that P does not equal NP. Why? Because if P did equal NP, A would also lie in P, since we just picked A from NP.
I have been having some difficulty understanding reductions using NP problems and would like clarification. Consider the following problem:
Show that the following problem is NP-Complete by designing
a polynomial-time reduction algorithm from an already known
NP-Complete problem.
Problem: Given an undirected graph G=(V,E) and integer k,
test whether G has a cycle of length k.
I know there are other topics regarding this subject, but I am still not sure I understand how reductions like this would be done.
It is my understanding that this is how you would approach a problem such as this.
Assume the given problem can be solved in polynomial time.
Use the given problem to solve a problem that we know is NP-Hard in polynomial time
This creates a contradiction, so the assumption must be incorrect
Thus, the given problem mustn't be solvable in polynomial time
So, for a problem like this, would this be a proper approach?
If we choose k to be the length of the Hamiltonian cycle in the graph (assuming there is one) that means that this problem could be used to find the Hamiltonian cycle in the graph.
Because we can only find the Hamiltonian cycle in NP time, this problem must also only be solvable in NP time.
This looks rather like homework so I'll only give you a hint, but try consider a unweighted graph V, with k nodes. What is equivalent to finding a cycle with length k, which is solvable with the algorithm you assumed that is polynomial? Try to proceed from this.