CSCI 2670 Introduction to Theory of Computing November 17, 2005.

Slides:



Advertisements
Similar presentations
Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Advertisements

Limitation of Computation Power – P, NP, and NP-complete
1 Nondeterministic Space is Closed Under Complement Presented by Jing Zhang and Yingbo Wang Theory of Computation II Professor: Geoffrey Smith.
Polynomial-time reductions We have seen several reductions:
What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
The class NP Section 7.3 Giorgi Japaridze Theory of Computability.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
P and NP Sipser (pages ). CS 311 Fall Polynomial time P = ∪ k TIME(n k ) … P = ∪ k TIME(n k ) … TIME(n 3 ) TIME(n 2 ) TIME(n)
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
The Theory of NP-Completeness
CS 310 – Fall 2006 Pacific University CS310 P vs NP the steel cage death match Section 7.2 November 29, 2006.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
CSCI 2670 Introduction to Theory of Computing November 4, 2004.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
CSC 413/513: Intro to Algorithms NP Completeness.
CSCI 2670 Introduction to Theory of Computing November 23, 2004.
The class P Section 7.2 CSC 4170 Theory of Computation.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
Polynomial-time reductions We have seen several reductions:
CSCI 2670 Introduction to Theory of Computing December 1, 2004.
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.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
1 Design and Analysis of Algorithms Yoram Moses Lecture 11 June 3, 2010
The Class NP Lecture 39 Section 7.3 Mon, Nov 26, 2007.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 7 Time complexity Contents Measuring Complexity Big-O and small-o notation.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
LIMITATIONS OF ALGORITHM POWER
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
CS 461 – Nov. 18 Section 7.1 Overview of complexity issues –“Can quickly decide” vs. “Can quickly verify” Measuring complexity Dividing decidable languages.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
Introduction to NP Instructor: Neelima Gupta 1.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
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.
Great Theoretical Ideas in Computer Science.
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
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
Limitation of Computation Power – P, NP, and NP-complete
The NP class. NP-completeness
EMIS 8373: Integer Programming
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
CSC 4170 Theory of Computation The class P Section 7.2.
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
CSC 4170 Theory of Computation The class P Section 7.2.
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
ICS 353: Design and Analysis of Algorithms
Intro to Theory of Computation
Richard Anderson Lecture 25 NP-Completeness
Chapter 34: NP-Completeness
CSC 4170 Theory of Computation The class NP Section 7.3.
Theory of Computability
Instructor: Aaron Roth
Theory of Computability
Theory of Computability
Presentation transcript:

CSCI 2670 Introduction to Theory of Computing November 17, 2005

Agenda Today –Finish Section 7.2 –Start Section 7.3

November 17, 2005 Announcement Homework due next Tuesday (11/22) –7.3 a, 7.4, 7.6 (union only), 7.9, st edition 7.3a, 7.4, 7.6 (union only), 7.10, 7.12

November 17, 2005 Last class Introduced the class P –P = U k TIME(n k ) Proved two languages are in P –Binary tree query –PATH

November 17, 2005 Another problem in P RELPRIME = { | x and y are relatively prime} RELPRIME  P How can we show this? –We cannot find prime factorization of x and y and compare –Use Euclidean algorithm for finding gcd(x,y)  RELPRIME iff gcd(x,y) = 1

November 17, 2005 Euclidean algorithm E = “On input, where x and y are natural numbers in binary: 1.Repeat until y = 0 1.Assign x  x mod y 2.Exchange x and y 2.Output x”

November 17, 2005 Solution to RELPRIME R = “On input, where x and y are natural numbers in binary: 1.Run E on 2.If result is 1, accept 3.Else reject”

November 17, 2005 Verify solution is in P Is R a decider? –Yes How long will it take R to run? –Execution of R is dominated by E –Note that if x > y, then (x mod y) < x/2 If x ≥ 2y, then x mod y < y ≤ x/2 If x < 2y, then x mod y = x – y < x/2 –Therefore loop in E is executed O(log 2 x) times Is this polynomial in the length of the input? –log2x = O(n), where n = length of input

November 17, 2005 Solving vs. verifying What if we don’t know how to solve the problem in O(n k ) time? Given a problem and a potential solution, can we verify the solution is correct?

November 17, 2005 Example The bin-packing problem –Given a set of n items with weights w 1, w 2, …, w n, and k bins that can hold a maximum weight of 1, can we place these items the bins? There is no known O(n k ) solution to this problem What if we have a potential solution –b 1, b 2, …, b n 1  b i  k Can we verify it in O(n k ) time?

November 17, 2005 Verifier M = “On input 1.Initialize s 1, s 2, …, s k to 0 2.For i = 1, …, n 3. if b i  {1, 2, …, k} reject 4. s b_i = s b_i + w i 5. if s b_i > 1 reject 6.Next i 7.Accept

November 17, 2005 The class NP Definition: A verifier for a language A is an algorithm V, where A={w|V accepts for some string c} The string c is called a certificate of membership in A. Definition: NP is the class of languages that have polynomial-time verifiers.

November 17, 2005 Why NP? The N in NP stands for non- deterministic Any language in NP can be non- deterministically solved in polynomial time using the verifier –Guess the certificate –Verify

November 17, 2005 Other problems in NP The vertex cover problem –Given a graph G = and a number k in N, does there exist a subset V’ of V such that |V’| = k For every (u,v)  E, either u  V’ or v  V’ There is no known polynomial solution to this problem

November 17, 2005 Vertex cover Can we verify vertex cover in polynomial time? –Yes What should the certificate be? –The subset V’ How do we verify? –Check |V’| = k –Test that each (u,v)  E has u  V’ or v  V’ Takes O(|E|×k) time

November 17, 2005 Example 1 Find a verifier for the subset-sum problem –Given a finite set S  N and a target t  N, does there exist a subset S’  S such that the sum of all elements in S’ is equal to t? V takes input S’ –Checks S’  S O(|S’| x |S|) = O(|S| 2 ) –Check Σ s  S’ s = t O(|S’|) = O(|S|)

November 17, 2005 Example 2 Find a verifier for the traveling- salesman problem –Given a weighted graph G (i.e., a graph where each edge has a associated weight) and a distance d, does there exist a cycle through the graph that visits each vertex exactly once (except for the start/end vertex) and has a total distance d?

November 17, 2005 Example 2 Find a verifier for the traveling- salesman problem V takes input Check the input is a permutation of the nodes of the graph –O(|V| 2 ) Check Σ 1≤k<n v ik = d –O(|E|x|V|)