Download presentation
Presentation is loading. Please wait.
1
Reduction Techniques Restriction Local Replacement Component Design Examples
2
Restriction Show that a special case of the problem you are interested in is NP-complete. For example: –Long Path Problem –Input: Graph G = (V,E), Integer k –Yes/No Question: Does G have a simple path of length at least k? –What special case of this problem is another problem we have considered?
3
Local Replacement Make many independent (non-interacting) local changes to the structure. Example: Reducing SAT to 3SAT Work on each clause of the SAT instance independently as follows
4
Easy Cases Suppose a clause contains k literals: if k = 1 (meaning C i = {z 1 } ), we can add in two new variables v 1 and v 2, and transform this into 4 clauses: {v 1, v 2, z 1 } {v 1, v 2, z 1 } { v 1, v 2, z 1 } { v 1, v 2, z 1 } if k = 2 ( C i = {z 1, z 2 } ), we can add in one variable v 1 and 2 new clauses: {v 1, z 1, z 2 } { v 1, z 1, z 2 } if k = 3 ( C i = {z 1, z 2, z 3 } ), we move this clause as-is.
5
Harder Case if k > 3 ( C i = {z 1, z 2, …, z k } ) we can add in k - 3 new variables (v 1, …, v k-3 ) and k - 2 clauses: {z 1, z 2, v 1 } { v 1, z 3, v 2 } { v 2, z 4, v 3 } … { v k-3, z k-1, z k } Thus, in the worst case, n clauses will be turned into n 2 clauses. This cannot move us from polynomial to exponential time.
6
Component Design These are the more elaborate problems where we design complex interacting components Examples: –Reducing 3SAT to independent set –Reducing independent set to Hamiltonian Cycle
7
Truth Assignment Component For each variable, we can create two vertices: … v 1 v 1 v 2 v 2 v 3 v 3 v n v n If we connect a variable and its negation, we can be sure that only one of them is in the independent set. We will set our integer bound for independent set to force one vertex from each pair to be chosen.
8
Clause Component … v 1 v 1 v 2 v 2 v 3 v 3 v n v n For each clause, we create a triangle: v 3 v 7 v1v1 v 3 v 4 v2v2 v 5 v 6 v4v4 At most one vertex in a triangle can be in the independent set. We will set our integer bound for independent set to force one vertex from each triangle to be chosen.
9
Opposing literals rule v 1 v 1 v 2 v 2 v 3 v 3 v 5 v 5 v 1 v 3 v2 v2 v 2 v 4 v1 v1 v 4 v 5 v2v2 v 4 v 4 v 4 v 5 v3 v3 C ={ v 1, v 2, v 3 }, {v 1, v 2, v 4 }, { v 2, v 4, v 5 }, {v 3, v 4, v 5 }
10
Independent Set to Ham Cycle Edge Component: For every edge in the Minimum Vertex Cover problem, we create a component in the Hamiltonian Cycle Problem: v u u u v v
11
Observations…. u u v v u u v v u u v v There are only three possible ways that a cycle can include all of the vertices in this component. Key property: If a path enters v (u), it leaves on v’ (u’)
12
u u u u Node Selection u v v w w u x x All components that represent edges connected to node u are strung together into a chain. If there are V vertices, then we will have V of these chains, all interwoven. Choosing a node u corresponds to traversing such a chain
13
u v v v u u u u w w u x x y y v v z z v vu yw xz Vertex cover = (v,u)
14
u v v v u u u u w w u x x y y v v z z v vu yw xz Vertex cover = (v,w,x)
15
Tying the Chains Together If we want to know if its possible to cover the original graph using only k vertices, this would be the same as seeing if we can include all of the vertices using only k chains. How can we include exactly k chains in the Hamiltonian Cycle problem? We must add k extra vertices and connect each of them to the beginning and end of every chain. Since each vertex con only be included once, this allows k chains in the final cycle.
16
Beginning a Transform
17
The Final Transform for k=1
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.