approximation algorithms pages 365 - 367 1 advanced topics in complexity theory
TRANSCRIPT
![Page 1: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/1.jpg)
1
Approximation Algorithms
Pages 365 - 367
ADVANCED TOPICS IN COMPLEXITY THEORY
![Page 2: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/2.jpg)
2
![Page 3: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/3.jpg)
3
Optimization problems
• Optimization problems - seek the best solution among a collection of possible solutions.
• Example: shortest path connecting two nodes
• Approximation algorithm is designed to find such approximately optimal solutions.
• A solution that is nearly optimal may be good enough and may be much easier to find.
![Page 4: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/4.jpg)
4
Polynomial & Exponential • Decision problem-one that has a yes/no answer.• POLYNOMIAL TIME - polynomial differences in
running time are considered to be small and fast, whereas exponential differences are considered to be large.
• Polynomial time algorithm - n3.• Exponential time algorithm - 3n .• MIN-VERTEX-COVER is an example of a
minimization problem because we aim to find the smallest among the collection of possible solutions.
![Page 5: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/5.jpg)
5
Exponential time algorithm
• Exponential time algorithms typically arise when we solve problems by exhaustively searching through a space of solutions, called brute-force search.
![Page 6: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/6.jpg)
6
Exponential time algorithm
• factor a number into its constituent primes is to search through all potential divisors.
![Page 7: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/7.jpg)
7
• minimization problem - find the smallest among the collection of possible solutions.
• maximization problem - seek the largest solution.
• Decision problem and NP- Decision.
• Optimization problem and NP-Optimization.
• Approximation problem and approximation.
Note: (NP) Nondeterministic polynomial.
![Page 8: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/8.jpg)
8
Explanation
![Page 9: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/9.jpg)
9
Explanation
![Page 10: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/10.jpg)
10
PROBABILISTIC ALGORITHMS
Pages 368 - 375
![Page 11: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/11.jpg)
11
![Page 12: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/12.jpg)
12
PROBABILISTIC ALGORITHMS
• A probabilistic algorithm is an algorithm designed to use the outcome of a random process.
• Example: flip a coin.
• How can making a decision by flipping a coin ever be better than actually calculating, or even estimating, the best choice in a particular situation?
![Page 13: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/13.jpg)
13
THE CLASS BPP
• We begin our formal discussion of probabilistic computation by defining a model of a probabilistic Turing machine.
![Page 14: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/14.jpg)
14
![Page 15: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/15.jpg)
15
Definition 10.3 (cont.)
• When a probabilistic Turing machine recognizes a language = it must accept all strings in the language and reject all strings out of the language as usual.
• Except that now we allow the machine a small probability of error. For say that M recognizes language A with error probability .
![Page 16: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/16.jpg)
16
• We also consider error probability bounds that depend on the input length n. For example, error probability = 2-n indicates an exponentially small probability of error.
Definition 10.3 (cont.)
worst case computation branch on each input
![Page 17: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/17.jpg)
17
= amplification lemma.• Amplification lemma gives a simple way of
making the error probability exponentially small.
• LEMMA 10.5 and proof IDEA. (self study) PROOF.
![Page 18: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/18.jpg)
18
PRIMALITY• A prime number is an integer greater than 1
that is not divisible by positive integers other than 1 and itself.
• A nonprime number greater than 1 is called composite.
• One way to determine whether a number is prime is to try all possible integers less than that number and see whether any are divisors, also called factors.
• exponential time complexity
![Page 19: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/19.jpg)
19
• For example, if p = 7 and a = 2, the theorem says that 2 (7-1) mod 7 should be 1 because 7 is prime.
• The simple calculation 2(7-1) = 26 = 64 and 64 mod 7 = 1 confirms this result.
• Suppose that we try p = 6 instead. Then 2(6-1) = 25 = 32 and 32 mod 6 = 2
Fermat's little theorem
![Page 20: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/20.jpg)
20
Algorithm Fermat test
![Page 21: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/21.jpg)
21
![Page 22: Approximation Algorithms Pages 365 - 367 1 ADVANCED TOPICS IN COMPLEXITY THEORY](https://reader035.vdocuments.mx/reader035/viewer/2022081520/56649e9d5503460f94b9dc83/html5/thumbnails/22.jpg)
22
Note
The probabilistic primality algorithm has one-sided error. When the algorithm outputs reject, we know that the
input must be composite. When the output is accept, we know only that the input
could be prime or composite. Thus an incorrect answer can only occur when the input
is a composite number. The one-sided error feature is common to many
probabilistic algorithms, so the special complexity class RP is designated for it.