NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

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.
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 
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
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
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Analysis of Algorithms CS 477/677
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Chapter 11: Limitations of Algorithmic Power
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
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.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
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.
MCS312: NP-completeness and Approximation Algorithms
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
CSCE350 Algorithms and Data Structure
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.
Lecture 22 More NPC problems
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
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.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Unit 9: Coping with NP-Completeness
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.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Instructor Neelima Gupta Table of Contents Class NP Class NPC Approximation Algorithms.
Design and Analysis of Algorithms - Chapter 101 Our old list of problems b Sorting b Searching b Shortest paths in a graph b Minimum spanning tree b Primality.
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.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
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
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 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
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.
Advanced Algorithms NP-hard and NP-Complete Problems Instructor: Saeid Abrishami Ferdowsi University of Mashhad.
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
Chapter 10 NP-Complete Problems.
Richard Anderson Lecture 26 NP-Completeness
Advanced Algorithms Analysis and Design
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
ICS 353: Design and Analysis of Algorithms
NP-Complete Problems.
P, NP and NP-Complete Problems
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
P, NP and NP-Complete Problems
Our old list of problems
Presentation transcript:

NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.

NP-Complete Problems Problems in Computer Science are classified into –Tractable: There exists a polynomial time algorithm that solves the problem O(n k ) –Intractable: Unlikely for a polynomial time algorithm solution to exist NP-Complete Problems

Decision Problems vs. Optimization Problems Decision Problem: Yes/no answer Optimization Problem: Maximization or minimization of a certain quantity When studying NP-Completeness, it is easier to deal with decision problems than optimization problems

Element Uniqueness Problem Decision Problem: Element Uniqueness –Input: A sequence of integers S –Question: Are there two elements in S that are equal? Optimization Problem: Element Count –Input: A sequence of integers S –Output: An element in S of highest frequency What is the algorithm to solve this problem? How much does it cost?

Coloring a Graph Decision Problem: Coloring –Input: G=(V,E) undirected graph and k , k > 0. –Question: Is G k-colorable? Optimization Problem: Chromatic Number –Input: G=(V,E) undirected graph –Output: The chromatic number of G,  (G) i.e. the minimum number  (G) of colors needed to color a graph in such a way that no two adjacent vertices have the same color.

Clique Definition: A clique of size k in G, for some +ve integer k, is a complete subgraph of G with k vertices. Decision Problem –Input: –Question: Optimization Problem –Input: –Output:

Vertex Cover Definition: A vertex cover of an undirected graph G=(V,E) is a subset C  V such that each edge e=(x,y)  E is incident to at least one vertex in C, i.e. x  C or y  C. Decision Problem –Input: –Question: Optimization Problem –Input: –Output:

Independent Set Definition: Given an undirected graph G=(V,E) a subset S  V is called an independent set if for each pair of vertices x, y  S, (x,y)  E Decision Problem –Input: –Question: Optimization Problem –Input: –Output:

From Decision To Optimization For a given problem, assume we were able to find a solution to the decision problem in polynomial time. Can we find a solution to the optimization problem in polynomial time also?

Deterministic Algorithms Definition: Let A be an algorithm to solve problem . A is called deterministic if, when presented with an instance of the problem , it has only one choice in each step throughout its execution. –If we run A again and again, is there a possibility that the output may change? What type of algorithms did we have so far?

The Class P Definition: The class of decision problems P consists of those whose yes/no solution can be obtained using a deterministic algorithm that runs in polynomial time of steps, i.e. O(n k ), where k is a non-negative integer and n is the input size.

Examples Sorting: Given n integers, are they sorted in non-decreasing order? Set Disjointness: Given two sets of integers, are they disjoint? Shortest path: 2-coloring: –Theorem: A graph G is 2-colorable if and only if G is bipartite

Closure Under Complementation C C CA class C of problems is closed under complementation if for any problem   C the complement of  is also in C. Theorem: The class P is closed under complementation

Non-Deterministic Algorithms A non-deterministic algorithm A on input x consists of two phases: –Guessing: An arbitrary “string of characters y” is generated in polynomial time. It may Correspond to a solution Not correspond to a solution Not be in proper format of a solution Differ from one run to another –Verification: A deterministic algorithm verifies The generated “string of characters y” is in proper format Whether y is a solution in polynomial time

Non-Deterministic Algorithms (Cont.) Definition: Let A be a nondeterministic algorithm for a problem . We say that A accepts an instance I of  if and only if on input I, there exists a guess that leads to a yes answer. –Does it mean that if an algorithm A on a given input I leads to an answer of no for a certain guess, that it does not accept it? What is the running time of a non-deterministic algorithm?

The Class NP Definition: The class of decision problems NP consists of those decision problems for which there exists a nondeterministic algorithm that runs in polynomial time

Example Show that the coloring problem belongs to the class of NP problems

P and NP Problems What is the difference between P problems and NP Problems? We can decide/solve problems in P using deterministic algorithms that run in polynomial time We can check or verify the solution of NP problems in polynomial time using a deterministic algorithm What is the set relationship between the classes P and NP?

NP-Complete Problems Definition: Let  and  ’ be two decision problems. We say that  ’ reduces to  in polynomial time, denoted by  ’  poly , if there exists a deterministic algorithm A that behaves as follows: When A is presented with an instance I’ of problem  ’, it transforms it into an instance I of problem  in polynomial time such that the answer to I’ is yes if and only if the answer to I is yes.

NP-Hard and NP-Complete Definition: A decision problem  is said to be NP-hard if  ’  NP,  ’  poly . Definition: A decision problem  is said to be NP-complete if –  NP –  ’  NP,  ’  poly . What is the difference between an NP-complete problem and an NP-hard problem?

Conjunctive Normal Forms Definition: A clause is the disjunction of literals, where a literal is a boolean variable or its negation –E.g., x 1  x 2  x 3  x 4 Definition: A boolean formula f is said to be in conjunctive normal form (CNF) if it is the conjunction of clauses. –E.g., (x 1  x 2 )  (x 1  x 5 )  (x 2  x 3  x 4  x 6 ) Definition: A boolean formula f is said to be satisfiable if there is a truth assignment to its variables that makes it true.

The Satisfiability Problem Input: A CNF boolean formula f. Question: Is f satisfiable? Theorem: Satisfiability is NP-Complete –Satisfiability is the first problem to be proven as NP-Complete –The proof includes reducing every problem in NP to Satisfiability in polynomial time.