Download presentation
Presentation is loading. Please wait.
Published byCalvin Alexander Modified over 6 years ago
1
Pattern Matching With Don’t Cares Clifford & Clifford’s Algorithm
Orgad Keller Modified by Ariel Rosenfeld
2
Orgad Keller - Algorithms 2 - Further Reading
PM with Don’t Cares Input: A text , a pattern over alphabet ( is the don’t care symbol). Output: All locations where Orgad Keller - Algorithms 2 - Further Reading
3
Orgad Keller - Algorithms 2 - Further Reading
Idea Let be a symbol from the pattern and be a symbol from the text. As mentioned, In our matching relation, iff: Orgad Keller - Algorithms 2 - Further Reading
4
Orgad Keller - Algorithms 2 - Further Reading
Idea we encode as 0, which is like saying: Orgad Keller - Algorithms 2 - Further Reading
5
Orgad Keller - Algorithms 2 - Further Reading
Idea As mentioned, we seek All locations where As we’ve seen, that’s true iff: Orgad Keller - Algorithms 2 - Further Reading
6
Orgad Keller - Algorithms 2 - Further Reading
Problem We have a problem because, generally speaking: but the opposite is not true! On the other hand, if we know that then Orgad Keller - Algorithms 2 - Further Reading
7
Orgad Keller - Algorithms 2 - Further Reading
Problem So we can easily fix the problem: Now: Orgad Keller - Algorithms 2 - Further Reading
8
Orgad Keller - Algorithms 2 - Further Reading
Idea (cont’d) To sum up, we got that: Problem left: How can we compute for all efficiently? Orgad Keller - Algorithms 2 - Further Reading
9
Orgad Keller - Algorithms 2 - Further Reading
Computing Efficiently Orgad Keller - Algorithms 2 - Further Reading
10
Orgad Keller - Algorithms 2 - Further Reading
Convolutions We can easily compute , and for all ‘s using FFT-based multiplication in time Then we’ll return all locations where Orgad Keller - Algorithms 2 - Further Reading
11
Orgad Keller - Algorithms 2 - Further Reading
12
Orgad Keller - Algorithms 2 - Further Reading
Running Time Most costly operations are 3 polynomial multiplications, so overall time is Orgad Keller - Algorithms 2 - Further Reading
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.