
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Some concept of Data Structures and Algorithm are Permutation, Representation, Implemented, Algorithm Design, Dynamic Programming, Graph Data Structures, String Processing, General Trees. Main points of this lecture are: Other Reductions, Dense Subgraph Problem, Subgraph, Contain, Bandersnatch, Instance, Bo-Billy Problem, Solve, Problem, Preserved
Typology: Slides
1 / 24
This page cannot be seen from the preview
Don't miss anything!

















Show that the Dense subgraph problem is NP-complete: Input: A graph G, and integers k and y. Question: Does G contain a subgraph with exactly k vertices and at least y edges?
Now suppose my reduction translates G to Y in O(P (n)):
The second argument is the idea we use to prove problems hard!
Instance: A set of integers S and a target integer t. Problem: Is there a subset of S which adds up exactly to t? Example: S = { 1 , 4 , 16 , 64 , 256 , 1040 , 1041 , 1093 , 1284 , 1344 } and T = 3754 Answer: 1 + 16 + 64 + 256 + 1040 + 1093 + 1284 = T Observe that integer partition is a number problem, as opposed to the graph and logic problems we have seen to date.
The reduction from vertex cover will create n + m numbers from G. The numbers from the vertices will be a base-4 realization of rows from the incidence matrix, plus a high order digit:
xi = 4|E|^ + ∑| jE=0|− 1 b[i, j] × 4 j ie. V 2 = 10100 becomes 45 + (4^4 + 4^2 ). The numbers from the edges will be yi = 4j. The target integer will be
t = k × 4 |E|^ +
|E∑|− 1 j=
2 × 4 j
Each column (digit) represents an edge. We want a subset of vertices which covers each edge. We can only use k x vertex/numbers, because of the high order digit of the target. x 0 = 100101 = 1041 x 2 = 111000 = 1344 y 1 = 000010 = 4 We might get only one instance of each edge in a cover - but we are free to take extra edge/numbers to grab an extra 1 per column.
Any solution to S must contain exactly k vertex/numbers. Why? It cannot be more because the target in that digit is k and it cannot be less because, with at most 3 1′s per edge/digit-column, no sum of these can carry over into the next column. (This is why base- 4 number were chosen). This subset of k vertex/numbers must contain at least one edge-list per column, since if not there is no way to account for the two in each column of the target integer, given that we can pick up at most one edge-list using the edge number. (Again, the prevention of carrys across digits prevents any other possibilites). Neat, sweet, and NP -complete!
Notice that this reduction could not be performed in polyno- mial time if the number were written in unary 5 = 11111. Big numbers is what makes integer partition hard!
Example: v 1 ≥ 1 , v 2 ≥ 0 v 1 + v 2 ≤ 3 f (v) : 2v 2 , B = 5
Since the maximum value of f (v) given the constraints is 2 × 2 = 4, there is no solution.
We use a reduction from Satisfiability Any SAT instance has boolean variables and clauses. Our Integer programming problem will have twice as many variables as the SAT instance, one for each variable and its compliment, as well as the following inequalities: For each variable vi in the set problem, we will add the following constraints:
Any SAT solution gives a solution to the IP problem – A TRUE literal in SAT corresponds to a 1 in the IP. If the expression is satisfied, at least one literal per clause must be TRUE, so the sum in the inequality is ≥ 1. Any IP solution gives a SAT solution – All variables of any IP solution are 0 or 1. Set the literals corresponding to 1 to be TRUE and those of 0 to FALSE. No boolean variable and its complement will both be true, so it is a legal assignment which satisfies the clauses. Neat, sweet, and NP-complete!
A nice example of a reduction goes from sorting numbers to the convex hull problem:
We must translate each number to a point. We can map x to (x, x^2 ).
5 11 13 17
Each integer is mapped to a point on the parabola y = x^2.