JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA

Slides:



Advertisements
Similar presentations
Problems and Their Classes
Advertisements

NP-Hard Nattee Niparnan.
 2004 SDU Lecture17-P,NP, NPC.  2004 SDU 2 1.Decision problem and language decision problem decision problem and language 2.P and NP Definitions of.
The Theory of NP-Completeness
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
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
Analysis of Algorithms CS 477/677
Chapter 11: Limitations of Algorithmic Power
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
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.
1 UNIT -6 P, NP, and NP-Complete. 2 Tractability u Some problems are intractable: as they grow large, we are unable to solve them in reasonable time u.
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.
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:
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.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
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.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
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.
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.
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.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
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.
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.
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.
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
NP-Completeness A problem is NP-complete if: It is in NP
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-Complete and NP-hard Problems
Chapter 10 NP-Complete Problems.
Hard Problems Some problems are hard to solve.
Richard Anderson Lecture 26 NP-Completeness
Advanced Algorithms Analysis and Design
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
Richard Anderson Lecture 26 NP-Completeness
Hard Problems Introduction to NP
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Richard Anderson Lecture 25 NP-Completeness
How Hard Can It Be?.
Chapter 11 Limitations of Algorithm Power
NP-Complete Problems.
Prabhas Chongstitvatana
CSE 6408 Advanced Algorithms.
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
Our old list of problems
RAIK 283 Data Structures & Algorithms
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Presentation transcript:

JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA NP – HARD JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA

P and NP P – The set of all problems solvable in polynomial time by a deterministic Turing Machine (DTM). Example: Sorting and searching.

P and NP NP- the set of all problems solvable in polynomial time by non deterministic Turing Machine (NDTM) Example Partition. P is a subset of NP

NP complete NP – Complete (NP – C): the set of all problems in NP “at least as hard” as every other problem in NP. To prove a problem x is NP complete Show that x is in NP Show that some other NP - C problem reduces to x If an NP hard problem can be solved in polynomial time, then all NP complete problems can be solved in polynomial time. NP – H includes all NP - C problems

Deterministic and non deterministic problems Algorithm is deterministic if for a given input the output generated is same for function. A mathematical function is deterministic hence the state is known at every step of algorithm.

To specify such algorithms we introduce three statements Algorithm is nondeterministic if there are more than one path the algorithm can take. Due to this one cannot determine the next state of the machine running the algorithm. To specify such algorithms we introduce three statements Choice(s) - arbitrary choose one of the elements of the set S Failure - signals an unsuccessful completion Success - signals a successful completion

Whenever there is a set of choices that leads to a successful completion than one search set of choices is always made and the algorithm terminates. A nondeterministic algorithm terminates unsuccessfully iff there exists no set of choices leading to a successful signal

A machine capable of executing a nondeterministic algorithm is called a nondeterministic machine. While nondeterministic machine do not exist in practice they will provide strong reason to conclude that certain problems cannot be solved by fast deterministic algorithms

Example of nondeterministic algorithm // the problem is to search for an element X// //output j such that A(j) = x; or j = 0 if x is not in A// j -> choice (1:n) If A(j)= x then print (j); success end if Print (‘0’); failure Complexity O(1); Nondeterministic decision algorithms generate a zero or 1 as their output.

Definition of classes NP - hard and NP - complete P is a set of all decision problems solvable by a deterministic algorithm in polynomial time. NP is a set of all decision problems solvable by a nondeterministic algorithm in polynomial time. Since deterministic algorithms are special case of nondeterministic ones, we can conclude that PNP

Reducibility Let L1 and L2 be problems. L1 reduces to L2 (L1  L2) if and only if there is a deterministic polynomial time algorithm to solve L1 that solves L2 in polynomial time If L1  L2 and L2  L3 then L1  L3 Definition: NP-Hard problem: a problem L is NP hard iff satisfiability reduces to L

Definition : NP-complete Problem : A problem L is NP-complete if and only if L is NP-hard and L є NP. There are NP-hard problems that are not NP-complete. Example : Halting problem is NP-hard decision problem, but it is not NP-complete. Halting Problem : To determine for an arbitrary deterministic algorithm A and an input I whether algorithm A with input I ever terminates (or enters an infinite loop).

Halting problem is not NP-complete; but NP-hard Halting problem is un-decidable. - Hence there exists no algorithm to solve this problem. - So, it is not in NP. - So, it is not NP-complete. Halting problem is NP-hard To show that Halting problem is NP-hard, we show that satisfiability is  halting problem. For this let us construct an algorithm A whose input is a prepositional formula X. - Suppose X has n variables. - Algorithm A tries out all 2n possible truth assignments and verifies if X is satisfiable.

Halting problem is NP-hard (Contd..) - If it is satisfied then A stops. - If X is not satisfiable, then A enters an infinite loop. - Hence A halts on input iff X is satisfiable. - If we had a polynomial time algorithm for the halting problem, then we could solve the satisfiability problem in polynomial time using A and X as input to the algorithm for the halting problem . - Hence the halting problem is an NP-hard problem which is not in NP. - So it is not NP-complete.

NP-HARD GRAPH AND SCHEDULING PROBLEMS (CONTD..) Chromatic Number Decision Problem (CNP) A coloring of a graph G = (V,E) is a function f : V  { 1,2, …, k}  i  V . If (U,V) E then f(u)  f(v). The CNP is to determine if G has a coloring for a given K. Satisfiability with at most three literals per clause  chromatic number problem.  CNP is NP-hard.

NP-HARD GRAPH AND SCHEDULING PROBLEMS (contd..) Directed Hamiltonian Cycle (DHC) Let G = (V,E) be a directed graph and length n = V The DHC is a cycle that goes through every vertex exactly once and then returns to the starting vertex. The DHC problem is to determine if G has a directed Hamiltonian Cycle. Theorem : CNF (Conjunctive Normal Form) satisfiability  DHC  DHC is NP-hard.

NP-HARD GRAPH AND SCHEDULING PROBLEMS (CONTD..) Travelling Salesperson Decision Problem (TSP) : The problem is to determine if a complete directed graph G = (V,E) with edge costs C(u, v) has a tour of cost at most M. Theorem : Directed Hamiltonian Cycle (DHC)  TSP  TSP is NP-hard.

SOME SIMPLIIFIED NP-HARD PROBLEMS An NP-hard problem L cannot be solved in deterministic polynomial time. By placing enough restrictions on any NP hard problem, we can arrive at a polynomial solvable problem.

Examples. (i) CNF(conjuctive normal form)- Satisfiability with at most three literals per clause is NP-hard. If each clause is restricted to have at most two literals then CNF-satisfiability is polynomial solvable (ii)Generating optimal code for a parallel assignment statement is NP-hard, - however if the expressions are restricted to be simple variables, then optimal code can be generated in polynomial time.

(iii)Generating optimal code for level one directed a- cyclic graphs is NP-hard but optimal code for trees can be generated in polynomial time. (iv)Determining if a planner graph is three colorable is NP-Hard - To determine if it is two colorable is a polynomial complexity problem.

https://www.youtube.com/watch?v=CY_klh5uD-E

THANK YOU