example of reduction a polynomial decision to an NP-complete - complexity-theory

I know if I reduce an NP-complete problem to a unknown problem P then I'm sure that P is itself NP-complete. And I know if I reduce a Problem P to an NP-complete problem there is no conclusion. So I want to give an example to show that we can reduce a Polynomial solvable problem P to an NP-complete one.

If I reduce an NP-complete problem to a unknown problem P then I'm
sure that P is itself NP-complete
No, this is not well formulated. If an NP-complete problem A is reducible to a problem P all we can say is that any problem in NP is reducible to P. To say that P is NP-complete we need to know additionally that P is itself in NP.
What you probably intended to say was
If I reduce an NP-complete problem to some a unknown problem P in NP then I'm
sure that P is itself NP-complete
Now to your original question.
give an example to show that we can reduce a Polynomial solvable
problem P to an NP-complete one
Consider the problem known as 2-SAT: Given a boolean formula in conjunctive normal form such that each disjunction contains at most two variables tell it if is satisfiable.
Solving this problem following an algorithm by Aspvall, Plass & Tarjan (1979) involves building an implication graph and finding all its strongly connected components. The paper proves that the formula is satisfiable if and only if the implication graph does not contain a strongly connected component that include some variable together with its negation. It also shows that this algorithm is linear in the size of the formula encoding.
So
there exists a linear algorithm for 2-SAT.
2-SAT is reducible to unrestricted boolean satisfiability problem known as SAT.
This gives an example of a polynomially solvable problem (2-SAT) that is reducible to an NP-complete problem (SAT).

Related

Classification and complexity of generating all possible combinations: P, NP, NP-Complete or NP-Hard

The algorithm needs to generate all possible combinations from a given list (empty set excluded).
list => [1, 2, 3]
combinations => [{1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}]
This algorithm would take O(2n) time complexity to generate all combinations. However, I'm not sure if an improved algorithm can bring this time complexity down. If an improved algorithm exists, please do share your knowledge!
In the case that it takes O(2n) which is exponential, I would like some insight regarding which class this algorithm belongs to P, NP, NP-Complete, or NP-Hard. Thanks in advance :)
P, NP, NP-complete, and NP-hard are all classes of decision problems, none of which contain problems that involve non-binary output (such as this enumeration problem).
Often people refer colloquially to problems in FNP as being in NP. This problem is not in FNP either because the length of the output string for the relation must be bounded by some polynomial function of the input length. It might be FNP-hard, but we're getting into the weeds that even a graduate CS education doesn't cover. Worth asking on the CS Stack Exchange if you care enough.
This problem is in none of them except, arguably, NP-hard.
It is not in P because there is no polynomial time algorithm to do it. You cannot generate an exponential number of things in polynomial time.
It is not in NP because there is no polynomial time algorithm to validate the answer. You cannot process an exponential number of things in polynomial time.
It is not in NP-complete because everything in NP-complete must be in NP and it is not.
The argument for it being in NP-hard goes like this. You can say anything that you want about the members of the empty set. Including that they make monkeys fly out of your nose and can solve any problem in NP in polynomial time. So if we could find a polynomial solution, we can solve any NP problem fast, and therefore it meets the definition of NP-hard. But uselessly so - we know that no polynomial solution exists.

Reduction between problems in NP

By definition, any problem in NP can be reduced to a problem in NP-Complete. However, let's say we have two arbitrary problems X and Y in NP. Is it necessarily true that X is reducible to Y?
I'm unclear on the aspect of reduction between two arbitrary problems of a particular complexity class, so any guidance would be appreciated.
In principle there is no reason why an arbitrary problem should be reducible to another.
For a concrete example, it is known that factorization of an arbitrary integer with n bits is in NP, but it is is believed to both not be in P and not to be NP-complete. Therefore traveling salesman is not reducible to integer factorization.
https://en.wikipedia.org/wiki/NP-intermediate has a list of other problems that are in the same category, and there is no reason to believe that, for example, graph isomorphism is reducible to factoring or vice versa.

Is polynomial reduction reversible?

Is this statement true or false : "If a problem A is polynomially reducible to a problem B, then problem B must also be polynomially reducible to A".
This is wrong, consider the reducible to relationship as its hardness is less than or equal. For example, if A is polynomially reducible to B, it means that A <= B in terms of hardness (amount of computation needed to solve it). If A is reducible to B it means that A is simpler than (or as hard as) B, which means if you can solve B you can solve A, as well.
Some supplementary information:
Any problem in P, which are problems that are simple and can be solved in polynomial time, is reducible to any problem in NP-complete (e.g. SAT). This means that problems in P are simpler than problems in NP-complete. Now, if your statement was true then problems in NP-complete would have been solved in polynomial time, which is seemingly impossible (no one has proved or disproved it). And if anybody solves it there will be chaos!!!
https://en.wikipedia.org/wiki/P_versus_NP_problem
SAT problem
A world with P=NP
Here is a (slightly edited) illustration from a very well-known graduate text on Complexity Theory (C.H. Papadimitriou, Computational Complexity). It shows what a reduction from A to B is.
A reduction from A to B is an algorithm for solving A that is composed of a translation R that maps every instance of A into an instance of B, and an algorithm for B. The translation must ensure that the answer for A(x) and for B(R(x)) is the same.
The existence of a such a translation does not guarantee that the inverse translation also exists. Intuitively the images of instances of A might form a subset of easy instances of B.
Anyone can easily suggest simple examples of problems where reduction in one direction does not guarantee a reduction in the other direction. For instance, 2-SAT is trivially reducible to SAT, yet 2-SAT is solvable in polynomial time, while SAT is NP-complete.
This is false. Consider the following problem:
Given a finite automaton, does it halt on a given input?
The answer to this problem happens always to be yes since all deterministic finite automata halt on all inputs. However, this problem is polynomial-time reducible to the following problem:
Given a Turing machine, does it halt on a given input?
The answer to this problem happens to be undecidable in the general case. This is the halting problem. However, if we had an oracle for this problem, we could certainly use it to answer the first question, albeit much less efficiently:
Produce a Turing machine equivalent to the DFA
Use the oracle to determine whether the Turing machine halts.
The halting problem for Turing machines, however, is not polynomial-time reducible to the halting problem for DFAs.

What are NP-Intermediate problems?

Assuming P != NP
The euler diagram shows a part not part of P and NP-complete. I read on wikipedia that this set is called NP-Intermediate.
Euler Diagram
I have some doubts as to how are NPI problems defined?
An NP-intermediate problem is a decision problem that
is in NP (that is, "yes" answers can be verified in polynomial time),
is not in P (that is, there is no polynomial-time algorithm for solving the problem), and
is not NP-complete.
That last criterion can be stated in a number of different ways. One way to say this is that there is no polynomial-time mapping reduction from SAT to that particular problem.
These problems are primarily of theoretical interest right now because we don't know if any NP-intermediate problems exist - if we could find one, we'd have a problem in NP that's not in P, meaning that P ≠ NP! However, they're interesting because if we can prove that P ≠ NP, then we know that there are some problems in NP that are too hard to be solved in polynomial time, but which aren't among the "hardest" of the hard problems in NP (the problems that are NP-complete).
In the event that P = NP, then there would not be any NP-intermediate problems because you couldn't have a problem in NP but not in P. If P ≠ NP, then Ladner's theorem guarantees at least one NP-intermediate problem exists, but does so by specifically constructing a problem that is highly artificial and designed solely to be NP-intermediate in that case. Right now, with a few exceptions (notably the graph isomorphism problem), all the problems we know of in NP are either squarely in P or known to be NP-complete.

NP COMPLETE and NP HARD

I have to check out whether my logic is on the right path.
NP-HARD: these are the hardest problems which may/may not be in NP class. If you have an efficient algorithm for these problems you have one for every problem in class NP.
NP COMPLETE: these are the hardest problems in class NP and also if you solve one of these you could solve any problem in class NP. So, NP COMPLETE problem is an NP-HARD problem.
COOK'S THEOREM: If SAT(NP-HARD) has a polynomial time algorithm then so does every problem in class NP.
Now, suppose we have to prove that CDP(clique decision problem) is NP COMPLETE.
->Step 1: Prove that CDP is in the class NP.
It is in class NP because the prover can generate a proof for yes inputs which would enable the verifier to check that it is a CDP (has a clique of size k).
->Step 2: Prove that CDP is NP HARD.
For that, we can convert the SAT to CDP by constructing a graph from clauses and supplying k.
We supply(G,k) to the clique subroutine which would verify is there a clique of size k or not. If it can figure this out in polynomial time then SAT has a polynomial time algorithm as CDP had a polynomial time algorithm and we converted SAT to CDP. So, now we proved that if there is a polynomial time algorithm for CDP then there is for the SAT. Now if we can find a polynomial time algorithm for CDP then it would imply that there is a polynomial time algorithm for SAT. This would imply that there is a polynomial time algorithm for every problem in NP by COOK'S THEOREM.
So we proved that CDP is NP COMPLETE. Once we have added CDP to NP COMPLETE class and now we come up with a new problem which we have again to prove that it is NP COMPLETE we can prove that problem to be in NP and then we could prove that if there is an efficient algorithm for given problem then that implies that there is an efficient algorithm for SAT/CDP(as we have added this to NP COMPLETE). Then as said above we can convert this problem to CDP/SAT and then prove that if there is an efficient algorithm for our problem then there is one for CDP/SAT and then by COOK'S THEOREM again we have that if there is a solution to NP-HARD problem (in this case CDP/SAT) then there is one for every problem in NP. So we again proved our problem as NP-HARD and as now it also belongs to NP as said above it is NP COMPLETE.
So we can add as many problems to the NP COMPLETE class as long as we can convert some problem which is already in NP-HARD class(in this case SAT/CDP) into our problem and we should find an efficient algorithm to our problem which would indirectly find an efficient algorithm to the NP-HARD problem and by COOK's theorem we can say that as some NP-HARD problem has an efficient algorithm we have an efficient algorithm to solve all problems in NP.
You're on the right path, but there your logic is a little incomplete.
The general structure of your proof is correct: First prove a problem is in NP, then prove the problem is NP-Hard. Those two bits of information together prove that a problem is NP-Complete.
Your proof for proving a problem is in NP is incomplete. Here are the key components to proving a problem is in NP:
Reword the problem as a decision problem that can be answered with a yes or a no.
Describe what a "certificate" would be. NOTE: a certificate is an output that can be checked to verify the answer to the decision problem. For CDP it could be a list of vertices and edges that make up the clique of size k.
Prove that this certificate can be verified in polynomial time.
Your proof for proving NP-Hard is incomplete. Here are the key components to proving a problem is NP-Hard:
Transform the input of the known NP-Hard problem into the input for the problem you are trying to prove.
Prove that this transformation can be done in polynomial time.
Transform the output of the problem your trying to prove into the output of the known NP-Hard problem.
Demonstrate how this can be done in polynomial time.
Prove that if you get an answer for the problem you are trying to prove, then you have an answer for the known problem.
Prove that if you get an answer for the known problem you have an answer for the problem you are trying to prove.
Only by meeting those 6 criterion can you say you have completely proven that a problem is NP-Hard.
Besides the specifics on that your logic is sound. Be careful when saying "efficient" if you really mean "can be solved in polynomial time".

Resources