COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.

Slides:



Advertisements
Similar presentations
Complexity Classes: P and NP
Advertisements

Polynomial-time reductions We have seen several reductions:
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
NP-Completeness: Reductions
NP and NP Complete. Definitions A problem is in the class P if there is a polynomial time solution to the problem A problem is in the class NP if there.
Department of Computer Science & Engineering
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
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.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
NP-complete and NP-hard problems
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Analysis of Algorithms CS 477/677
NP-complete examples CSC3130 Tutorial 11 Xiao Linfu Department of Computer Science & Engineering Fall 2009.
Chapter 11: Limitations of Algorithmic Power
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Clique Cover Cook’s Theorem 3SAT and Independent Set
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
Polynomial-time reductions We have seen several reductions:
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
1 How to prove that a problem is NPC. 2 Cook Cook showed the first NPC problem: SAT Cook received Turing Award in 1982.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
NP-Algorithms Tractable vs Intractable Some problems are intractable: as they grow large, we are unable to solve them in reasonable time.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
CSC 413/513: Intro to Algorithms
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
NP-complete Languages
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CS623: Introduction to Computing with Neural Nets (lecture-7) Pushpak Bhattacharyya Computer Science and Engineering Department IIT Bombay.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
P & NP.
Richard Anderson Lecture 26 NP-Completeness
ICS 353: Design and Analysis of Algorithms
NP-Complete Problems.
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
Presentation transcript:

COMPLEXITY

Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several sums(or). For example, where addition and multiplication correspond to the and and or Boolean operations, and each variable is either 0 (false) or 1 (true) A Boolean expression is said to be satisfiable if there exists an assignment of 0s and 1s to its variables such that the value of the expression is 1

Satisfiability(SAT) problem Example: Can x, y, z be set so that this expression is true? (NO, in the above case) SAT problem is to determine whether a given expression is satisfiable At least one is true All three the same At least one is false

Decision problems Problems with answer either “yes” or “no” Decision problem can be viewed as language-recognition problem: –U is the set of possible inputs to the problem –L  U is the set of inputs which yield “yes” –L is the language corresponding to the problem

Class of Decision Problems P: Problems could be solved by deterministic algorithm in polynomial time NP: Problems for which exists a non- deterministic algorithm whose running time is a polynomial in the size of the input Note: Whether P = NP is not known, but most people believe P  NP

DETERMINISTIC TURING MACHINE (DTM) Formally: {Q, , , q 0, F}, where: Q – the set of control states of machine  – alphabet (the set of symbols) of tape,  transition function:  : Q  Q  {R, L, N} q 0 – initial control state, F – the set of final states

DTM – PERFORMANCE Start from a certain tape position with state q 0 Read symbol s from the tape By basing on such data (state q = q 0, symbol s) calculate from function  a new state q’, new symbol s’, which we write at the tape, and one of symbols R, L or N, corresponding to direction of the machine movement Repeat the above operation until the machine finds itself in a state belonging to F {Q, , , q 0, F}

NONDETERMINISTIC TURING MACHINE (NDTM) {Q, , , q 0, F}, Definition analogous to DTM, however transition function  (q,s) can have multiple values Result of calculations is positive, if at least one of the ways of the machine performance leads to a success In other words: while running the „program” NDTM is able to forecast in a magic way, which value of transition function should be chosen (e.g. whether to write 1 or 0) in purpose of obtaining positive result (if it is possible)

Definitions and Classifications NP-Hard: A problem X is called an NP- hard problem if every problem in NP is polynomially reducible to X NP-Complete: A problem X is called an NP-complete problem if: –X belongs to NP, and –X is NP-hard Also, X is NP-complete if X  NP and Y is polynomially reducible to X for some Y that is NP-complete NP-complete problems are the hardest problems in NP

Fundamental Result Cook’s theorem: The SAT problem is NP-complete Once we have found an NP-complete problem, proving that other problems are also NP-complete becomes easier Given a new problem Y, it is sufficient to prove that Cook’s problem, or any other NP-complete problem, is polynomially reducible to Y

Vertex Cover (VC) Problem A vertex cover of G=(V, E) is V’  V such that every edge in E is incident to some v  V’ VC: Given undirected G=(V, E) and integer k, does G have a vertex cover with  k vertices?

Dominating Set (DS) Problem A dominating set D of G=(V, E) is D  V such that every v  V is either in D or adjacent to at least one vertex of D DS: Given G and k, does G have a dominating set of size  k ?

More Problems CLIQUE: Does G contain a clique of size  k? 3SAT: Give a Boolean expression in CNF such that each clause has exactly 3 variables, determine satisfiability

Reduction Examples Vertex Cover Clique3SAT SAT 3-Colorability Dominating Set All NP problems

Reduction Let L 1 and L 2 be two languages from the input spaces U 1 and U 2 We say that L 1 is polynomially reducible to L 2 if there exists a polynomial-time algorithm that converts each input u 1  U 1 to another input u 2  U 2 such that u 1  L 1 if and only if u 2  L 2 Note: The algorithm is polynomial in the size of the input u 1

Reduction Typ_o1 P1(i1) { Typ_i2 i2 = Encode(i1);//polynomial Typ_o2 o2 = P2(i2); Typ_o1 o1 = Decode(o2);//polynomial return o1; }

CLIQUE  VC VC is NP: This is trivial since we can guess a cover of size  k and check it easily in poly-time Goal: Transform arbitrary CLIQUE instance into VC instance such that CLIQUE answer is “yes” if and only if VC answer is “yes”

CLIQUE  VC CLIQUE(G,k) has the same answer as VC(G’,n-k), where n = |V| and G’ is a complement of G GG’

VC  DS G’ has DS D of size k if and only if G has VC of size k vw u z v vz w u vu z zu uw vw GG’

SAT  CLIQUE G has m-clique (m is the number of clauses in E), if and only if E is satisfiable (assign value 1 to all variables in clique)

Decision Reducts {T,H,W} and any its subset is not a reduct {O,T,H} and any its subset is not a reduct {O,W} and any its subset is not a reduct The only reducts are {O,T,W},{O,H,W}