cse 421 algorithms richard anderson lecture 29 complexity theory np-complete p
DESCRIPTION
NP Complete Problems 1.Circuit Satisfiability 2.Formula Satisfiability a.3-SAT 3.Graph Problems a.Independent Set b.Vertex Cover c.Clique 4.Path Problems a.Hamiltonian cycle b.Hamiltonian path 5.Partition Problems a.Three dimensional matching b.Exact cover 6.Graph Coloring 7.Number problems a.Subset sum 8.Integer linear programming 9.Scheduling with release times and deadlinesTRANSCRIPT
![Page 1: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/1.jpg)
CSE 421Algorithms
Richard AndersonLecture 29
Complexity Theory
NP-Complete
P
![Page 2: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/2.jpg)
Announcements
• Final exam, – Monday, December 14, 2:30-4:20 pm– Comprehensive (2/3 post midterm, 1/3 pre
midterm)• Review session
– Friday, 3:30 – 5:00 pm. More 220• Online course evaluations available
![Page 3: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/3.jpg)
NP Complete Problems
1. Circuit Satisfiability2. Formula Satisfiability
a. 3-SAT3. Graph Problems
a. Independent Setb. Vertex Coverc. Clique
4. Path Problemsa. Hamiltonian cycleb. Hamiltonian path
5. Partition Problemsa. Three dimensional
matchingb. Exact cover
6. Graph Coloring7. Number problems
a. Subset sum8. Integer linear
programming9. Scheduling with release
times and deadlines
![Page 4: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/4.jpg)
Karp’s 21 NP Complete Problems
![Page 5: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/5.jpg)
A final NP completeness result: Graph Coloring
• NP-Complete– Graph K-coloring– Graph 3-coloring
• Polynomial– Graph 2-Coloring
![Page 6: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/6.jpg)
Z
3-SAT <P 3 Colorability
Y
T F
B
X Y
Z
X
Truth Setting Gadget Clause Testing Gadget
X T Z F
Y
![Page 7: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/7.jpg)
What we don’t know
• P vs. NP
NP-Complete
P
P = NP
![Page 8: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/8.jpg)
If P != NP, is there anything in between
• Yes, Ladner [1975]• Problems not known to be in P or NP Complete
– Factorization– Discrete Log– Graph Isomorphism Solve gk = b over a finite group
![Page 9: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/9.jpg)
Coping with NP Completeness
• Approximation Algorithms– Christofides algorithm for TSP (Undirected
graphs satisfying triangle inequality)• Solution guarantees on greedy algorithms
– Bin packing
![Page 10: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/10.jpg)
Coping with NP-Completeness
• Branch and Bound– Euclidean TSP
![Page 11: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/11.jpg)
Coping with NP-Completeness
• Local Search– Modify solution until a local minimum is
reached• Interchange algorithm for TSP• Recoloring algorithms
– Simulated annealing
![Page 12: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/12.jpg)
Complexity Theory
• Computational requirements to recognize languages
• Models of Computation• Resources• Hierarchies
Regular Languages
Context Free Languages
Decidable Languages
All Languages
![Page 13: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/13.jpg)
Time complexity
• P: (Deterministic) Polynomial Time• NP: Non-deterministic Polynomial Time• EXP: Exponential Time
![Page 14: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/14.jpg)
Space Complexity
• Amount of Space (Exclusive of Input) • L: Logspace, problems that can be solved
in O(log n) space for input of size n
• PSPACE, problems that can be required in a polynomial amount of space
![Page 16: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/16.jpg)
NP vs. Co-NP
• Given a Boolean formula, is it true for some choice of inputs
• Given a Boolean formula, is it true for all choices of inputs
![Page 17: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/17.jpg)
Problems beyond NP
• Exact TSP, Given a graph with edge lengths and an integer K, does the minimum tour have length K
• Minimum circuit, Given a circuit C, is it true that there is no smaller circuit that computes the same function a C
![Page 18: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/18.jpg)
Polynomial Hierarchy
• Level 1– X1 (X1), X1 (X1)
• Level 2– X1X2 (X1,X2), X1X2 (X1,X2)
• Level 3– X1X2X3 (X1,X2,X3), X1X2X3 (X1,X2,X3)
![Page 19: CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P](https://reader035.vdocuments.mx/reader035/viewer/2022081606/5a4d1bd97f8b9ab0599db7b9/html5/thumbnails/19.jpg)
Polynomial Space
• Quantified Boolean Expressions– X1X2X3...Xn-1Xn (X1,X2,X3…Xn-1Xn)
• Space bounded games– Competitive Facility Location Problem
• Counting problems– The number of Hamiltonian Circuits in a graph