A randomized algorithm for 2-Satisfiability Captain China Group members: Yaoming Zhu Lantao Yu Rui Meng Ruisheng Cao Chenglong Yang CS214 Captain China Algorithms and complexity Vu Pham 1
Outline Introduction Example —— Map Labeling What is Satisfiability? Terminology A randomized algorithm Monte-Carlo Algorithm for 2-SAT 2-SAT to random walk on the line Decide Satisfiability CS214 Captain China Algorithms and complexity Vu Pham 2
Example —— Map Labeling Sweden Sweden Sweden Sweden Germany Germany France Germany Germany France Italy Italy CS214 Captain China Algorithms and complexity Vu Pham 3
Example —— Map Labeling 𝐭 𝟐 𝐭 𝟑 𝐭 𝟒 𝐭 𝟓 𝒉 𝟐 𝒉 𝟑 𝒈 𝟐 𝒉 𝟒 𝒉 𝟓 𝒋 𝟐 𝒈 𝟑 𝒋 𝟑 CS214 Captain China Algorithms and complexity Vu Pham 4
Example —— Map Labeling 𝐭 𝟐 𝐭 𝟑 𝐭 𝟒 𝐭 𝟓 𝒉 𝟐 𝒉 𝟑 𝒈 𝟐 𝒉 𝟒 𝒉 𝟓 𝒋 𝟐 𝒈 𝟑 𝒋 𝟑 CS214 Captain China Algorithms and complexity Vu Pham 5
Outline Introduction Example —— Map Labeling What is Satisfiability? Terminology A randomized algorithm Monte-Carlo Algorithm for 2-SAT 2-SAT to random walk on the line Decide Satisfiability CS214 Captain China Algorithms and complexity Vu Pham 6
What is Satisfiability? Satisfiability(SAT) is the problem of deciding whether a boolean formula in propositional logic allows a boolean assignment to variables so that formula evaluates to true. Example: No satisfying assignment CS214 Captain China Algorithms and complexity Vu Pham 7
Outline Introduction Example —— Map Labeling What is 2-Satisfiability Terminology A randomized algorithm Monte-Carlo Algorithm for 2-SAT 2-SAT to random walk on the line Decide Satisfiability CS214 Captain China Algorithms and complexity Vu Pham 8
Terminology literal CS214 Captain China Algorithms and complexity Vu Pham 9
Terminology literal 3-clause 2-clause CS214 Captain China Algorithms and complexity Vu Pham 10
Terminology literal 3-clause 2-clause 3-CNF formula CS214 Captain China Algorithms and complexity Vu Pham 11
Terminology literal 3-clause 2-clause 3-CNF formula A boolean formula is in conjunctive normal form(CNF) if it is the conjunction of clauses, where a clause is the disjunction of literals. A CNF formula with m clauses is of the form: CS214 Captain China Algorithms and complexity Vu Pham 12
Outline Introduction Example —— Map Labeling What is 2-Satisfiability Terminology A randomized algorithm Monte-Carlo Algorithm for 2-SAT 2-SAT to random walk on the line Decide Satisfiability CS214 Captain China Algorithms and complexity Vu Pham 13
Algorithm for 2-SAT Giving an instance: a randomly initialized assignment: F F F T F F CS214 Captain China Algorithms and complexity Vu Pham 14
Algorithm for 2-SAT Giving an instance: a randomly initialized assignment: F F F T F F F T F T F F CS214 Captain China Algorithms and complexity Vu Pham 15
Algorithm for 2-SAT Giving an instance: a randomly initialized assignment: F F F T F F T F F T F F CS214 Captain China Algorithms and complexity Vu Pham 16
Monte-Carlo Algorithm for 2-SAT CS214 Captain China Algorithms and complexity Vu Pham 17
Monte-Carlo Algorithm for 2-SAT Question: If there is a satisfying assignment for , how long does the above algorithm take to discover it ? CS214 Captain China Algorithms and complexity Vu Pham 18
Outline Introduction Example —— Map Labeling What is 2-Satisfiability Terminology A randomized algorithm Monte-Carlo Algorithm for 2-SAT 2-SAT to random walk on the line Decide Satisfiability CS214 Captain China Algorithms and complexity Vu Pham 19
A random walk on the line 1 1 1 1 1 Start 1 2 2 2 2 2 0 1 2 3 4 5 6 1 1 1 1 1 2 2 2 2 2 CS214 Captain China Algorithms and complexity Vu Pham 20
A random walk on the line 1 1 1 1 1 Start 1 2 2 2 2 2 0 1 2 3 4 5 6 1 1 1 1 1 2 2 2 2 2 Let denote the state number of the random walk process after steps. CS214 Captain China Algorithms and complexity Vu Pham 21
2-SAT to random walk on the line What is the relationship between the random walk process and our randomized algorithm ? CS214 Captain China Algorithms and complexity Vu Pham 22
2-SAT to random walk on the line Giving an instance: a satisfying assignment: a randomly initialized assignment: Let denote the number of variables in that has the same assignment as in , after flip operations. F T F F T T F F F T F F CS214 Captain China Algorithms and complexity Vu Pham 23
2-SAT to random walk on the line Suppose is not a satisfying assignment and the algorithm picks an unsatisfying clause with variables . Case 1: is different from in both and F T F F T T F F F T F F CS214 Captain China Algorithms and complexity Vu Pham 24
2-SAT to random walk on the line Suppose is not a satisfying assignment and the algorithm picks an unsatisfying clause with variables . Case 2: is different from only in (or ) F T F F T T F F F T F F CS214 Captain China Algorithms and complexity Vu Pham 25
2-SAT to random walk on the line Key Point: The variable behave just like the random walk variable except that: Sometimes going to the correct direction with 100% probability Might have instead of Might stop early, before CS214 Captain China Algorithms and complexity Vu Pham 26
2-SAT to random walk on the line The random walk is the worst case for 2-SAT! Let denote the number of random walk steps to get to from . Claim: is the upper bound of the running time of the randomized algorithm for 2-SAT. CS214 Captain China Algorithms and complexity Vu Pham 27
2-SAT to random walk on the line Edge cases: Otherwise: CS214 Captain China Algorithms and complexity Vu Pham 28
2-SAT to random walk on the line CS214 Captain China Algorithms and complexity Vu Pham 29
Outline Introduction Example —— Map Labeling What is 2-Satisfiability Terminology A randomized algorithm Monte-Carlo Algorithm for 2-SAT 2-SAT to random walk on the line Decide Satisfiability CS214 Captain China Algorithms and complexity Vu Pham 30
Decide Satisfiability Can we use the algorithm to decide the satisfiability of a CNF ? CS214 Captain China Algorithms and complexity Vu Pham 31
Decide Satisfiability Theorem: For a satisfiable 2-SAT instance with variables, running the algorithm for iterations will produce a satisfying assignment with probability larger than Proof: CS214 Captain China Algorithms and complexity Vu Pham 32
Decide Satisfiability The error probability is CS214 Captain China Algorithms and complexity Vu Pham 33
End Thanks! CS214 Captain China Algorithms and complexity Vu Pham 29
Recommend
More recommend