Computational Complexity

Similar documents
NP Complete Problems. COMP 215 Lecture 20

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

NP-Complete Reductions 1

1. Introduction Recap

Polynomial-time reductions. We have seen several reductions:

1 Primals and Duals: Zero Sum Games

Algorithm Design and Analysis

NP Completeness and Approximation Algorithms

Limitations of Algorithm Power

CS/COE

NP-Completeness. Sections 28.5, 28.6

Complexity, P and NP

Classes of Problems. CS 461, Lecture 23. NP-Hard. Today s Outline. We can characterize many problems into three classes:

COP 4531 Complexity & Analysis of Data Structures & Algorithms

SAT, NP, NP-Completeness

Essential facts about NP-completeness:

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.

Agenda. What is a complexity class? What are the important complexity classes? How do you prove an algorithm is in a certain class

CS 583: Algorithms. NP Completeness Ch 34. Intractability

Polynomial-time Reductions

NP and NP Completeness

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

Design and Analysis of Algorithms

NP-problems continued

Intro to Theory of Computation

NP-Hardness reductions

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

1.1 P, NP, and NP-complete

NP-Completeness. Dr. B. S. Panda Professor, Department of Mathematics IIT Delhi, Hauz Khas, ND-16

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015

CS21 Decidability and Tractability

NP-Completeness. Subhash Suri. May 15, 2018

Computability and Complexity Theory: An Introduction

NP-problems continued

SAT, Coloring, Hamiltonian Cycle, TSP

Algorithm Design and Analysis

Algorithm Design and Analysis

More NP-Complete Problems

Formal definition of P

Lecture 19: Finish NP-Completeness, conp and Friends

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9

CSE 135: Introduction to Theory of Computation NP-completeness

NP-Complete Problems. More reductions

Lecture 13, Fall 04/05

P and NP. Inge Li Gørtz. Thank you to Kevin Wayne, Philip Bille and Paul Fischer for inspiration to slides

CSE 421 NP-Completeness

CSCI3390-Lecture 17: A sampler of NP-complete problems

4/19/11. NP and NP completeness. Decision Problems. Definition of P. Certifiers and Certificates: COMPOSITES

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

NP-completeness. Chapter 34. Sergey Bereg

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM

More on NP and Reductions

CSE 105 THEORY OF COMPUTATION

CS 5114: Theory of Algorithms

Algorithms and Complexity Theory. Chapter 8: Introduction to Complexity. Computer Science - Durban - September 2005

8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability. Classify Problems

5. Complexity Theory

NP and Computational Intractability

NP and Computational Intractability

NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20

CSL 356: Analysis and Design of Algorithms. Ragesh Jaiswal CSE, IIT Delhi

No Harder Than. We want these transformations to effectively be a problem-hardness version of #, which we will call No Harder Than.

INTRO TO COMPUTATIONAL COMPLEXITY

Introduction to Computational Complexity

Correctness of Dijkstra s algorithm

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

P and NP. Warm Up: Super Hard Problems. Overview. Problem Classification. Tools for classifying problems according to relative hardness.

NP-Complete problems

CS Fall 2011 P and NP Carola Wenk

CS154, Lecture 13: P vs NP

Graph Theory and Optimization Computational Complexity (in brief)

CSE 105 THEORY OF COMPUTATION

NP-Complete Reductions 2

Polynomial-Time Reductions

Spring Lecture 21 NP-Complete Problems

Chapter 8. NP and Computational Intractability. CS 350 Winter 2018

Introduction to Complexity Theory

Discrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness

COMP Analysis of Algorithms & Data Structures

CS 580: Algorithm Design and Analysis

Automata Theory CS S-18 Complexity Theory II: Class NP

3/22/2018. CS 580: Algorithm Design and Analysis. Circuit Satisfiability. Recap. The "First" NP-Complete Problem. Example.

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle

Chapter 34: NP-Completeness

Computational Complexity. IE 496 Lecture 6. Dr. Ted Ralphs

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

Introduction. Pvs.NPExample

CS 561, Lecture 12. Jared Saia University of New Mexico

Computational Intractability 2010/4/15. Lecture 2

Lecture 18: More NP-Complete Problems

NP and conp. Theorem. Skoulakis Stratis NP,coNP and Funtion Problems EuroCG 14, Ein-Gedi, Israel 1 / 18

NP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof

CSE 548: (Design and) Analysis of Algorithms

CS154, Lecture 13: P vs NP

Lecture 24 : Even more reductions

CSC 373: Algorithm Design and Analysis Lecture 15

COMP 382. Unit 10: NP-Completeness

CS5371 Theory of Computation. Lecture 19: Complexity IV (More on NP, NP-Complete)

Transcription:

Computational Complexity Ref: Algorithm Design (Ch 8) on Blackboard Mohammad T. Irfan Email: mirfan@bowdoin.edu Web: www.bowdoin.edu/~mirfan Famous complexity classes u NP (non-deterministic polynomial time) u Class of decision problems for which we can verify a solution (certificate/ witness) in polynomial time u P (deterministic polynomial time) u Class of decision problems that can be solved in polynomial time 1

Famous complexity classes u NP-Hard u "As hard as NP" u Every NP problem reduces to problems in this class in polynomial time u May not be in NP (e.g., may not have polynomialtime verifier) u NP-Complete u Decision problems that are: 1. In NP 2. NP-Hard (i.e., every NP problem reduces to these problem!) Millennium prize problem: P=NP? Unresolved! Implication Fact? Alternative Fact? 2

Other classes u EXPTIME u Evaluating a position in chess/checkers/go u Undecidable u Halting problem u A ton of other classes... NP-completeness proof recipe u Want to prove problem B is NP-complete u 2 main steps: 1. Prove that B is in NP u Show that we can verify an answer to B in polynomial time 2. Prove that B is NP-hard u Pick a known NP-complete problem A Caution: not the other way! u Reduce A to B in a polynomial-time (i.e., A is not harder than B è B is at least as hard as the already-known hard problem A) 3

First NP-complete problem Stephen Cook u Boolean satisfiability problem (SAT) is NPcomplete (Stephen Cook, 1971) u P = NP if and only if SAT is in P SAT u Operators u AND u OR u NOT (also, over-score) u Given a boolean formula, is there a satisfying assignment to the boolean variables? (x 1 v v x 3 ) x 1 x 3? ( x 1 v ) ( x 1 v ) (x 1 v ) (x 1 v )? 4

3-SAT u Stylized version of SAT u (... V... V...) (... V... V...) (... V... V...)... u Each parenthetic expression is a clause u Each green box is a literal (e.g., x 1,, etc.) u 3-SAT is NP-complete Application: Electronic Design Automation (EDA) 5

Prove that CLIQUE is NP-complete CLIQUE u Clique: A subset of nodes of a graph such that there is an edge between every pair of nodes in that subset. A clique of size 5 u CLIQUE problem: Given a graph and a number k, Is there a clique of size >= k? Example: Costas Busch- LSU 6

Proof: CLIQUE is NP-complete 1. CLIQUE is in NP u We can verify a solution (k-clique) in polynomial time u Check whether there is an edge between every pair of nodes in that clique Proof: CLIQUE is NP-complete 2. CLIQUE is NP-Hard u Take our favorite NP-complete problem 3- SAT (that's the only one we know...) u Reduce 3-SAT to CLIQUE u u u Given k, take any instance of 3-SAT with k clauses Convert it to an instance of CLIQUE in polynomial time Show that the answer to CLIQUE is yes if and only if the answer to 3-SAT is yes Caution: not the other way! 7

Reduction Node: every literal of 3-SAT instance ( x1 x2 x4) ( x1 x2 x4) ( x1 x2 x3) ( x2 x3 x4) Clause 2 x1 x x 2 4 Clause 3 x 1 x 1 Clause 1 x 4 Clause 4 x 3 x 3 x 4 Costas Busch - LSU Reduction Edge: Connect each node/literal with every literal of a different clause, except two literals that are negations of each other. ( x1 x2 x4) ( x1 x2 x4) ( x1 x2 x3) ( x2 x3 x4) Do it for every node! x 1 x1 x x 2 4 x 1 x 4 x 3 x 3 x 4 Costas Busch - LSU 8

( x1 x2 x4) ( x1 x2 x4) ( x1 x2 x3) ( x2 x3 x4) x1 x x 2 4 x 1 x 1 x 4 x 3 x 3 x 4 Resulting Graph: CLIQUE instance Costas Busch - LSU Prove: The graph has a k-clique if and only if 3-SAT has a solution (k = 4 here) ( 4 4 4 x1 x2 x ) ( x1 x2 x ) ( x1 x2 x3) ( x2 x3 x ) = 1 x = 1 1 x = 0 2 x = 0 3 x = 1 4 x 1 x1 x x 2 4 x 1 x 4 x 3 x 3 x 4 This proves CLIQUE is NP-Hard (3-SAT is not harder than CLIQUE!) Costas Busch - LSU 9

Review u NP (non-deterministic polynomial time) u Class of decision problems for which we can verify a solution (certificate/ witness) in polynomial time u P (deterministic polynomial time) u Class of decision problems that can be solved in polynomial time Review u NP-Hard u "As hard as NP" u Every NP problem reduces to problems in this class in polynomial time u NP-Complete u Decision problems that are: 1. In NP 2. NP-Hard (i.e., every NP problem reduces to these problem!) 10

Examples HALTING PROBLEM [Optimization versions of NP-complete prob.] TSP CLIQUE INDEPENDENT SET FACTORIZATION/RSA GRAPH ISOMORPHISM SHORTEST-PATH FRACTIONAL KNAPSACK INDEPENDENT SET is NP-Complete You do the proof! 11

INDEPENDENT SET problem u Independent set: a subset of nodes of a graph such that there is no edge between any two nodes in that subset u INDEPNDENT SET problem u Given a graph and a number k, does there exist an independent set of size >= k? Example u Is there an independent set of size 6? Yes u Is there an independent set of size 7? No independent set Hantao Zhang U Iowa 12

Proof recipe 1. INDEPENDENT SET is in NP 2. INDEPENDENT SET is NP-hard u Reduce a known NP-complete problem to INDEPENDENT SET u Art: Which NP-complete problem would you like to pick? How would you do the reduction? REDUCTION: A à B Given any instance of problem A, convert it to an instance of B in polynomial time such that B instance has answer yes if and only if A instance has answer yes VERTEX COVER is NP-complete You do the proof! 13

VERTEX COVER problem u Vertex cover: a subset of nodes of a graph such that every edge has at least one endpoint in that subset u VERTEX COVER problem: u Given a graph and a number k, is there a vertex cover of size <= k? Example u Is there a vertex cover of size 4? Yes. u Is there a vertex cover of size 3? No. vertex cover Hantao Zhang U Iowa 14

Proof recipe 1. VERTEX COVER is in NP 2. VERTEX COVER is NP-hard u Reduce a known NP-complete problem to VERTEX COVER vertex cover independent set Hantao Zhang U Iowa Other NP-Complete problems u Special cases of 3-SAT u SET COVER u HITTING SET u SUBSET-SUM u PARTITION u GRAPH COLORING u HAMILTONIAN PATH (TSP) u... 15

Complexity of computing pure-strategy NE "Pure Nash Equilbria: Hard and Easy Games" Gottlob et al. [Blackboard] Is there a pure-strategy NE? u (Gottlob et al., 2005) Deciding whether a graphical game (GG) has a PSNE is NP-complete, even for max degree 3 and max # of actions 3. u Proof. 1. GG is in NP 2. GG is NP-Hard u Reduction: 3-SAT' à GG u For any 3-SAT' instance, create a GG instance u Each clause and variable is a player u Neighbors/friends based on clause-var relations u Actions: {t, f, u} u Payoffs: next slide 16

Payoffs of GG instance Payoff of a clause player c Pay off Case 3 c plays t & all neighboring variables play t/f making the clause true 2 c plays u & all neighboring variables play t/f making the clause false 2 c plays f & some neighboring variable plays u 1 All other cases Payoff of a variable player v Pay off Case 3 v plays t/f & all neighboring clauses play t/f 2 v plays u & some neighboring clause plays u 1 All other cases 3-SAT' instance is satisfiable GG instance has a pure NE Is there a pure-strategy NE? u NP-complete, even for very special types of "graphical games" u Games in "normal form" (with payoff matrices) is a different story Representation size is important! 17

Computing a mixed-strategy NE u Always exists (so not NP-complete!) u PPAD-complete even for 2-player games (with m actions) [Chen et al. (2009), Daskalakis et al. (2009)] u PPAD: Polynomial Parity Arguments on Directed graphs (Papadimitriou, 1994) 18