Presentation is loading. Please wait.

Presentation is loading. Please wait.

Algorithms in Exponential Time. Outline Backtracking Local Search Randomization: Reducing to a Polynomial-Time Case Randomization: Permuting the Evaluation.

Similar presentations


Presentation on theme: "Algorithms in Exponential Time. Outline Backtracking Local Search Randomization: Reducing to a Polynomial-Time Case Randomization: Permuting the Evaluation."— Presentation transcript:

1 Algorithms in Exponential Time

2 Outline Backtracking Local Search Randomization: Reducing to a Polynomial-Time Case Randomization: Permuting the Evaluation Order Randomized Local Search Randomization with Biased Coins

3 Backtracking SAT Brute-force Backtracking for 3-SAT 3-coloring Brute-force Backtracking

4 Local Search For a wrong assignment, make a local modification on it. Hamming distance d: two bit vectors of equal length is the number of bits in which they differ Take two initial assignments

5 Randomization: Reducing to a Polynomial-Time Case If we have some randomized algorithm which has complexity t and success probability p, then the algorithm needs to be repeated times to achieve an error probability of at most so that the overall time complexity is 3-coloring problem Wrong decision for a node with probability All decisions are consistent It could be reduced to 2-SAT problem

6 Randomization: Permuting the evaluation order. Recursion Tree v ^^ v ^ vv

7 Advantage For Or-gate: one of the two inputs is true For And-gate: one of the two inputs is false The time complexity is

8 3-SAT Variable order is chosen at random One variable after the other is assigned a truth value- (with probability ½ this choice might be wrong) It takes over n! permutations. Only 2n/3 many random choices are needed

9 Randomized local search 3-SAT The probability of choosing the correct variable to flip can be as low as 1/3. The probability of finding a satisfying assignment which is by Hamming distance d away from the initial assignment is (1/3)^d Let the flipping process last for 3d steps If we have d mistakes, we could correct it by 2d steps

10 3-SAT The probability of finding successful solution is

11 Randomization with Biased Coins Greedy collect as many mutually variable- disjoint clauses having 3 literals of as possible. Suppose the number m of clauses collected is small than 0.1469n. We can cycle through all potential 7^m assignments of these variables O(1.331^n) Else With probability 3p exactly one of the 3 literals is assigned the value true With probability 3q exactly two of the 3 literals is assigned the value true With probability 1 – 3p – 3q assign all of the 3 literals as the value true

12 If x, y, z in a* is 1, 0, 0 The hamming distance between the initial assignment a and a*, as a random variable 0, p(1, 0, 0) 1, 2q (1, 1, 0) (1, 0, 1) 2, 1 – p – 3q (1, 1, 1) (0, 1, 0) (0, 0, 1) 3, q (0, 1, 1) The expectation of the random variable ½^d is 1 p + ½ (2q) + ¼ (1 – p – 3q) + 1/8 q

13 If x, y, z in a* is 1, 1, 0 The hamming distance between the initial assignment a and a*, as a random variable 0, q(1, 1, 0) 1, 1 – p – 3q (0, 1, 0) (1, 0, 0), (1, 1, 1) 2, 2q (1, 0, 1) (0, 1, 1) 3, p (0, 0, 1) The expectation of the random variable ½^d is 1 q + ½ (1 – p – 3q) ) + ¼ (2q) + 1/8 p

14 If x, y, z in a* is 1, 1, 1 The hamming distance between the initial assignment a and a*, as a random variable 0, 1 – 3p – 3q (1, 1, 1) 1, 3q (1, 1, 0) (1, 0, 1) (0, 1, 1) 2, 3p (1, 0, 0) (0, 1, 0) (0, 0, 1) 3, 0 The expectation of the random variable ½^d is 1 (1 – 3p – 3q) + ½ (3q) + ¼ (3p)

15 The success probability is

16 Set p = 4/21 and q = 2/21 This algorithm could be done in O(1.331^n)

17 Questions?


Download ppt "Algorithms in Exponential Time. Outline Backtracking Local Search Randomization: Reducing to a Polynomial-Time Case Randomization: Permuting the Evaluation."

Similar presentations


Ads by Google