香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 10

CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin

Outline Decision,Search and Optimization ·Class P&Class NP 。Reductions ·NP-Completeness 2
Outline • Decision, Search and Optimization • Class P & Class NP • Reductions • NP-Completeness 2

Problems in Different Forms Decision Problem,the answer is simply "YES"or "NO" Search Problem,find a solution satisfying some properties if one exists,else return it doesn't exist Optimization Problem,each solution has an associated value,find a solution with best value (min max) 3
Problems in Different Forms Decision Problem, the answer is simply “YES” or “NO” Search Problem, find a solution satisfying some properties if one exists, else return it doesn’t exist Optimization Problem, each solution has an associated value, find a solution with best value (min / max) 3

Three Forms of CLIQUE Usually,it's enough to consider Decision Problem Decision Problem in complexity theory Given a graph G and a number k,decide whether G has a clique of size≥k ↓no harder than Search Problem Given a graph G and a number k,find a clique with size k in G if one exists,else return it doesn't exist ↓no harder than Optimization Problem Given a graph 6,find a largest clique in G 4
Three Forms of CLIQUE Decision Problem Given a graph G and a number k, decide whether G has a clique of size ≥ k Search Problem Given a graph G and a number k, find a clique with size ≥ k in G if one exists, else return it doesn’t exist Optimization Problem Given a graph G, find a largest clique in G no harder than no harder than Usually, it’s enough to consider Decision Problem in complexity theory 4

Language and Decision Problem are Equivalent Language A language L is just a subset of (0,1)*,the set of all strings of bits {0,1}*=Un≥0{0,1m Language to Decision Problem Given a bit string x,decide whether x EL Decision Problem to Language Given a Decision Problem Encode all the instances into bit strings The corresponding language contains all the strings of "YES"instances 5
Language and Decision Problem are Equivalent Language A language 𝐿 is just a subset of 0,1 ∗ , the set of all strings of bits ❖ 0,1 ∗ = ڂ≤��0 0,1 𝑛 Language to Decision Problem • Given a bit string 𝑥, decide whether 𝑥 ∈ 𝐿 Decision Problem to Language • Given a Decision Problem • Encode all the instances into bit strings • The corresponding language contains all the strings of “YES” instances 5

Class P V.S.Class NP ·P stands for what? Polynomial! Class P:Problems solvable in deterministic polynomial time What about NP? No Problem? Not Polynomial (i.e.polynomial time unsolvable)? Nondeterministic Polynomial! Class NP:Problems solvable in nondeterministic polynomial time
Class P V.S. Class NP • P stands for what? Polynomial! • Class P: Problems solvable in deterministic polynomial time • What about NP? ❖ No Problem? ❖ Not Polynomial (i.e. polynomial time unsolvable)? Nondeterministic Polynomial ! • Class NP: Problems solvable in nondeterministic polynomial time 6

Deterministic/Nondeterministic Polynomial time? Where do these terms come from? They're based on different computation models Deterministic Turing Machine Nondeterministic Turing Machine We will NOT talk about Turing Machine in this course Details of these computation models,please refer to the following course *CSCI3130 (Formal Languages and Automata Theory) 7
Deterministic/Nondeterministic Polynomial time? • Where do these terms come from? • They’re based on different computation models ❖ Deterministic Turing Machine ❖ Nondeterministic Turing Machine • We will NOT talk about Turing Machine in this course • Details of these computation models, please refer to the following course ❖ CSCI3130 (Formal Languages and Automata Theory) 7

An Equivalent Definition of Class NP Class NP:Problems checkable or verifiable in polynomial time Verification: *Given a "certificate"of a solution,we could verify that the certificate is correct,e.g. Certificate for SAT would be an assignment Certificate for Hamiltonian Cycle would be a sequence of n vertices,V1,V2,...Vn 8
An Equivalent Definition of Class NP Class NP: Problems checkable or verifiable in polynomial time Verification: ❖Given a “certificate” of a solution, we could verify that the certificate is correct, e.g. ❖Certificate for SAT would be an assignment ❖Certificate for Hamiltonian Cycle would be a sequence of n vertices, v1 , v2 , …, vn 8

Solvable V.S.Verifiable For a problem in P,we have polynomial time algorithm to solve it For a problem in NP,we have polynomial time verification algorithm to verify a certificate 9
Solvable V.S. Verifiable • For a problem in P, we have polynomial time algorithm to solve it • For a problem in NP, we have polynomial time verification algorithm to verify a certificate 9

Reductions Reduction:a transformation between instance a of Problem A and instance B of Problem B such that The transformation takes polynomial time Polynomial in size of the input instance The answer for a is "YES"if and only if the answer for B is also "YES" 10
Reductions Reduction: a transformation between instance α of Problem A and instance β of Problem B such that • The transformation takes polynomial time ❖ Polynomial in size of the input instance • The answer for α is “YES” if and only if the answer for β is also “YES” 10
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 01.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 10 Stable Matching and Secretary Problem.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 8 Maximum Network Flow.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 7 Divide and Conquer.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 6 Linear Programming.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 12 Online Algorithms.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 11 Approximation Algorithms.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 10 NP-completeness.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 5 Dynamic Programming.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 4 Randomized Algorithms.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 3 Greedy Algorithms.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 2 Single Source Shortest Paths.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(PPT课件讲稿)Week 1 Introduction to the course.pptx
- 香港中文大学:《Quantum Computing》课程教学资源(课件讲稿)Lecture 12 Quantum information theory 4.pdf
- 香港中文大学:《Quantum Computing》课程教学资源(课件讲稿)Lecture 11 Quantum information theory 3.pdf
- 香港中文大学:《Quantum Computing》课程教学资源(课件讲稿)Lecture 10 Quantum information theory 2.docx
- 香港中文大学:《Quantum Computing》课程教学资源(课件讲稿)Lecture 9 Quantum information theory 1.docx
- 香港中文大学:《Quantum Computing》课程教学资源(课件讲稿)Lecture 8 Quantum communication complexity 2.docx
- 香港中文大学:《Quantum Computing》课程教学资源(课件讲稿)Lecture 7 Quantum communication complexity 1.docx
- 香港中文大学:《Quantum Computing》课程教学资源(课件讲稿)Lecture 6 Quantum query complexity.docx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 11.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 12.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 02.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 03.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 04.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 05.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 06.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 08.pptx
- 香港中文大学:《Design and Analysis of Algorithms》课程教学资源(辅导课件)tutorial 09.pptx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 1 Samples of possibility and impossibility results in algorithm designing.docx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 2 More samples.docx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 3 Communication complexity.docx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 4 Multiparty Communication Complexity.docx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 5 Formula complexity I.docx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 6 Formula complexity II.docx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 7 Decision Tree Complexity and Fourier analysis.docx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 9 Circuit Complexity.docx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 10 Circuit Complexity 2.docx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 11 Information theoretical argument.docx
- 香港中文大学:《Theory of Computational Complexity》课程教学资源(讲义)Lecture 12 A glimpse of computational complexity.docx