* = Items in bold red are FYI. * = Items in normal red are the answer. 2. Consider the bipartite Edge Cover problem, wherein we are given a bipartite graph G and an integer k. We want to choose a subset of edges S such that |𝑆| ≤ 𝑘, and every node is adjacent to an edge in S. a. Explain why Bipartite Edge Cover is ∈ NP. To prove that a problem is in NP, you need to verify that a certificate (an algorithm) can solve this problem in polynomial time. It doesn't matter too much if it takes a long time to find the right answer just as long as the answer comes out right eventually. To prove that this problem, the Bipartite Edge Cover, is in NP, suppose that a set of max k edges are chosen randomly from graph G to form set S. Using each of those edges in S, each vertex in G is checked to make sure that some edge E = (u, v) ∈ S. To choose k number of edges to insert into S, it would take k number of operations to do so. And to check to make sure each vertex in G is involved with S, it would take v number of vertices to look through and k number of edges to look through which in total would take vk number of operations. Both inserting into S and checking for a bipartite edge cover, take polynomial time, thus this problem is in NP. b. Consider the following reduction from Bipartite Edge Cover to Set Cover. For each edge (u, v) in the Bipartite Edge Cover problem, create a set with exactly two elements: u and v. Explain why this reduction doesn't prove that Bipartite Edge Cover is NP-Complete. To prove that a problem is NP-Complete, there are two steps. The first step is to prove that it is an NP problem (done in part a) and then the second step is to take any known example in the NP-Complete and prove that the reduction of problem A to B or A ≤p B. Every solution that is in A must be a solution of B and every solution that is not in A must not be a solution of B. Assume that the reduction from Bipartite Edge Cover to Set Cover is NP-Complete. This means that the Set Cover can be reduced from a Bipartite Edge Cover or the solution of the Set Cover will be the same as the Bipartite Edge Cover. To reduce the Edge Cover problem to a Set Cover problem, each edge (u, v) is inserted as {u, v} into the set cover. Also the k number of edges in the edge cover will also be a restriction in the set cover. Since this is an NP-Complete solution to Set Cover, this reduction will create a polynomial time algorithm. However, to solve the Set Cover problem with only k operations, takes exponential amount, kC|S|, number of possibilities as there are |S| number of edges in S. Thus leading to the contradiction that it will still take non-polynomial time and cannot prove the Bipartite Edge Cover is NP-Complete. c. Consider the following reduction from Set Cover to Bipartite Edge Cover. For each element in the Set cover problem, create a node. Add an edge between two nodes if both elements appear in the same set. Explain why this reduction doesn't prove that Bipartite Edge Cover is NP-Complete. Assume that the reduction from Set Cover to Bipartite Edge Cover is NP-Complete. This means that the Bipartite Edge Cover can be reduced from a Set Edge Cover or the solution of the Bipartite Edge Cover will be the same as the Set Edge Cover. To reduce the Set Cover problem to a Bipartite Edge Cover problem, each node is inserted and edges are created to make the entire graph. To do this amount of operations, there would be nm number of operations because it would take n number of operations to go through each set and compare sets against each other and m number of operations to compare sets together. All of that would take exponential amount of time; but it's supposed to polynomial amount of time. Thus the contradiction is false and the Bipartite Edge Cover is not NP-Complete d. Give a poly-time reduction from Bipartite Matching, thereby proving that Bipartite Edge Cover ∈ P. The steps is the same way as the other reductions. Try to prove that it can be reducible and that it is always polynomially solveable. To prove that the Bipartite Edge Cover is in P (polynomial time), what is needed to be proven is Bipartite Edge Cover is polynomially reducible down to Bipartite Matching. To do that the Bipartite Matching will be mapped using Maximum Matching. The Maximum Matching will take values of one graph G, vertices that are not included with an edge are unmatched and the vertices that are includes with an edge are matched. With Maximum Matching, the unmatched nodes that contain the most edges will be selected first and then those edges will be removed and the process will be repeated. This algorithm always takes polynomial time going through k number of edges and checking v number of vertices, thus it will always be vk amount of time, thus proving the Bipartite Edge Cover problem is in P. 3. Recall the Subset Sum problem, wherein we are given a set of integers 𝑋 = {𝑥1 , 𝑥2 , … , 𝑥𝑛 } and a target T. We want to determine whether there is a subset of the integers which add up exactly to the target. Consider also the Separation problem, wherein we are given a set of integers 𝑆 = {𝑎1 , 𝑎2 , … , 𝑎𝑛 }, and we want to determine whether we can partition S into two sets S1 and S2 such that ∑𝑎𝑖∈𝑆1 𝑎𝑖 = ∑𝑎𝑗∈𝑆2 𝑎𝑗 . Recall that if we partition S, this means 𝑆1 ∪ 𝑆2 = 𝑆 and 𝑆1 ∩ 𝑆2 = ∅. a. Explain why both problems are ∈ NP. The Subset Sum problem is in NP because the solution set can be done normally in exponential (non-polynomial) time. To get a polynomial time solution, choose randomly a group of integers S from the set of integers in X such that S = {s1, s2, s3, ..., sm} where 𝑚 ≤ 𝑛. Choosing m elements would take m amount of time to place them in set S while adding them up will cost a total of m operations to add one by one, to get a total time of 2m and then the last step is to check to see if the sum == target T. Thus this problem is in complexity class, NP. The Separation Problem is in NP because solution set would also take normally nonpolynomial time. To do this in deterministic polynomial time, go through each element in S and randomly choose S1 or S2 to have the value in S be placed in either set. S1 will be of size p and S2 will be of size q where p + q = n. To go through each element in S and place them in the two new sets it would be n operations and to add up each set individually it would take p + q number of operations which would give: n + p + q total number of operations. Since n + p + q is polynomial time, this problem can be in NP problem set. b. Give a poly-time reduction from the Separation problem to Subset Sum. To reduce the Separation problem into Subset Sum problem, there will still be two sets of values from the Separation problem to the Subset sum problem but with a twist. Instead of one value matching up with the value of the target T, S1 and S2 are both equal to the same target value (not T but some value). In a sense the Separation problem is a very specific type of Subset Sum problem in that both will match up to some value, it's just instead of an arbitrary T value, it will be the other set's value. c. It turns out the Subset Sum is a well-known NP-Complete problem. Given that fact that you have found the reduction Separation ≤p Subset Sum in part b, what does this prove about the Separation problem? Explain your answer. Since the Subset Sum problem is an NP-Complete problem that means it is also in the NP class and also NP-Hard. Since the Separation Problem can be polynomially reduced to Subset Problem, the Separation Problem is also NP-Complete, in the class NP and is at least as hard as solving the Subset Sum problem. The reason is if a problem can be reduced to another, then it takes on the characteristics of that problem it's being compared to. d. Suppose that ∑𝑖 𝑥𝑖 = 2 ∙ 𝑇 − 𝑦, for some integer y. Give a poly-time reduction from Subset Sum to the Separation Problem (Hint: add y to your set of integers). To reduce the Subset Sum to the Separation Problem, using ∑𝑖 𝑥𝑖 = 2 ∙ 𝑇 − 𝑦, the first step is to add y to both sides which gives: ∑𝑖 𝑥𝑖 + 𝑦 = 2 ∙ 𝑇. To transform this formula into the Separation Problem, the sum of the two sets must be equal to some target value, thus if T is transformed into the target value of the sum of the two sets (that make T equal to each other), ∑𝑖∈𝑆 𝑥𝑖 + 𝑦 = ∑𝑖∈𝑆1 𝑥𝑖 + ∑𝑗∈𝑆2 𝑥𝑗 . In a sense there's some transformed value that takes the target value, adds the value of y, to get the new poly-time reduction for the subset sum problem. e. Now give a general poly-time reduction from Subset Sum to the Separation problem, thereby proving that the Separation problem is NP-Complete. The Separation Problem is NP, from part (a), thus the next step is to prove that the Separation Problem is polynomially reducible from another NP-Complete problem -- which in this case will be the Subset Sum. To map to the Separation Problem from Subset Sum, the values of x in 𝑋 = {𝑥1 , 𝑥2 , … , 𝑥𝑛 } map to their respective values of 𝑆 = {𝑎1 , 𝑎2 , … , 𝑎𝑛 },where ai = xi. Now the values are linked together. When S is partitioned into two sets S1 and S2 that same set will be partitioned the same way in X as X1 and X2. So the sum(S 1) + sum(S2) = sum(S) and the sum(X1) + sum(X2) = sum(X). Since they are the same sum(S) and sum(X), it will always result in the same final result YES or NO. Thus this problem is polynomially reducible as NP-Complete. 4. In the 4-SAT problem, every clause has exactly 4 variables or their negations, and is otherwise exactly identical to 3-SAT. Prove that 4-SAT is NP-Complete. To prove 4-SAT is NP-Complete, the 4-SAT problem must be a problem that is in NP, non-deterministic polynomial, and that it can be polynomially reducible from another NP-complete problem. Proof that 4-SAT is NP. Suppose to solve this problem in a deterministic algorithm is to select some group of boolean values (TRUE/FALSE) for all each variable that occurs in the conjunctive normal form. Using that one set of boolean values, the values are checked with the expression to see if it is accepts or rejects it as something that makes every statement true in the conjunctive normal form, which would take 4m number of evaluations, where m is the number of terms in the CNF expression which is done in polynomial time. To find the right answer though, it'd take O(4n) number of combinations. Proof that 4-SAT is polynomially reducible from SAT, another NP-Complete problem. There are a couple of cases here for the SAT transforming into a 4-SAT problem: both of which deal with abnormal size cases having fewer than or more than 4 variables in a clause. Case 1: There are fewer than 4 variables per clause. In terms of Case 1, one of the variables can be repeated more than once for instance if a clause is (a or b or c) then a, b, or c can be repeated to make the 3 variable clause into a 4 while keeping the same evaluation of the clause: in this case (a or a or b or c). Case 2: There are more than 4 variables per clause. In terms of Case 2, introducing a new variable and breaking the expression up into two separate clauses would be the way to go. For instance if the clause were to be (a or b or c or d or e) which has 5 variables, a split can be done down the middle with a new variable introduced, f, to make (a or b or f) and (not f or c or d or e). Altering one version of SAT to a 4-SAT would take polynomial amount of time proportional to the length of this full expression, thus 4-SAT is polynomially reducible from SAT and also NP-Complete.