Instructor: Aaron Roth

Slides:



Advertisements
Similar presentations
Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems.
Advertisements

Max Cut Problem Daniel Natapov.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
NP-Completeness: Reductions
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Fall 2006Costas Busch - RPI1 More NP-complete Problems.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
APPROXIMATION ALGORITHMS VERTEX COVER – MAX CUT PROBLEMS
Lecture 22 More NPC problems
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Suppose I construct a TM M f which: 1. Preserves its input u. 2. Simulates a machine M b on input ε. 3. If M b hangs on input ε, force an infinite loop.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
NPC.
Prof. Busch - LSU1 Busch Complexity Lectures: More NP-complete Problems.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
Costas Busch - LSU 1 More NP-complete Problems. Costas Busch - LSU 2 Theorem: If: Language is NP-complete Language is in NP is polynomial time reducible.
The Theory of NP-Completeness
The NP class. NP-completeness
More NP-Complete and NP-hard Problems
P & NP.
Chapter 10 NP-Complete Problems.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
More NP-complete Problems
More NP-complete Problems
Richard Anderson Lecture 26 NP-Completeness
(xy)(yz)(xz)(zy)
NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Intro to Theory of Computation
Computability and Complexity
CS154, Lecture 16: More NP-Complete Problems; PCPs
Where Can We Draw The Line?
Intro to NP Completeness
More NP-complete Problems
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
Additional NP-complete problems
Approximation Algorithms
Richard Anderson Lecture 28 NP Completeness
NP-Complete Problems.
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
CSE 6408 Advanced Algorithms.
NP-Completeness Yin Tat Lee
The Theory of NP-Completeness
CS154, Lecture 16: More NP-Complete Problems; PCPs
CS21 Decidability and Tractability
Trevor Brown DC 2338, Office hour M3-4pm
Instructor: Aaron Roth
Instructor: Aaron Roth
CHAPTER 7 Time complexity
Lecture 23 NP-Hard Problems
Presentation transcript:

Instructor: Aaron Roth aaroth@cis.upenn.edu CIS 262 Automata, Computability, and Complexity Spring 2019 http://www.seas.upenn.edu/~cse262/ Instructor: Aaron Roth aaroth@cis.upenn.edu Lecture: April 22, 2019

Vertex Cover A vertex cover of a graph G is a subset of vertices S such that every edge in G is adjacent to a vertex in S.

Vertex Cover A vertex cover of a graph G is a subset of vertices S such that every edge in G is adjacent to a vertex in S. VERTEX-COVER = {<G,k> | G is a graph with a vertex cover of size k}

Vertex Cover Theorem: VERTEX-COVER is NP-Complete. Proof: VERTEX-COVER is clearly in NP: The cover itself is the certificate. 3SAT ≤ 𝑃 VERTEX-COVER.

Vertex Cover Theorem: VERTEX-COVER is NP-Complete. Proof: Given: A formula 𝜙 with L variables and m clauses. Construct: A graph G and a cover-size k. For each variable 𝑥 𝑖 , create two “variable” vertices and connected by an edge. One of these will need to be chosen in any vertex cover: will correspond to truth value for 𝑥 𝑖 . For each clause ( 𝑎 1 ∨ 𝑎 2 ∨ 𝑎 3 ), create three vertices all connected to one another, and to the variable vertices with the same label. At least two of these will need to be chosen in any vertex cover – three if no edge to a variable vertex is already covered. Set k = L + 2m. 𝑥 𝑖 𝑥 𝑖 𝑎 1 𝑎 2 𝑎 3

Vertex Cover Theorem: VERTEX-COVER is NP-Complete. Proof: Example Construction 𝜙= 𝑥 1 ∨ 𝑥 1 ∨ 𝑥 2 ∧ 𝑥 1 ∨ 𝑥 2 ∨ 𝑥 2 ∧ 𝑥 1 ∨ 𝑥 2 ∨ 𝑥 2 (L = 2, m = 3) k = 2 + 2x3 = 8 𝑥 1 𝑥 1 𝑥 2 𝑥 2 𝑥 1 𝑥 1 𝑥 1 𝑥 2 𝑥 1 𝑥 2 𝑥 2 𝑥 2 𝑥 2

Vertex Cover Theorem: VERTEX-COVER is NP-Complete. Proof: 𝜙= 𝑥 1 ∨ 𝑥 1 ∨ 𝑥 2 ∧ 𝑥 1 ∨ 𝑥 2 ∨ 𝑥 2 ∧ 𝑥 1 ∨ 𝑥 2 ∨ 𝑥 2 Observation: Any vertex cover needs to choose one variable vertex for each variable, and at least two clause vertices for each clause. So: VC ≥ L + 2m = k. To show: there is a VC of size k iff 𝜙 is satisfiable. 𝑥 1 𝑥 1 𝑥 2 𝑥 2

Vertex Cover Theorem: VERTEX-COVER is NP-Complete. Proof: 𝜙= 𝑥 1 ∨ 𝑥 1 ∨ 𝑥 2 ∧ 𝑥 1 ∨ 𝑥 2 ∨ 𝑥 2 ∧ 𝑥 1 ∨ 𝑥 2 ∨ 𝑥 2 ⇒: Suppose 𝜙 is satisfiable. Let 𝜌 be a satisfying assignment. Add 𝐿 variable vertices to the cover, corresponding to true literals in 𝜌 Choose a true literal in each clause. Add the other two clause vertices. Every edge in variable gadget covered. Every edge in clause gadget covered. Every edge between variable and clause gadgets covered since clause vertices are chosen when corresponding variable vertices are not. 𝑥 1 𝑥 1 𝑥 2 𝑥 2 𝑥 1 𝑥 1 𝑥 1 𝑥 2 𝑥 1 𝑥 2 𝑥 2 𝑥 2 𝑥 2

Vertex Cover Theorem: VERTEX-COVER is NP-Complete. Proof: 𝜙= 𝑥 1 ∨ 𝑥 1 ∨ 𝑥 2 ∧ 𝑥 1 ∨ 𝑥 2 ∨ 𝑥 2 ∧ 𝑥 1 ∨ 𝑥 2 ∨ 𝑥 2 ⇐: Suppose there is a vertex cover of size 𝑘=𝐿+2𝑚. It must include exactly one vertex from each variable gadget, and two vertices for each clause gadget. Let 𝜌 be the truth assignment corresponding to the literals chosen in the variable gadgets. 𝜌 is a satisfying assignment. Every edge between clause and variable gadgets is covered, but only two are covered by clause vertices. So every clause contains a true literal. 𝑥 1 𝑥 1 𝑥 2 𝑥 2 𝑥 1 𝑥 1 𝑥 1 𝑥 2 𝑥 1 𝑥 2 𝑥 2 𝑥 2 𝑥 2

The optimization version: Vertex Cover Theorem: VERTEX-COVER is NP-Complete. The optimization version: MIN-VC: Given a graph G, find the smallest vertex cover S. MIN-VC is not a decision problem, so not in NP. But… If we can solve MIN-VC in polynomial time, we can solve VERTEX-COVER (and vice versa) Why? So, MIN-VC is NP-hard.

But suppose we want to solve MIN-VC… Vertex Cover But suppose we want to solve MIN-VC… What do we do? A couple of options: Try and solve it anyway. (e.g. encode vertex cover as a 3SAT instance, and run a commodity SAT solver.) Might work on your instance. Not guaranteed to work. Design an Approximation Algorithm A poly-time algorithm guaranteed to find a vertex cover quickly. But not necessarily the smallest vertex cover.

S is a vertex cover of G, and Given a graph G, let OPT(G) denote the size of the smallest vertex cover of G. An algorithm A is a c-approximation algorithm for MIN-VC if, given any graph G as input, A outputs a subset of vertices S such that: S is a vertex cover of G, and |S| ≤ c⋅OPT(G) We want to find polynomial time approximation algorithms with small approximation factors c.

Lets try designing an approximation algorithm. Vertex Cover Lets try designing an approximation algorithm. Greedy(G): Let 𝑆←∅, G’ ← G While G’ has any remaining edges: Find any un-covered edge (u,v). Choose any endpoint v. Add v to S, remove v from G’. Output S. S: 4 1 3 5 5 1 2 4

Lets try designing an approximation algorithm. Vertex Cover Lets try designing an approximation algorithm. Is Greedy a good approximation algorithm? No: Greedy is not a c-approximation algorithm for any c. Consider a star graph G with c+1 vertices. Optimal cover has size OPT(G) = 1. But Greedy can pick a cover of size c.

Vertex Cover Another Attempt Greedy2(G): Let 𝑆←∅, G’ ← G While G’ has any remaining edges: Find any un-covered edge (u,v). Add both u and v to S, remove u and v from G’. Output S. S: 4 1 3 2 5 3 1 2 4

Vertex Cover Another Attempt Is Greedy2 a good approximation algorithm? Seems wasteful! Adds two vertices to cover a single edge! How does it do on the star example? Never finds OPT… But always finds a cover of size 2.

Vertex Cover Theorem: Greedy2 is a poly-time 2-approximation algorithm for MIN-VC. Proof: Clearly, Greedy2 runs in polynomial time. Greedy2 always outputs a vertex cover S since it continues to add vertices to S until all edges are covered. To show: For every graph G, |S| ≤ 2⋅OPT(G).

Vertex Cover Theorem: Greedy2 is a poly-time 2-approximation algorithm for MIN-VC. Proof: Let H denote the set of edges selected by the algorithm. By construction, |S| = 2⋅|H|. Observe that OPT(G) ≥ |H|: By construction, none of the edges in H share an endpoint (because we remove both endpoints from the graph before selecting the next edge). So every edge in H must be covered by a different vertex. So: |S| = 2⋅|H| ≤ 2⋅OPT(G).

Vertex Cover Theorem: Greedy2 is a poly-time 2-approximation algorithm for MIN-VC. No better algorithm is known. Finding a poly-time 1.99-approximation algorithm for MIN-VC would disprove the “Unique Games Conjecture”

Max-Cut A cut in a graph G is a partition of the vertices into two sets S, T. The size of the cut is the number of edges crossing the partition. S: T: MAX-CUT: Given G, find the largest cut. NP-hard (See book). 4 3 6 2 1 5

Max-Cut Can we give an approximation algorithm for MAX-CUT? LocalSearch(G): Let S, T be an arbitrary partition of the vertices of G. Until there are no more changes: If one exists, find a vertex v such that moving it from S to T or from T to S increases the size of cut(T,S). Swap v to the other set in the partition.

Max-Cut LocalSearch Example: S: T: 4 3 6 2 1 5

Max-Cut LocalSearch Example: S: T: 4 3 6 2 1 5

Max-Cut LocalSearch Example: S: T: 4 3 6 2 1 5

Max-Cut Can we give an approximation algorithm for MAX-CUT? Theorem: LocalSearch is a polynomial time 2-approximation algorithm for MAX-CUT. e.g. finds a cut of size at least half of the max-size cut.

Cut(S,T) ≥ |E|/2 ≥ OPT(G)/2 Max-Cut Can we give an approximation algorithm for MAX-CUT? Theorem: LocalSearch is a polynomial time 2-approximation algorithm for MAX-CUT. Proof: Polynomial time: By definition, each swap increases the cut size by at least 1. The cut can’t get larger than size |E| ≤ 𝑛 2 . So algorithm halts after at most 𝑛 2 rounds. Cut size: At final cut, #cut-edges adjacent to each vertex is ≥ #uncut-edges. (Otherwise we keep going). So more edges cut than uncut. So cut(S,T) ≥ |E|/2. But obviously, OPT(G) ≤ |E|. Therefore: Cut(S,T) ≥ |E|/2 ≥ OPT(G)/2