Other Reductions - Data Structures and Algorithm - Lecture Slides, Slides of Data Structures and Algorithms

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

2012/2013

Uploaded on 04/27/2013

shareeka_555
shareeka_555 🇮🇳

4

(6)

74 documents

1 / 24

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Other Reductions
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Other Reductions - Data Structures and Algorithm - Lecture Slides and more Slides Data Structures and Algorithms in PDF only on Docsity!

Other Reductions

Problem of the Day

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?

What Does this Imply?

Now suppose my reduction translates G to Y in O(P (n)):

  1. If my Bo-billy subroutine ran in O(P ′(n)) I can solve the Bandersnatch problem in O(P (n) + P ′(n′))
  2. If I know that Ω(P ′(n)) is a lower-bound to compute Bandersnatch, then Ω(P ′(n) − P (n′)) must be a lower- bound to compute Bo-billy.

The second argument is the idea we use to prove problems hard!

Integer Partition (Subset Sum)

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.

Using the Incidence Matrix

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

Why?

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.

Integer Partition in S → V C in G

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.

Integer Programming is NP-Hard

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:

  • 1 ≤ Vi ≤ 0 and 1 ≤ V (^) i ≤ 0 Both IP variables are restricted to values of 0 or 1, which makes them equivalent to boolean variables restricted to true/false.

Why?

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!

Things to Notice

  1. The reduction preserved the structure of the problem. Note that the reduction did not solve the problem – it just put it in a different format.
  2. The possible IP instances which result are a small subset of the possible IP instances, but since some of them are hard, the problem in general must be hard.
  3. The transformation captures the essence of why IP is hard
    • it has nothing to do with big coefficients or big ranges on variables; for restricting to 0 / 1 is enough. A careful study of what properties we do need for our reduction tells us a lot about the problem. Docsity.com

Convex Hull and Sorting

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.